Pygame meory leak with pyOpengL

Viewed 66

Maybe someone enlighten me. I got this piece of code:

import pygame
from OpenGL.GL import glClear, GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT, GL_STENCIL_BUFFER_BIT
from pygame.constants import DOUBLEBUF, OPENGL

pygame.init()
clock = pygame.time.Clock()
pygame.display.set_mode((640,480), DOUBLEBUF|OPENGL)

    
while 1:
    glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT)


    pygame.display.flip()
    clock.tick(50)

Running this causes slow but annoying memory consumption when I check it with process manager. Why is this happening? Not really creating any new object... Just clearing GL buffer and flipping window buffers. I narrowed this down to pygame.display.flip() call but cant do anything about it. Please help.

0 Answers
Related