Menu

glGetString() problem

2002-02-01
2012-09-26
  • Nobody/Anonymous

    Why is it every time I do:

        cout << (char *)glGetString(GL_VENDOR) << endl;

    it outputs "<null>"?

    I have included gl.h the opengl lib.

    Kip

     
    • Nobody/Anonymous

      I'm not sure but it's possible the NULL=0=error code, either:

      GL_INVALID_ENUM or GL_INVALID_OPERATION (sorry, I don't know their numerical values, you'll need to check the headers).

      It might also be (guessing) that since the fn description says 'The GL_VERSION string begins with a version number' that the version number is zero!

       
    • Nobody/Anonymous

      dunno if it makes sense, see yourself

      the lines of code are for pure Windoze, i really don't know how to invoke opengl from a dos box

      first, i declared this:

      const GLubyte *info;

      then, within InitOpenGL(), i do this (before returning):

      info = glGetString(GL_VENDOR);

      finally, i have put it into KillGLWindow, do this:

      MessageBox(NULL,(char *) info,"Status",MB_OK);

      it says "NVIDIA Corporation", so i assume it works

      are you working with NEHE's tuts?

       
    • Nobody/Anonymous

      From msdn: The glGetString function returns a string describing the current OpenGL connection.

      ie you need to have initialised your opengl surface prior to calling the fn. That's why it works in your 'NeHe' style windows example but does not not succeed in your console.

      I think the source for GLUT is available somewhere or other and that may give you some ideas about how to go about setting up opengl within a console app.

      Hope that helps.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.