I use GLEW and freeglut. For some reason, after a call to glewInit(), glGetError() returns error code 1280. Reinstalling the drivers didn't help. I tried to disable glewExperimental, it had no effect. Code worked before, but I am not aware of any changes I could possibly make.

Here's my code:

int main(int argc, char* argv[])
    GLenum GlewInitResult, res;

    InitWindow(argc, argv);

    res = glGetError(); // res = 0

    glewExperimental = GL_TRUE;
    GlewInitResult = glewInit();    

    res = glGetError(); // res = 1280



void InitWindow(int argc, char* argv[])
    glutInit(&argc, argv);

    glutInitContextVersion(4, 0);


    glutInitWindowPosition(0, 0);
    glutInitWindowSize(CurrentWidth, CurrentHeight);
    glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA);

    WindowHandle = glutCreateWindow(WINDOW_TITLE);

    GLenum errorCheckValue = glGetError();

    if (WindowHandle < 1)
        fprintf(stderr, "ERROR: Could not create new rendering window.\n");

    glutTimerFunc(0, TimerFunction, 0);

Could someone tell me what I am doing wrong? Thanks.

  • \$\begingroup\$ is GLEW returning an error? \$\endgroup\$
    – Publius
    Jun 1, 2012 at 21:33

2 Answers 2


Try disabling the glewExperimental support, as that may be attempting to call something in OpenGL that isn't supported by your particular driver. That actual error is GL_INVALID_ENUM​ which, unfortunately, can be raised from pretty much anywhere.

Also, what OpenGL driver are you using and in what environment? Some drivers may allow you to enable a debug log or the like. Unfortunately, GLEW itself is not written in a way that makes it easy to add in generic glGetError() checks after every extension query or the like, but you might be able to narrow it down by adding it in at strategic locations.

  • \$\begingroup\$ I tried to disable glewExperimental, it had no effect. I use Windows 7 64bit, latest AMD drivers. \$\endgroup\$
    – Martin
    Jun 1, 2012 at 21:29
  • \$\begingroup\$ Whoops, I had error in my vertex shader. GL_INVALID_ENUM wasn't really the problem. Thanks \$\endgroup\$
    – Martin
    Jun 1, 2012 at 21:50

The error code given, 1280, corresponds with GL error 0x0500

GL_INVALID_ENUM​, 0x0500: Given when an enumeration parameter is not a legal enumeration for that function. This is given only for local problems; if the spec allows the enumeration in certain circumstances, and other parameters or state dictate those circumstances, then GL_INVALID_OPERATION​ is the result instead.


Apparently one of the enums you are passing into OpenGL is bad. I've never used GLUT so I have no idea what the possible enum error could be.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .