Allolib  1.0
C++ Components For Interactive Multimedia
al_OpenGL.hpp
1 #ifndef INCLUDE_AL_OPENGL_HPP
2 #define INCLUDE_AL_OPENGL_HPP
3 
4 #include "glad/glad.h"
5 
6 namespace al {
7 
8 namespace gl {
9 
10 bool load();
11 bool loaded();
12 
13 const char *versionString();
14 
18 const char *errorString(bool verbose = false);
19 
21 
25 bool error(const char *msg = "", int ID = -1);
26 
28 int numBytes(GLenum v);
29 
31 template <typename Type>
32 GLenum toDataType();
33 
37 void bufferToDraw(unsigned int buffer);
38 
39 void viewport(int left, int bottom, int width, int height);
40 
42 void blending(bool doBlend);
43 
52 void blendMode(unsigned int src, unsigned int dst, unsigned int eq);
53 
55 void depthTesting(bool testDepth);
56 
58 void depthMask(bool maskDepth);
59 
61 void scissorTest(bool testScissor);
62 void scissorArea(int left, int bottom, int width, int height);
63 
65 void culling(bool doCulling);
67 void cullFace(unsigned int face);
68 
72 void polygonMode(unsigned int mode);
73 
75 void colorMask(bool r, bool g, bool b, bool a);
76 
78 void colorMask(bool b);
79 
81 void pointSize(float size);
82 
85 void lineWidth(float size);
86 
87 // clears the default color buffer(buffer 0) with the provided color
88 void clearColor(float r, float g, float b, float a = 1.f);
89 
90 // clears the depth buffer with the provided depth value
91 void clearDepth(float d = 1.f);
92 
93 // clears the specified color buffer with the provided color
94 void clearBuffer(int buffer, float r, float g, float b, float a = 1.f);
95 } // namespace gl
96 } // namespace al
97 
103 //#define AL_ENABLE_DEBUG
104 
105 #ifdef AL_ENABLE_DEBUG
106 #define AL_GRAPHICS_ERROR(msg, ID) al::gl::error(msg, ID)
107 #else
108 #define AL_GRAPHICS_ERROR(msg, ID) ((void)0)
109 #endif
110 
111 #endif // include guard
Definition: al_App.hpp:23