Jump to content
  • Advertisement
Sign in to follow this  

OpenGL OpenGL Driver Info - How to get?

This topic is 4078 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How do programs like cardinfo.exe on windows and glxinfo on linux get the openGL version/vendor/driver info? Is there a specific call or function that returns that info?

Share this post

Link to post
Share on other sites
glGet*() provides such infos and the current OpenGL states.

char* str = NULL;

// get vendor string
str = (char*)glGetString(GL_VENDOR);

// get renderer string
str = (char*)glGetString(GL_RENDERER);

// get version string
str = (char*)glGetString(GL_VERSION);

// get all extensions as a string
str = (char*)glGetString(GL_EXTENSIONS);

// get number of color bits
int colorBits[4];
glGetIntegerv(GL_RED_BITS, &colorBits[0]);
glGetIntegerv(GL_GREEN_BITS, &colorBits[1]);
glGetIntegerv(GL_BLUE_BITS, &colorBits[2]);
glGetIntegerv(GL_ALPHA_BITS, &colorBits[3]);

// get depth bits
int depthBits = 0;
glGetIntegerv(GL_DEPTH_BITS, &depthBits);

// get stecil bits
int stencilBits = 0;
glGetIntegerv(GL_STENCIL_BITS, &stencilBits);


Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!