Add get_fbo_state().
This commit is contained in:
parent
7be75b29dc
commit
0e75731685
1
driver.h
1
driver.h
|
@ -233,6 +233,7 @@ typedef struct video_poke_interface
|
||||||
void (*set_blend)(void *data, bool enable);
|
void (*set_blend)(void *data, bool enable);
|
||||||
void (*set_filtering)(void *data, unsigned index, bool smooth);
|
void (*set_filtering)(void *data, unsigned index, bool smooth);
|
||||||
void (*set_fbo_state)(void *data, unsigned state);
|
void (*set_fbo_state)(void *data, unsigned state);
|
||||||
|
unsigned (*get_fbo_state)(void *data);
|
||||||
void (*set_aspect_ratio)(void *data, unsigned aspectratio_index);
|
void (*set_aspect_ratio)(void *data, unsigned aspectratio_index);
|
||||||
void (*apply_state_changes)(void *data);
|
void (*apply_state_changes)(void *data);
|
||||||
|
|
||||||
|
|
7
gfx/gl.c
7
gfx/gl.c
|
@ -2259,6 +2259,12 @@ static void gl_set_fbo_state(void *data, unsigned mode)
|
||||||
#endif
|
#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)
|
static void gl_set_aspect_ratio(void *data, unsigned aspectratio_index)
|
||||||
{
|
{
|
||||||
gl_t *gl = (gl_t*)data;
|
gl_t *gl = (gl_t*)data;
|
||||||
|
@ -2304,6 +2310,7 @@ static const video_poke_interface_t gl_poke_interface = {
|
||||||
gl_set_blend,
|
gl_set_blend,
|
||||||
gl_set_filtering,
|
gl_set_filtering,
|
||||||
gl_set_fbo_state,
|
gl_set_fbo_state,
|
||||||
|
gl_get_fbo_state,
|
||||||
gl_set_aspect_ratio,
|
gl_set_aspect_ratio,
|
||||||
gl_apply_state_changes,
|
gl_apply_state_changes,
|
||||||
#ifdef HAVE_RGUI
|
#ifdef HAVE_RGUI
|
||||||
|
|
|
@ -44,6 +44,7 @@ enum thread_cmd
|
||||||
CMD_POKE_SET_BLEND,
|
CMD_POKE_SET_BLEND,
|
||||||
CMD_POKE_SET_FILTERING,
|
CMD_POKE_SET_FILTERING,
|
||||||
CMD_POKE_SET_FBO_STATE,
|
CMD_POKE_SET_FBO_STATE,
|
||||||
|
CMD_POKE_GET_FBO_STATE,
|
||||||
CMD_POKE_SET_ASPECT_RATIO,
|
CMD_POKE_SET_ASPECT_RATIO,
|
||||||
|
|
||||||
CMD_DUMMY = INT_MAX
|
CMD_DUMMY = INT_MAX
|
||||||
|
@ -283,6 +284,11 @@ static void thread_loop(void *data)
|
||||||
thread_reply(thr, CMD_POKE_SET_FBO_STATE);
|
thread_reply(thr, CMD_POKE_SET_FBO_STATE);
|
||||||
break;
|
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:
|
case CMD_POKE_SET_ASPECT_RATIO:
|
||||||
thr->poke->set_aspect_ratio(thr->driver_data,
|
thr->poke->set_aspect_ratio(thr->driver_data,
|
||||||
thr->cmd_data.i);
|
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);
|
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)
|
static void thread_set_aspect_ratio(void *data, unsigned aspectratio_index)
|
||||||
{
|
{
|
||||||
thread_video_t *thr = (thread_video_t*)data;
|
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_blend,
|
||||||
thread_set_filtering,
|
thread_set_filtering,
|
||||||
thread_set_fbo_state,
|
thread_set_fbo_state,
|
||||||
|
thread_get_fbo_state,
|
||||||
thread_set_aspect_ratio,
|
thread_set_aspect_ratio,
|
||||||
thread_apply_state_changes,
|
thread_apply_state_changes,
|
||||||
#ifdef HAVE_RGUI
|
#ifdef HAVE_RGUI
|
||||||
|
|
|
@ -1041,6 +1041,7 @@ static const video_poke_interface_t gx_poke_interface = {
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
|
NULL,
|
||||||
gx_set_aspect_ratio,
|
gx_set_aspect_ratio,
|
||||||
gx_apply_state_changes,
|
gx_apply_state_changes,
|
||||||
gx_set_rgui_texture,
|
gx_set_rgui_texture,
|
||||||
|
|
Loading…
Reference in New Issue