View Full Version : Query OpenGL Support
03-01-2004, 06:27 AM
is there any possibility to detect if there is an opengl implementation on a system, i.e. how can i check if openGL is supported (an opengGL driver is installed) before i try to set up the rendering context?
03-01-2004, 06:32 AM
03-01-2004, 09:24 AM
Just do a glGetString(GL_VENDOR), and if the Result is Microsoft then you're most likely running on a software-implementation. Another way would be to query the versionstring (glGetString(GL_VERSION) and if that's 1.1 or even below, you're either on an very old implementation or again on software.
03-01-2004, 03:07 PM
Originally posted by PanzerSchreck:
Just do a glGetString(GL_VENDOR), and if the Result is Microsoft then you're most likely running on a software-implementation.
Hmm... I don't think it's particularly safe to call glGetString (or any GL function) before setting up the rendering context. It'd probably work, but I don't think you should rely on it.
Also, the MS software implementation IS an OpenGL implementation - Tombernick, would you consider it as such for your purposes? The most paranoid approach would be to link at runtime instead of statically with an import library - if there's no OpenGL DLL, you'l know because LoadLibrary will fail.
If you're not that paranoid, I'm not too clear what your aim is here - wglCreateContext will return null if it can't set up GL, why isn't that good enough?
This question should probably have been posted on one of the platform-specific fora, BTW.
03-01-2004, 03:35 PM
Enumarate pixel formats and check for PFD_GENERIC_ACCELERATED.
03-01-2004, 03:51 PM
I recommend creating a fake, invisible window, and creating a context in that window. You can use this to test what the vendor is, test what extensions are available, getting the real pixel format extension functions (for pbuffers etc), and other useful things.
Then destroy this window and create your real context.
03-02-2004, 04:40 AM
MS OpenGL uses the Installable Client Driver system.
There will always be an opengl32.dll, even if no vendor specific drivers are installed, so dynamically loading one isn't going to help, you have to go through the MS system of doing things. OpenGL32.dll chooses a vendor specific opengl implementation when you call wglCreateContext based on the DC's pixel format and a registry setting which contains the name of the real opengl dll to use with that pixel format on that device.
This is to the extent of my knowledge of such things. Take it with a smidgen of salt.
03-03-2004, 08:08 AM
First thanks to all for your replies.
I think the best way is to create a rendering context and check if it fails like MikeC and jwatte suggested. This should also work on other platforms than windows.
I thought there could maybe another possibility to check this without the expense of creating a window and a rendering context.
By the way I found an older but interesting article about the ICD model if someone wants to know more about this topic.
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.