MasterMastic
MasterMastic

Reputation: 21306

Swapping buffers with core profile uses invalid operations

Whenever I call a function to swap buffers I get tons of errors from glDebugMessageCallback saying:

glVertex2f has been removed from OpenGL Core context (GL_INVALID_OPERATION)

I've tried using both with GLFW and freeglut, and neither work appropriately.

I haven't used glVertex2f, of course. I even went as far as to delete all my rendering code to see if I can find what's causing it, but the error is still there, right after glutSwapBuffers/glfwSwapBuffers.
Using single-buffering causes no errors either.

I've initialized the context to 4.3, core profile, and flagged forward-compatibility.

Upvotes: 0

Views: 455

Answers (2)

Andon M. Coleman
Andon M. Coleman

Reputation: 43359

As explained in comments, the problem here is actually third-party software and not any code you yourself wrote.

When software such as the Steam overlay or FRAPS need to draw something overtop OpenGL they usually go about this by hooking/injecting some code into your application's SwapBuffers implementation at run-time.

You are dealing with a piece of software (RivaTuner) that still uses immediate mode to draw its overlay and that is the source of the unexplained deprecated API calls on every buffer swap.

Upvotes: 6

datenwolf
datenwolf

Reputation: 162297

Do you have code you can share? Either the driver is buggy or something tries to call glVertex in your process. You could try to use glloadgen to build a loader library that covers OpenGL-4.3 symbols only (and only that symbols), so that when linking your program uses of symbols outside the 4.3 specs causes linkage errors.

Upvotes: 0

Related Questions