blob: 4b9104b3f526f1caf1f098c7c015ad83d5f29202 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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
|