My Project
Loading...
Searching...
No Matches
SDL_vulkan.h
Go to the documentation of this file.
1/*
2 Simple DirectMedia Layer
3 Copyright (C) 2017, Mark Callow
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20*/
21
28#ifndef SDL_vulkan_h_
29#define SDL_vulkan_h_
30
31#include "SDL_video.h"
32
33#include "begin_code.h"
34/* Set up for C function definitions, even when using C++ */
35#ifdef __cplusplus
36extern "C" {
37#endif
38
39/* Avoid including vulkan.h, don't define VkInstance if it's already included */
40#ifdef VULKAN_H_
41#define NO_SDL_VULKAN_TYPEDEFS
42#endif
43#ifndef NO_SDL_VULKAN_TYPEDEFS
44#define VK_DEFINE_HANDLE(object) typedef struct object##_T* object;
45
46#if defined(__LP64__) || defined(_WIN64) || defined(__x86_64__) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__)
47#define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef struct object##_T *object;
48#else
49#define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef uint64_t object;
50#endif
51
52VK_DEFINE_HANDLE(VkInstance)
53VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSurfaceKHR)
54
55#endif /* !NO_SDL_VULKAN_TYPEDEFS */
56
57typedef VkInstance SDL_vulkanInstance;
58typedef VkSurfaceKHR SDL_vulkanSurface; /* for compatibility with Tizen */
59
66/* @{ */
67
109extern DECLSPEC int SDLCALL SDL_Vulkan_LoadLibrary(const char *path);
110
121extern DECLSPEC void *SDLCALL SDL_Vulkan_GetVkGetInstanceProcAddr(void);
122
130extern DECLSPEC void SDLCALL SDL_Vulkan_UnloadLibrary(void);
131
160extern DECLSPEC SDL_bool SDLCALL SDL_Vulkan_GetInstanceExtensions(SDL_Window *window,
161 unsigned int *pCount,
162 const char **pNames);
163
182extern DECLSPEC SDL_bool SDLCALL SDL_Vulkan_CreateSurface(SDL_Window *window,
183 VkInstance instance,
184 VkSurfaceKHR* surface);
185
204extern DECLSPEC void SDLCALL SDL_Vulkan_GetDrawableSize(SDL_Window * window,
205 int *w, int *h);
206
207/* @} *//* Vulkan support functions */
208
209/* Ends C function definitions when using C++ */
210#ifdef __cplusplus
211}
212#endif
213#include "close_code.h"
214
215#endif /* SDL_vulkan_h_ */
struct SDL_Window SDL_Window
The type used to identify a window.
Definition: SDL_video.h:95
DECLSPEC SDL_bool SDLCALL SDL_Vulkan_CreateSurface(SDL_Window *window, VkInstance instance, VkSurfaceKHR *surface)
DECLSPEC void SDLCALL SDL_Vulkan_GetDrawableSize(SDL_Window *window, int *w, int *h)
DECLSPEC SDL_bool SDLCALL SDL_Vulkan_GetInstanceExtensions(SDL_Window *window, unsigned int *pCount, const char **pNames)
DECLSPEC void SDLCALL SDL_Vulkan_UnloadLibrary(void)
DECLSPEC int SDLCALL SDL_Vulkan_LoadLibrary(const char *path)
DECLSPEC void *SDLCALL SDL_Vulkan_GetVkGetInstanceProcAddr(void)