vk_platform.h revision 65ab552c18df3e94c5d275294a20dd4d20dda119
1//
2// File: vk_platform.h
3//
4/*
5** Copyright (c) 2014-2015 The Khronos Group Inc.
6**
7** Permission is hereby granted, free of charge, to any person obtaining a
8** copy of this software and/or associated documentation files (the
9** "Materials"), to deal in the Materials without restriction, including
10** without limitation the rights to use, copy, modify, merge, publish,
11** distribute, sublicense, and/or sell copies of the Materials, and to
12** permit persons to whom the Materials are furnished to do so, subject to
13** the following conditions:
14**
15** The above copyright notice and this permission notice shall be included
16** in all copies or substantial portions of the Materials.
17**
18** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
22** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
25*/
26
27
28#ifndef __VK_PLATFORM_H__
29#define __VK_PLATFORM_H__
30
31#ifdef __cplusplus
32extern "C"
33{
34#endif // __cplusplus
35
36/*
37***************************************************************************************************
38*   Platform-specific directives and type declarations
39***************************************************************************************************
40*/
41
42#if defined(_WIN32)
43    // On Windows, VKAPI should equate to the __stdcall convention
44    #define VKAPI   __stdcall
45#else
46    // On other platforms, use the default calling convention
47    #define VKAPI
48#endif
49
50#include <stddef.h>
51
52#if !defined(VK_NO_STDINT_H)
53    #if defined(_MSC_VER) && (_MSC_VER < 1600)
54        typedef signed   __int8  int8_t;
55        typedef unsigned __int8  uint8_t;
56        typedef signed   __int16 int16_t;
57        typedef unsigned __int16 uint16_t;
58        typedef signed   __int32 int32_t;
59        typedef unsigned __int32 uint32_t;
60        typedef signed   __int64 int64_t;
61        typedef unsigned __int64 uint64_t;
62    #else
63        #include <stdint.h>
64    #endif
65#endif // !defined(VK_NO_STDINT_H)
66
67#ifdef __cplusplus
68} // extern "C"
69#endif // __cplusplus
70
71// Platform-specific headers required by platform window system extensions.
72// These are enabled prior to #including "vulkan.h". The same enable then
73// controls inclusion of the extension interfaces in vulkan.h.
74
75#ifdef VK_USE_PLATFORM_ANDROID_KHR
76#include <android/native_window.h>
77#endif
78
79#ifdef VK_USE_PLATFORM_MIR_KHR
80#include <mir_toolkit/client_types.h>
81#endif
82
83#ifdef VK_USE_PLATFORM_WAYLAND_KHR
84#include <wayland-client.h>
85#endif
86
87#ifdef VK_USE_PLATFORM_WIN32_KHR
88#include <windows.h>
89#endif
90
91#ifdef VK_USE_PLATFORM_XLIB_KHR
92#include <X11/Xlib.h>
93#endif
94
95#ifdef VK_USE_PLATFORM_XCB_KHR
96#include <xcb/xcb.h>
97#endif
98
99#endif // __VK_PLATFORM_H__
100