compiles!!! (seg faults)

This commit is contained in:
Gregory Wells
2025-06-24 12:41:59 -04:00
parent 953feebfe4
commit 78202825db
8 changed files with 118 additions and 141 deletions

View File

@@ -3,11 +3,12 @@ project(Gryphn)
add_compile_definitions(GN_PLATFORM_LINUX GN_WINDOW_X11 GN_REVEAL_IMPL) add_compile_definitions(GN_PLATFORM_LINUX GN_WINDOW_X11 GN_REVEAL_IMPL)
add_subdirectory(projects/core/) # build gryphn code add_subdirectory(projects/core/) # build gryphn core
add_subdirectory(projects/loader) # build gryphn loader
add_subdirectory(projects/apis/vulkan/) add_subdirectory(projects/apis/vulkan/)
add_library(Gryphn INTERFACE) add_library(Gryphn INTERFACE)
target_link_libraries(Gryphn INTERFACE GryphnCore GryphnVulkanImpl) target_link_libraries(Gryphn INTERFACE GryphnCore GryphnLoader GryphnVulkanImpl)
# set(CMAKE_EXPORT_COMPILE_COMMANDS on) # set(CMAKE_EXPORT_COMPILE_COMMANDS on)
# project(Gryphn) # project(Gryphn)

View File

