reimplement gnCreateOutputDevice

This commit is contained in:
Greg Wells
2025-05-23 15:01:59 -04:00
parent 273b1ad59e
commit 8744b56955
14 changed files with 43 additions and 104 deletions

View File

@@ -4,6 +4,7 @@
gnReturnCode gnCreateInstance(gnInstance* instance, struct gnInstanceInfo_t info) {
if (!gnIsAPISupported(info.renderingAPI)) return GN_UNSUPPORTED_RENDERING_API;
instance->debugger = NULL;
instance->dynamicLib = gnLoadRenderingDLL(info.renderingAPI);
if (instance->dynamicLib == NULL) return GN_UNABLE_TO_LOAD_DYNAMIC_LIBARRY;
instance->functions = malloc(sizeof(struct gnFunctions_t));

View File

@@ -5,6 +5,7 @@
struct gnPlatformInstance_t;
struct gnFunctions_t;
struct gnDynamicLibrary_t;
struct gnDebugger_t;
typedef struct gnInstanceInfo_t {
gnString applicationName;
@@ -22,6 +23,8 @@ typedef struct gnInstance_t {
struct gnFunctions_t* functions;
struct gnDynamicLibrary_t* dynamicLib;
struct gnDebugger_t* debugger;
} gnInstance;
gnReturnCode gnCreateInstance(gnInstance* instance, struct gnInstanceInfo_t info);

View File

@@ -42,8 +42,7 @@ void gnLoadFunctions(struct gnDynamicLibrary_t* lib, struct gnFunctions_t* funct
gnLoadDLLFunction(lib, functions->_gnCreateDebugger, "gnCreateDebuggerFn");
gnLoadDLLFunction(lib, functions->_gnDestroyDebugger, "gnDestroyDebuggerFn");
gnLoadDLLFunction(lib, functions->_gnGetPhysicalDevices, "gnGetPhysicalDevicesFn");
gnLoadDLLFunction(lib, functions->_gnDeviceSupportsAPI, "gnDeviceSupportsAPIFn");
gnLoadDLLFunction(lib, functions->_gnRegisterOutputDevice, "gnRegisterOutputDeviceFn");
gnLoadDLLFunction(lib, functions->_gnCreateOutputDevoce, "gnCreateOutputDeviceFn");
gnLoadDLLFunction(lib, functions->_gnDestroyOutputDevice, "gnDestroyOutputDeviceFn");
#ifdef GN_PLATFORM_LINUX