diff options
Diffstat (limited to 'Client/Source/Graphics/FrameBuffer.h')
-rw-r--r-- | Client/Source/Graphics/FrameBuffer.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/Client/Source/Graphics/FrameBuffer.h b/Client/Source/Graphics/FrameBuffer.h new file mode 100644 index 0000000..4b9104b --- /dev/null +++ b/Client/Source/Graphics/FrameBuffer.h @@ -0,0 +1,35 @@ +#ifndef FRAME_BUFFER_H +#define FRAME_BUFFER_H + +#include "OpenGL.h" +#include "RenderTexture.h" + +// Fbo,所有绑定的texture和renderbuffer的target都是可读写的GL_FRAMEBUFFER +class FrameBuffer +{ +public: + enum FrameBufferUsage + { + FrameBufferUsage_None = 0, + FrameBufferUsage_Depth = 1, + FrameBufferUsage_Stencil = 2, + FrameBufferUsage_DepthStencil = 3, + }; + + FrameBuffer(FrameBufferUsage usage, int width, int height); + ~FrameBuffer(); + + bool Blit(FrameBuffer* target); + + bool BindRenderTexture(RenderTexture* rt, int location = 0); + + GET(int, Width, m_Width); + GET(int, Height, m_Height); + +private: + int m_Width, m_Height; + FrameBufferUsage m_Usage; + +}; + +#endif
\ No newline at end of file |