Quick answer: Pygame display set with pygame.OPENGL not responding to surface.fill? OpenGL surfaces don’t accept pygame drawing — use OpenGL clear calls instead.
A game switched to OpenGL mode for shader work. screen.fill no longer clears the screen between frames; everything ghosts.
OPENGL Disables Pygame Drawing
The OPENGL flag tells SDL to expose an OpenGL context instead of a software surface. fill, blit, draw — all no-op on the resulting Surface. Only GL calls render.
Use glClear
glClearColor(0, 0, 0, 1)
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
# ... GL draws ...
pygame.display.flip()Clear via GL each frame. flip swaps the GL buffers.
Mix Software + GL
For UI overlay over GL content, render text/UI to a separate pygame Surface, upload as a texture, draw a textured quad. Pure-pygame UI on a GL surface is impossible.
ModernGL or Pyglet
If you need OpenGL extensively, consider ModernGL or pyglet — they have native GL APIs and don’t fight pygame conventions.
Verifying
The screen clears each frame. GL draws appear. fill / blit calls produce no errors (they no-op silently).
“OPENGL surfaces don’t accept pygame drawing. Use GL clears.”
Decide upfront: pure pygame software, or pygame + PyOpenGL. Mixing leads to a constant stream of “why is this drawing not appearing” questions.