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

@@ -1,8 +1,6 @@
#ifdef GN_PLATFORM_LINUX
#include "gryphn_platform_linux.h"
#include "core/gryphn_rendering_api.h"
#include "core/instance/init/gryphn_dynamic_library.h"
#include "dlfcn.h"
#include "gryphn_rendering_api.h"
gnRenderingAPI renderingAPIs[2] = {
GN_RENDERINGAPI_VULKAN,
@@ -14,19 +12,4 @@ gnRenderingAPI* gnGetSupportedRenderingAPIs(int* count) {
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