Resize frame buffer method added

This commit is contained in:
IlyaShurupov 2024-06-18 14:48:26 +03:00
parent 787681d320
commit bafe6a7f43
6 changed files with 66 additions and 13 deletions

View file

@ -7,7 +7,7 @@
namespace tp {
class RenderBuffer {
public:
RenderBuffer(const Vec2F& size);
explicit RenderBuffer(const Vec2F& size);
RenderBuffer(const Vec2F& size, tp::uint1 samples);
~RenderBuffer();
@ -16,10 +16,12 @@ namespace tp {
void clear();
void endDraw();
uint4 texId() const;
uint4 buffId() const;
[[nodiscard]] uint4 texId() const;
[[nodiscard]] uint4 buffId() const;
const Vec2F& getSize() const;
void resize(const Vec2F& size);
[[nodiscard]] const Vec2F& getSize() const;
public:
RGBA mClearCol = 0.f;
@ -28,7 +30,8 @@ namespace tp {
uint4 mFrameBufferID = 0; // regroups 0, 1, or more textures, and 0 or 1 depth buffer.
uint4 mTextureId = 0; // texture we're going to render to ( colour attachement #0 )
uint4 mDepthBufferID = 0;
uint4 mDrawBuffers[1];
uint4 mDrawBuffers[1] = { 0 };
Vec2F mSize;
ualni mSamples = 0;
};
};