mirror of
https://github.com/libretro/RetroArch
synced 2025-04-18 14:42:30 +00:00
Add GFX_CTL_SET_RESIZE
This commit is contained in:
parent
5516ff05b5
commit
bcaf08ad2d
@ -868,8 +868,14 @@ static bool d3d_alive(void *data)
|
|||||||
|
|
||||||
if (resize)
|
if (resize)
|
||||||
{
|
{
|
||||||
|
gfx_ctx_mode_t mode;
|
||||||
|
|
||||||
d3d->should_resize = true;
|
d3d->should_resize = true;
|
||||||
gfx_ctx_set_resize(temp_width, temp_height);
|
|
||||||
|
mode.width = temp_width;
|
||||||
|
mode.height = temp_height;
|
||||||
|
|
||||||
|
gfx_ctx_ctl(GFX_CTL_SET_RESIZE, &mode);
|
||||||
d3d_restore(d3d);
|
d3d_restore(d3d);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1706,9 +1706,14 @@ static bool gl_frame(void *data, const void *frame,
|
|||||||
|
|
||||||
if (gl->should_resize)
|
if (gl->should_resize)
|
||||||
{
|
{
|
||||||
|
gfx_ctx_mode_t mode;
|
||||||
|
|
||||||
gl->should_resize = false;
|
gl->should_resize = false;
|
||||||
|
|
||||||
gfx_ctx_set_resize(width, height);
|
mode.width = width;
|
||||||
|
mode.height = height;
|
||||||
|
|
||||||
|
gfx_ctx_ctl(GFX_CTL_SET_RESIZE, &mode);
|
||||||
|
|
||||||
#ifdef HAVE_FBO
|
#ifdef HAVE_FBO
|
||||||
if (gl->fbo_inited)
|
if (gl->fbo_inited)
|
||||||
|
@ -90,15 +90,6 @@ void gfx_ctx_get_video_size(unsigned *width, unsigned *height)
|
|||||||
current_video_context->get_video_size(video_context_data, width, height);
|
current_video_context->get_video_size(video_context_data, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool gfx_ctx_set_resize(unsigned width, unsigned height)
|
|
||||||
{
|
|
||||||
if (!current_video_context)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return current_video_context->set_resize(
|
|
||||||
video_context_data, width, height);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* find_gfx_ctx_driver_index:
|
* find_gfx_ctx_driver_index:
|
||||||
* @ident : Identifier of resampler driver to find.
|
* @ident : Identifier of resampler driver to find.
|
||||||
@ -432,6 +423,14 @@ bool gfx_ctx_ctl(enum gfx_ctx_ctl_state state, void *data)
|
|||||||
mode_info->height, mode_info->fullscreen);
|
mode_info->height, mode_info->fullscreen);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case GFX_CTL_SET_RESIZE:
|
||||||
|
{
|
||||||
|
gfx_ctx_mode_t *mode_info = (gfx_ctx_mode_t*)data;
|
||||||
|
if (!current_video_context)
|
||||||
|
return false;
|
||||||
|
return current_video_context->set_resize(
|
||||||
|
video_context_data, mode_info->width, mode_info->height);
|
||||||
|
}
|
||||||
case GFX_CTL_NONE:
|
case GFX_CTL_NONE:
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -80,7 +80,8 @@ enum gfx_ctx_ctl_state
|
|||||||
GFX_CTL_INPUT_DRIVER,
|
GFX_CTL_INPUT_DRIVER,
|
||||||
GFX_CTL_SUPPRESS_SCREENSAVER,
|
GFX_CTL_SUPPRESS_SCREENSAVER,
|
||||||
GFX_CTL_IDENT_GET,
|
GFX_CTL_IDENT_GET,
|
||||||
GFX_CTL_SET_VIDEO_MODE
|
GFX_CTL_SET_VIDEO_MODE,
|
||||||
|
GFX_CTL_SET_RESIZE
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef void (*gfx_ctx_proc_t)(void);
|
typedef void (*gfx_ctx_proc_t)(void);
|
||||||
@ -274,8 +275,6 @@ const gfx_ctx_driver_t *gfx_ctx_init_first(void *data, const char *ident,
|
|||||||
|
|
||||||
void gfx_ctx_get_video_size(unsigned *width, unsigned *height);
|
void gfx_ctx_get_video_size(unsigned *width, unsigned *height);
|
||||||
|
|
||||||
bool gfx_ctx_set_resize(unsigned width, unsigned height);
|
|
||||||
|
|
||||||
bool gfx_ctx_ctl(enum gfx_ctx_ctl_state state, void *data);
|
bool gfx_ctx_ctl(enum gfx_ctx_ctl_state state, void *data);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
Loading…
x
Reference in New Issue
Block a user