C instance creation

This commit is contained in:
Greg Wells
2025-05-20 22:35:51 -04:00
parent a4166ae5c2
commit fa58a2f2d6
12 changed files with 150 additions and 112 deletions

View File

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