开发者

SDL - (Hardware) Pixel Scaling

开发者 https://www.devze.com 2023-01-18 11:32 出处:网络
In my SDL game, I\'d like to retain a fixed resolution o开发者_Go百科f the game area, both for gameplay and performance reasons.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消