-
-
Notifications
You must be signed in to change notification settings - Fork 16
/
VulkanEnvironment.h
77 lines (66 loc) · 2.17 KB
/
VulkanEnvironment.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
// vulkan.h header global settings
// Should be included as soon as possible (first line in translation unit preferably)
#ifndef COMMON_VULKAN_ENVIRONMENT_H
#define COMMON_VULKAN_ENVIRONMENT_H
// detect premature vulkan.h
#ifdef VULKAN_H_
#error "vulkan.h is included before VulkanEnvironment.h!"
#endif //VULKAN_H_
#include "CompilerMessages.h"
#define REQUIRED_HEADER_VERSION 121
#ifdef NDEBUG
#ifndef VULKAN_VALIDATION
#define VULKAN_VALIDATION 0
#endif
#else
#ifndef VULKAN_VALIDATION
#define VULKAN_VALIDATION 1
#endif
#endif
#if defined(USE_PLATFORM_NONE) \
|| defined(USE_PLATFORM_GLFW) \
|| defined(VK_USE_PLATFORM_ANDROID_KHR) \
|| defined(VK_USE_PLATFORM_MIR_KHR) \
|| defined(VK_USE_PLATFORM_WAYLAND_KHR) \
|| defined(VK_USE_PLATFORM_WIN32_KHR) \
|| defined(VK_USE_PLATFORM_XCB_KHR) \
|| defined(VK_USE_PLATFORM_XLIB_KHR) \
|| defined(VK_USE_PLATFORM_IOS_MVK) \
|| defined(VK_USE_PLATFORM_MACOS_MVK) \
|| defined(VK_USE_PLATFORM_VI_NN)
#define WSI_CHOSEN_EXTERNALLY
#endif
#if defined(_WIN32) && !defined(_CONSOLE)
#include "LeanWindowsEnvironment.h"
#include <Windows.h>
#endif
// platform specific settings
#if defined(__CYGWIN__)
#ifndef WSI_CHOSEN_EXTERNALLY
#define USE_PLATFORM_GLFW
//#define VK_USE_PLATFORM_WIN32_KHR
#endif
#include "LeanWindowsEnvironment.h" // Windows.h settings must be first -- vulkan.h does include Windows.h
#elif defined(__MINGW32__)
#ifndef WSI_CHOSEN_EXTERNALLY
#define USE_PLATFORM_GLFW
//#define VK_USE_PLATFORM_WIN32_KHR
#endif
#include "LeanWindowsEnvironment.h" // Windows.h settings must be first -- vulkan.h does include Windows.h
#elif defined(_WIN32)
#ifndef WSI_CHOSEN_EXTERNALLY
#define USE_PLATFORM_GLFW
//#define VK_USE_PLATFORM_WIN32_KHR
#endif
#elif defined(__linux__)
#ifndef WSI_CHOSEN_EXTERNALLY
#define USE_PLATFORM_GLFW
//#define VK_USE_PLATFORM_XCB_KHR
//#define VK_USE_PLATFORM_XLIB_KHR
//#define VK_USE_PLATFORM_WAYLAND_KHR
#endif
#else
//#error "Unsupported OS platform." // caught in main.cpp instead
#endif
TODO( "Add other (all would be awesome) platforms" )
#endif //COMMON_VULKAN_ENVIRONMENT_H