-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrenderstates.h
More file actions
executable file
·37 lines (29 loc) · 915 Bytes
/
renderstates.h
File metadata and controls
executable file
·37 lines (29 loc) · 915 Bytes
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
#ifndef RENDERSTATES_H
#define RENDERSTATES_H
#include "glsupport.h"
// Currently the following GL states are supported:
//
// - glPolygonMode (Default: GL_FRONT_AND_BACK, GL_FILL)
// - glBlendFunc (Default: GL_ONE, GL_ZERO)
// - glCullFace (Default: GL_BACK)
//
// The following flags for glEnable/glDisable are supported
//
// - GL_BLEND (Default: off)
// - GL_CULL_FACE (Default: on)
class RenderStates {
GLenum glFront, glBack; // for polygonMode
GLenum glBlendSrcFactor, glBlendDstFactor; // for blendFunc
GLenum glCullFaceMode; // for cullFace
unsigned int flags;
public:
RenderStates();
RenderStates& polygonMode(GLenum face, GLenum mode);
RenderStates& blendFunc(GLenum sfactor, GLenum dfactor);
RenderStates& cullFace(GLenum mode);
RenderStates& enable(GLenum target);
RenderStates& disable(GLenum target);
void apply() const;
void captureFromGl();
};
#endif