2020-06-16 12:46:07 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#define VK_NO_PROTOTYPES
|
|
|
|
|
|
|
|
#if defined(WIN32)
|
|
|
|
|
|
|
|
#define VK_USE_PLATFORM_WIN32_KHR
|
|
|
|
|
|
|
|
// vulkan.h pulls in windows.h on Windows, so we need to include our replacement header first
|
2022-07-08 11:49:27 +00:00
|
|
|
#include "../windows_headers.h"
|
2020-06-16 12:46:07 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2022-07-08 11:49:27 +00:00
|
|
|
#if defined(USE_X11)
|
2020-06-16 12:46:07 +00:00
|
|
|
#define VK_USE_PLATFORM_XLIB_KHR
|
|
|
|
#endif
|
|
|
|
|
2022-07-08 11:49:27 +00:00
|
|
|
#if defined(USE_WAYLAND)
|
2020-09-23 10:19:50 +00:00
|
|
|
#define VK_USE_PLATFORM_WAYLAND_KHR
|
|
|
|
#endif
|
|
|
|
|
2020-06-16 12:46:07 +00:00
|
|
|
#if defined(ANDROID)
|
|
|
|
#define VK_USE_PLATFORM_ANDROID_KHR
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(__APPLE__)
|
2020-06-22 05:58:07 +00:00
|
|
|
// #define VK_USE_PLATFORM_MACOS_MVK
|
|
|
|
#define VK_USE_PLATFORM_METAL_EXT
|
2020-06-16 12:46:07 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "vulkan/vulkan.h"
|
|
|
|
|
|
|
|
// Currently, exclusive fullscreen is only supported on Windows.
|
|
|
|
#if defined(WIN32)
|
|
|
|
#define SUPPORTS_VULKAN_EXCLUSIVE_FULLSCREEN 1
|
|
|
|
#endif
|
|
|
|
|
2022-07-08 11:49:27 +00:00
|
|
|
#if defined(USE_X11)
|
2020-06-16 12:46:07 +00:00
|
|
|
|
|
|
|
// This breaks a bunch of our code. They shouldn't be #defines in the first place.
|
|
|
|
#ifdef None
|
|
|
|
#undef None
|
|
|
|
#endif
|
|
|
|
#ifdef Status
|
|
|
|
#undef Status
|
|
|
|
#endif
|
2020-06-29 17:03:27 +00:00
|
|
|
#ifdef CursorShape
|
|
|
|
#undef CursorShape
|
|
|
|
#endif
|
|
|
|
#ifdef KeyPress
|
|
|
|
#undef KeyPress
|
|
|
|
#endif
|
|
|
|
#ifdef KeyRelease
|
|
|
|
#undef KeyRelease
|
|
|
|
#endif
|
|
|
|
#ifdef FocusIn
|
|
|
|
#undef FocusIn
|
|
|
|
#endif
|
|
|
|
#ifdef FocusOut
|
|
|
|
#undef FocusOut
|
|
|
|
#endif
|
|
|
|
#ifdef FontChange
|
|
|
|
#undef FontChange
|
|
|
|
#endif
|
|
|
|
#ifdef Expose
|
|
|
|
#undef Expose
|
|
|
|
#endif
|
2020-09-09 15:29:22 +00:00
|
|
|
#ifdef Unsorted
|
|
|
|
#undef Unsorted
|
|
|
|
#endif
|
2020-09-13 02:40:32 +00:00
|
|
|
#ifdef Bool
|
|
|
|
#undef Bool
|
|
|
|
#endif
|
2020-06-16 12:46:07 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2022-07-08 11:49:27 +00:00
|
|
|
#include "entry_points.h"
|
2020-06-16 12:46:07 +00:00
|
|
|
|
2022-09-26 10:44:23 +00:00
|
|
|
// We include vk_mem_alloc globally, so we don't accidentally include it before the vulkan header somewhere.
|
|
|
|
#if defined(__clang__)
|
|
|
|
#pragma clang diagnostic push
|
|
|
|
#pragma clang diagnostic ignored "-Wnullability-completeness"
|
|
|
|
#elif defined(_MSC_VER)
|
|
|
|
#pragma warning(push, 0)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define VMA_STATIC_VULKAN_FUNCTIONS 1
|
|
|
|
#define VMA_DYNAMIC_VULKAN_FUNCTIONS 0
|
|
|
|
#define VMA_STATS_STRING_ENABLED 0
|
|
|
|
#include "vulkan/vk_mem_alloc.h"
|
|
|
|
|
|
|
|
#if defined(__clang__)
|
|
|
|
#pragma clang diagnostic pop
|
|
|
|
#elif defined(_MSC_VER)
|
|
|
|
#pragma warning(pop)
|
|
|
|
#endif
|
|
|
|
|
2020-06-16 12:46:07 +00:00
|
|
|
namespace Vulkan {
|
|
|
|
|
|
|
|
bool LoadVulkanLibrary();
|
|
|
|
bool LoadVulkanInstanceFunctions(VkInstance instance);
|
|
|
|
bool LoadVulkanDeviceFunctions(VkDevice device);
|
|
|
|
void UnloadVulkanLibrary();
|
2020-07-04 10:06:04 +00:00
|
|
|
void ResetVulkanLibraryFunctionPointers();
|
2020-06-16 12:46:07 +00:00
|
|
|
|
|
|
|
} // namespace Vulkan
|