Modifying Design with Full Screen in mind

Ironic wrote:

I was wondering how many people
set the display to full screen? Since you
do not know the size of the screen
in advance it seems it will ruin
all the positioning and possibly distort
the graphics.

I’m assuming you’re talking about 2D graphics, as 3D graphics are generally resolution independent.

The usual procedure with 2D graphics is to allow the game to show more of the scene at higher resolutions. When drawing your game sprites, you check their bounding rectangles against the rectangle of the screen, and if they overlap, draw the sprite. So in a game designed for a 640x480 screen, if the user sets the display to 1920x1080, the effect will be as if you have zoomed out for a much larger birds eye view. The sprites will look smaller, but you will see much more of the scene.

This is actually not difficult to do, so long as you make all your coordinates relative to some origin point (e.g. the top left corner of the screen).

If your game is a single non-scrolling screen, you might want to draw some kind of tiled background behind the scene, and perhaps position the scene so that it is always drawn in the center of the screen. If your game supports window mode, you’ll probably want to be doing this anyway as the user may resize the window.

If you don’t want the sprites to look smaller at higher resolutions, you can include multiple versions for each resolution you support. For example, for high definition displays, you can include sprites twice as big, and when drawing them to the screen you multiply the x and y by 2. The cost of this approach is that you have more sprites to create and ship with your game.

The other alternative is to use OpenGL and show your sprites using screen-aligned textured rectangles. This may be harder to do if you’re not used to programming in 3D, but it will allow your game to look the same at any resolution or window shape.

The path you choose really depends on the kind of game you’re trying to make.

Ironic wrote:

Is there an easy way around
this or is it just a lot of effort for not much
gain?

If your making games for profit, anything that makes life easier for the end user is worth the effort.

If you want to preserve the game/interface logic and don’t mind stretching,
you can try SDL_gpu. SDL_gpu uses OpenGL to implement a 2D API similar to
SDL 1.2 plus other important graphical features (lines, shapes, rotation,
scaling, camera). You specify a virtual (logical) resolution and use that
throughout the program. You do have to convert screen coordinates you get
from SDL mouse events and such, but there’s a built-in function for that.

Jonny D