Pygame OpenGL get window size

Viewed 56

I am working on a pygame opengl project. I have a resizable window, but I'm having trouble getting the size of it. The following methods only return the original size of the window, not the current size (after it has been resized):

pygame.display.get_surface().get_size()

screen.get_width(),screen.get_height()

Any help would be appreciated.

1 Answers

I found a solution to this. Use the following if you have the same problem:

size = numpy.ndarray.tolist(glGetIntegerv(GL_VIEWPORT))
size = size[2],size[3]
Related