Example #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()
Example #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()
Example #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()
Example #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()