Wrap more gfx_ctx functions
This commit is contained in:
parent
50736c164c
commit
133d7b7dd2
|
@ -1281,8 +1281,7 @@ static INLINE void gl_copy_frame(gl_t *gl, const void *frame,
|
||||||
if (gl->egl_images)
|
if (gl->egl_images)
|
||||||
{
|
{
|
||||||
EGLImageKHR img = 0;
|
EGLImageKHR img = 0;
|
||||||
const gfx_ctx_driver_t *ctx = gfx_ctx_get_ptr();
|
bool new_egl = gfx_ctx_write_egl_image(gl,
|
||||||
bool new_egl = ctx && ctx->write_egl_image(gl,
|
|
||||||
frame, width, height, pitch, (gl->base_size == 4),
|
frame, width, height, pitch, (gl->base_size == 4),
|
||||||
gl->tex_index, &img);
|
gl->tex_index, &img);
|
||||||
|
|
||||||
|
@ -2500,12 +2499,7 @@ static bool gl_suppress_screensaver(void *data, bool enable)
|
||||||
|
|
||||||
static bool gl_has_windowed(void *data)
|
static bool gl_has_windowed(void *data)
|
||||||
{
|
{
|
||||||
gl_t *gl = (gl_t*)data;
|
return gfx_ctx_has_windowed(data);
|
||||||
const gfx_ctx_driver_t *ctx = gfx_ctx_get_ptr();
|
|
||||||
|
|
||||||
if (gl && ctx)
|
|
||||||
return ctx->has_windowed(gl);
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gl_update_tex_filter_frame(gl_t *gl)
|
static void gl_update_tex_filter_frame(gl_t *gl)
|
||||||
|
@ -3072,9 +3066,7 @@ static uintptr_t gl_get_current_framebuffer(void *data)
|
||||||
|
|
||||||
static retro_proc_address_t gl_get_proc_address(void *data, const char *sym)
|
static retro_proc_address_t gl_get_proc_address(void *data, const char *sym)
|
||||||
{
|
{
|
||||||
const gfx_ctx_driver_t *ctx = gfx_ctx_get_ptr();
|
return gfx_ctx_get_proc_address(sym);
|
||||||
|
|
||||||
return ctx->get_proc_address(sym);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gl_set_aspect_ratio(void *data, unsigned aspect_ratio_idx)
|
static void gl_set_aspect_ratio(void *data, unsigned aspect_ratio_idx)
|
||||||
|
@ -3179,11 +3171,7 @@ static void gl_set_osd_msg(void *data, const char *msg,
|
||||||
|
|
||||||
static void gl_show_mouse(void *data, bool state)
|
static void gl_show_mouse(void *data, bool state)
|
||||||
{
|
{
|
||||||
gl_t *gl = (gl_t*)data;
|
gfx_ctx_show_mouse(data, state);
|
||||||
const gfx_ctx_driver_t *ctx = gfx_ctx_get_ptr();
|
|
||||||
|
|
||||||
if (gl && ctx->show_mouse)
|
|
||||||
ctx->show_mouse(gl, state);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct video_shader *gl_get_current_shader(void *data)
|
static struct video_shader *gl_get_current_shader(void *data)
|
||||||
|
|
|
@ -127,6 +127,39 @@ bool gfx_ctx_get_metrics(enum display_metric_types type, float *value)
|
||||||
value);
|
value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool gfx_ctx_write_egl_image(void *data, const void *frame, unsigned width,
|
||||||
|
unsigned height, unsigned pitch, bool rgb32,
|
||||||
|
unsigned index, void **image_handle)
|
||||||
|
{
|
||||||
|
const gfx_ctx_driver_t *ctx = gfx_ctx_get_ptr();
|
||||||
|
if (ctx && ctx->write_egl_image)
|
||||||
|
return ctx->write_egl_image(data, frame, width, height, pitch,
|
||||||
|
rgb32, index, image_handle);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
retro_proc_address_t gfx_ctx_get_proc_address(const char *sym)
|
||||||
|
{
|
||||||
|
const gfx_ctx_driver_t *ctx = gfx_ctx_get_ptr();
|
||||||
|
return ctx->get_proc_address(sym);
|
||||||
|
}
|
||||||
|
|
||||||
|
void gfx_ctx_show_mouse(void *data, bool state)
|
||||||
|
{
|
||||||
|
const gfx_ctx_driver_t *ctx = gfx_ctx_get_ptr();
|
||||||
|
if (data && ctx->show_mouse)
|
||||||
|
ctx->show_mouse(data, state);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool gfx_ctx_has_windowed(void *data)
|
||||||
|
{
|
||||||
|
const gfx_ctx_driver_t *ctx = gfx_ctx_get_ptr();
|
||||||
|
|
||||||
|
if (data && ctx)
|
||||||
|
return ctx->has_windowed(data);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* find_gfx_ctx_driver_index:
|
* find_gfx_ctx_driver_index:
|
||||||
* @ident : Identifier of resampler driver to find.
|
* @ident : Identifier of resampler driver to find.
|
||||||
|
|
|
@ -215,6 +215,16 @@ void gfx_ctx_swap_buffers(void *data);
|
||||||
|
|
||||||
bool gfx_ctx_focus(void *data);
|
bool gfx_ctx_focus(void *data);
|
||||||
|
|
||||||
|
bool gfx_ctx_write_egl_image(void *data, const void *frame,
|
||||||
|
unsigned width, unsigned height, unsigned pitch, bool rgb32,
|
||||||
|
unsigned index, void **image_handle);
|
||||||
|
|
||||||
|
void gfx_ctx_show_mouse(void *data, bool state);
|
||||||
|
|
||||||
|
bool gfx_ctx_has_windowed(void *data);
|
||||||
|
|
||||||
|
retro_proc_address_t gfx_ctx_get_proc_address(const char *sym);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue