comparison src/video/bwindow/SDL_sysvideo.cc @ 4012:4e29535b821b SDL-1.2

Fixed bug #360 Fixed fullscreen video modes and improved the mouse grab code.
author Sam Lantinga <slouken@libsdl.org>
date Sat, 07 Jul 2007 19:20:28 +0000
parents 678576473849
children a1b03ba2fcd0
comparison
equal deleted inserted replaced
4011:f5794774970d 4012:4e29535b821b
364 } 364 }
365 if ( ! modes[i] || (modes[i]->w < width) || (modes[i]->h < width) ) { 365 if ( ! modes[i] || (modes[i]->w < width) || (modes[i]->h < width) ) {
366 --i; /* We went too far */ 366 --i; /* We went too far */
367 } 367 }
368 368
369 /* BeSman::We dont want to use a Desktop resolution */ 369 width = modes[i]->w;
370 // width = modes[i]->w; 370 height = modes[i]->h;
371 // height = modes[i]->h;
372 371
373 bscreen.GetModeList(&dmodes, &nmodes); 372 bscreen.GetModeList(&dmodes, &nmodes);
374 for ( i = 0; i < nmodes; ++i ) { 373 for ( i = 0; i < nmodes; ++i ) {
375 if ( (bpp == ColorSpaceToBitsPerPixel(dmodes[i].space)) && 374 if ( (bpp == ColorSpaceToBitsPerPixel(dmodes[i].space)) &&
376 (width == dmodes[i].virtual_width) && 375 (width == dmodes[i].virtual_width) &&
453 * (windowed mode) or to set drawing offsets (fullscreen mode) 452 * (windowed mode) or to set drawing offsets (fullscreen mode)
454 */ 453 */
455 cx = (bounds.IntegerWidth() - width)/2; 454 cx = (bounds.IntegerWidth() - width)/2;
456 cy = (bounds.IntegerHeight() - height)/2; 455 cy = (bounds.IntegerHeight() - height)/2;
457 456
457 if ( fullscreen ) {
458 /* Set offset for drawing */
459 SDL_Win->SetXYOffset(cx, cy);
460 } else {
461 SDL_Win->SetXYOffset(0, 0);
462 }
458 if ( ! needs_unlock || was_fullscreen ) { 463 if ( ! needs_unlock || was_fullscreen ) {
459 /* Center the window the first time */ 464 /* Center the window the first time */
460 SDL_Win->MoveTo(cx, cy); 465 SDL_Win->MoveTo(cx, cy);
461 } 466 }
462 SDL_Win->Show(); 467 SDL_Win->Show();