Skip to content

Implement GRAFX2_RENDER_SCALE support for SDL2 backend

Jesse Pavel requested to merge jpavel1/grafX2:sdl2-render-scale into master

This patch adds the ability to scale up the entire display of GrafX2 by an integer factor in the SDL2 backend by doing a scaled texture draw. In the same way the GDK_SCALE environment variable is used for scaling GTK apps, this patch uses the GRAFX2_RENDER_SCALE variable.For instance,

GRAFX2_RENDER_SCALE=2 grafx2-sdl2

will double the display size, as though one were using a 2x2 pixel size.

The intent is that one would use GRAFX2_RENDER_SCALE on HiDPI displays.

An advantage over using Double, Triple, or Quadruple pixels is that the upscale is done on the GPU and thus is virtually free---on my machine it does perform around 4x faster than Double pixels, as one would expect. It can also combined with Wide or Tall pixel ratios.

Merge request reports