X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=init.cpp;fp=init.cpp;h=c37614e4c58de3e3be37ea93f804e2aeace978ea;hp=4b8c970df5f705fc372ed59effd732bab2fc0e95;hb=34036d849937f22c0addfcba44f65207c96deddc;hpb=f332ac28f6a5255a6908c29124589148a8a5b2c5 diff --git a/init.cpp b/init.cpp index 4b8c970..c37614e 100644 --- a/init.cpp +++ b/init.cpp @@ -359,6 +359,17 @@ double get_glsl_version() return glsl_version; } +void APIENTRY debug_callback(GLenum source, + GLenum type, + GLuint id, + GLenum severity, + GLsizei length, + const char *message, + const void *userParam) +{ + printf("Debug: %s\n", message); +} + } // namespace bool init_movit(const string& data_directory, MovitDebugLevel debug_level) @@ -375,6 +386,12 @@ bool init_movit(const string& data_directory, MovitDebugLevel debug_level) glPixelStorei(GL_UNPACK_ALIGNMENT, 1); glDisable(GL_DITHER); + // You can turn this on if you want detailed debug messages from the driver. + // You should probably also ask for a debug context (see gtest_sdl_main.cpp), + // or you might not get much data back. + // glDebugMessageCallbackARB(callback, NULL); + // glDebugMessageControlARB(GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE, 0, 0, GL_TRUE); + if (!check_extensions()) { return false; }