mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 13:03:36 +00:00
Add windows support to vulkan_wrapper
Signed-off-by: Osyotr <Osyotr@users.noreply.github.com>
This commit is contained in:
committed by
Konstantin Pastbin
parent
7e5e6ec78e
commit
5158ceb311
@@ -19,7 +19,18 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
#include "vulkan_wrapper.h"
|
||||
|
||||
#if defined(_WIN32)
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
#ifndef NOMINMAX
|
||||
#define NOMINMAX
|
||||
#endif
|
||||
#include <windows.h>
|
||||
#else
|
||||
#include <dlfcn.h>
|
||||
#endif
|
||||
|
||||
int InitVulkan(void) {
|
||||
#if defined(__APPLE__)
|
||||
@@ -30,6 +41,9 @@ int InitVulkan(void) {
|
||||
if (!libvulkan) {
|
||||
libvulkan = dlopen("libMoltenVK.dylib", RTLD_NOW | RTLD_LOCAL);
|
||||
}
|
||||
#elif defined( _WIN32 )
|
||||
HMODULE libvulkan = LoadLibraryA("vulkan-1.dll");
|
||||
auto dlsym = [](HMODULE h, char const * name) { return GetProcAddress(h, name); };
|
||||
#else
|
||||
void* libvulkan = dlopen("libvulkan.so.1", RTLD_NOW | RTLD_LOCAL);
|
||||
if (!libvulkan) {
|
||||
|
||||
Reference in New Issue
Block a user