space-game001/FrameBuffer.h
2025-12-20 23:08:26 +03:00

29 lines
727 B
C++

#pragma once
#include "OpenGlExtensions.h"
#include <memory>
namespace ZL {
class FrameBuffer {
private:
GLuint fbo = 0;
GLuint textureID = 0;
int width, height;
public:
FrameBuffer(int w, int h);
~FrameBuffer();
// Çàïðåùàåì êîïèðîâàíèå, êàê â VBOHolder
FrameBuffer(const FrameBuffer&) = delete;
FrameBuffer& operator=(const FrameBuffer&) = delete;
void Bind(); // Íà÷àòü ðåíäåð â ýòîò áóôåð
void Unbind(); // Âåðíóòüñÿ ê îáû÷íîìó ðåíäåðó â ýêðàí
GLuint getTextureID() const { return textureID; }
int getWidth() const { return width; }
int getHeight() const { return height; }
};
} // namespace ZL