patch/gfx: Implement scaling using different screen and viewport resolutions

Define a set of fixed modes covering our use-cases to allow rendering
4:3 games to a pillarbox on widescreen monitors.
This commit is contained in:
icex2
2021-03-20 11:12:31 +01:00
parent 8bb157c206
commit 517adc153a
3 changed files with 128 additions and 18 deletions
+19 -4
View File
@@ -1,12 +1,27 @@
#pragma once
/**
* Hook module to run the games on non NVIDIA cards
* Different modes for scaling different source resolutions to target
* resolutions including keeping the aspect ratio
*/
#ifndef PATCH_GFX_H
#define PATCH_GFX_H
enum patch_gfx_scale_mode {
PATCH_GFX_SCALE_MODE_INVALID = 0,
PATCH_GFX_SCALE_MODE_SD_480_TO_PILLARBOX_HD_720 = 1,
PATCH_GFX_SCALE_MODE_SD_480_TO_PILLARBOX_HD_1080 = 2,
PATCH_GFX_SCALE_MODE_SD_480_TO_SD_960 = 3,
PATCH_GFX_SCALE_MODE_HD_720_TO_HD_1080 = 4,
};
/**
* Initialize the patch module
*
* This takes care of running the games on non NVIDIA cards
*/
void patch_gfx_init();
#endif
/**
* Scale the rendered output according to the given mode (see enum)
*
* @param scale_mode The scaling mode to apply
*/
void patch_gfx_scale(enum patch_gfx_scale_mode scale_mode);