opengl-cpp/src/Renderer.cpp

21 lines
483 B
C++
Raw Normal View History

2025-01-11 17:48:48 +00:00
#include "Renderer.h"
#include <iostream>
2025-01-11 17:48:48 +00:00
void GLClearError() {
2025-01-12 15:53:46 +00:00
while (glGetError() != GL_NO_ERROR);
2025-01-11 17:48:48 +00:00
}
bool GLLogCall() {
Color::Modifier red(Color::FG_RED);
Color::Modifier def(Color::FG_DEFAULT);
while (GLenum error = glGetError()) {
std::cout << red << "[OpenGL Error] (" << error << ")" << def << std::endl; //if error, it will return a number, this needs to be converted to hex to then look up that value inn GL docs
return false;
}
return true;
}