|
Setting up Modern OpenGL with allegro 5 |
Ariesnl
Member #2,902
November 2002
|
hello, With allegro 5 as a framework. I did include #include <allegro5/allegro_opengl.h> ||=== Build: Release in OpenGL_Demo (compiler: GNU GCC Compiler) ===| Any tips on how to set it up correctly > Perhaps one day we will find that the human factor is more complicated than space and time (Jean luc Picard) |
Edgar Reynaldo
Major Reynaldo
May 2007
|
Windows OpenGL headers only expose 1.1. To get extensions, you need to use something custom like GLEW, or al_get_opengl_proc_address. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
Ariesnl
Member #2,902
November 2002
|
I tought Allegro would already take care of that, since it uses OpenGL itself... Annyway what would be the easiest way to do it ? Perhaps one day we will find that the human factor is more complicated than space and time (Jean luc Picard) |
Edgar Reynaldo
Major Reynaldo
May 2007
|
Undefined references are caused by not linking to the correct libraries. If you want to be a good programmer, you're going to have to learn how to link properly. Link or swim. Extensions are not defined because they're extensions. Read the manual link I posted that tells you exactly how to define an extension pointer and call it. https://www.opengl.org/discussion_boards/showthread.php/172481-glGenBuffer-was-not-declared Your project wasn't linking opengl so even if it compiled, it would still give undefined references. -lglu32 -lopengl32 My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
Elias
Member #358
May 2000
|
Allegro already loads all the extensions (i.e. it does the same thing GLEW does already). If some newer extension is missing from Allegro we should add it. It also might make sense to replace Allegro's extension code with GLEW (as a new dependency for Allegro) since they are probably doing a better job. (If we can do so without breaking old Allegro code at least.) -- |
Edgar Reynaldo
Major Reynaldo
May 2007
|
I discovered something with gdb today. If you do 'info variables', it will print out EVERY variable in existence. That means every single global defined in any file anywhere. If you do 'info variables glGenBuffer' inside gdb while running an allegro program, you get this back : (gdb) info variables glGenBuffer All variables matching regular expression "glGenBuffer": File E:/LIBS/LIBS81Build/allegro5/include/allegro5/opengl/GLext/gl_ext_api.h: _ALLEGRO_glGenBuffers_t _al_glGenBuffers; _ALLEGRO_glGenBuffersARB_t _al_glGenBuffersARB; (gdb) So allegro 5 knows about glGenBuffer, it's just hiding it from you. The Manual said:
al_get_opengl_proc_address Helper to get the address of an OpenGL symbol Example: How to get the function glMultiTexCoord3fARB that comes with ARB's Multitexture extension: // define the type of the function Note: Under Windows, OpenGL functions may need a special calling convention, so it's best to always use the ALLEGRO_DEFINE_PROC_TYPE macro when declaring function pointer types for OpenGL functions. Parameters: name - The name of the symbol you want to link to. Return value: A pointer to the symbol if available or NULL otherwise.
My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
|