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
18
#include "
lmgl/renderer/texture.hpp
"
19
20
namespace
lmgl
{
21
22
namespace
renderer
{
23
32
class
Framebuffer
{
33
public
:
44
Framebuffer
(
int
width,
int
height,
bool
hdr =
false
);
45
47
~Framebuffer
();
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
lmgl::renderer::Framebuffer::resize
void resize(int width, int height)
Resize the framebuffer.
Definition
framebuffer.cpp:59
lmgl::renderer::Framebuffer::get_color_attachment
std::shared_ptr< Texture > get_color_attachment() const
Get the color attachment texture.
Definition
framebuffer.hpp:81
lmgl::renderer::Framebuffer::unbind
void unbind() const
Unbind the framebuffer.
Definition
framebuffer.cpp:57
lmgl::renderer::Framebuffer::bind
void bind() const
Bind the framebuffer.
Definition
framebuffer.cpp:52
lmgl::renderer::Framebuffer::~Framebuffer
~Framebuffer()
Destructor for the Framebuffer.
Definition
framebuffer.cpp:15
lmgl::renderer::Framebuffer::Framebuffer
Framebuffer(int width, int height, bool hdr=false)
Constructor for the Framebuffer.
Definition
framebuffer.cpp:10
lmgl::renderer
Namespace for rendering-related classes and functions.
Definition
buffer.cpp:9
lmgl
Forward declarations for Assimp Material structure.
Definition
model_loader.cpp:12
texture.hpp
Texture class for managing OpenGL textures.
include
lmgl
renderer
framebuffer.hpp
Generated by
1.13.2