@@ -1,13 +1,10 @@
#include "gryphn_instance.h" #include "gryphn_instance.h"
#include <gryphn_platform_functions.h> #include <gryphn_platform_functions.h>
#include "instance/gryphn_instance.h" #include "instance/gryphn_instance.h"
#include "gryphn_handles.h" #include "loader/src/gryphn_loader.h"
gnReturnCode gnCreateInstance(gnInstanceHandle* instanceHandlePtr, gnInstanceInfo info) { gnReturnCode gnCreateInstance(gnInstanceHandle* instance, gnInstanceInfo info) {
// *instanceHandlePtr = malloc(sizeof(struct gnInstance_t)); *instance = malloc(sizeof(struct gnInstance_t));
// gnInstanceHandle instance = *instanceHandlePtr;
// if (!gnIsAPISupported(info.renderingAPI)) return GN_UNSUPPORTED_RENDERING_API;
// instance->loadDeviceFunctions = gnFalse;
// instance->dynamicLib = gnLoadRenderingDLL(info.renderingAPI); // instance->dynamicLib = gnLoadRenderingDLL(info.renderingAPI);
// if (instance->dynamicLib == NULL) return GN_UNABLE_TO_LOAD_DYNAMIC_LIBARRY; // if (instance->dynamicLib == NULL) return GN_UNABLE_TO_LOAD_DYNAMIC_LIBARRY;
// instance->functions = gnLoadFunctions(instance); // instance->functions = gnLoadFunctions(instance);
@@ -15,8 +12,6 @@ gnReturnCode gnCreateInstance(gnInstanceHandle* instanceHandlePtr, gnInstanceInf
// if (info.debugger) // if (info.debugger)
// instance->debugger = info.debugger; // instance->debugger = info.debugger;
// instance->loadCommandFunctions = gnFalse;
// instance->loadDeviceFunctions = gnFalse;
// return instance->functions->_gnCreateInstance(instance, info); // return instance->functions->_gnCreateInstance(instance, info);
return GN_SUCCESS; return GN_SUCCESS;
} }

View File

@@ -1,14 +0,0 @@
#pragma once
#include "utils/gryphn_string.h"
#include "utils/gryphn_bool.h"
typedef struct gnDynamicLibrary_t {
void* dllPtr;
gnBool isValid;
} gnDynamicLibrary;
struct gnDynamicLibrary_t* gnLoadDynamicLibrary(const gnString path);
void gnUnloadDynamicLibrary(struct gnDynamicLibrary_t* dll);
void* gnLoadFunctionPtr(struct gnDynamicLibrary_t* dll, const char* name);
#define gnLoadDLLFunction(dll, function, name) function = (typeof(function))gnLoadFunctionPtr(dll, name)

View File

@@ -1,127 +1,126 @@
// #undef GN_UTILS_CPP // #undef GN_UTILS_CPP
#include "gryphn_init.h" #include "gryphn_init.h"
#include <platform/gryphn_platform_include.h> #include <platform/gryphn_platform_include.h>
#include "gryphn_dynamic_library.h"
// #include <dlfcn.h> // #include <dlfcn.h>
#include "stdbool.h" #include "stdbool.h"
#include "stdio.h" #include "stdio.h"
gnBool gnIsAPISupported(gnRenderingAPI api) { // gnBool gnIsAPISupported(gnRenderingAPI api) {
int renderingAPICount = 0; // int renderingAPICount = 0;
gnRenderingAPI* supportedRenderingAPIS = gnGetSupportedRenderingAPIs(&renderingAPICount); // gnRenderingAPI* supportedRenderingAPIS = gnGetSupportedRenderingAPIs(&renderingAPICount);
for (int i = 0; i < renderingAPICount; i++) if (supportedRenderingAPIS[i] == api) return true; // for (int i = 0; i < renderingAPICount; i++) if (supportedRenderingAPIS[i] == api) return true;
return false; // return false;
} // }
struct gnDynamicLibrary_t* gnLoadRenderingDLL(gnRenderingAPI renderingAPI) { // struct gnDynamicLibrary_t* gnLoadRenderingDLL(gnRenderingAPI renderingAPI) {
gnString libName = gnCreateEmptyString(); // gnString libName = gnCreateEmptyString();
switch (renderingAPI) { // switch (renderingAPI) {
case GN_RENDERINGAPI_NONE: return NULL; // case GN_RENDERINGAPI_NONE: return NULL;
case GN_RENDERINGAPI_SOFTWARE: return NULL; // case GN_RENDERINGAPI_SOFTWARE: return NULL;
case GN_RENDERINGAPI_OPENGL: return NULL; // case GN_RENDERINGAPI_OPENGL: return NULL;
case GN_RENDERINGAPI_VULKAN: { // case GN_RENDERINGAPI_VULKAN: {
if (!gnIsAPISupported(GN_RENDERINGAPI_VULKAN)) return NULL; // if (!gnIsAPISupported(GN_RENDERINGAPI_VULKAN)) return NULL;
libName = gnCreateString("GryphnVulkanImpl"); // libName = gnCreateString("GryphnVulkanImpl");
break; // break;
} // }
case GN_RENDERINGAPI_DIRECTX11: return NULL; // case GN_RENDERINGAPI_DIRECTX11: return NULL;
case GN_RENDERINGAPI_DIRECTX12: return NULL; // case GN_RENDERINGAPI_DIRECTX12: return NULL;
case GN_RENDERINGAPI_METAL: { // case GN_RENDERINGAPI_METAL: {
if (!gnIsAPISupported(GN_RENDERINGAPI_METAL)) return NULL; // if (!gnIsAPISupported(GN_RENDERINGAPI_METAL)) return NULL;
libName = gnCreateString("GryphnMetalImpl"); // libName = gnCreateString("GryphnMetalImpl");
break; // break;
} // }
} // }
return gnLoadDynamicLibrary(gnCombineStrings(gnCreateString("gryphn/rendering_apis/"), libName)); // return gnLoadDynamicLibrary(gnCombineStrings(gnCreateString("gryphn/rendering_apis/"), libName));
} // }
gnInstanceFunctions* gnLoadFunctions(gnInstanceHandle instance) { gnInstanceFunctions* gnLoadFunctions(gnInstanceHandle instance) {
gnInstanceFunctions* functions = malloc(sizeof(gnInstanceFunctions)); gnInstanceFunctions* functions = malloc(sizeof(gnInstanceFunctions));
gnLoadDLLFunction(instance->dynamicLib, functions->_gnCreateInstance, "gnCreateInstanceFn"); // gnLoadDLLFunction(instance->dynamicLib, functions->_gnCreateInstance, "gnCreateInstanceFn");
gnLoadDLLFunction(instance->dynamicLib, functions->_gnDestroyInstance, "gnDestroyInstanceFn"); // gnLoadDLLFunction(instance->dynamicLib, functions->_gnDestroyInstance, "gnDestroyInstanceFn");
gnLoadDLLFunction(instance->dynamicLib, functions->_gnGetPhysicalDevices, "gnGetPhysicalDevicesFn"); // gnLoadDLLFunction(instance->dynamicLib, functions->_gnGetPhysicalDevices, "gnGetPhysicalDevicesFn");
gnLoadDLLFunction(instance->dynamicLib, functions->_gnQueueCanPresentToSurface, "gnQueueCanPresentToSurfaceFn"); // gnLoadDLLFunction(instance->dynamicLib, functions->_gnQueueCanPresentToSurface, "gnQueueCanPresentToSurfaceFn");
gnLoadDLLFunction(instance->dynamicLib, functions->_gnCreateOutputDevice, "gnCreateOutputDeviceFn"); // gnLoadDLLFunction(instance->dynamicLib, functions->_gnCreateOutputDevice, "gnCreateOutputDeviceFn");
gnLoadDLLFunction(instance->dynamicLib, functions->_gnDestroyOutputDevice, "gnDestroyOutputDeviceFn"); // gnLoadDLLFunction(instance->dynamicLib, functions->_gnDestroyOutputDevice, "gnDestroyOutputDeviceFn");
#ifdef GN_PLATFORM_LINUX // #ifdef GN_PLATFORM_LINUX
#ifdef GN_WINDOW_X11 // #ifdef GN_WINDOW_X11
gnLoadDLLFunction(instance->dynamicLib, functions->_gnCreateX11WindowSurface, "gnCreateX11WindowSurfaceFn"); // gnLoadDLLFunction(instance->dynamicLib, functions->_gnCreateX11WindowSurface, "gnCreateX11WindowSurfaceFn");
#endif // #endif
#ifdef GN_WINDOW_WAYLAND // #ifdef GN_WINDOW_WAYLAND
gnLoadDLLFunction(instance->dynamicLib, functions->_gnCreateWaylandWindowSurface, "gnCreateWaylandWindowSurfaceFn"); // gnLoadDLLFunction(instance->dynamicLib, functions->_gnCreateWaylandWindowSurface, "gnCreateWaylandWindowSurfaceFn");
#endif // #endif
#endif // #endif
#ifdef GN_PLATFORM_WIN32 // #ifdef GN_PLATFORM_WIN32
gnLoadDLLFunction(instance->dynamicLib, functions->_gnCreateWin32WindowSurface, "gnCreateWin32WindowSurfaceFn"); // gnLoadDLLFunction(instance->dynamicLib, functions->_gnCreateWin32WindowSurface, "gnCreateWin32WindowSurfaceFn");
#endif // #endif
#ifdef GN_PLATFORM_MACOS // #ifdef GN_PLATFORM_MACOS
gnLoadDLLFunction(instance->dynamicLib, functions->_gnCreateMacOSWindowSurface, "gnCreateMacOSWindowSurfaceFn"); // gnLoadDLLFunction(instance->dynamicLib, functions->_gnCreateMacOSWindowSurface, "gnCreateMacOSWindowSurfaceFn");
#endif // #endif
gnLoadDLLFunction(instance->dynamicLib, functions->_gnDestroyWindowSurface, "gnDestroyWindowSurfaceFn"); // gnLoadDLLFunction(instance->dynamicLib, functions->_gnDestroyWindowSurface, "gnDestroyWindowSurfaceFn");
gnLoadDLLFunction(instance->dynamicLib, functions->_gnGetSurfaceDetails, "gnGetSurfaceDetailsFn"); // gnLoadDLLFunction(instance->dynamicLib, functions->_gnGetSurfaceDetails, "gnGetSurfaceDetailsFn");
return functions; return functions;
} }
void gnLoadDeviceFunctions(struct gnDynamicLibrary_t* lib, struct gnDeviceFunctions_t* functions) { void gnLoadDeviceFunctions(struct gnDynamicLibrary_t* lib, struct gnDeviceFunctions_t* functions) {
gnLoadDLLFunction(lib, functions->_gnCreatePresentationQueue, "gnCreatePresentationQueueFn"); // gnLoadDLLFunction(lib, functions->_gnCreatePresentationQueue, "gnCreatePresentationQueueFn");
gnLoadDLLFunction(lib, functions->_gnPresentationQueueGetImage, "gnPresentationQueueGetImageFn"); // gnLoadDLLFunction(lib, functions->_gnPresentationQueueGetImage, "gnPresentationQueueGetImageFn");
gnLoadDLLFunction(lib, functions->_gnDestroyPresentationQueue, "gnDestroyPresentationQueueFn"); // gnLoadDLLFunction(lib, functions->_gnDestroyPresentationQueue, "gnDestroyPresentationQueueFn");
gnLoadDLLFunction(lib, functions->_gnCreateShaderModule, "gnCreateShaderModuleFn"); // gnLoadDLLFunction(lib, functions->_gnCreateShaderModule, "gnCreateShaderModuleFn");
gnLoadDLLFunction(lib, functions->_gnDestroyShaderModule, "gnDestroyShaderModuleFn"); // gnLoadDLLFunction(lib, functions->_gnDestroyShaderModule, "gnDestroyShaderModuleFn");
gnLoadDLLFunction(lib, functions->_gnCreateRenderPassDescriptor, "gnCreateRenderPassDescriptorFn"); // gnLoadDLLFunction(lib, functions->_gnCreateRenderPassDescriptor, "gnCreateRenderPassDescriptorFn");
gnLoadDLLFunction(lib, functions->_gnDestroyRenderPassDescriptor, "gnDestroyRenderPassDescriptorFn"); // gnLoadDLLFunction(lib, functions->_gnDestroyRenderPassDescriptor, "gnDestroyRenderPassDescriptorFn");
gnLoadDLLFunction(lib, functions->_gnCreateGraphicsPipeline, "gnCreateGraphicsPipelineFn"); // gnLoadDLLFunction(lib, functions->_gnCreateGraphicsPipeline, "gnCreateGraphicsPipelineFn");
gnLoadDLLFunction(lib, functions->_gnDestroyGraphicsPipeline, "gnDestroyGraphicsPipelineFn"); // gnLoadDLLFunction(lib, functions->_gnDestroyGraphicsPipeline, "gnDestroyGraphicsPipelineFn");
gnLoadDLLFunction(lib, functions->_gnCreateFramebuffer, "gnCreateFramebufferFn"); // gnLoadDLLFunction(lib, functions->_gnCreateFramebuffer, "gnCreateFramebufferFn");
gnLoadDLLFunction(lib, functions->_gnDestroyFramebuffer, "gnDestroyFramebufferFn"); // gnLoadDLLFunction(lib, functions->_gnDestroyFramebuffer, "gnDestroyFramebufferFn");
gnLoadDLLFunction(lib, functions->_gnCreateCommandPool, "gnCreateCommandPoolFn"); // gnLoadDLLFunction(lib, functions->_gnCreateCommandPool, "gnCreateCommandPoolFn");
gnLoadDLLFunction(lib, functions->_gnDestroyCommandPool, "gnDestroyCommandPoolFn"); // gnLoadDLLFunction(lib, functions->_gnDestroyCommandPool, "gnDestroyCommandPoolFn");
gnLoadDLLFunction(lib, functions->_gnCreateSemaphore, "gnCreateSemaphoreFn"); // gnLoadDLLFunction(lib, functions->_gnCreateSemaphore, "gnCreateSemaphoreFn");
gnLoadDLLFunction(lib, functions->_gnDestroySemaphore, "gnDestroySemaphoreFn"); // gnLoadDLLFunction(lib, functions->_gnDestroySemaphore, "gnDestroySemaphoreFn");
gnLoadDLLFunction(lib, functions->_gnCreateBuffer, "gnCreateBufferFn"); // gnLoadDLLFunction(lib, functions->_gnCreateBuffer, "gnCreateBufferFn");
gnLoadDLLFunction(lib, functions->_gnBufferData, "gnBufferDataFn"); // gnLoadDLLFunction(lib, functions->_gnBufferData, "gnBufferDataFn");
gnLoadDLLFunction(lib, functions->_gnMapBuffer, "gnMapBufferFn"); // gnLoadDLLFunction(lib, functions->_gnMapBuffer, "gnMapBufferFn");
gnLoadDLLFunction(lib, functions->_gnDestroyBuffer, "gnDestroyBufferFn"); // gnLoadDLLFunction(lib, functions->_gnDestroyBuffer, "gnDestroyBufferFn");
gnLoadDLLFunction(lib, functions->_gnCreateUniformPool, "gnCreateUniformPoolFn"); // gnLoadDLLFunction(lib, functions->_gnCreateUniformPool, "gnCreateUniformPoolFn");
gnLoadDLLFunction(lib, functions->_gnUniformPoolAllocateUniforms, "gnUniformPoolAllocateUniformsFn"); // gnLoadDLLFunction(lib, functions->_gnUniformPoolAllocateUniforms, "gnUniformPoolAllocateUniformsFn");
gnLoadDLLFunction(lib, functions->_gnDestroyUniformPool, "gnDestroyUniformPoolFn"); // gnLoadDLLFunction(lib, functions->_gnDestroyUniformPool, "gnDestroyUniformPoolFn");
gnLoadDLLFunction(lib, functions->_gnUpdateBufferUniform, "gnUpdateBufferUniformFn"); // gnLoadDLLFunction(lib, functions->_gnUpdateBufferUniform, "gnUpdateBufferUniformFn");
gnLoadDLLFunction(lib, functions->_gnUpdateImageUniform, "gnUpdateImageUniformFn"); // gnLoadDLLFunction(lib, functions->_gnUpdateImageUniform, "gnUpdateImageUniformFn");
gnLoadDLLFunction(lib, functions->_gnCreateTexture, "gnCreateTextureFn"); // gnLoadDLLFunction(lib, functions->_gnCreateTexture, "gnCreateTextureFn");
gnLoadDLLFunction(lib, functions->_gnTextureData, "gnTextureDataFn"); // gnLoadDLLFunction(lib, functions->_gnTextureData, "gnTextureDataFn");
gnLoadDLLFunction(lib, functions->_gnDestroyTexture, "gnDestroyTextureFn"); // gnLoadDLLFunction(lib, functions->_gnDestroyTexture, "gnDestroyTextureFn");
gnLoadDLLFunction(lib, functions->_gnCreateFence, "gnCreateFenceFn"); // gnLoadDLLFunction(lib, functions->_gnCreateFence, "gnCreateFenceFn");
gnLoadDLLFunction(lib, functions->_gnSignalFence, "gnSignalFenceFn"); // gnLoadDLLFunction(lib, functions->_gnSignalFence, "gnSignalFenceFn");
gnLoadDLLFunction(lib, functions->_gnWaitForFence, "gnWaitForFenceFn"); // gnLoadDLLFunction(lib, functions->_gnWaitForFence, "gnWaitForFenceFn");
gnLoadDLLFunction(lib, functions->_gnResetFence, "gnResetFenceFn"); // gnLoadDLLFunction(lib, functions->_gnResetFence, "gnResetFenceFn");
gnLoadDLLFunction(lib, functions->_gnDestroyFence, "gnDestroyFenceFn"); // gnLoadDLLFunction(lib, functions->_gnDestroyFence, "gnDestroyFenceFn");
gnLoadDLLFunction(lib, functions->_gnSubmit, "gnSubmitFn"); // gnLoadDLLFunction(lib, functions->_gnSubmit, "gnSubmitFn");
gnLoadDLLFunction(lib, functions->_gnPresent, "gnPresentFn"); // gnLoadDLLFunction(lib, functions->_gnPresent, "gnPresentFn");
gnLoadDLLFunction(lib, functions->_gnWaitForDevice, "gnWaitForDeviceFn"); // gnLoadDLLFunction(lib, functions->_gnWaitForDevice, "gnWaitForDeviceFn");
} }
void gnLoadCommandFunctions(struct gnDynamicLibrary_t* lib, struct gnCommandFunctions_t* functions) { void gnLoadCommandFunctions(struct gnDynamicLibrary_t* lib, struct gnCommandFunctions_t* functions) {
gnLoadDLLFunction(lib, functions->_gnCommandPoolAllocateCommandBuffers, "gnCommandPoolAllocateCommandBuffersFn"); // gnLoadDLLFunction(lib, functions->_gnCommandPoolAllocateCommandBuffers, "gnCommandPoolAllocateCommandBuffersFn");
gnLoadDLLFunction(lib, functions->_gnBeginCommandBuffer, "gnBeginCommandBufferFn"); // gnLoadDLLFunction(lib, functions->_gnBeginCommandBuffer, "gnBeginCommandBufferFn");
gnLoadDLLFunction(lib, functions->_gnResetCommandBuffer, "gnResetCommandBufferFn"); // gnLoadDLLFunction(lib, functions->_gnResetCommandBuffer, "gnResetCommandBufferFn");
gnLoadDLLFunction(lib, functions->_gnEndCommandBuffer, "gnEndCommandBufferFn"); // gnLoadDLLFunction(lib, functions->_gnEndCommandBuffer, "gnEndCommandBufferFn");
gnLoadDLLFunction(lib, functions->_gnCommandBeginRenderPass, "gnCommandBeginRenderPassFn"); // gnLoadDLLFunction(lib, functions->_gnCommandBeginRenderPass, "gnCommandBeginRenderPassFn");
gnLoadDLLFunction(lib, functions->_gnCommandEndRenderPass, "gnCommandEndRenderPassFn"); // gnLoadDLLFunction(lib, functions->_gnCommandEndRenderPass, "gnCommandEndRenderPassFn");
gnLoadDLLFunction(lib, functions->_gnCommandBindGraphicsPipeline, "gnCommandBindGraphicsPipelineFn"); // gnLoadDLLFunction(lib, functions->_gnCommandBindGraphicsPipeline, "gnCommandBindGraphicsPipelineFn");
gnLoadDLLFunction(lib, functions->_gnCommandSetViewport, "gnCommandSetViewportFn"); // gnLoadDLLFunction(lib, functions->_gnCommandSetViewport, "gnCommandSetViewportFn");
gnLoadDLLFunction(lib, functions->_gnCommandSetScissor, "gnCommandSetScissorFn"); // gnLoadDLLFunction(lib, functions->_gnCommandSetScissor, "gnCommandSetScissorFn");
gnLoadDLLFunction(lib, functions->_gnCommandBindUniform, "gnCommandBindUniformFn"); // gnLoadDLLFunction(lib, functions->_gnCommandBindUniform, "gnCommandBindUniformFn");
gnLoadDLLFunction(lib, functions->_gnCommandBindBuffer, "gnCommandBindBufferFn"); // gnLoadDLLFunction(lib, functions->_gnCommandBindBuffer, "gnCommandBindBufferFn");
gnLoadDLLFunction(lib, functions->_gnCommandPushConstant, "gnCommandPushConstantFn"); // gnLoadDLLFunction(lib, functions->_gnCommandPushConstant, "gnCommandPushConstantFn");
gnLoadDLLFunction(lib, functions->_gnCommandDraw, "gnCommandDrawFn"); // gnLoadDLLFunction(lib, functions->_gnCommandDraw, "gnCommandDrawFn");
gnLoadDLLFunction(lib, functions->_gnCommandDrawIndexed, "gnCommandDrawIndexedFn"); // gnLoadDLLFunction(lib, functions->_gnCommandDrawIndexed, "gnCommandDrawIndexedFn");
} }

View File

@@ -0,0 +1,5 @@
set(CMAKE_EXPORT_COMPILE_COMMANDS on)
project(GryphnLoader)
file(GLOB_RECURSE SOURCE_FILES CONFIGURE_DEPENDS "src/*.c")
add_library(GryphnLoader STATIC ${SOURCE_FILES})

View File

@@ -0,0 +1,5 @@
#include "stdio.h"
void test_loader() {
printf("Loader works %i\n", 32);
}

View File

@@ -0,0 +1,3 @@
#pragma once
void test_loader();

View File

@@ -1,8 +1,6 @@
#ifdef GN_PLATFORM_LINUX #ifdef GN_PLATFORM_LINUX
#include "gryphn_platform_linux.h" #include "gryphn_platform_linux.h"
#include "core/gryphn_rendering_api.h" #include "gryphn_rendering_api.h"
#include "core/instance/init/gryphn_dynamic_library.h"
#include "dlfcn.h"
gnRenderingAPI renderingAPIs[2] = { gnRenderingAPI renderingAPIs[2] = {
GN_RENDERINGAPI_VULKAN, GN_RENDERINGAPI_VULKAN,
@@ -14,19 +12,4 @@ gnRenderingAPI* gnGetSupportedRenderingAPIs(int* count) {
return renderingAPIs; return renderingAPIs;
} }
struct gnDynamicLibrary_t* gnLoadDynamicLibrary(const gnString path) {
struct gnDynamicLibrary_t* dll = malloc(sizeof(struct gnDynamicLibrary_t));
dll->dllPtr = dlopen(gnToCString(gnCombineStrings(path, ".so")), RTLD_LAZY),
dll->isValid = gnTrue;
if (dll->dllPtr == NULL) dll->isValid = gnFalse;
return dll;
}
void* gnLoadFunctionPtr(struct gnDynamicLibrary_t* dll, const char* name) {
if (dll->isValid == gnFalse) return NULL;
return dlsym(dll->dllPtr, name);
}
void gnUnloadDynamicLibrary(struct gnDynamicLibrary_t* dll) {
if (dll->isValid) dlclose(dll->dllPtr);
}
#endif #endif