Fullscreen problem

Hello,

My game riotball runs in a 640x480 display fullscreen. The game opens up
a SOFTWARE main display surface. One of my customers is having problems
with the fullscreen display. Instead of going to the 640x480 resolution,
she gets a display of 1024x768 (Her desktop resolution) with the game
window of size 640x480 centered in middle.

I asked her to try DxBall (Which also runs in 640x480 but uses display surface
in HARDWARE) and it works fine.

One more curious thing: She can switch to only 2 resolutions
800x600, and 1024x768. Also, when she switches to 800x600 it centers to
the middle 800x600, with the rest of the pixels black.

She is using WinXP on a Laptop. That of course means that she has an LCD
monitor. Could this have something to do with the LCD display?

Any ideas what the problem could be? Here is the code I use to open my
display surface. I call this function with

vinfo.scrw = 640
vinfo.scrh = 480
vinfo.bpp = 16

and
mode = SWDBUF

also,
SAFE_FLAG_FULL = (SDL_SWSURFACE|SDL_FULLSCREEN)

///////////////////////////////////////////////////////////////////////
//
// init_video_mode()
///
/// Attempt to initialize SDL to the video mode we want. The video
/// modes may be windowed or not. The possible types are given in
/// the enum IC_Video_mode .
///
/// \param
/// vinfo: Video Information. This is both an input and output
/// parameter. The size and depth of video mode requested
/// is stored in in vinfo.scrw, vinfo.scrh, vinfo.bpp. The
/// allocated main screen is assigned to vinfo.screen, and
/// the software shadow surface (if any) is assigned
/// to vinfo.shadow. If the shadow surface does not exist,
/// vinfo.shadow is set to point to vinfo.screen.
/// Vinfo.vidmode is set to the proper enum value which
/// indicates the mode of the screen allocated.
/// \param
/// mode: Input paramater. The mode requested. Note that the mode
/// only pertains to whether the surface is allocated in
/// VRAM, or system RAM, other parameters such as
/// dimensions should be set in vinfo.
///
/// \return
/// IC_SUCCESS on Success. On failure, returns
/// IC_FAILURE, vinfo.screen is set to NULL and ic_get_custom_error()
/// can be used to determine the error that occured.
//
///////////////////////////////////////////////////////////////////////
int init_video_mode(Vid_info &vinfo, unsigned mode)
{

if(mode >= LASTVMODE || mode == NOMODE)
return ic_error_bad_parameter();

vinfo.vidmode = NOMODE;
switch(mode)
{

  case SWSBUFHWDBUF:
  case HWDBUF:

 vinfo.screen = SDL_SetVideoMode(vinfo.scrw,
	  vinfo.scrh,
	  vinfo.bpp,
	  BEST_FLAG);

 if(vinfo.screen != NULL)
 {

    vinfo.vidmode = HWDBUF;
    vinfo.vflags  = vinfo.screen->flags;

    if(mode == SWSBUFHWDBUF)
    {
       vinfo.shadow = SDL_CreateRGBSurface(
	     SDL_SWSURFACE,
	     vinfo.scrw,
	     vinfo.scrh,
	     vinfo.bpp,
	     vinfo.screen->format->Rmask,
	     vinfo.screen->format->Gmask,
	     vinfo.screen->format->Bmask,
	     vinfo.screen->format->Amask);

       if(NULL == vinfo.shadow) {
	  vinfo.shadow = vinfo.screen;
       }
       else {
	  vinfo.vidmode = SWSBUFHWDBUF;
       }

    }
    break;
 }

 // Fallthrough
 // 
  case  SWDBUF:
 vinfo.screen = SDL_SetVideoMode(vinfo.scrw,
	  vinfo.scrh,
	  vinfo.bpp,
	  SAFE_FLAG_FULL);
 
 if(vinfo.screen != NULL)
 {
    vinfo.vidmode = SWSBUF;
    vinfo.vflags  = vinfo.screen->flags;
    vinfo.shadow = SDL_CreateRGBSurface(
	  SDL_SWSURFACE,
	  vinfo.scrw,
	  vinfo.scrh,
	  vinfo.bpp,
	  vinfo.screen->format->Rmask,
	  vinfo.screen->format->Gmask,
	  vinfo.screen->format->Bmask,
	  vinfo.screen->format->Amask);

    if(NULL == vinfo.shadow) {
       vinfo.shadow = vinfo.screen;
    }
    else {
       vinfo.vidmode = SWDBUF;
    }
    break;
 }

 // Fallthrough

  case  SWSBUF:
 vinfo.screen = SDL_SetVideoMode(vinfo.scrw,
	  vinfo.scrh,
	  vinfo.bpp,
	  SAFE_FLAG_FULL);
 
 if(vinfo.screen != NULL)
 {
    vinfo.vidmode = SWSBUF;
    vinfo.shadow  = vinfo.screen;
    vinfo.vflags  = vinfo.screen->flags;
    break;
 }

 // Fallthrough

  case SWDBUFWIN:
 vinfo.screen = SDL_SetVideoMode(vinfo.scrw,
	  vinfo.scrh,
	  vinfo.bpp,
	  SAFE_FLAG_WIN);
 
 if(vinfo.screen != NULL)
 {
    vinfo.vidmode = SWSBUFWIN;
    vinfo.vflags  = vinfo.screen->flags;
    vinfo.shadow = SDL_CreateRGBSurface(
	  SDL_SWSURFACE,
	  vinfo.scrw,
	  vinfo.scrh,
	  vinfo.bpp,
	  vinfo.screen->format->Rmask,
	  vinfo.screen->format->Gmask,
	  vinfo.screen->format->Bmask,
	  vinfo.screen->format->Amask);

    if(NULL == vinfo.shadow) {
       vinfo.shadow = vinfo.screen;
    }
    else {
       vinfo.vidmode = SWDBUFWIN;
    }
    break;
 }

 // Fallthrough
 
  case SWSBUFWIN:
 vinfo.screen = SDL_SetVideoMode(vinfo.scrw,
	  vinfo.scrh,
	  vinfo.bpp,
	  SAFE_FLAG_WIN);
 
 if(vinfo.screen != NULL)
 {
    vinfo.vidmode = SWSBUFWIN;
    vinfo.vflags  = vinfo.screen->flags;
    vinfo.shadow  = vinfo.screen;
 }
 break;


  default:
 vinfo.screen = NULL;
 break;

}

if(vinfo.screen == NULL)
{
vinfo.vidmode = NOMODE;
ic_set_custom_error(SDL_GetError());
return IC_FAILURE;
}

return IC_SUCCESS;

}

Thanks in advance,
Pallav Nawani–


This message was sent using NWebmail, BSNL’s Webmail Program

My game riotball runs in a 640x480 display fullscreen. The game opens up
a SOFTWARE main display surface. One of my customers is having problems
with the fullscreen display. Instead of going to the 640x480 resolution,
she gets a display of 1024x768 (Her desktop resolution) with the game
window of size 640x480 centered in middle.

Maybe the solution is easy. Some graphics drivers (newer NVIDIA drivers for
example) have the option to control how is the lower resulution screen
displayed on TFT monitors (which are usually made for one factory resolution
). Usually this should be set to ‘monitor scaling’ in the gfx driver options
but it seems that she has ‘centered output’ option checked which causes the
driver to use the natural resultion, and draw the smaller screen inside.

Hope this helps
Vladimir_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it’s FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/