Turn some video context driver functions into macros
This commit is contained in:
parent
06c86f0852
commit
1dcef5e429
|
@ -93,8 +93,8 @@ static const gfx_ctx_driver_t *gfx_ctx_drivers[] = {
|
|||
NULL
|
||||
};
|
||||
|
||||
static const gfx_ctx_driver_t *current_video_context = NULL;
|
||||
static void *video_context_data = NULL;
|
||||
const gfx_ctx_driver_t *current_video_context = NULL;
|
||||
void *video_context_data = NULL;
|
||||
|
||||
/**
|
||||
* find_video_context_driver_driver_index:
|
||||
|
@ -349,34 +349,6 @@ void video_context_driver_destroy(void)
|
|||
current_video_context = NULL;
|
||||
}
|
||||
|
||||
bool video_context_driver_update_window_title(void)
|
||||
{
|
||||
if (current_video_context && current_video_context->update_window_title)
|
||||
{
|
||||
current_video_context->update_window_title(video_context_data);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool video_context_driver_swap_buffers(void)
|
||||
{
|
||||
if (current_video_context && current_video_context->swap_buffers)
|
||||
{
|
||||
current_video_context->swap_buffers(video_context_data);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool video_context_driver_focus(void)
|
||||
{
|
||||
if (video_context_data && current_video_context->has_focus &&
|
||||
current_video_context->has_focus(video_context_data))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool video_context_driver_translate_aspect(gfx_ctx_aspect_t *aspect)
|
||||
{
|
||||
if (!video_context_data || !aspect)
|
||||
|
@ -388,13 +360,6 @@ bool video_context_driver_translate_aspect(gfx_ctx_aspect_t *aspect)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool video_context_driver_has_windowed(void)
|
||||
{
|
||||
if (video_context_data && current_video_context->has_windowed(video_context_data))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
void video_context_driver_free(void)
|
||||
{
|
||||
if (current_video_context->destroy)
|
||||
|
|
|
@ -56,6 +56,7 @@ enum display_flags
|
|||
GFX_CTX_FLAGS_CUSTOMIZABLE_SWAPCHAIN_IMAGES
|
||||
};
|
||||
|
||||
|
||||
typedef void (*gfx_ctx_proc_t)(void);
|
||||
|
||||
typedef struct gfx_ctx_driver
|
||||
|
@ -167,6 +168,7 @@ typedef struct gfx_ctx_driver
|
|||
void (*make_current)(bool release);
|
||||
} gfx_ctx_driver_t;
|
||||
|
||||
|
||||
typedef struct gfx_ctx_flags
|
||||
{
|
||||
uint32_t flags;
|
||||
|
@ -288,11 +290,15 @@ bool video_context_driver_set(const gfx_ctx_driver_t *data);
|
|||
|
||||
void video_context_driver_destroy(void);
|
||||
|
||||
bool video_context_driver_update_window_title(void);
|
||||
#define video_context_driver_update_window_title() \
|
||||
if (current_video_context && current_video_context->update_window_title) \
|
||||
current_video_context->update_window_title(video_context_data)
|
||||
|
||||
bool video_context_driver_swap_buffers(void);
|
||||
#define video_context_driver_swap_buffers() \
|
||||
if (current_video_context && current_video_context->swap_buffers) \
|
||||
current_video_context->swap_buffers(video_context_data)
|
||||
|
||||
bool video_context_driver_focus(void);
|
||||
#define video_context_driver_focus() ((video_context_data && current_video_context->has_focus && current_video_context->has_focus(video_context_data)) ? true : false)
|
||||
|
||||
bool video_context_driver_get_video_output_size(gfx_ctx_size_t *size_data);
|
||||
|
||||
|
@ -326,10 +332,14 @@ bool video_context_driver_translate_aspect(gfx_ctx_aspect_t *aspect);
|
|||
|
||||
bool video_context_driver_input_driver(gfx_ctx_input_t *inp);
|
||||
|
||||
bool video_context_driver_has_windowed(void);
|
||||
#define video_context_driver_has_windowed() ((video_context_data && current_video_context->has_windowed(video_context_data)) ? true : false)
|
||||
|
||||
void video_context_driver_free(void);
|
||||
|
||||
extern const gfx_ctx_driver_t *current_video_context;
|
||||
|
||||
extern void *video_context_data;
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue