Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: weird opengl error problem

  1. #1
    Junior Member Regular Contributor
    Join Date
    Apr 2001
    Posts
    133

    weird opengl error problem

    ok, this is kinda a weird error, and its not that important, but i thought id ask anyway. first, the code im using to grab and output the latest opengl error:

    error=glGetError();
    if ( error != GL_NO_ERROR);
    {
    errorstring=gluErrorString(error);
    fprintf(stderr, "OpenGL error: %s\n", errorstring);
    }

    seems simple enough (i ripped it from the red book), but every time that bit of code is run, it outputs the error string, even when the error is "no error." id rather it not do this. can anybody see anything wrong with this?

    thanks

  2. #2
    Intern Contributor
    Join Date
    Jun 2001
    Posts
    69

    Re: weird opengl error problem

    Code :
    error=glGetError();
    if ( error != GL_NO_ERROR); // delete the ;
    {
      // that's no error, but i'd write:
      //  fprintf(stderr, "OpenGL error: %s\n", gluErrorString(error));
      // or cerr << "OpenGL error: " << gluErrorString(error) << '\n';
      errorstring=gluErrorString(error);
      fprintf(stderr, "OpenGL error: %s\n", errorstring);
    }

  3. #3
    Junior Member Regular Contributor
    Join Date
    Apr 2001
    Posts
    133

    Re: weird opengl error problem

    ok, thats very embarasing...

    sorry, and thanks...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •