comparison libvo/vo_gl.c @ 15748:f75ba7f7b7b2

support -wid
author reimar
date Sat, 18 Jun 2005 18:32:29 +0000
parents e040252b8370
children f9e53883dfd2
comparison
equal deleted inserted replaced
15747:fbf14e1ab725 15748:f75ba7f7b7b2
70 70
71 static unsigned int slice_height = 1; 71 static unsigned int slice_height = 1;
72 72
73 static void resize(int x,int y){ 73 static void resize(int x,int y){
74 mp_msg(MSGT_VO, MSGL_V, "[gl] Resize: %dx%d\n",x,y); 74 mp_msg(MSGT_VO, MSGL_V, "[gl] Resize: %dx%d\n",x,y);
75 if (WinID >= 0) {
76 int top = 0, left = 0, w = x, h = y;
77 geometry(&top, &left, &w, &h, vo_screenwidth, vo_screenheight);
78 glViewport(top, left, w, h);
79 } else
75 glViewport( 0, 0, x, y ); 80 glViewport( 0, 0, x, y );
76 81
77 glMatrixMode(GL_PROJECTION); 82 glMatrixMode(GL_PROJECTION);
78 glLoadIdentity(); 83 glLoadIdentity();
79 if (vo_fs && use_aspect) { 84 if (vo_fs && use_aspect) {
173 if (use_gui) { 178 if (use_gui) {
174 // GUI creates and manages window for us 179 // GUI creates and manages window for us
175 vo_dwidth = d_width; 180 vo_dwidth = d_width;
176 vo_dheight= d_height; 181 vo_dheight= d_height;
177 guiGetEvent(guiSetShVideo, 0); 182 guiGetEvent(guiSetShVideo, 0);
178 setGlWindow(&gl_vinfo, &gl_context, vo_window); 183 goto glconfig;
179 initGl(vo_dwidth, vo_dheight); 184 }
180 return 0; 185 #endif
181 } 186 if (WinID >= 0) {
182 #endif 187 Window win_tmp;
188 int int_tmp;
189 vo_window = WinID ? (Window)WinID : mRootWin;
190 goto glconfig;
191 }
183 if ( vo_window == None ) { 192 if ( vo_window == None ) {
184 unsigned int fg, bg; 193 unsigned int fg, bg;
185 XSizeHints hint; 194 XSizeHints hint;
186 XVisualInfo *vinfo; 195 XVisualInfo *vinfo;
187 XEvent xev; 196 XEvent xev;
244 if (vo_ontop) vo_x11_setlayer(mDisplay, vo_window, vo_ontop); 253 if (vo_ontop) vo_x11_setlayer(mDisplay, vo_window, vo_ontop);
245 254
246 vo_x11_nofs_sizepos(vo_dx, vo_dy, d_width, d_height); 255 vo_x11_nofs_sizepos(vo_dx, vo_dy, d_width, d_height);
247 if (vo_fs ^ (flags & VOFLAG_FULLSCREEN)) 256 if (vo_fs ^ (flags & VOFLAG_FULLSCREEN))
248 vo_x11_fullscreen(); 257 vo_x11_fullscreen();
258
259 glconfig:
249 setGlWindow(&gl_vinfo, &gl_context, vo_window); 260 setGlWindow(&gl_vinfo, &gl_context, vo_window);
250 initGl(vo_dwidth, vo_dheight); 261 initGl(vo_dwidth, vo_dheight);
251 262
252 return 0; 263 return 0;
253 } 264 }