As you said, I have tried the testgl sample and, like a miracle, the system worked after
that. Are there any registry entries you are setting in the SDL code or something else
that could have caused a hang? Its not that cool to command the user of a game to
start the testgl sample first ;-).
Very strange. No, SDL isn’t doing any registry work at all.
So, I had the chance to work around with it a bit, but I did’t liked what I saw. I thought
that I have no hardware accel on my GDI system under NT, but after doing some changes
to the code, it worked with a heavily droped frame rate and an awful color adaption on
my 16Bit screen. I then had a look into the code of SDL and I don’t understand, why you
are treating OpenGL so special. Correct me, if I am wrong, but the MSDN tells me, that you
can render OpenGL directly to any GDI context, so switching off any hardware accel is
not necessary. Shure, there is a limit with doublebuffering, but using you’re own double
buffer and display a single buffered OpenGL to that shouldn’t be a problem. Using DX,
you can gain a DC on every surface, so this shouldn’t be a
problem, too. So, please, tell me why the frame rate drops that hard? Why havn’t you
implemented the SDL_GL_SwapBuffers within SDL_Flip? Why isn’t it possible to render
OpenGL to ANY surface? As far as I am familar with Win32 and OpenGL, this isn’t a
problem, you can even use it easily in the MFC… Why don’t you let the screen surface
configure the OpenGL pixel format description, why do I have to set them manualy?
In general answer to your question “why not OpenGL to any surface”, just
because it works on Windows doesn’t mean it will work on any other platform.
In addition, rendering to software surfaces tends to be very slow, as you
have found. You are more likely to want to use a separate tool to generate
3D looking sprites and then loading them in SDL for 2D graphics, than to
really want offscreen OpenGL, for speed reasons.
As you’ve shown, you can always add OpenGL rendering to your app independently
of SDL if you really want that functionality.
-Sam Lantinga, Lead Programmer, Loki Entertainment Software