Personal tools
You are here: Home / cmgui / Wiki / OpenGL Extension in CMGUI
Navigation
Log in


Forgot your password?
 

OpenGL Extension in CMGUI

Introduction

The OpenGL standard allows individual to provide additional functionalities through extension. Some object and scene rendering functionalities in cmgui (framebuffer object that I am currently working on now) are developed using the OpenGL extension.

Compilation error

When you compile cmgui under windows or AIX while simply include the header file <GL/glext.h> and use the functions from the header files, a compilation error will occur. And here is the cause and solution of this problem.

Quoted from Shane:

"In Windows and AIX you also have to dynamically load all extension functions. They are not exported as windows does not allow unresolved function pointers when binding a dll. This means the dll exports the minimal functions and you have to fetch and store the rest in pointers. This is done in cmgui with function pointers and macros when accessing the functions (so that the code looks like you are just directly calling the function). You should look at some other extension in graphics/graphics_library.h and graphics/graphics_library.c, you have to do the same as other extensions including adding a section in Graphics_library_load_extension for all the functions you require.

I also compile and link using the Mesa headers, but you must call Graphics_library_check_extension(your-extension-here-when-you-implement-it) before calling any of the functions you need. You need to do this check on Linux too, in case it wasn't defined on that system (in which case the function would not be defined and will generate a seg fault)."