diff --git a/driver.h b/driver.h index ca575f3555..1642819d6d 100644 --- a/driver.h +++ b/driver.h @@ -233,6 +233,7 @@ typedef struct video_poke_interface void (*set_blend)(void *data, bool enable); void (*set_filtering)(void *data, unsigned index, bool smooth); void (*set_fbo_state)(void *data, unsigned state); + unsigned (*get_fbo_state)(void *data); void (*set_aspect_ratio)(void *data, unsigned aspectratio_index); void (*apply_state_changes)(void *data); diff --git a/gfx/gl.c b/gfx/gl.c index b30ac028ce..bfd28b552f 100644 --- a/gfx/gl.c +++ b/gfx/gl.c @@ -2259,6 +2259,12 @@ static void gl_set_fbo_state(void *data, unsigned mode) #endif } +static unsigned gl_get_fbo_state(void *data) +{ + gl_t *gl = (gl_t*)data; + return gl->fbo_inited ? FBO_INIT : FBO_DEINIT; +} + static void gl_set_aspect_ratio(void *data, unsigned aspectratio_index) { gl_t *gl = (gl_t*)data; @@ -2304,6 +2310,7 @@ static const video_poke_interface_t gl_poke_interface = { gl_set_blend, gl_set_filtering, gl_set_fbo_state, + gl_get_fbo_state, gl_set_aspect_ratio, gl_apply_state_changes, #ifdef HAVE_RGUI diff --git a/gfx/thread_wrapper.c b/gfx/thread_wrapper.c index 1b594f46c5..dd95c8af58 100644 --- a/gfx/thread_wrapper.c +++ b/gfx/thread_wrapper.c @@ -44,6 +44,7 @@ enum thread_cmd CMD_POKE_SET_BLEND, CMD_POKE_SET_FILTERING, CMD_POKE_SET_FBO_STATE, + CMD_POKE_GET_FBO_STATE, CMD_POKE_SET_ASPECT_RATIO, CMD_DUMMY = INT_MAX @@ -283,6 +284,11 @@ static void thread_loop(void *data) thread_reply(thr, CMD_POKE_SET_FBO_STATE); break; + case CMD_POKE_GET_FBO_STATE: + thr->cmd_data.i = thr->poke->get_fbo_state(thr->driver_data); + thread_reply(thr, CMD_POKE_GET_FBO_STATE); + break; + case CMD_POKE_SET_ASPECT_RATIO: thr->poke->set_aspect_ratio(thr->driver_data, thr->cmd_data.i); @@ -625,6 +631,14 @@ static void thread_set_fbo_state(void *data, unsigned state) thread_wait_reply(thr, CMD_POKE_SET_FBO_STATE); } +static unsigned thread_get_fbo_state(void *data) +{ + thread_video_t *thr = (thread_video_t*)data; + thread_send_cmd(thr, CMD_POKE_GET_FBO_STATE); + thread_wait_reply(thr, CMD_POKE_GET_FBO_STATE); + return thr->cmd_data.i; +} + static void thread_set_aspect_ratio(void *data, unsigned aspectratio_index) { thread_video_t *thr = (thread_video_t*)data; @@ -656,6 +670,7 @@ static const video_poke_interface_t thread_poke = { thread_set_blend, thread_set_filtering, thread_set_fbo_state, + thread_get_fbo_state, thread_set_aspect_ratio, thread_apply_state_changes, #ifdef HAVE_RGUI diff --git a/gx/gx_video.c b/gx/gx_video.c index a2aa49dc37..2ecb160ce4 100644 --- a/gx/gx_video.c +++ b/gx/gx_video.c @@ -1041,6 +1041,7 @@ static const video_poke_interface_t gx_poke_interface = { NULL, NULL, NULL, + NULL, gx_set_aspect_ratio, gx_apply_state_changes, gx_set_rgui_texture,