mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-23 03:10:14 +00:00
(Graphics context) Create gfx_ctx_translate_aspect
This commit is contained in:
parent
a002ce6e6d
commit
4e24111f42
@ -776,10 +776,8 @@ void gl_set_viewport(gl_t *gl, unsigned width,
|
||||
struct gl_ortho ortho = {0, 1, 0, 1, -1, 1};
|
||||
settings_t *settings = config_get_ptr();
|
||||
global_t *global = global_get_ptr();
|
||||
const gfx_ctx_driver_t *ctx = gfx_ctx_get_ptr();
|
||||
|
||||
if (ctx->translate_aspect)
|
||||
device_aspect = ctx->translate_aspect(gl, width, height);
|
||||
gfx_ctx_translate_aspect(gl, &device_aspect, width, height);
|
||||
|
||||
if (settings->video.scale_integer && !force_full)
|
||||
{
|
||||
|
@ -81,6 +81,14 @@ const gfx_ctx_driver_t *gfx_ctx_get_ptr(void)
|
||||
return (const gfx_ctx_driver_t*)driver->video_context;
|
||||
}
|
||||
|
||||
void gfx_ctx_translate_aspect(void *data, float *aspect,
|
||||
unsigned width, unsigned height)
|
||||
{
|
||||
const gfx_ctx_driver_t *ctx = gfx_ctx_get_ptr();
|
||||
if (ctx && ctx->translate_aspect)
|
||||
*aspect = ctx->translate_aspect(data, width, height);
|
||||
}
|
||||
|
||||
bool gfx_ctx_get_metrics(enum display_metric_types type, float *value)
|
||||
{
|
||||
driver_t *driver = driver_get_ptr();
|
||||
|
@ -204,6 +204,9 @@ const gfx_ctx_driver_t *gfx_ctx_get_ptr(void);
|
||||
|
||||
bool gfx_ctx_get_metrics(enum display_metric_types type, float *value);
|
||||
|
||||
void gfx_ctx_translate_aspect(void *data, float *aspect,
|
||||
unsigned width, unsigned height);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user