Renderbuffer¶
-
class
moderngl.Renderbuffer¶ Renderbuffer objects are OpenGL objects that contain images. They are created and used specifically with
Framebufferobjects. They are optimized for use as render targets, whileTextureobjects may not be, and are the logical choice when you do not need to sample from the produced image. If you need to resample, use Textures instead. Renderbuffer objects also natively accommodate multisampling.A Renderbuffer object cannot be instantiated directly, it requires a context. Use
Context.renderbuffer()orContext.depth_renderbuffer()to create one.
Create¶
-
Context.renderbuffer(size, components=4, samples=0, dtype='f1') → Renderbuffer Renderbufferobjects are OpenGL objects that contain images. They are created and used specifically withFramebufferobjects.Parameters: - size (tuple) – The width and height of the renderbuffer.
- components (int) – The number of components 1, 2, 3 or 4.
Keyword Arguments: - samples (int) – The number of samples. Value 0 means no multisample format.
- dtype (str) – Data type.
Returns: Renderbufferobject
-
Context.depth_renderbuffer(size, samples=0) → Renderbuffer Renderbufferobjects are OpenGL objects that contain images. They are created and used specifically withFramebufferobjects.Parameters: size (tuple) – The width and height of the renderbuffer. Keyword Arguments: samples (int) – The number of samples. Value 0 means no multisample format. Returns: Renderbufferobject
Attributes¶
-
Renderbuffer.width¶ The width of the renderbuffer.
Type: int
-
Renderbuffer.height¶ The height of the renderbuffer.
Type: int
-
Renderbuffer.size¶ The size of the renderbuffer.
Type: tuple
-
Renderbuffer.samples¶ The samples of the renderbuffer.
Type: int
-
Renderbuffer.components¶ The components of the renderbuffer.
Type: int
-
Renderbuffer.depth¶ Is the renderbuffer a depth renderbuffer?
Type: bool
-
Renderbuffer.dtype¶ Data type.
Type: str
-
Renderbuffer.glo¶ The internal OpenGL object. This values is provided for debug purposes only.
Type: int
-
Renderbuffer.mglo¶ Internal representation for debug purposes only.
-
Renderbuffer.extra¶ Any - Attribute for storing user defined objects
-
Renderbuffer.ctx¶ The context this object belongs to