Results 1 to 3 of 3

Thread: weird opengl error problem

  1. #1
    Senior Member Regular Contributor
    Join Date
    Apr 2001
    Posts
    103

    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
    Member Contributor
    Join Date
    Jun 2001
    Posts
    55

    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
    Senior Member Regular Contributor
    Join Date
    Apr 2001
    Posts
    103

    Re: weird opengl error problem

    ok, thats very embarasing...

    sorry, and thanks...

Similar Threads

  1. weird color problem with openGL
    By floh667 in forum OpenGL: User Software
    Replies: 0
    Last Post: 02-03-2013, 09:30 AM
  2. weird error.
    By ElectronicTempest in forum OpenGL: Linux
    Replies: 11
    Last Post: 06-06-2005, 02:31 AM
  3. "weird error"
    By JOSE ML in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 09-09-2002, 05:09 PM
  4. Replies: 3
    Last Post: 11-30-2000, 02:23 AM
  5. Weird compile error
    By Mats in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 08-10-2000, 04:09 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean