I’m a beginner developing a 2D game in SDL2 using C with a visual style that uses crisp high resolution graphics (like geometry dash and Hollow Knight -- not pixel art). I want the game to scale correctly to fullscreen on arbitrary monitor resolutions, keeping graphics crisp and sharp
I’ve found little guidance online about the industry-standard approach for this. I’m unsure whether I should:
Use a fixed-size display buffer (a 720p or 1080p texture set to the render target) and scale it to the monitor size (adding black bars to maintain a 16:9 aspect ratio). My concern is that scaling a fixed buffer will enlarge individual pixels on larger monitors, making graphics less sharp.
Use manual math with a "render_scale" variable to scale and position each sprite individually in SDL_RenderCopy.
Use some other method that I’m not aware of.
I’m looking for the standard approach in modern 2D game development, not necessarily limited to SDL2. Any insights, techniques, or example rendering pipelines would be greatly appreciated.
glViewport
sets the portion of the window that will be drawn into, so it can help with doing things like letterboxing, but it doesn't itself handle scaling the game to work on different screen/window resolutions while maintaining crispness. \$\endgroup\$