Jump to content
  • Advertisement
Sign in to follow this  
GosuDrew

glGetString(GL_EXTENSIONS)

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

Hi, This function is returning 0 and I don't understand why. I can't check now if certain functions are supported. Any ideas as to why this is happening? Also, is the way I'm parsing the buffer decent?
int main(int argc, char** argv)
{
   char extension[] = "GL_ARB_imaging";
   char *extensions_list = (char*) glGetString(GL_EXTENSIONS);

   if (!extensions_list)
      cout << "error" << endl;

   while (*extensions_list != '\0')
   {
      for (int i = 0; i < 14; i++)
      {
         if (extension != *(extensions_list++))
         {
            while (*(extensions_list++) != ' ');
            break;
         }
      }
      if (i == 14 && (*extensions_list == ' ' ||
          *extensions_list == '\0'))
      {
         cout << "found!" << endl;
         break;
      }
   }

   return 0;
}

Share this post


Link to post
Share on other sites
Advertisement
Not sure if this is the case, but I believe you need to have an active OpenGL context available before any of the GL calls will be valid. From the looks of your code this is just a test program to see what OGL extensions are available so there is no OGL context. In order for your program to work I think you are going to need to create a window and get an OpenGL context for it before you can query the available extensions.

Hope this helps,
Dan

Share this post


Link to post
Share on other sites
I cut out the rest of the glut code that I had in the main function. I read on some post to change the class style to CS_OWNDC, however I'm using glut.

Nevermind I just put the code after all the initialization stuff and it works fine. I didn't know you needed the opengl device context setup before that call.

Thanks for the responses.

[Edited by - GosuDrew on July 10, 2005 11:58:10 PM]

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!