first commit
This commit is contained in:
20
src/platform/gryphn_platform_include.h
Normal file
20
src/platform/gryphn_platform_include.h
Normal file
@@ -0,0 +1,20 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef GN_PLATFORM_LINUX
|
||||
#include <platform/platform_linux/gryphn_platform_linux.h>
|
||||
#elif GN_PLATFORM_MACOS
|
||||
#include <platform/platform_macos/gryphn_platform_macos.h>
|
||||
#elif GN_PLATFORM_WINDOWS
|
||||
#include <platform/platform_windows/gryphn_platform_windows.h>
|
||||
#endif
|
||||
|
||||
#include <core/gryphn_rendering_api.h>
|
||||
|
||||
std::vector<gnRenderingAPI> gnGetSupportedRenderingAPIS();
|
||||
void* gnPlatformLoadDLL(gnString name);
|
||||
void* gnLoadFunctionPtr(void* dll, gnString name);
|
||||
|
||||
template <typename function>
|
||||
void gnPlatformLoadDLLFunction(void *dll, function& func, gnString name) {
|
||||
func = (function)gnLoadFunctionPtr(dll, name);
|
||||
}
|
0
src/platform/platform_linux/gryphn_platform_linux.h
Normal file
0
src/platform/platform_linux/gryphn_platform_linux.h
Normal file
17
src/platform/platform_macos/gryphn_platform_macos.cpp
Normal file
17
src/platform/platform_macos/gryphn_platform_macos.cpp
Normal file
@@ -0,0 +1,17 @@
|
||||
#ifdef GN_PLATFORM_MACOS
|
||||
#include <platform/platform_macos/gryphn_platform_macos.h>
|
||||
#include <dlfcn.h>
|
||||
|
||||
std::vector<gnRenderingAPI> gnGetSupportedRenderingAPIS() {
|
||||
return { GN_RENDERINGAPI_METAL, GN_RENDERINGAPI_VULKAN };
|
||||
}
|
||||
|
||||
void* gnPlatformLoadDLL(gnString name) {
|
||||
return dlopen(gnToCString(name + ".dylib"), RTLD_LAZY);
|
||||
}
|
||||
|
||||
void* gnLoadFunctionPtr(void *dll, gnString name) {
|
||||
return dlsym(dll, gnToCString(name));
|
||||
}
|
||||
|
||||
#endif
|
5
src/platform/platform_macos/gryphn_platform_macos.h
Normal file
5
src/platform/platform_macos/gryphn_platform_macos.h
Normal file
@@ -0,0 +1,5 @@
|
||||
#pragma once
|
||||
#include <core/gryphn_rendering_api.h>
|
||||
#include <utils/strings/gryphn_string.h>
|
||||
#include <vector>
|
||||
#include <dlfcn.h>
|
Reference in New Issue
Block a user