[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] pygame - writing over existing window information
To copy the screen contents to a texture, do something like:
screentexture = glGenTextures(1)
def copy_screen_to_texture():
glBindTexture(GL_TEXTURE_2D,screentexture)
glCopyTexImage2D(GL_TEXTURE_2D,0,GL_RGB,0,0,screenwidth,screenheight,0)
glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST)
glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAX_FILTER,GL_NEAREST)
Completely untested, but should work without too much trouble.
Cheers,
Ian