-
Notifications
You must be signed in to change notification settings - Fork 0
/
FrameBuffer.h
64 lines (44 loc) · 1.22 KB
/
FrameBuffer.h
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#pragma once
#include <GL\glew.h>
class FrameBuffer
{
public:
FrameBuffer(void);
~FrameBuffer(void);
void Release(void);
int Initialize(unsigned int w, unsigned int h,
unsigned int colour, bool useDepth=true,
bool useHDR=true, bool useLinearFilter=true, bool clamp=true);
void Activate(void) const;
static void Deactivate(void);
void UnbindTextures(void);
//////////
//SETTERS
//////////
void BindColour(unsigned int target = 0) const;
void BindDepth(void) const;
void SetTexture(unsigned int texture = 0);
//////////
//GETTERS
//////////
//Get the handle
inline unsigned int GetHandle(void) { return handle; }
//Get the texture handles
inline unsigned int* GetColourTex(void) { return colourTex; }
inline unsigned int GetNumTargets(void) { return numTargets;}
//Get the dimentions of the frame buffer
inline unsigned int GetWidth(void) { return width; }
inline unsigned int GetHeight(void) { return height; }
private:
//Handle for openGl access
unsigned int handle;
//Texture handle
unsigned int colourTex[16];
unsigned int numTargets;
//Depth target
unsigned int depthTex;
//Dimentions of the Frame Buffer
unsigned int width, height;
//max dimension
unsigned int maxSize;
};