[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] How many display modes to support?
Dave,
To answer question 1...
I had major problems with display modes. Let me explain:
Initially, I assumed that:
modes = pygame.display.list_modes()
modes.sort()
#print modes
would reveal what the display capabilities are. Wrong. On several PCs it gave a max resolution
which was beyond the capabilities of one or other of the display card or monitor. I guess that if
the monitor doesn't support the display card's highest resolution and you switch to that
resolution, the user won't see a lot.
Here are the comments I put in the program at the time:
# List_Modes can give modes higher than the current resolution!
# That's a really difficult one to get around.
# Using the FULLSCREEN param will actually
# change mode to the highest resolution available. That's one
# way. I tried all sorts of other things, like a
# non-fullscreen after a fullscreen but that didn't work.
# Also its no good to ask the size of the resulting
# surface because the surface is always the size you asked for.
# I don't want to force a low resolution (like assume 800x600)
# because the graphic quality suffers.
I recently found out how to detect the current resolution, and it's a safe bet that the current
resolution works. The beast is:
# 2 constants which could be imported from somewhere I guess:
SM_CXSCREEN = 0
SM_CYSCREEN = 1
x = win32api.GetSystemMetrics(SM_CXSCREEN)
y = win32api.GetSystemMetrics(SM_CYSCREEN)
# that gives the dimensions of the display. Now, for my own window, I'm using something a
little smaller.
width = x -50
height = y -80
screen = pygame.display.set_mode((width,height),0,16)
> Is it reasonable to assume that most PC users can support
> 1024x768x8?
Most, yes. But why not support all?
Personally, I scale everything according to my window size. Most applications don't do that and
I'm more familiar with training apps than games. I guess it depends on the nature of the game,
whether everything is scaled or whether you have a lot of open space when playing at high
resolution.
> A few questions to those that have (or are planning to) distribute
> Pygame games:
>
> 1) How many display modes does your game support?
>
> 2) Is it reasonable to assume that most PC users can support
> 1024x768x8?
>
> 3) Do you use different sized sprites for each supported res?
>
> Thanks...
>
Regards
Ben Friman
*********************************
Now - the commercial bit
*********************************
Holiday in the highlands:
http://www.scotland-cottage.com
Holiday in the Canaries:
http://www.learntotype.com/grancan
Learn to touch-type:
http://www.learntotype.com