arsa  2.7
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
36 extern "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 
52 VK_DEFINE_HANDLE(VkInstance)
54 
55 #endif /* !NO_SDL_VULKAN_TYPEDEFS */
56 
57 typedef VkInstance SDL_vulkanInstance;
58 typedef VkSurfaceKHR SDL_vulkanSurface; /* for compatibility with Tizen */
59 
66 /* @{ */
67 
116 extern DECLSPEC int SDLCALL SDL_Vulkan_LoadLibrary(const char *path);
117 
125 
132 extern DECLSPEC void SDLCALL SDL_Vulkan_UnloadLibrary(void);
133 
208  SDL_Window *window,
209  unsigned int *pCount,
210  const char **pNames);
211 
242  SDL_Window *window,
243  VkInstance instance,
244  VkSurfaceKHR* surface);
245 
268  int *w, int *h);
269 
270 /* @} *//* Vulkan support functions */
271 
272 /* Ends C function definitions when using C++ */
273 #ifdef __cplusplus
274 }
275 #endif
276 #include "close_code.h"
277 
278 #endif /* SDL_vulkan_h_ */
DECLSPEC int SDLCALL SDL_Vulkan_LoadLibrary(const char *path)
Dynamically load a Vulkan loader library.
SDL_bool
Definition: SDL_stdinc.h:161
VkSurfaceKHR SDL_vulkanSurface
Definition: SDL_vulkan.h:58
#define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object)
Definition: SDL_vulkan.h:49
GLfloat GLfloat GLfloat GLfloat h
#define DECLSPEC
Definition: begin_code.h:74
#define SDLCALL
Definition: begin_code.h:89
DECLSPEC void SDLCALL SDL_Vulkan_GetDrawableSize(SDL_Window *window, int *w, int *h)
Get the size of a window's underlying drawable in pixels (for use with setting viewport,...
#define VK_DEFINE_HANDLE(object)
Definition: SDL_vulkan.h:44
DECLSPEC void *SDLCALL SDL_Vulkan_GetVkGetInstanceProcAddr(void)
Get the address of the vkGetInstanceProcAddr function.
VkInstance SDL_vulkanInstance
Definition: SDL_vulkan.h:57
DECLSPEC SDL_bool SDLCALL SDL_Vulkan_CreateSurface(SDL_Window *window, VkInstance instance, VkSurfaceKHR *surface)
Create a Vulkan rendering surface for a window.
struct SDL_Window SDL_Window
The type used to identify a window.
Definition: SDL_video.h:90
DECLSPEC void SDLCALL SDL_Vulkan_UnloadLibrary(void)
Unload the Vulkan loader library previously loaded by SDL_Vulkan_LoadLibrary().
GLsizei const GLchar *const * path
GLubyte GLubyte GLubyte GLubyte w
DECLSPEC SDL_bool SDLCALL SDL_Vulkan_GetInstanceExtensions(SDL_Window *window, unsigned int *pCount, const char **pNames)
Get the names of the Vulkan instance extensions needed to create a surface with SDL_Vulkan_CreateSurf...