pyglet.image.buffer
- class Framebuffer
OpenGL Framebuffer Object
New in version 2.0.
- __init__(target=36160) Framebuffer
- attach_renderbuffer(renderbuffer, target=36160, attachment=36064)
Attach a Renderbuffer to the Framebuffer
- Parameters:
- renderbufferpyglet.image.Renderbuffer
Specifies the Renderbuffer to attach to the framebuffer attachment point named by attachment.
- targetint
Specifies the framebuffer target. target must be GL_DRAW_FRAMEBUFFER, GL_READ_FRAMEBUFFER, or GL_FRAMEBUFFER. GL_FRAMEBUFFER is equivalent to GL_DRAW_FRAMEBUFFER.
- attachmentint
Specifies the attachment point of the framebuffer. attachment must be GL_COLOR_ATTACHMENTi, GL_DEPTH_ATTACHMENT, GL_STENCIL_ATTACHMENT or GL_DEPTH_STENCIL_ATTACHMENT.
- attach_texture(texture, target=36160, attachment=36064)
Attach a Texture to the Framebuffer
- Parameters:
- texturepyglet.image.Texture
Specifies the texture object to attach to the framebuffer attachment point named by attachment.
- targetint
Specifies the framebuffer target. target must be GL_DRAW_FRAMEBUFFER, GL_READ_FRAMEBUFFER, or GL_FRAMEBUFFER. GL_FRAMEBUFFER is equivalent to GL_DRAW_FRAMEBUFFER.
- attachmentint
Specifies the attachment point of the framebuffer. attachment must be GL_COLOR_ATTACHMENTi, GL_DEPTH_ATTACHMENT, GL_STENCIL_ATTACHMENT or GL_DEPTH_STENCIL_ATTACHMENT.
- attach_texture_layer(
- texture,
- layer,
- level,
- target=36160,
- attachment=36064,
Attach a Texture layer to the Framebuffer
- Parameters:
- texturepyglet.image.TextureArray
Specifies the texture object to attach to the framebuffer attachment point named by attachment.
- layerint
Specifies the layer of texture to attach.
- levelint
Specifies the mipmap level of texture to attach.
- targetint
Specifies the framebuffer target. target must be GL_DRAW_FRAMEBUFFER, GL_READ_FRAMEBUFFER, or GL_FRAMEBUFFER. GL_FRAMEBUFFER is equivalent to GL_DRAW_FRAMEBUFFER.
- attachmentint
Specifies the attachment point of the framebuffer. attachment must be GL_COLOR_ATTACHMENTi, GL_DEPTH_ATTACHMENT, GL_STENCIL_ATTACHMENT or GL_DEPTH_STENCIL_ATTACHMENT.
- bind()
Bind the Framebuffer
This ctivates it as the current drawing target.
- clear()
Clear the attachments
- delete()
Explicitly delete the Framebuffer.
- static get_status() str
Get the current Framebuffer status, as a string.
If Framebuffer.is_complete is False, this method can be used for more information. It will return a string with the OpenGL reported status.
- Return type:
- unbind()
Unbind the Framebuffer
Unbind should be called to prevent further rendering to the framebuffer, or if you wish to access data from its Texture atachments.
- property height
The height of the tallest attachment.
- property id
The Framebuffer id
- property width
The width of the widest attachment.
- class Renderbuffer
OpenGL Renderbuffer Object
- __init__(width, height, internal_format, samples=1)
- bind()
- delete()
- static unbind()
- property height
- property id
- property width
- get_max_color_attachments()
Get the maximum allow Framebuffer Color attachements