OpenGL: glGetError() returns invalid enum after call to glewInit()

前端 未结 2 1130
甜味超标
甜味超标 2020-12-03 17:09

I use GLEW and freeglut. For some reason, after a call to glewInit(), glGetError() returns error code 1280, even with glewExperimental = GL_FALSE.

I cannot compile

2条回答
  •  情书的邮戳
    2020-12-03 17:34

    It seems glew just does not work correctly... The easiest solution for me was using libepoxy. It does not require any init thing. Just replace your

    #include 
    

    with

    #include 
    #include 
    

    and remove all the glew code. If you use gcc, you will also have to replace "-lGLEW" with "-lepoxy". That's it. For example I have something like:

    g++ main.cpp -lepoxy -lSDL2 -lSDL2_image -lSDL2_mixer -lglut -lGLU -o main
    

    It seems to be important to keep epoxy flag before others.

提交回复
热议问题