mirror of
https://github.com/libretro/RetroArch
synced 2025-04-18 05:43:34 +00:00
Add GFX_CTL_SUPPRESS_SCREENSAVER
This commit is contained in:
parent
f6afe72a1e
commit
154f85c6fa
@ -889,7 +889,8 @@ static bool d3d_focus(void *data)
|
|||||||
|
|
||||||
static bool d3d_suppress_screensaver(void *data, bool enable)
|
static bool d3d_suppress_screensaver(void *data, bool enable)
|
||||||
{
|
{
|
||||||
return gfx_ctx_suppress_screensaver(enable);
|
bool enabled = enable;
|
||||||
|
return gfx_ctl(GFX_CTL_SUPPRESS_SCREENSAVER, &enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool d3d_has_windowed(void *data)
|
static bool d3d_has_windowed(void *data)
|
||||||
|
@ -2739,7 +2739,8 @@ static bool gl_focus(void *data)
|
|||||||
|
|
||||||
static bool gl_suppress_screensaver(void *data, bool enable)
|
static bool gl_suppress_screensaver(void *data, bool enable)
|
||||||
{
|
{
|
||||||
return gfx_ctx_suppress_screensaver(enable);
|
bool enabled = enable;
|
||||||
|
return gfx_ctx_ctl(GFX_CTL_SUPPRESS_SCREENSAVER, &enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool gl_has_windowed(void *data)
|
static bool gl_has_windowed(void *data)
|
||||||
|
@ -413,7 +413,8 @@ static bool vg_focus(void *data)
|
|||||||
|
|
||||||
static bool vg_suppress_screensaver(void *data, bool enable)
|
static bool vg_suppress_screensaver(void *data, bool enable)
|
||||||
{
|
{
|
||||||
return gfx_ctx_suppress_screensaver(enable);
|
bool enabled = enable;
|
||||||
|
return gfx_ctx_ctl(GFX_CTL_SUPPRESS_SCREENSAVER, &enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool vg_has_windowed(void *data)
|
static bool vg_has_windowed(void *data)
|
||||||
|
@ -100,14 +100,6 @@ bool gfx_ctx_set_video_mode(
|
|||||||
video_context_data, width, height, fullscreen);
|
video_context_data, width, height, fullscreen);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool gfx_ctx_suppress_screensaver(bool enable)
|
|
||||||
{
|
|
||||||
if (!video_context_data || !current_video_context)
|
|
||||||
return false;
|
|
||||||
return current_video_context->suppress_screensaver(
|
|
||||||
video_context_data, enable);
|
|
||||||
}
|
|
||||||
|
|
||||||
void gfx_ctx_get_video_size(unsigned *width, unsigned *height)
|
void gfx_ctx_get_video_size(unsigned *width, unsigned *height)
|
||||||
{
|
{
|
||||||
if (!current_video_context || !current_video_context->get_video_size)
|
if (!current_video_context || !current_video_context->get_video_size)
|
||||||
@ -431,6 +423,14 @@ bool gfx_ctx_ctl(enum gfx_ctx_ctl_state state, void *data)
|
|||||||
video_context_data, inp->input, inp->input_data);
|
video_context_data, inp->input, inp->input_data);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case GFX_CTL_SUPPRESS_SCREENSAVER:
|
||||||
|
{
|
||||||
|
bool *bool_data = (bool*)data;
|
||||||
|
if (!video_context_data || !current_video_context)
|
||||||
|
return false;
|
||||||
|
return current_video_context->suppress_screensaver(
|
||||||
|
video_context_data, *bool_data);
|
||||||
|
}
|
||||||
case GFX_CTL_NONE:
|
case GFX_CTL_NONE:
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -78,6 +78,7 @@ enum gfx_ctx_ctl_state
|
|||||||
GFX_CTL_TRANSLATE_ASPECT,
|
GFX_CTL_TRANSLATE_ASPECT,
|
||||||
GFX_CTL_GET_METRICS,
|
GFX_CTL_GET_METRICS,
|
||||||
GFX_CTL_INPUT_DRIVER,
|
GFX_CTL_INPUT_DRIVER,
|
||||||
|
GFX_CTL_SUPPRESS_SCREENSAVER
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef void (*gfx_ctx_proc_t)(void);
|
typedef void (*gfx_ctx_proc_t)(void);
|
||||||
@ -260,8 +261,6 @@ const gfx_ctx_driver_t *gfx_ctx_init_first(void *data, const char *ident,
|
|||||||
bool gfx_ctx_set_video_mode(unsigned width, unsigned height,
|
bool gfx_ctx_set_video_mode(unsigned width, unsigned height,
|
||||||
bool fullscreen);
|
bool fullscreen);
|
||||||
|
|
||||||
bool gfx_ctx_suppress_screensaver(bool enable);
|
|
||||||
|
|
||||||
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_set_resize(unsigned width, unsigned height);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user