views:

33

answers:

1

In my SDL game, I'd like to retain a fixed resolution of the game area, both for gameplay and performance reasons.

What I wanted to do was to have a small resolution (e.g. 320 * 240), and when resizing the window / switching to fullscreen mode letting SDL / the graphics card scale each pixel.

However the problems that occur are:

  • The rendered picture gets 'blurry'
  • The actual drawing area is smaller than the screen, there are black regions on top, bottom left and right

What can I do to solve this?

I have already seen this work in other games before

A: 

Use something like this to stretch-blit your surface, or upload your surface to an OpenGL texture each frame and render an appropriately-sized quad.

genpfault