Exemplo n.º 1
0
 def __init__(self):
     # This code is on init to make creation fail if FBOs are not available
     self.fbuf = FramebufferObject()
     self.fbuf.check_status()
Exemplo n.º 2
0
 def __init__(self):
     # This code is on init to make creation fail if FBOs are not available
     self.fbuf = FramebufferObject()
     self.fbuf.check_status()
Exemplo n.º 3
0
class FBOGrabber(_TextureGrabber):
    """Render-to texture system based on framebuffer objects (the GL
    extension). It is quite fast and portable, but requires a recent GL
    implementation/driver.

    Requires framebuffer_object extensions"""
    def __init__(self):
        # This code is on init to make creation fail if FBOs are not available
        self.fbuf = FramebufferObject()
        self.fbuf.check_status()

    def grab(self, texture):
        self.fbuf.bind()
        self.fbuf.texture2d(texture)
        self.fbuf.check_status()
        self.fbuf.unbind()

    def before_render(self, texture):
        self.fbuf.bind()
        glClear(GL_COLOR_BUFFER_BIT)

    def after_render(self, texture):
        self.fbuf.unbind()
Exemplo n.º 4
0
class FBOGrabber(_TextureGrabber):
    """Render-to texture system based on framebuffer objects (the GL
    extension). It is quite fast and portable, but requires a recent GL
    implementation/driver.

    Requires framebuffer_object extensions"""
    def __init__(self):
        # This code is on init to make creation fail if FBOs are not available
        self.fbuf = FramebufferObject()
        self.fbuf.check_status()

    def grab(self, texture):
        self.fbuf.bind()
        self.fbuf.texture2d(texture)
        self.fbuf.check_status()
        self.fbuf.unbind()

    def before_render(self, texture):
        self.fbuf.bind()
        glClear(GL_COLOR_BUFFER_BIT)

    def after_render(self, texture):
        self.fbuf.unbind()