SDL - (Hardware) Pixel Scaling
In my SDL game, I'd like to retain a fixed resolution o开发者_Go百科f 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
Use Stretch Functions For SDL to stretch-blit your surface, or upload your surface to an OpenGL texture each frame and render an appropriately-sized quad.
精彩评论