better logging and OpenGL ARB_debug_output
[laserbrain_demo] / src / main.cc
index c497dc1..e3c8a73 100644 (file)
@@ -32,6 +32,9 @@ int main(int argc, char **argv)
        SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1);
        SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 8);
        SDL_GL_SetAttribute(SDL_GL_FRAMEBUFFER_SRGB_CAPABLE, 1);
+#ifndef NDEBUG
+       SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, SDL_GL_CONTEXT_DEBUG_FLAG);
+#endif
 
        int defpos = SDL_WINDOWPOS_UNDEFINED;
        unsigned int sdlflags = SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI;
@@ -154,8 +157,6 @@ bool app_is_mouse_grabbed()
 
 static bool init(int argc, char **argv)
 {
-       glewInit();
-
        if(!app_init(argc, argv)) {
                return false;
        }