comparison libvo/vo_gl2.c @ 15748:f75ba7f7b7b2

support -wid
author reimar
date Sat, 18 Jun 2005 18:32:29 +0000
parents b4c3f02811dd
children fd51fd1ff231
comparison
equal deleted inserted replaced
15747:fbf14e1ab725 15748:f75ba7f7b7b2
575 glClear(GL_COLOR_BUFFER_BIT); 575 glClear(GL_COLOR_BUFFER_BIT);
576 aspect(x, y, A_ZOOM); 576 aspect(x, y, A_ZOOM);
577 glViewport( (vo_screenwidth-*x)/2, (vo_screenheight-*y)/2, *x, *y); 577 glViewport( (vo_screenwidth-*x)/2, (vo_screenheight-*y)/2, *x, *y);
578 } else { 578 } else {
579 //aspect(x, y, A_NOZOOM); 579 //aspect(x, y, A_NOZOOM);
580 #ifndef GL_WIN32
581 if (WinID >= 0) {
582 int top = 0, left = 0, w = *x, h = *y;
583 geometry(&top, &left, &w, &h, vo_screenwidth, vo_screenheight);
584 glViewport(top, left, w, h);
585 } else
586 #endif
580 glViewport( 0, 0, *x, *y ); 587 glViewport( 0, 0, *x, *y );
581 } 588 }
582 589
583 glMatrixMode(GL_PROJECTION); 590 glMatrixMode(GL_PROJECTION);
584 glLoadIdentity(); 591 glLoadIdentity();
684 XFree(vi_list); 691 XFree(vi_list);
685 return (best_weight < 1000000) ? 0 : -1; 692 return (best_weight < 1000000) ? 0 : -1;
686 } 693 }
687 694
688 static int config_glx(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t flags, char *title, uint32_t format) { 695 static int config_glx(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t flags, char *title, uint32_t format) {
696 if (WinID >= 0) {
697 vo_window = WinID ? (Window)WinID : mRootWin;
698 return 0;
699 }
689 if ( vo_window == None ) 700 if ( vo_window == None )
690 { 701 {
691 XSizeHints hint; 702 XSizeHints hint;
692 XVisualInfo *vinfo, vinfo_buf; 703 XVisualInfo *vinfo, vinfo_buf;
693 XEvent xev; 704 XEvent xev;
888 draw_alpha_fnc=draw_alpha_24; break; 899 draw_alpha_fnc=draw_alpha_24; break;
889 case 32: 900 case 32:
890 draw_alpha_fnc=draw_alpha_32; break; 901 draw_alpha_fnc=draw_alpha_32; break;
891 } 902 }
892 903
893 if (initGl(d_width, d_height) == -1) 904 if (initGl(vo_dwidth, vo_dheight) == -1)
894 return -1; 905 return -1;
895 #ifndef GL_WIN32 906 #ifndef GL_WIN32
896 if (vo_ontop) vo_x11_setlayer(mDisplay,vo_window, vo_ontop); 907 if (vo_ontop) vo_x11_setlayer(mDisplay,vo_window, vo_ontop);
897 #endif 908 #endif
898 909