Jump to content
  • Advertisement
Sign in to follow this  
glmisscelan

glGetString problem

This topic is 4539 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

When i use this code char *p = (char *) glGetString(GL_EXTENSIONS); I dont get any information, p always is null. What im doing wrong? Thanks in advance

Share this post


Link to post
Share on other sites
Advertisement
A return value of zero means an error occured. Use glGetError to obtain what error it was.
You may for example not call glGetStrings inside a glBegin/glEnd pair.

Share this post


Link to post
Share on other sites
You must bind a context (MakeCurrent) before you can issue any GL calls, including GetString. This is especially significant on Windows, where some pixel formats are exported by the Microsoft renderer and others by the hardware ICD - until you bind a context, there is no way for opengl32.dll to know which driver you are using, and its the driver which returns the strings.

Share this post


Link to post
Share on other sites
Are you sure you have an OGL context before you are calling glGetString?

EDIT: Juuust beaten! [smile]

Share this post


Link to post
Share on other sites
Quote:
Original post by gold
You must bind a context (MakeCurrent) before you can issue any GL calls, including GetString. This is especially significant on Windows, where some pixel formats are exported by the Microsoft renderer and others by the hardware ICD - until you bind a context, there is no way for opengl32.dll to know which driver you are using, and its the driver which returns the strings.


sorry for hijacking the topic, but does this means that there is a way to use software renderer even if a hardware icd is installed?

Share this post


Link to post
Share on other sites
Yes, you can select a Microsoft pixel format by searching for the PFD_GENERIC_FORMAT flag in the pfd.dwFlags.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!