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 __init__ (self): # This code is on init to make creation fail if FBOs are not available self.fbuf = FramebufferObject() self.fbuf.check_status()
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()
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()