World of Might and Magic  0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
SDL_vulkan.h
См. документацию.
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)
53 VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSurfaceKHR)
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 
124 extern DECLSPEC void *SDLCALL SDL_Vulkan_GetVkGetInstanceProcAddr(void);
125 
132 extern DECLSPEC void SDLCALL SDL_Vulkan_UnloadLibrary(void);
133 
207 extern DECLSPEC SDL_bool SDLCALL SDL_Vulkan_GetInstanceExtensions(
209  unsigned int *pCount,
210  const char **pNames);
211 
241 extern DECLSPEC SDL_bool SDLCALL SDL_Vulkan_CreateSurface(
243  VkInstance instance,
244  VkSurfaceKHR* surface);
245 
267 extern DECLSPEC void SDLCALL SDL_Vulkan_GetDrawableSize(SDL_Window * window,
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_ */
SDL_Vulkan_GetDrawableSize
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,...
SDL_Vulkan_CreateSurface
DECLSPEC SDL_bool SDLCALL SDL_Vulkan_CreateSurface(SDL_Window *window, VkInstance instance, VkSurfaceKHR *surface)
Create a Vulkan rendering surface for a window.
w
GLubyte GLubyte GLubyte GLubyte w
Definition: SDL_opengl_glext.h:734
path
GLsizei const GLchar *const * path
Definition: SDL_opengl_glext.h:3733
h
GLfloat GLfloat GLfloat GLfloat h
Definition: SDL_opengl_glext.h:1949
close_code.h
begin_code.h
SDL_vulkanSurface
VkSurfaceKHR SDL_vulkanSurface
Definition: SDL_vulkan.h:58
SDL_Vulkan_GetInstanceExtensions
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...
surface
EGLSurface surface
Definition: SDL_egl.h:992
window
EGLSurface EGLNativeWindowType * window
Definition: SDL_egl.h:1580
SDL_bool
SDL_bool
Definition: SDL_stdinc.h:161
SDL_Window
struct SDL_Window SDL_Window
The type used to identify a window.
Definition: SDL_video.h:90
SDL_video.h
VK_DEFINE_HANDLE
VK_DEFINE_HANDLE(VkInstance) VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSurfaceKHR) typedef VkInstance SDL_vulkanInstance
SDL_Vulkan_GetVkGetInstanceProcAddr
DECLSPEC void *SDLCALL SDL_Vulkan_GetVkGetInstanceProcAddr(void)
Get the address of the vkGetInstanceProcAddr function.
SDL_Vulkan_LoadLibrary
DECLSPEC int SDLCALL SDL_Vulkan_LoadLibrary(const char *path)
Dynamically load a Vulkan loader library.
SDL_Vulkan_UnloadLibrary
DECLSPEC void SDLCALL SDL_Vulkan_UnloadLibrary(void)
Unload the Vulkan loader library previously loaded by SDL_Vulkan_LoadLibrary().