X-Git-Url: https://git.cinelerra-gg.org/git/?p=goodguy%2Fcinelerra.git;a=blobdiff_plain;f=cinelerra-5.1%2Fguicast%2Fbcdisplayinfo.C;h=50e07bb19f9a0b16f03ec93324422ec641bd0377;hp=e94ee7502b488ff4c7bab7cde502cf6edd8600da;hb=9fed7535470aa37781733db836068da3b4c17a0d;hpb=47bf02b68d1ab0f1ca8a240750b451802ce12d31 diff --git a/cinelerra-5.1/guicast/bcdisplayinfo.C b/cinelerra-5.1/guicast/bcdisplayinfo.C index e94ee750..50e07bb1 100644 --- a/cinelerra-5.1/guicast/bcdisplayinfo.C +++ b/cinelerra-5.1/guicast/bcdisplayinfo.C @@ -41,7 +41,7 @@ int BC_DisplayInfo::bottom_border = -1; int BC_DisplayInfo::right_border = -1; int BC_DisplayInfo::auto_reposition_x = -1; int BC_DisplayInfo::auto_reposition_y = -1; - +char BC_DisplayInfo::gl_shader_version[64] = { 0, }; BC_DisplayInfo::BC_DisplayInfo(const char *display_name, int show_error) { @@ -130,12 +130,63 @@ static void get_top_coords(Display *display, Window win, int &px,int &py, int &t } -void BC_DisplayInfo::test_window(int &x_out, - int &y_out, - int &x_out2, - int &y_out2, - int x_in, - int y_in) +int BC_DisplayInfo::gl_probe(Display *dpy, Window win) +{ +#ifdef HAVE_GL + int fbAttribSingle[] = { + GLX_RENDER_TYPE, GLX_RGBA_BIT, + GLX_RED_SIZE, 1, + GLX_GREEN_SIZE, 1, + GLX_BLUE_SIZE, 1, + GLX_DOUBLEBUFFER, False, + None }; + int fbAttribDouble[] = { + GLX_RENDER_TYPE, GLX_RGBA_BIT, + GLX_RED_SIZE, 1, + GLX_GREEN_SIZE, 1, + GLX_BLUE_SIZE, 1, + GLX_DOUBLEBUFFER, True, + None }; + int scrnum = DefaultScreen(dpy); + int n_fb_cfgs = 0; + GLXFBConfig *fb_cfgs = glXChooseFBConfig(dpy, scrnum, fbAttribSingle, &n_fb_cfgs); + if( !fb_cfgs ) + fb_cfgs = glXChooseFBConfig(dpy, scrnum, fbAttribDouble, &n_fb_cfgs); + if( !fb_cfgs ) + return 1; + XVisualInfo *vis_info = 0; + GLXFBConfig glx_fb_config = 0; + for( int i=0; !vis_info && i