| globjects 1.0.0.000000000000 Strict OpenGL objects wrapper.

AbstractState.h
Go to the documentation of this file.
1
2 #pragma once
3
4 #include <array>
5
6 #include <glbinding/gl/types.h>
7
8 #include <globjects/globjects_api.h>
9
10
11 namespace globjects
12 {
13
14
15 class StateSetting;
16
17 class GLOBJECTS_API AbstractState
18 {
19 public:
20 virtual void enable(gl::GLenum capability) = 0;
21 virtual void disable(gl::GLenum capability) = 0;
22 virtual bool isEnabled(gl::GLenum capability) const = 0;
23 virtual void enable(gl::GLenum capability, int index) = 0;
24 virtual void disable(gl::GLenum capability, int index) = 0;
25 virtual bool isEnabled(gl::GLenum capability, int index) const = 0;
26
27 void setEnabled(gl::GLenum capability, bool enabled);
28 void setEnabled(gl::GLenum capability, int index, bool enabled);
29
30 void blendColor(gl::GLfloat red, gl::GLfloat green, gl::GLfloat blue, gl::GLfloat alpha);
31 void blendColor(const std::array<gl::GLfloat, 4> & color);
32 void blendFunc(gl::GLenum sFactor, gl::GLenum dFactor);
33 void blendFuncSeparate(gl::GLenum srcRGB, gl::GLenum dstRGB, gl::GLenum srcAlpha, gl::GLenum dstAlpha);
34 void clearColor(gl::GLfloat red, gl::GLfloat green, gl::GLfloat blue, gl::GLfloat alpha);
35 void clearColor(const std::array<gl::GLfloat, 4> & color);
36 void clearDepth(gl::GLfloat depth);
37 void clearStencil(gl::GLint s);
38 void colorMask(gl::GLboolean red, gl::GLboolean green, gl::GLboolean blue, gl::GLboolean alpha);
39 void colorMask(const std::array<gl::GLboolean, 4> & mask);
40 void cullFace(gl::GLenum mode);
41 void depthFunc(gl::GLenum func);
42 void depthMask(gl::GLboolean flag);
43 void depthRange(gl::GLdouble nearVal, gl::GLdouble farVal);
44 void depthRange(gl::GLfloat nearVal, gl::GLfloat farVal);
45 void depthRange(const std::array<gl::GLfloat, 2> & range);
46 void frontFace(gl::GLenum winding);
47 void logicOp(gl::GLenum opcode);
48 void pixelStore(gl::GLenum pname, gl::GLboolean param);
49 void pixelStore(gl::GLenum pname, gl::GLint param);
50 void pixelStore(gl::GLenum pname, gl::GLfloat param);
51 void pointParameter(gl::GLenum pname, gl::GLenum param);
52 void pointSize(gl::GLfloat size);
53 void polygonMode(gl::GLenum face, gl::GLenum mode);
54 void polygonOffset(gl::GLfloat factor, gl::GLfloat units);
55 void primitiveRestartIndex(gl::GLuint index);
56 void provokingVertex(gl::GLenum provokeMode);
57 void sampleCoverage(gl::GLfloat value, gl::GLboolean invert);
58 void scissor(gl::GLint x, gl::GLint y, gl::GLsizei width, gl::GLsizei height);
59 void scissor(const std::array<gl::GLint, 4> & scissorBox);
60 void stencilFunc(gl::GLenum func, gl::GLint ref, gl::GLuint mask);
61 void stencilMask(gl::GLuint mask);
62 void stencilOp(gl::GLenum stencilFail, gl::GLenum depthFail, gl::GLenum depthPass);
63 void stencilFuncSeparate(gl::GLenum face, gl::GLenum func, gl::GLint ref, gl::GLuint mask);
64 void stencilMaskSeparate(gl::GLenum face, gl::GLuint mask);
65 void stencilOpSeparate(gl::GLenum face, gl::GLenum stencilFail, gl::GLenum depthFail, gl::GLenum depthPass);
66
67 virtual void add(StateSetting * setting) = 0;
68
69 template <typename... Arguments>
70 void set(void (*function)(Arguments...), Arguments... arguments);
71 };
72
73
74 } // namespace globjects
75
76
77 #include <globjects/AbstractState.inl>
globjects::isEnabled
GLOBJECTS_API bool isEnabled(gl::GLenum capability)
globjects::StateSetting
Definition: StateSetting.h:36
globjects::disable
GLOBJECTS_API void disable(gl::GLenum capability)
globjects
Contains all the classes that wrap OpenGL functionality.
globjects::setEnabled
GLOBJECTS_API void setEnabled(gl::GLenum capability, bool enabled)
globjects::AbstractState
Definition: AbstractState.h:17
globjects::enable
GLOBJECTS_API void enable(gl::GLenum capability)