class
framebuffer_tclass for creating and managing framebuffers in OpenGL
framebuffer_
Public static functions
-
static void bind_default_framebuffer(framebuffer_
target_ t target = framebuffer_target_t::read_and_write) - bind default framebuffer
Constructors, destructors, conversion operators
- framebuffer_t(size_t width, size_t height)
- constructor
-
framebuffer_t(std::
initializer_list<std:: pair<const texture_ t&, attachment_ t>> list) explicit - constructor
-
framebuffer_t(const framebuffer_
t& cpy) deleted - copy constructor
-
framebuffer_t(framebuffer_
t&& mov) defaulted - move constructor
Public functions
-
void attach(const texture_
t& texture, attachment_ t attatchment) - attatch texture to framebuffer
-
void bind(framebuffer_
target_ t target = framebuffer_target_t::read_and_write) - bind framebuffer
- auto height() const -> size_t
- get height
-
auto operator=(const framebuffer_
t& cpy) -> framebuffer_ t& deleted - copy assignment operator
-
auto operator=(framebuffer_
t&& mov) -> framebuffer_ t& defaulted - move assignment operator
-
template<class T = glm::vec3>auto pixel_read(size_t x = 0, size_t y = 0) const -> image_
t<T> -
template<class T = glm::vec3>auto pixel_read(size_t x, size_t y, size_t width, size_t height) const -> image_
t<T> - auto width() const -> size_t
- get width
Function documentation
static void glpp:: core:: object:: framebuffer_t:: bind_default_framebuffer(framebuffer_ target_ t target = framebuffer_target_t::read_and_write)
bind default framebuffer
Parameters | |
---|---|
target | [in] target that shall be bound |
Make default framebuffer active. If write or read_and_write is passed as target, following draw calls will be rendered to the screen.
glpp:: core:: object:: framebuffer_t:: framebuffer_t(size_t width,
size_t height)
constructor
Parameters | |
---|---|
width | [in] width of framebuffer in pixels |
height | [in] height of framebuffer in pixels |
Create an empty framebuffer with no texture attatchments.
glpp:: core:: object:: framebuffer_t:: framebuffer_t(std:: initializer_list<std:: pair<const texture_ t&, attachment_ t>> list) explicit
constructor
Parameters | |
---|---|
list | [in] list of texture attatchments |
Create an empty framebuffer with a list of texture attatchents. The width and height of the framebuffer is deduced from the textures that shall be attatched. All textures must have the same width and height.
glpp:: core:: object:: framebuffer_t:: framebuffer_t(const framebuffer_ t& cpy) deleted
copy constructor
Framebuffer objects are not copy-constructible.
glpp:: core:: object:: framebuffer_t:: framebuffer_t(framebuffer_ t&& mov) defaulted
move constructor
Framebuffer objects are move-constructible. Constructs a framebuffer_
void glpp:: core:: object:: framebuffer_t:: attach(const texture_ t& texture,
attachment_ t attatchment)
attatch texture to framebuffer
Parameters | |
---|---|
texture | [in] texture object that shall be attatched |
attatchment | [in] channel which shall be rendered to texture |
This functions will attatch a texture object to the framebuffer. Following rendering to this framebuffer will render the contents of the specified attatchment into the texture object. Width and height of the attatched texture must match the width and height of the framebuffer.
void glpp:: core:: object:: framebuffer_t:: bind(framebuffer_ target_ t target = framebuffer_target_t::read_and_write)
bind framebuffer
Parameters | |
---|---|
target | [in] target hint |
Bind framebuffer to OpenGL context. If write or read_and_write is used as target, all following draw calls will be rendered into this framebuffer object or into assigned texture objects.
framebuffer_ t& glpp:: core:: object:: framebuffer_t:: operator=(const framebuffer_ t& cpy) deleted
copy assignment operator
Framebuffer objects are not copy-assignable.
framebuffer_ t& glpp:: core:: object:: framebuffer_t:: operator=(framebuffer_ t&& mov) defaulted
move assignment operator
Framebuffer objects are move-assignable. Constructs a framebuffer_
template<class T = glm::vec3>
image_ t<T> glpp:: core:: object:: framebuffer_t:: pixel_read(size_t x = 0,
size_t y = 0) const
Parameters | |
---|---|
x | [in] left border of rendered screen |
y | [in] bottom border of rendered screen |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
This function will copy a subimage of the framebuffer into cpu memory. [x, y] are the left and top border. The subimage will be widht and height pixels wide. x+widht must be smaller or equal to the widht of the framebuffer. y+height must be smaller or equal to the height of the framebuffer.
template<class T = glm::vec3>
image_ t<T> glpp:: core:: object:: framebuffer_t:: pixel_read(size_t x,
size_t y,
size_t width,
size_t height) const
Parameters | |
---|---|
x | [in] left border of rendered screen |
y | [in] bottom border of rendered screen |
width | [in] width of rendered screen |
height | [in] height of rendered screen |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
This function will copy a subimage of the framebuffer into cpu memory. [x, y] are the left and top border. The subimage will be widht and height pixels wide. x+widht must be smaller or equal to the widht of the framebuffer. y+height must be smaller or equal to the height of the framebuffer.