Welcome to Python-flavored Magnum! Please note that, while already being rather stable, this functionality is still considered experimental and some APIs might get changed without preserving full backwards compatibility.

magnum.gl.Framebuffer class

Framebuffer

Classes

class BufferAttachment
Buffer attachment
class ColorAttachment
Color attachment
class DrawAttachment
Draw attachment

Static methods

def blit(source: AbstractFramebuffer, destination: AbstractFramebuffer, source_rectangle: Range2Di, destination_rectangle: Range2Di, mask: FramebufferBlit, filter: FramebufferBlitFilter) -> None
Copy a block of pixels
def blit(source: AbstractFramebuffer, destination: AbstractFramebuffer, rectangle: Range2Di, mask: FramebufferBlit) -> None
Copy a block of pixels

Methods

def attach_renderbuffer(self, attachment: BufferAttachment, renderbuffer: Renderbuffer) -> None
Attach renderbuffer to given buffer
def attach_texture(self, attachment: BufferAttachment, texture: Texture2D, level: int) -> None
Attach texture to given buffer
def bind(self, /) -> None
Bind framebuffer for drawing
def clear(self, arg0: FramebufferClear, /) -> None
Clear specified buffers in the framebuffer
def map_for_draw(self, arg0: DrawAttachment, /) -> None
Map shader output to an attachment
def map_for_read(self, arg0: ColorAttachment, /) -> None
Map given color attachment for reading
def read(self, rectangle: Range2Di, image: MutableImageView2D) -> None
Read a block of pixels from the framebuffer to an image view
def read(self, rectangle: Range2Di, image: Image2D) -> None
Read a block of pixels from the framebuffer to an image

Special methods

def __init__(self, arg0: Range2Di, /) -> None
Constructor

Properties

attachments: list[object] get
Renderbuffer and texture objects referenced by the framebuffer
id: int get
OpenGL framebuffer ID
viewport: Range2Di get set
Viewport