OPENGLBLIT and Mac OSX

I am playing around with SDL and decided to build an OpenGL sample.
I started with SDL_OPENGLBLIT turned on and ran into problems. I then
traced it do only to the use of OPENGLBLIT.

I can run the included test program with no options and everything
is fine. The sample runs
and even at a decent frame rate :slight_smile: If the ā€˜-logoā€™ is passed to the
testgl sample, it attempts to use SDL_OPENGLBLIT and then dies with this
error message: Couldnā€™t load GL function: glBegin

Any ideas?

SDL calls GL functions like so:

this->glFlush();

So that you can run SDL with OpenGL installed, since the symbol
"glBegin()" is loaded explicitly. In other words, the run-time
dependency of OpenGL has been removed. Which is actually a nice feature.

BUT SDL_GL_GetProcAddress is of course broken on MacOS X. I will attempt
to fix this in the upcoming Quartz video driver.

A quick hack would be to change the macro in SDL_Video.c:

#ifdef HAVE_OPENGL
#define SDL_PROC(ret,func,params)
do {
video->func = SDL_GL_GetProcAddress(#func);
if ( ! video->func ) {
SDL_SetError(ā€œCouldnā€™t load GL function: %s\nā€, #func);
return(NULL);
}
} while ( 0 );

To take out the test, and force the linker to load the function at
runtime (whether you use OpenGL blitting or not.

For example:

video->func = #func;On Monday, April 16, 2001, at 08:59 PM, Josh Bonczkowski wrote:

I am playing around with SDL and decided to build an OpenGL sample.
I started with SDL_OPENGLBLIT turned on and ran into problems. I then
traced it do only to the use of OPENGLBLIT.

I can run the included test program with no options and everything
is fine. The sample runs
and even at a decent frame rate :slight_smile: If the ā€˜-logoā€™ is passed to the
testgl sample, it attempts to use SDL_OPENGLBLIT and then dies with this
error message: Couldnā€™t load GL function: glBegin

Any ideas?