Mercurial > mplayer.hg
comparison libvo/vo_xmga.c @ 6016:be9cd7d845c2
-zoom, -fs with x[11|mga|v] fix -- round two
author | pontscho |
---|---|
date | Wed, 08 May 2002 20:24:35 +0000 |
parents | bb1f3552f118 |
children | 421781c5b128 |
comparison
equal
deleted
inserted
replaced
6015:04fe086ae486 | 6016:be9cd7d845c2 |
---|---|
192 { | 192 { |
193 char * mTitle=(title == NULL) ? "XMGA render" : title; | 193 char * mTitle=(title == NULL) ? "XMGA render" : title; |
194 XVisualInfo vinfo; | 194 XVisualInfo vinfo; |
195 | 195 |
196 unsigned long xswamask; | 196 unsigned long xswamask; |
197 | |
198 if ( X_already_started ) return -1; | |
199 if (!vo_init()) return -1; | |
197 | 200 |
198 width+=width&1; | 201 width+=width&1; |
199 | 202 |
200 switch(format) | 203 switch(format) |
201 { | 204 { |
219 mga_vid_config.frame_size=( ( width + 31 ) & ~31 ) * height * 2; | 222 mga_vid_config.frame_size=( ( width + 31 ) & ~31 ) * height * 2; |
220 break; | 223 break; |
221 default: printf("mga: invalid output format %0X\n",format); return (-1); | 224 default: printf("mga: invalid output format %0X\n",format); return (-1); |
222 } | 225 } |
223 | 226 |
224 if ( X_already_started ) return -1; | |
225 | |
226 if (!vo_init()) return -1; | |
227 | |
228 aspect_save_orig(width,height); | 227 aspect_save_orig(width,height); |
229 aspect_save_prescale(d_width,d_height); | 228 aspect_save_prescale(d_width,d_height); |
230 aspect_save_screenres(vo_screenwidth,vo_screenheight); | 229 aspect_save_screenres(vo_screenwidth,vo_screenheight); |
231 | 230 |
232 mvWidth=width; mvHeight=height; | 231 mvWidth=width; mvHeight=height; |
233 | 232 |
234 wndX=0; wndY=0; | 233 wndX=0; wndY=0; |
235 vo_dwidth=d_width; vo_dheight=d_height; | 234 vo_dwidth=d_width; vo_dheight=d_height; |
236 vo_mouse_autohide=1; | 235 vo_mouse_autohide=1; |
237 // vo_fs=fullscreen&1; | |
238 // if ( vo_fs ) | |
239 // { vo_old_width=d_width; vo_old_height=d_height; } | |
240 | 236 |
241 switch ( vo_depthonscreen ) | 237 switch ( vo_depthonscreen ) |
242 { | 238 { |
243 case 32: | 239 case 32: |
244 case 24: fgColor=0x00ff00ffL; break; | 240 case 24: fgColor=0x00ff00ffL; break; |
247 default: printf( "Sorry, this (%d) color depth not supported.\n",vo_depthonscreen ); return -1; | 243 default: printf( "Sorry, this (%d) color depth not supported.\n",vo_depthonscreen ); return -1; |
248 } | 244 } |
249 | 245 |
250 inited=1; | 246 inited=1; |
251 | 247 |
252 aspect(&vo_dwidth,&vo_dheight,A_NOZOOM); | 248 aspect(&vo_dwidth,&vo_dheight,A_NOZOOM); |
253 | 249 |
254 #ifdef HAVE_NEW_GUI | 250 #ifdef HAVE_NEW_GUI |
255 if(use_gui) | 251 if(use_gui) |
256 guiGetEvent( guiSetShVideo,0 ); // the GUI will set up / resize the window | 252 guiGetEvent( guiSetShVideo,0 ); // the GUI will set up / resize the window |
257 else | 253 else |
258 #endif | 254 #endif |
259 { | 255 { |
260 if ( vo_fs ) | |
261 { | |
262 // vo_dwidth=vo_screenwidth; | |
263 // vo_dheight=vo_screenheight; | |
264 #ifdef X11_FULLSCREEN | 256 #ifdef X11_FULLSCREEN |
265 aspect(&dwidth,&dheight,A_ZOOM); | 257 if ( fullscreen&1 ) aspect(&dwidth,&dheight,A_ZOOM); |
266 #endif | 258 #endif |
267 } | |
268 | 259 |
269 XGetWindowAttributes( mDisplay,DefaultRootWindow( mDisplay ),&attribs ); | 260 XGetWindowAttributes( mDisplay,DefaultRootWindow( mDisplay ),&attribs ); |
270 mDepth=attribs.depth; | 261 mDepth=attribs.depth; |
271 if ( mDepth != 15 && mDepth != 16 && mDepth != 24 && mDepth != 32 ) mDepth=24; | 262 if ( mDepth != 15 && mDepth != 16 && mDepth != 24 && mDepth != 32 ) mDepth=24; |
272 XMatchVisualInfo( mDisplay,mScreen,mDepth,TrueColor,&vinfo ); | 263 XMatchVisualInfo( mDisplay,mScreen,mDepth,TrueColor,&vinfo ); |
280 if ( WinID>=0 ){ | 271 if ( WinID>=0 ){ |
281 vo_window = WinID ? ((Window)WinID) : RootWindow(mDisplay,mScreen); | 272 vo_window = WinID ? ((Window)WinID) : RootWindow(mDisplay,mScreen); |
282 XUnmapWindow( mDisplay,vo_window ); | 273 XUnmapWindow( mDisplay,vo_window ); |
283 XChangeWindowAttributes( mDisplay,vo_window,xswamask,&xWAttribs); | 274 XChangeWindowAttributes( mDisplay,vo_window,xswamask,&xWAttribs); |
284 } else | 275 } else |
285 vo_window=XCreateWindow( mDisplay,RootWindow( mDisplay,mScreen ), | 276 vo_window=XCreateWindow( mDisplay,mRootWin, |
286 wndX,wndY, | 277 wndX,wndY, |
287 vo_dwidth,vo_dheight, | 278 vo_dwidth,vo_dheight, |
288 xWAttribs.border_pixel, | 279 xWAttribs.border_pixel, |
289 mDepth, | 280 mDepth, |
290 InputOutput, | 281 InputOutput, |