Turn video_driver_data and current_video into static variables again

This commit is contained in:
twinaphex 2017-05-20 14:09:24 +02:00
parent 4333e3d5e7
commit bd424da015
2 changed files with 3 additions and 12 deletions

View File

@ -163,8 +163,8 @@ static uint64_t video_driver_frame_count = 0;
static video_viewport_t video_viewport_custom; static video_viewport_t video_viewport_custom;
void *video_driver_data = NULL; static void *video_driver_data = NULL;
video_driver_t *current_video = NULL; static video_driver_t *current_video = NULL;
/* Interface for "poking". */ /* Interface for "poking". */
static const video_poke_interface_t *video_driver_poke = NULL; static const video_poke_interface_t *video_driver_poke = NULL;
@ -2609,12 +2609,11 @@ void video_driver_get_window_title(char *buf, unsigned len)
} }
} }
void video_driver_get_status(uint64_t *frame_count, bool * is_alive, void video_driver_get_status(uint64_t *frame_count, bool * is_alive,
bool *is_focused) bool *is_focused)
{ {
*frame_count = video_driver_frame_count; *frame_count = video_driver_frame_count;
*is_alive = video_driver_is_alive(); *is_alive = current_video ? current_video->alive(video_driver_data) : true;
*is_focused = video_driver_cb_has_focus(); *is_focused = video_driver_cb_has_focus();
} }

View File

@ -181,9 +181,6 @@ struct uniform_info
} result; } result;
}; };
typedef struct shader_backend typedef struct shader_backend
{ {
void *(*init)(void *data, const char *path); void *(*init)(void *data, const char *path);
@ -779,8 +776,6 @@ struct aspect_ratio_elem
extern struct aspect_ratio_elem aspectratio_lut[ASPECT_RATIO_END]; extern struct aspect_ratio_elem aspectratio_lut[ASPECT_RATIO_END];
#define video_driver_is_alive() ((current_video) ? current_video->alive(video_driver_data) : true)
bool video_driver_is_focused(void); bool video_driver_is_focused(void);
bool video_driver_has_windowed(void); bool video_driver_has_windowed(void);
@ -1120,9 +1115,6 @@ extern const gfx_ctx_driver_t gfx_ctx_khr_display;
extern const gfx_ctx_driver_t gfx_ctx_gdi; extern const gfx_ctx_driver_t gfx_ctx_gdi;
extern const gfx_ctx_driver_t gfx_ctx_null; extern const gfx_ctx_driver_t gfx_ctx_null;
extern void *video_driver_data;
extern video_driver_t *current_video;
/** /**
* video_context_driver_init_first: * video_context_driver_init_first:
* @data : Input data. * @data : Input data.