Note that there are some explanatory texts on larger screens.

plurals
  1. POOpenGL: glGetError() returns invalid enum after call to glewInit()
    primarykey
    data
    text
    <p>I use GLEW and freeglut. For some reason, after a call to glewInit(), glGetError() returns error code 1280, even with glewExperimental = GL_FALSE. </p> <p>I cannot compile the shaders, glGetProgramInfoLog() returns "Vertex shader(s) were not successfully compiled before glLinkProgram() was called. Link failed." I was able to compile the shaders before.</p> <p>Reinstalling the drivers didn't help. </p> <p>Here's my code: </p> <pre><code>int main(int argc, char* argv[]) { GLenum GlewInitResult, res; InitWindow(argc, argv); res = glGetError(); // res = 0 glewExperimental = GL_TRUE; GlewInitResult = glewInit(); fprintf(stdout, "ERROR: %s\n", glewGetErrorString(GlewInitResult)); // "No error" res = glGetError(); // res = 1280 glutMainLoop(); exit(EXIT_SUCCESS); } void InitWindow(int argc, char* argv[]) { glutInit(&amp;argc, argv); glutInitContextVersion(4, 0); glutInitContextFlags(GLUT_FORWARD_COMPATIBLE); glutInitContextProfile(GLUT_CORE_PROFILE); glutSetOption(GLUT_ACTION_ON_WINDOW_CLOSE, GLUT_ACTION_GLUTMAINLOOP_RETURNS); glutInitWindowPosition(0, 0); glutInitWindowSize(CurrentWidth, CurrentHeight); glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA); WindowHandle = glutCreateWindow(WINDOW_TITLE); GLenum errorCheckValue = glGetError(); if (WindowHandle &lt; 1) { fprintf(stderr, "ERROR: Could not create new rendering window.\n"); exit(EXIT_FAILURE); } glutReshapeFunc(ResizeFunction); glutDisplayFunc(RenderFunction); glutIdleFunc(IdleFunction); glutTimerFunc(0, TimerFunction, 0); glutCloseFunc(Cleanup); glutKeyboardFunc(KeyboardFunction); } </code></pre> <p>What I am doing wrong?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload