shinji360

Hello guys!
I'm deploying my game to xbox 360.
The deploy is perfect, but my game aways presented on 800x600 screen.

Graphics.PreferredBackBufferWidth value is 800
Graphics.PreferredBackBufferHeight is 600

Graphics.GraphicsDevice.DisplayMode.Width is 1360
Graphics.GraphicsDevice.DisplayMode.Height is 768


how can I to set the resolution

My monitor is an AOC 19" widescreen...

Thanks!




Re: XNA Game Studio Express how to set xbox 360 resolution?

Kurt Jaegers

I use a generic function to set the video mode, testing first to see if it is a possible mode to use.   I don't have an XBox 360 ( :( ) but I know for setting resolution it works on my brother's 360.  I don't know if the tests will fail if you have a 360 connected to an SDTV and thus prevent you from using 720/1080 as his is connected to an HDTV. 

private bool InitGraphicsMode(int iWidth, int iHeight, bool bFullScreen)
{
  // If we aren't using a full screen mode, the height and width of the window can
  // be set to anything equal to or smaller than the actual screen size.
  if (bFullScreen == false)
  {
    if ((iWidth <= GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width)
    && (iHeight <=
GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height))
    {
      graphics.PreferredBackBufferWidth = iWidth;
      graphics.PreferredBackBufferHeight = iHeight;
      graphics.IsFullScreen = bFullScreen;
      graphics.ApplyChanges();
      return true;
    }
  }
  else
  {
    // If we are using full screen mode, we should check to make sure that the display
    // adapter can handle the video mode we are trying to set. To do this, we will
    // iterate thorugh the display modes supported by the adapter and check them against
    // the mode we want to set.
    foreach (DisplayMode dm in GraphicsAdapter.DefaultAdapter.SupportedDisplayModes)
    {
      // Check the width and height of each mode against the passed values
      if ((dm.Width == iWidth) && (dm.Height == iHeight))
      {
        // The mode is supported, so set the buffer formats, apply changes and return
        graphics.PreferredBackBufferWidth = iWidth;
        graphics.PreferredBackBufferHeight = iHeight;
        graphics.IsFullScreen = bFullScreen;
        graphics.ApplyChanges();
        return true;
      }
    }
  }
  return false;
}

When I call this, I do it via a series of if statements to get the highest resolution supported  by the device:

if (!InitGraphicsMode(1280, 720, true))
{
 
if (!InitGraphicsMode(1024, 768, true))
  {
   
if (!InitGraphicsMode(800, 600, true))
    {
     
if (!InitGraphicsMode(640, 480, true))
     
{
       
this.Exit();
      }
    }
  }
}





Re: XNA Game Studio Express how to set xbox 360 resolution?

Shinji

Wooow Kurt!! I think this code will be run!! I will test it at night and report the results here!

thanks a looot!!!!!!!





Re: XNA Game Studio Express how to set xbox 360 resolution?

Epsicode

No, you cannot change the XBOX 360's resolution, as it's defined by the user in the system settings. (or even if there is a way to force it, don't do it !)

Your game is automatically scaled to the resolution of the XBOX, so you don't have to do anything about that.
But you have to manually stretch the game to fit the user's resolution on Windows.

Read the tutorial included in the help file of XNA 1.0 for more information about this subject.





Re: XNA Game Studio Express how to set xbox 360 resolution?

StLuisRey

I had the same problem last night. After much head scratching adding the code below to the main game class (before Initialize() is called) fixed it for me.

graphics = new GraphicsDeviceManager(this);
this.graphics.PreferredBackBufferWidth = 1280;
this.graphics.PreferredBackBufferHeight = 720;

R.

Stlr





Re: XNA Game Studio Express how to set xbox 360 resolution?

Persian Lion

Hello shinji i just joined the xna membersclub and i am triyng to get trow the tutorials and i have a couple questions can you add me to your friends list and help me out

My gamertag is Persian Lion,thanx






Re: XNA Game Studio Express how to set xbox 360 resolution?

Jim Perry

Why not just post your questions here so everyone can help out




Re: XNA Game Studio Express how to set xbox 360 resolution?

Shinji

woooooooooooooow Kurt! this code is very ver very coooool! It works magnifically!!!!
Thanks a lot!! Thanks Thanks! My game ruinning now on 720p!!!!

:D:D:D:D:D:D:D:D