I seem to have problems getting the OGL extensions in SDL (both 1.2.8 and
the CVS version). I use the function SDL_GL_GetProcAddress for all
functions, and it works just fine for things like glBegin, etc but when I
want to get extension functions like glActiveTextureARB or glTexImage3DEXT,
the only thing I get is a NULL pointer. I loaded the OGL library with
SDL_GL_LoadLibrary(NULL). I’m sure my card supports both these extensions,
so does anyone know what I’m doing wrong here?
Thanks
Bram_________________________________________________________________
Talk with your online friends with MSN Messenger http://messenger.msn.nl/
Not answer to your question, but try http://glew.sf.net to handle the
extensions for you…
– Pasi
^
. .
Linux
/ - \
Choice.of.the
.Next.Generation.On Tue, Feb 01, 2005 at 01:27:08PM +0100, Bram Thijssen wrote:
Hi everyone,
I seem to have problems getting the OGL extensions in SDL (both 1.2.8 and
the CVS version). I use the function SDL_GL_GetProcAddress for all
functions, and it works just fine for things like glBegin, etc but when I
want to get extension functions like glActiveTextureARB or glTexImage3DEXT,
the only thing I get is a NULL pointer. I loaded the OGL library with
SDL_GL_LoadLibrary(NULL). I’m sure my card supports both these extensions,
so does anyone know what I’m doing wrong here?
I seem to have problems getting the OGL extensions in SDL (both 1.2.8
and the CVS version). I use the function SDL_GL_GetProcAddress for all
functions, and it works just fine for things like glBegin, etc but
when I want to get extension functions like glActiveTextureARB or
glTexImage3DEXT, the only thing I get is a NULL pointer. I loaded the
OGL library with SDL_GL_LoadLibrary(NULL).
So, there are two ways to work with OpenGL/SDL :
use dynamic library loading (with SDL_GL_LoadLibrary) and then
retrieve function pointers for all OpenGL functions like shown in the
testdyngl.c sample code
don’t use dynamic library loading and retrieve function pointers only
for the extensions.
But you can’t mix the two.
I seem to have problems getting the OGL extensions in SDL (both 1.2.8
and the CVS version). I use the function SDL_GL_GetProcAddress for all
functions, and it works just fine for things like glBegin, etc but
when I want to get extension functions like glActiveTextureARB or
glTexImage3DEXT, the only thing I get is a NULL pointer. I loaded the
OGL library with SDL_GL_LoadLibrary(NULL).
So, there are two ways to work with OpenGL/SDL :
use dynamic library loading (with SDL_GL_LoadLibrary) and then
retrieve function pointers for all OpenGL functions like shown in the
testdyngl.c sample code
don’t use dynamic library loading and retrieve function pointers only
for the extensions.
But you can’t mix the two.
Stephane
I did in fact get all OpenGL functions using SDL_GL_GetProcAddress. I didn’t
notice the testdyngl.c sample code, so I tried loading extensions with that.
That did work properly, so then I still wonder what I’m doing wrong in my own
code, since it looks very similar to me:
I did in fact get all OpenGL functions using SDL_GL_GetProcAddress. I didn’t
notice the testdyngl.c sample code, so I tried loading extensions with that.
That did work properly, so then I still wonder what I’m doing wrong in my own
code, since it looks very similar to me:
just tossing this out there but maybe your card doesnt support the
extensions you’re trying to use?
Ah I’ve found the problem - I moved the calls to SDL_GL_GetProcAddress to after
SDL_SetVideoMode, then also the extension functions work. I assumed it had to
be done before, since SDL_GL_LoadLibrary() has to be before as well.
So is that indeed the case, that it has to be after the SDL_SetVideoMode call
or is there some kind of other problem?
Thanks for the help
just tossing this out there but maybe your card doesnt support the
extensions you’re trying to use?
Ah I’ve found the problem - I moved the calls to SDL_GL_GetProcAddress to after
SDL_SetVideoMode, then also the extension functions work. I assumed it had to
be done before, since SDL_GL_LoadLibrary() has to be before as well.
So is that indeed the case, that it has to be after the SDL_SetVideoMode call
or is there some kind of other problem?
That’s the case. SDL_GL_GetProcAddress can be used only when an OpenGL
context exists.
The OpenGL context is created bu SDL_SetVideoMode(…SDL_OPENGL…).