mirror of
https://github.com/libretro/RetroArch
synced 2025-04-09 21:45:45 +00:00
(video_driver.c) Move some code over
This commit is contained in:
parent
0448afab96
commit
4574a58683
@ -18,6 +18,19 @@
|
|||||||
|
|
||||||
#include "video_driver.h"
|
#include "video_driver.h"
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
struct string_list *list;
|
||||||
|
enum gfx_ctx_api api;
|
||||||
|
} gfx_api_gpu_map;
|
||||||
|
|
||||||
|
static gfx_api_gpu_map gpu_map[] = {
|
||||||
|
{ NULL, GFX_CTX_VULKAN_API },
|
||||||
|
{ NULL, GFX_CTX_DIRECT3D10_API },
|
||||||
|
{ NULL, GFX_CTX_DIRECT3D11_API },
|
||||||
|
{ NULL, GFX_CTX_DIRECT3D12_API }
|
||||||
|
};
|
||||||
|
|
||||||
video_driver_t *hw_render_context_driver(
|
video_driver_t *hw_render_context_driver(
|
||||||
enum retro_hw_context_type type, int major, int minor)
|
enum retro_hw_context_type type, int major, int minor)
|
||||||
{
|
{
|
||||||
@ -121,6 +134,37 @@ enum retro_hw_context_type hw_render_context_type(const char *s)
|
|||||||
return RETRO_HW_CONTEXT_NONE;
|
return RETRO_HW_CONTEXT_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* string list stays owned by the caller and must be available at
|
||||||
|
* all times after the video driver is inited */
|
||||||
|
void video_driver_set_gpu_api_devices(
|
||||||
|
enum gfx_ctx_api api, struct string_list *list)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < ARRAY_SIZE(gpu_map); i++)
|
||||||
|
{
|
||||||
|
if (api == gpu_map[i].api)
|
||||||
|
{
|
||||||
|
gpu_map[i].list = list;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
struct string_list* video_driver_get_gpu_api_devices(enum gfx_ctx_api api)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < ARRAY_SIZE(gpu_map); i++)
|
||||||
|
{
|
||||||
|
if (api == gpu_map[i].api)
|
||||||
|
return gpu_map[i].list;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* video_driver_translate_coord_viewport:
|
* video_driver_translate_coord_viewport:
|
||||||
* @mouse_x : Pointer X coordinate.
|
* @mouse_x : Pointer X coordinate.
|
||||||
|
30
retroarch.c
30
retroarch.c
@ -23442,36 +23442,6 @@ const char* video_driver_get_gpu_api_version_string(void)
|
|||||||
return p_rarch->video_driver_gpu_api_version_string;
|
return p_rarch->video_driver_gpu_api_version_string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* string list stays owned by the caller and must be available at
|
|
||||||
* all times after the video driver is inited */
|
|
||||||
void video_driver_set_gpu_api_devices(
|
|
||||||
enum gfx_ctx_api api, struct string_list *list)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_SIZE(gpu_map); i++)
|
|
||||||
{
|
|
||||||
if (api == gpu_map[i].api)
|
|
||||||
{
|
|
||||||
gpu_map[i].list = list;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
struct string_list* video_driver_get_gpu_api_devices(enum gfx_ctx_api api)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_SIZE(gpu_map); i++)
|
|
||||||
{
|
|
||||||
if (api == gpu_map[i].api)
|
|
||||||
return gpu_map[i].list;
|
|
||||||
}
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* CAMERA */
|
/* CAMERA */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -936,12 +936,6 @@ typedef struct video_pixel_scaler
|
|||||||
void *scaler_out;
|
void *scaler_out;
|
||||||
} video_pixel_scaler_t;
|
} video_pixel_scaler_t;
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
struct string_list *list;
|
|
||||||
enum gfx_ctx_api api;
|
|
||||||
} gfx_api_gpu_map;
|
|
||||||
|
|
||||||
typedef void *(*constructor_t)(void);
|
typedef void *(*constructor_t)(void);
|
||||||
typedef void (*destructor_t )(void*);
|
typedef void (*destructor_t )(void*);
|
||||||
|
|
||||||
@ -1606,13 +1600,6 @@ struct aspect_ratio_elem aspectratio_lut[ASPECT_RATIO_END] = {
|
|||||||
{ 1.3333f, "Full" }
|
{ 1.3333f, "Full" }
|
||||||
};
|
};
|
||||||
|
|
||||||
static gfx_api_gpu_map gpu_map[] = {
|
|
||||||
{ NULL, GFX_CTX_VULKAN_API },
|
|
||||||
{ NULL, GFX_CTX_DIRECT3D10_API },
|
|
||||||
{ NULL, GFX_CTX_DIRECT3D11_API },
|
|
||||||
{ NULL, GFX_CTX_DIRECT3D12_API }
|
|
||||||
};
|
|
||||||
|
|
||||||
/* TODO/FIXME - turn these into static global variable */
|
/* TODO/FIXME - turn these into static global variable */
|
||||||
#ifdef HAVE_DISCORD
|
#ifdef HAVE_DISCORD
|
||||||
bool discord_is_inited = false;
|
bool discord_is_inited = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user