Hi,

The return value of glReadPixels seems to have changed since Py 2.5. To take a screenshot, one used to be able to go:
data = glReadPixels(0,0,screen_size[0],screen_size[1], GL_RGB, GL_UNSIGNED_BYTE)
image = pygame.image.fromstring(data,screen_size,"RGBA",True)
pygame.image.save(image,"screenshot.png")


This doesn't work anymore. It returns some data type that seems to encapsulate a 3D array. I wasn't able to track down where this datatype was defined. My best effort to reverse engineer it was unsuccessful (the output is garbled):
data = glReadPixels(0,0,screen_size[0],screen_size[1], GL_RGB, GL_UNSIGNED_BYTE)
r,g,b = data[0],data[1],data[2]
image = pygame.Surface(screen_size)
for y in range(screen_size[1]):
    for x in range(screen_size[0]):
        image.set_at((x,screen_size[1]-y-1),(r[y][x],g[y][x],b[y][x]))
pygame.image.save(image,"screenshot.png")


What is the return value format of glReadPixels?

Thanks,
Ian