Graphics: Dealing with multi resolutions?
Hello all. I have a question regarding writing applications involving graphics to support multi resolutions.
Essentially I want to adjust my application's graphics' sizes depending on the screen resolution.
Specifically I am writing a Solitaire game using the Win32 GDI and I wrote/created the code/graphics under a 1024x768 resolution. It looks perfectly as I had hoped utilizing every inch of the game window while properly being able to display all cards. However, when I switch to a lower resolution, such as 800x600 I now have the problem of my images being a bit too large for the new resolution. I have tried:
1) Utilizing the StretchBlt() function instead of BitBlt() to draw each card to the screen. By setting the destination rect smaller cards are scaled down.
Problem: Game now taking up too much CPU as I guess StretchBlt() is just that much slower?!? Instead of 2-5% on card/pile drags I'm getting 75-95%.
2) Drawing the game (every card) to a back buffer using BitBlt() as usual then using StretchBlt() to draw the back buffer to the screen (shrinking backbuffer from 1024x768 to destination rect of 800x600) hopefully increasing speed by reducing StretchBlt()'s from about 30 cards every repaint to just 1 backbuffer -> screen.
Problem: Still too much CPU usage. 75-95% instead of 2-5% with pure BitBlt()'s.
So, uh what can I do to make my application look just as nice on 800x600 -> 1024x768 -> 1600x1200? Do I have to create 3 separate bitmaps of cards? A low resolution one of smaller cards; a medium resolution one; and a high resolution one with bigger card images? Then depending on the resolution load the specific bitmap? (This of course would make my application larger, which I wanted to avoid).
I noticed the Solitaire game that shipped with windows resolves this problem by designing the game in 800x600 resolution and just uses the same card sizes for 1024x768. While this works at higher resolutions the cards get smaller and smaller and so much of the screen is wasted where bigger cards would be more appropriate.
Hopefully, the explaination above of what I'm trying to do isn't too confusing.