just a minor refactor, nothing special

This commit is contained in:
MihailRis
2024-04-23 02:00:03 +03:00
parent 6e2bc9ca95
commit 9f2bceb039
67 changed files with 143 additions and 143 deletions
+42
View File
@@ -0,0 +1,42 @@
#ifndef GRAPHICS_CORE_FRAMEBUFFER_H_
#define GRAPHICS_CORE_FRAMEBUFFER_H_
#include "../../typedefs.h"
#include <memory>
class Texture;
class Framebuffer {
uint fbo;
uint depth;
uint width;
uint height;
uint format;
std::unique_ptr<Texture> texture;
public:
Framebuffer(uint fbo, uint depth, std::unique_ptr<Texture> texture);
Framebuffer(uint width, uint height, bool alpha=false);
~Framebuffer();
/// @brief Use framebuffer
void bind();
/// @brief Stop using framebuffer
void unbind();
/// @brief Update framebuffer texture size
/// @param width new width
/// @param height new height
void resize(uint width, uint height);
/// @brief Get framebuffer color attachment
Texture* getTexture() const;
/// @brief Get framebuffer width
uint getWidth() const;
/// @brief Get framebuffer height
uint getHeight() const;
};
#endif // GRAPHICS_CORE_FRAMEBUFFER_H_