X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=init.cpp;fp=init.cpp;h=b4e69b0f6d444c03eeef24125a357198b03fb89d;hp=4802c68712e3b69b086eb5877da28528fc457c3f;hb=fe36cdba16b02cab582f2d0516e98fcdb62f3807;hpb=5ee3e6bb0bf100d57a06911b89c3a0a0dc49e2be diff --git a/init.cpp b/init.cpp index 4802c68..b4e69b0 100644 --- a/init.cpp +++ b/init.cpp @@ -362,6 +362,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) @@ -378,6 +389,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; }