Add gs_device_name function
This returns the name of the device, "Direct3D 11" or "OpenGL" respectively.
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
EXPORT const char *device_name(void);
|
||||
EXPORT const char *device_preprocessor_name(void);
|
||||
EXPORT device_t device_create(struct gs_init_data *data);
|
||||
EXPORT void device_destroy(device_t device);
|
||||
|
@@ -40,6 +40,7 @@ bool load_graphics_imports(struct gs_exports *exports, void *module,
|
||||
{
|
||||
bool success = true;
|
||||
|
||||
GRAPHICS_IMPORT(device_name);
|
||||
GRAPHICS_IMPORT(device_preprocessor_name);
|
||||
GRAPHICS_IMPORT(device_create);
|
||||
GRAPHICS_IMPORT(device_destroy);
|
||||
|
@@ -24,6 +24,7 @@
|
||||
#include "matrix4.h"
|
||||
|
||||
struct gs_exports {
|
||||
const char *(*device_name)(void);
|
||||
const char *(*device_preprocessor_name)(void);
|
||||
device_t (*device_create)(struct gs_init_data *data);
|
||||
void (*device_destroy)(device_t device);
|
||||
|
@@ -215,6 +215,11 @@ graphics_t gs_getcontext(void)
|
||||
return thread_graphics;
|
||||
}
|
||||
|
||||
const char *gs_device_name(void)
|
||||
{
|
||||
return thread_graphics ? thread_graphics->exports.device_name() : NULL;
|
||||
}
|
||||
|
||||
static inline struct matrix4 *top_matrix(graphics_t graphics)
|
||||
{
|
||||
return graphics ?
|
||||
|
@@ -416,6 +416,8 @@ struct gs_init_data {
|
||||
uint32_t adapter;
|
||||
};
|
||||
|
||||
EXPORT const char *gs_device_name(void);
|
||||
|
||||
EXPORT int gs_create(graphics_t *graphics, const char *module,
|
||||
struct gs_init_data *data);
|
||||
EXPORT void gs_destroy(graphics_t graphics);
|
||||
|
Reference in New Issue
Block a user