Class Framebuffer
Framebuffer abstraction for offscreen rendering.
class Framebuffer
: dlib .core .ownership .Owner;
Constructors
Name | Description |
---|---|
this
(owner)
|
Constructs an empty framebuffer. |
this
(w, h, format, depth, owner)
|
Constructs and initializes a framebuffer. |
Fields
Name | Type | Description |
---|---|---|
colorFormat
|
FrameBufferFormat | Color buffer format. |
framebuffer
|
uint | OpenGL framebuffer object. |
hasDepthBuffer
|
bool | True if a depth/stencil buffer is attached. |
height
|
uint | Framebuffer height in pixels. |
width
|
uint | Framebuffer width in pixels. |
Methods
Name | Description |
---|---|
bind
()
|
Binds the framebuffer for drawing. |
blitColorBuffer
()
|
Blits the color buffer to the default framebuffer. |
blitDepthBuffer
()
|
Blits the depth/stencil buffer to the default framebuffer. |
colorTexture
()
|
Returns the OpenGL color texture handle. |
depthTexture
()
|
Returns the OpenGL depth texture handle. |
init
(w, h, format, depth)
|
Initializes or reinitializes the framebuffer. |
releaseFramebuffer
()
|
Releases all OpenGL framebuffer and texture resources. |
resize
(w, h)
|
Resizes the framebuffer and its attachments. |
unbind
()
|
Unbinds the framebuffer (restores default framebuffer). |
createFramebuffer
()
|
Creates the OpenGL framebuffer and attachments. |
Description
Manages an OpenGL framebuffer object with color and optional depth/stencil attachments.