X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fguicast%2Fbcwindow3d.C;h=59a21d8eb16059683572644ac430038c3570b32f;hb=83b70dd60863377cb281e6be5206304e10373e30;hp=57118e7421bba74dedbb056bc039ef5e850155d8;hpb=7fd85fb66168f6b518c5f2d73e04036e87faa0e1;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/guicast/bcwindow3d.C b/cinelerra-5.1/guicast/bcwindow3d.C index 57118e74..59a21d8e 100644 --- a/cinelerra-5.1/guicast/bcwindow3d.C +++ b/cinelerra-5.1/guicast/bcwindow3d.C @@ -192,9 +192,32 @@ bool BC_WindowBase::glx_make_current(GLXDrawable draw, GLXContext glx_ctxt) return glXMakeContextCurrent(get_display(), draw, draw, glx_ctxt); } +//#define GL_BUG +#ifdef GL_BUG +static void GLAPIENTRY glDebugCallback(GLenum source, GLenum type, + GLuint id, GLenum severity, GLsizei length, const GLchar* message, + const void* userParam) +{ + if( type == GL_DEBUG_TYPE_OTHER && + severity == GL_DEBUG_SEVERITY_NOTIFICATION ) return; + fprintf(stderr, "GL CALLBACK: %s type = 0x%x, severity = 0x%x, message = %s\n", + ( type == GL_DEBUG_TYPE_ERROR ? "** GL ERROR **" : "" ), + type, severity, message ); +} +#endif + bool BC_WindowBase::glx_make_current(GLXDrawable draw) { - return glx_make_current(draw, glx_win_context); + bool ret = glx_make_current(draw, glx_win_context); +#ifdef GL_BUG + //Enabling OpenGL debug output + glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE, 0, 0, GL_TRUE); + glEnable(GL_DEBUG_OUTPUT); + glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS); + glDebugMessageCallback(glDebugCallback, 0); + glEnable(GL_DEBUG_OUTPUT); +#endif + return ret; } #endif @@ -237,14 +260,14 @@ void BC_WindowBase::flip_opengl() #endif } -unsigned int BC_WindowBase::get_shader(char *source, int *got_it) +int BC_WindowBase::get_shader(unsigned int *handle, const char *vert, const char *frag) { - return get_resources()->get_synchronous()->get_shader(source, got_it); + return get_resources()->get_synchronous()->get_shader(handle, vert, frag); } -void BC_WindowBase::put_shader(unsigned int handle, char *source) +void BC_WindowBase::put_shader(unsigned int handle, const char *vert, const char *frag) { - get_resources()->get_synchronous()->put_shader(handle, source); + get_resources()->get_synchronous()->put_shader(handle, vert, frag); } int BC_WindowBase::get_opengl_server_version()