45 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
47 glEnable(GL_DEPTH_TEST);
49 glViewport(0, 0, size.
x, size.
y);
57 console.
warn(
"OpenGL Debug Callback not available on OSX. Errors, warnings, and undefined behavior will not be reported.");
61 glDebugMessageCallback([](GLenum source, GLenum type, GLuint
id, GLenum severity, GLsizei length,
const GLchar *message,
62 const void *userParam) ->
void {
64 std::stringstream outMessage;
66 outMessage <<
"(" << enumStringValueMap.at(source) <<
") Sent the following message -\n(Type: " <<
67 enumStringValueMap.at(type) <<
")\n";
70 if (length < 0) outMessage.write(message, length);
71 else outMessage << message;
75 case GL_DEBUG_SEVERITY_NOTIFICATION:
78 case GL_DEBUG_SEVERITY_LOW:
82 case GL_DEBUG_SEVERITY_MEDIUM:
85 case GL_DEBUG_SEVERITY_HIGH:
94 glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS);
95 glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE, 0, NULL, GL_TRUE);
102 catch (
const std::exception& e) {
103 console.
error(std::string(
"Unable to setup OpenGL/Glad - ") + e.what());