Add GFX_CTL_SET_RESIZE

This commit is contained in:
twinaphex 2016-02-14 02:15:43 +01:00
parent 5516ff05b5
commit bcaf08ad2d
4 changed files with 23 additions and 14 deletions

View File

@ -868,8 +868,14 @@ static bool d3d_alive(void *data)
if (resize)
{
gfx_ctx_mode_t mode;
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);
}

View File

@ -1706,9 +1706,14 @@ static bool gl_frame(void *data, const void *frame,
if (gl->should_resize)
{
gfx_ctx_mode_t mode;
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
if (gl->fbo_inited)

View File

@ -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);
}
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:
* @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);
}
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:
default:
break;

View File

@ -80,7 +80,8 @@ enum gfx_ctx_ctl_state
GFX_CTL_INPUT_DRIVER,
GFX_CTL_SUPPRESS_SCREENSAVER,
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);
@ -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);
bool gfx_ctx_set_resize(unsigned width, unsigned height);
bool gfx_ctx_ctl(enum gfx_ctx_ctl_state state, void *data);
#ifdef __cplusplus