lmgl 1.0.0
A lightweight OpenGL graphics engine library written in C++
Loading...
Searching...
No Matches
framebuffer.hpp
Go to the documentation of this file.
1
11
12#pragma once
13
14#include <glad/glad.h>
15
16#include <memory>
17
19
20namespace lmgl {
21
22namespace renderer {
23
33 public:
44 Framebuffer(int width, int height, bool hdr = false);
45
48
54 void bind() const;
55
61 void unbind() const;
62
71 void resize(int width, int height);
72
81 inline std::shared_ptr<Texture> get_color_attachment() const { return m_texture_attachment; }
82
83 private:
89 void invalidate();
90
92 unsigned int m_renderer_id;
93
95 unsigned int m_depth_attachment;
96
98 std::shared_ptr<Texture> m_texture_attachment;
99
101 int m_width, m_height;
102
104 bool m_hdr;
105};
106
107} // namespace renderer
108
109} // namespace lmgl
void resize(int width, int height)
Resize the framebuffer.
Definition framebuffer.cpp:59
std::shared_ptr< Texture > get_color_attachment() const
Get the color attachment texture.
Definition framebuffer.hpp:81
void unbind() const
Unbind the framebuffer.
Definition framebuffer.cpp:57
void bind() const
Bind the framebuffer.
Definition framebuffer.cpp:52
~Framebuffer()
Destructor for the Framebuffer.
Definition framebuffer.cpp:15
Framebuffer(int width, int height, bool hdr=false)
Constructor for the Framebuffer.
Definition framebuffer.cpp:10
Namespace for rendering-related classes and functions.
Definition buffer.cpp:9
Forward declarations for Assimp Material structure.
Definition model_loader.cpp:12
Texture class for managing OpenGL textures.