Brenta Engine 1.2
Loading...
Searching...
No Matches
frame_buffer.hpp
1// SPDX-License-Identifier: MIT
2// Author: Giovanni Santini
3// Mail: giovanni.santini@proton.me
4// Github: @San7o
5
6#pragma once
7
8#include <brenta/buffer.hpp>
9#include <cassert>
10
11namespace brenta
12{
13
14namespace types
15{
16
24class framebuffer : public buffer
25{
26public:
27 GLuint texture_id;
28 GLuint render_buffer_id;
33 GLenum format;
39 {
40 }
47 framebuffer(int width, int height, GLenum format = GL_RGBA);
53
54 void bind();
55 void unbind();
59 void destroy();
60 void copy_data([[maybe_unused]] GLsizeiptr size,
61 [[maybe_unused]] const void *data,
62 [[maybe_unused]] GLenum usage)
63 {
64 assert(false && "TODO");
65 }
66
67 void copy_vertices([[maybe_unused]] GLsizeiptr size,
68 [[maybe_unused]] const void *data,
69 [[maybe_unused]] GLenum usage)
70 {
71 assert(false && "TODO");
72 }
73 void copy_indices([[maybe_unused]] GLsizeiptr size,
74 [[maybe_unused]] const void *data,
75 [[maybe_unused]] GLenum usage)
76 {
77 assert(false && "TODO");
78 }
84 void rescale(int width, int height);
89 void set_format(GLenum format);
90};
91
92} // namespace types
93
94} // namespace brenta
Buffer wrapper around OpenGL buffer objects.
Definition buffer.hpp:30
~framebuffer()
Destructor Deletes the framebuffer and its texture.
void destroy()
Delete the framebuffer and its texture.
void set_format(GLenum format)
Set the format of the framebuffer.
GLenum format
Color format of the frame buffer Default is GL_RGBA.
void rescale(int width, int height)
Rescale the framebuffer.
framebuffer()
Empty constructor Does nothing.