View Full Version : Querying GL_VENDOR before opening window
02-04-2003, 11:40 AM
A quick question. We'd like to identify faulty drivers by checking the results of GL_VENDOR and GL_RENDERER against our list. If the driver is identified as faulty, then the software implementation would be used instead.
This is a kind of chicken-and-egg problem since you can only get at this information after you've opened a window, but you'd like to know before you open it so that you can set the pixel format correctly.
Is there some quick way to get at this information without opening a window that is visible to the user?
If anyone has a code snippet that does something like this, I'd appreciate it.
Thanks in advance,
You could create the window and get the info you need, and if it's in your list, destroy and recreate the window. Or if you're using Windows, maybe EnumDisplayDevices can help.
02-04-2003, 12:21 PM
This would be a bit problematic as we are using the MFC framework. :-(
02-04-2003, 01:46 PM
Simply using MFC shouldn't interfere with creating a window. You can use MFC to do that with no problem.
02-04-2003, 02:47 PM
You have to create a window, choose and set a pixel format, and create a context before querying vendors etc. This is one of my main annoyances with current OpenGL implementations.
However, creating a simple window, doing the querying, and destroying the window is fairly simple, and can be written into a single source module.
02-04-2003, 07:39 PM
It is possible that you don't need to create a window with a GL context.
Some GL commands such as glGetString work without even having a current GL contexts, but this shouldn't happen in well behaved drivers.
May I suggest you let the user decide if they want software mode.
02-05-2003, 02:24 AM
You should open a window - and make sure that it is the same kind of window (pixel format and video mode) as you intend to use for your application, since you may get a different driver for your test window than for your "real" window otherwise (at least under Windows). For instance, if the resolution is too high, there may not be enough frame buffer memory etc for a HW GL implementation (if the card has too little mem), or the card may not support a certain pixel format, while others are OK.
It's not easy to know these things beforehand (e.g. the same vendor & renderer string may be used for cards with diffrent amounts of memory), so the only sure way of knowing is to test things for your real application window.
I would do it like this:
1) Open my application window just the way I want it
2) If vendor &| renderer fits your needs, skip to 5)
3) Close window
4) Open "SW window" (or whatever your fallback is)
5) Continue running your app.
[This message has been edited by marcus256 (edited 02-05-2003).]
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.