25 void GL::checkError() {
27 while ((error = glGetError()) != GL_NO_ERROR) {
28 Logger::logError(
"OpenGL error " + to_string(error) +
":");
31 Logger::logError(
"GL_INVALID_ENUM: An unacceptable value is specified for an enumerated argument.");
34 case GL_INVALID_VALUE:
35 Logger::logError(
"GL_INVALID_VALUE: A numeric argument is out of range.");
38 case GL_INVALID_OPERATION:
39 Logger::logError(
"GL_INVALID_OPERATION: The specified operation is not allowed in the current state.");
42 case GL_INVALID_FRAMEBUFFER_OPERATION:
43 Logger::logError(
"GL_INVALID_FRAMEBUFFER_OPERATION: The framebuffer object is not complete.");
46 case GL_OUT_OF_MEMORY:
47 Logger::logError(
"GL_OUT_OF_MEMORY: There is not enough memory left to execute the command.");
61 void GL::clearColor(
float r,
float g,
float b,
float a) {
62 clearColor(vec4(r, g, b, a));
65 void GL::clearColor(glm::vec4 color) {
67 vec4 normal = normalize(color);
68 glClearColor(normal.r, normal.g, normal.b, normal.a);
75 void GL::drawArrays(
Primitive mode,
int first,
int count) {
76 glDrawArrays(
to_GLenum(mode), first, count);
ClearBit
This enum wraps the clear buffer bits.
Primitive
This enum wraps Primitive types of OpenGL.
GLenum to_GLenum(E e)
Gets the GLenum value from an enum class.
Generic namespace for the SimpleGL framework.
DepthFunction
This enum wraps the depth functions.
CullFaceMode
This enum wraps the face culling modes.
BlendFactor
This enum wraps the blend factos.
GLbitfield to_GLbitfield(E e)
Gets the GLbitfield value from an enum class.
Capability
This enum wraps OpenGL capabilities.