29 lines
727 B
C++
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
|