views:

71

answers:

0

I have this code:

def setup_framebuffer(surface):
#Create texture if not done already
if surface.texture is None:
    create_texture(surface)
#Render child to parent
if surface.frame_buffer is None:
    surface.frame_buffer =  glGenFramebuffersEXT(1)
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, surface.frame_buffer)
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, surface.texture, 0)
glPushAttrib(GL_VIEWPORT_BIT)
glViewport(0,0,surface._scale[0],surface._scale[1])
glMatrixMode(GL_PROJECTION)
glLoadIdentity() #Load the projection matrix
gluOrtho2D(0,surface._scale[0],0,surface._scale[1])

glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, surface.frame_buffer) for this despite the second parameter printing as 1 for a test I did, I get:

glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, surface.frame_buffer)

I only got this after implementing pyglet. GLUT is too limited.

Thank you.