I am creating a game using C#, GDI+ and Raster images (2D images). For performance sake, I believe that I should have the game change the user's resolution to 800 x 600 and run the game in that setting. However, the graphics look distorted in a wide screen since the aspect ratio for 800 x 600 is different than from a wide screen. I cannot figure out how to determine the aspect ratio.

How is game programming normally handled on different resolutions? Should I even change the user's resolution? If I dont change the resolution, the game slows down a lot.

Also, some wide screens will "maintain the aspect ratio" when changing the resolution to 800 x 600 (thus creating black bars on the right and left) and some wide screens will fill up the entire screen. How do people handle that situation??

  • \$\begingroup\$ Why deal with this performance hit? Any reason you considered and rejected XNA? \$\endgroup\$ – Jonathan Dickinson Oct 31 '11 at 11:44
  • \$\begingroup\$ I already got into GDI+ before I heard about XNA. The game is half way built. Is XNA that much better? Is there not perf hit to XNA? I don't know much about it. ------ I continued looking around. I think ppl either use a 800 x 600 aspect ratio if the screen is regular, otherwise they use 1280 x 720 for wide screen. \$\endgroup\$ – CRobinson Oct 31 '11 at 12:02
  • 3
    \$\begingroup\$ Don't forget about 5/4 screens and others. You will need some general solution. \$\endgroup\$ – Kromster Oct 31 '11 at 12:19
  • \$\begingroup\$ @CRobinson XNA is hardware accelerated - you should really put some research into it, and it is 10x faster to make something in it compared to GDI+ (once you learn it) - especially for 2D games. \$\endgroup\$ – Jonathan Dickinson Oct 31 '11 at 12:22
  • 3
    \$\begingroup\$ Why not just add a black border instead of changing the resolution. Movies get away with this all the time. \$\endgroup\$ – Tili Oct 31 '11 at 15:28

In your current situation I would advice to get device resolution that is most similar to your planned resolution or slightly bigger than it (800x600 -> 1024x720) and deal with it manually. Add black areas on sides or some artistic patterns that complement your game.

As already said GDI+ is not a common approach to 2D game nowadays, but the general principle of dealing with various screen aspects still stands.

  • \$\begingroup\$ Thanks for all the advice. I'm pretty new to this. What are some good books on XNA? Probably a stupid question, but is XNA backwards compatible to Windows XP? \$\endgroup\$ – CRobinson Oct 31 '11 at 12:51
  • \$\begingroup\$ That question I can't answer here. I'm more of an OpenGL guy. \$\endgroup\$ – Kromster Oct 31 '11 at 12:58
  • \$\begingroup\$ ... I should add that although I'm new to game programming, I'm not new to programming. I did application development for 12 years. So I wouldn't need a book that's too basic. \$\endgroup\$ – CRobinson Oct 31 '11 at 13:06
  • \$\begingroup\$ Take a look at this question: gamedev.stackexchange.com/questions/19141/… \$\endgroup\$ – Kromster Oct 31 '11 at 13:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.