|
lmgl 1.0.0
A lightweight OpenGL graphics engine library written in C++
|
Framebuffer class for off-screen rendering. More...
#include <framebuffer.hpp>
Public Member Functions | |
| Framebuffer (int width, int height, bool hdr=false) | |
| Constructor for the Framebuffer. | |
| ~Framebuffer () | |
| Destructor for the Framebuffer. | |
| void | bind () const |
| Bind the framebuffer. | |
| void | unbind () const |
| Unbind the framebuffer. | |
| void | resize (int width, int height) |
| Resize the framebuffer. | |
| std::shared_ptr< Texture > | get_color_attachment () const |
| Get the color attachment texture. | |
Framebuffer class for off-screen rendering.
This class encapsulates the creation and management of an OpenGL framebuffer, including color and depth attachments.
| lmgl::renderer::Framebuffer::Framebuffer | ( | int | width, |
| int | height, | ||
| bool | hdr = false ) |
Constructor for the Framebuffer.
Initializes the framebuffer with the specified width and height. Creates a color attachment texture and a depth attachment renderbuffer.
| width | Width of the framebuffer. |
| height | Height of the framebuffer. |
| hdr | Flag for High Dynamic Range image Rendering. |
| void lmgl::renderer::Framebuffer::bind | ( | ) | const |
Bind the framebuffer.
Activates the framebuffer for subsequent rendering operations.
|
inline |
Get the color attachment texture.
Returns a shared pointer to the texture used as the color attachment of the framebuffer.
| void lmgl::renderer::Framebuffer::resize | ( | int | width, |
| int | height ) |
Resize the framebuffer.
Adjusts the size of the framebuffer and its attachments.
| width | New width of the framebuffer. |
| height | New height of the framebuffer. |
| void lmgl::renderer::Framebuffer::unbind | ( | ) | const |
Unbind the framebuffer.
Deactivates the framebuffer, reverting to the default framebuffer.