Maximized window frame rate issue

In my game, if I resize the window to fill the entire screen without actually maximizing the window, it runs at 59 FPS. If I hit the maximize button for the window, which isn't really changing the window size at all, since the window is already filling the screen, my FPS drops to 24 FPS. So with the same size window and the same code, the only difference is that the window is maximized. Any idea why this might be happening

Bill




Answer this question

Maximized window frame rate issue

  • madshi

    Go ahead and submit it if it's not already submitted. What are they going to do Take away your birthday
  • Loopsludge

    Kyle_W wrote:
    Go ahead and submit it if it's not already submitted. What are they going to do Take away your birthday

    One can only hope...I've had too many of those...OK I went ahead and submitted it, it looks like there were a few other Vista related issues already entered.



  • Deejjaayy

    Well as you probably know, Windows Vista is currently an unsupported platform for XNA as stated in the FAQ:

    http://msdn2.microsoft.com/en-us/xna/aa937793.aspx

    I think it's a significant possibility that Vista is the reason for the problem.

    Have you tested a release build as opposed to a debug build


  • Cyanide13

    Maybe one of them is not actually causing a device reset so the output is jsut being scaled. The other is actually resetting the device so you are drawing more pixels.

    Put a break point in the LoadContent and see if its being hit or not



  • Christie Myburgh

    Both types of resizing (draging the corner and maximizing) cause a LoadGraphicsContent(false) to be called, I'll put together a very simple example to reproduce this and post it.

    Here is the example:

    I have this test program which all it does is display the current frames per sec and allows user resizing. You can download it at http://www.bluerosegames.com/brg/MaximizeTest.zip

    If someone could try it and see if they get the same results, please do the following:

    1. resize the window to fill the entire screen (minus startbar, etc). Observer the frame rate.
    2. hit the maximize button, and observe the new frame rate. I'm seeing a frame rate of a little less than half of the original frame rate.
    3. Hit the restore button, and the frame rate should go back to its original value.

    By the way, this is on Vista, so I don't know if that has something to do with it.

    Thanks,
    Bill



  • JGreene

    maximized, but not full screen Maybe it's having a tough time scaling to the new resolution. I bet you get better frame rates if you go full-screen when user hit the maximize button.

  • BrentHecht

    Thanks for testing it, and thanks for the tip on SpriteBatch. It didn't change the behavior, so I guess it's a Vista thing. Sorry to trouble everyone. So is it OK to submit XNA bugs on Vista on Connect even though it's not officially supported I'd hate to see this problem in the next release that has Vista support.

  • Zoomy8

    Downloaded and tested it: I'm getting almost the same FPS rate on both modes: maximized and normal (the latter at almost the same size of the screen than the maximized mode's).

    It just take a second or two to adjust and get the same FPS rate when switching but works ok.

    One note: you should set the (un)loading of the spritebatch as manual, so:

    1. Move "spriteBatch = new SpriteBatch(graphics.GraphicsDevice)"; out of the "if (loadAllContent)" block.
    2. Add into the "UnloadAllGraphicsContent" method -again, out of the "if (loadAllContent)" block:

    if (spriteBatch != null)
    {
    spriteBatch.Dispose();
    spriteBatch = null;
    }

    Then see what happens on Vista (haven't checked your "Draw" method yet, though).



  • Raulsassaa

    But if I make the window the exact same size as it is when it's maximized without actually maximizing it, it's fine. I'm sure I'd get better framerates in full screen, but I'm just wondering what's going on.

    Bill



  • Maximized window frame rate issue