Loading GL Functions

Hey,

I am working on a games project porting it to Linux and trying to
integrate SDL. The project is currently using CGL and so does not
contain any code that will load the GL functions and handle dispatch. It
uses GL 3.2+ and extensions.

My first instinctive reaction was to use GLEW on Linux, however looking
forward in the face of Wayland, Mir and possibly porting to ARM also. I
do not wish to tie the implementation down to GLX.

I have looked at a few other options such as mesa glapi, waffle,
linaro’s egl glew or replacing glew’s call to glxGetProcAddress with
SDL_GL_GetProcAddress.

Do you have any suggestions or pointers to a library that I have not
looked at? Ideally it would be nice to have this within the SDL library
but I am sure this has been discussed before.

You really should not have to use the sdl wrapper of getprocaddresss. Glew
should work fine with the glx call.On Aug 24, 2013 2:19 PM, “x414e54” wrote:

Hey,

I am working on a games project porting it to Linux and trying to
integrate SDL. The project is currently using CGL and so does not
contain any code that will load the GL functions and handle dispatch. It
uses GL 3.2+ and extensions.

My first instinctive reaction was to use GLEW on Linux, however looking
forward in the face of Wayland, Mir and possibly porting to ARM also. I
do not wish to tie the implementation down to GLX.

I have looked at a few other options such as mesa glapi, waffle,
linaro’s egl glew or replacing glew’s call to glxGetProcAddress with
SDL_GL_GetProcAddress.

Do you have any suggestions or pointers to a library that I have not
looked at? Ideally it would be nice to have this within the SDL library
but I am sure this has been discussed before.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Sorry… Misread your dilemmaOn Aug 24, 2013 2:34 PM, “Andre D” <@Andre_D> wrote:

You really should not have to use the sdl wrapper of getprocaddresss. Glew
should work fine with the glx call.
On Aug 24, 2013 2:19 PM, “x414e54” wrote:

Hey,

I am working on a games project porting it to Linux and trying to
integrate SDL. The project is currently using CGL and so does not
contain any code that will load the GL functions and handle dispatch. It
uses GL 3.2+ and extensions.

My first instinctive reaction was to use GLEW on Linux, however looking
forward in the face of Wayland, Mir and possibly porting to ARM also. I
do not wish to tie the implementation down to GLX.

I have looked at a few other options such as mesa glapi, waffle,
linaro’s egl glew or replacing glew’s call to glxGetProcAddress with
SDL_GL_GetProcAddress.

Do you have any suggestions or pointers to a library that I have not
looked at? Ideally it would be nice to have this within the SDL library
but I am sure this has been discussed before.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

I think you overestimate how much tiedown there is when using GLEW, it’s
entirely separable. My codebase is targeted at OpenGL ES 2, the only
changes I have to make to build for the desktop are:

  • Link in libGL and libGLEW instead of libGLESv2
  • Have a build switch USE_GLEW, which triggers a single #ifdef in my
    graphics init code (just after context creation). This calls glewInit(),
    handles the error case, and checks for GLEW_VERSION_2_1. I also have one
    proxy header file which uses USE_GLEW to choose between #include
    <GL/glew.h> and #include <GLES/gl2.h> to obtain all the glMethods.

It’s likely that GLEW will get extended to include EGL support once it
becomes more widespread on the desktop. To be honest I’m still not sure how
the accessing desktop GL via EGL thing is meant to work in practice, given
how firmly the libGL ABI is anchored to GLX. IMHO GLEW kicks the crap out
of coddling (wgl/glX)GetProcAddress by hand, I’d go with that until the EGL
third party driver situation gets sorted (hopefully along with some
concrete instructions for developers).

Also if you’re interested in porting to ARM, you will probably have to keep
everything to the GL ES 2 subset, so don’t go too nutty with extensions.On 25 August 2013 02:38, Andre D wrote:

Sorry… Misread your dilemma
On Aug 24, 2013 2:34 PM, “Andre D” wrote:

You really should not have to use the sdl wrapper of getprocaddresss.
Glew should work fine with the glx call.
On Aug 24, 2013 2:19 PM, “x414e54” wrote:

Hey,

I am working on a games project porting it to Linux and trying to
integrate SDL. The project is currently using CGL and so does not
contain any code that will load the GL functions and handle dispatch. It
uses GL 3.2+ and extensions.

My first instinctive reaction was to use GLEW on Linux, however looking
forward in the face of Wayland, Mir and possibly porting to ARM also. I
do not wish to tie the implementation down to GLX.

I have looked at a few other options such as mesa glapi, waffle,
linaro’s egl glew or replacing glew’s call to glxGetProcAddress with
SDL_GL_GetProcAddress.

Do you have any suggestions or pointers to a library that I have not
looked at? Ideally it would be nice to have this within the SDL library
but I am sure this has been discussed before.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org