View Full Version : OpenGL 1.1 is not production safe?

04-08-2009, 01:56 AM
Hi, there seems to be a problem with OpenGL 1.1 stability on some machines. The software uses only 1.1 functions, but some machines just crash, reproducibly and on isolated hardware (some AMD integrated).

I cannot get those PCs to get memory dumps, but I have to find a solution, or else I will have to replace all OpenGL rendering stuff, because it's not safe enough for production as it is now.

What could be the cause and is anyone using OpenGL 1.1 successfully in wide scale projects?

Is there a way to fall back to Microsoft OpenGL 1.1 always, even if the drivers offer hardware implementation?

04-08-2009, 02:54 AM
I know two bugs in ATI/AMD drivers that may be the reason:
1. If the process is out of memory (2GB virtual memory) the driver tend to throw an exception instead of set the glGetError() to GL_OUT_OF_MEMORY. (check with the Task-Manager)
2. The driver can't handel adding a display list to another display list.

If you want to fallback to microsoft's implementation you should set the PFD_GENERIC_FORMAT flags in the PIXELFORMATDESCRIPTOR for ChoosePixelFormat.

04-08-2009, 03:03 AM
Thank you!

I don't know if one of those is at fault. I do use wglUseFontOutlines, and memory load is unknown.

PFD_GENERIC_FORMAT doesn't seem to be in accepted values in ChoosePixelFormat. When I add it to PIXELFORMATDESCRIPTOR I still get Vendor: "Intel" on my machine.

The test with DescribePixelFormat seems to work somehow though, but I have to figure how to decide which format to use, so far it seems messy.

For example MSDN says color bits are specified without alpha, but if I call for 24 bit color buffer I don't get a valid pfd at all.

EDIT: Is there a widely accepted DescribePixelFormat sample code somewhere? I am trying to dig through it, but the thing is that I don't know if the first pixel format that matches will be the best one. And there are issues with 16/24/32 bit colors, 32 bit depth flashing and so on. The documentation is not very rich and, as far as I understand, the results can vary widely depending on configuration, desktop color depth (RDC/local) and so on.

04-08-2009, 05:08 AM
I would recommend not to use ChoosePixelFormat in production application. To do things the right way it's best to enumerate existing pixel formats and choose one of them by yourself.

So simply call DescribePixelFormat with NULL as last argument to get number of pixel formats, and then call DescribePixelFormat for every one of them.
Check for PFD_GENERIC_FORMAT or any other flag you want.