World of Might and Magic  0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
Файл SDL_vulkan.h

См. исходные тексты.

Определения типов

typedef VkSurfaceKHR SDL_vulkanSurface
 

Функции

 VK_DEFINE_HANDLE (VkInstance) VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSurfaceKHR) typedef VkInstance SDL_vulkanInstance
 
Vulkan support functions
Заметки
SDL_Vulkan_GetInstanceExtensions & SDL_Vulkan_CreateSurface API is compatable with Tizen's implementation of Vulkan in SDL.
DECLSPEC int SDLCALL SDL_Vulkan_LoadLibrary (const char *path)
 Dynamically load a Vulkan loader library. Подробнее...
 
DECLSPEC void *SDLCALL SDL_Vulkan_GetVkGetInstanceProcAddr (void)
 Get the address of the vkGetInstanceProcAddr function. Подробнее...
 
DECLSPEC void SDLCALL SDL_Vulkan_UnloadLibrary (void)
 Unload the Vulkan loader library previously loaded by SDL_Vulkan_LoadLibrary(). Подробнее...
 
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_CreateSurface(). Подробнее...
 
DECLSPEC SDL_bool SDLCALL SDL_Vulkan_CreateSurface (SDL_Window *window, VkInstance instance, VkSurfaceKHR *surface)
 Create a Vulkan rendering surface for a window. Подробнее...
 
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, scissor & etc). Подробнее...
 

Подробное описание

Header file for functions to creating Vulkan surfaces on SDL windows.

См. определение в файле SDL_vulkan.h

Типы

◆ SDL_vulkanSurface

typedef VkSurfaceKHR SDL_vulkanSurface

См. определение в файле SDL_vulkan.h строка 58

Функции

◆ VK_DEFINE_HANDLE()

VK_DEFINE_HANDLE ( VkInstance  )

◆ SDL_Vulkan_LoadLibrary()

DECLSPEC int SDLCALL SDL_Vulkan_LoadLibrary ( const char *  path)

Dynamically load a Vulkan loader library.

Аргументы
[in]pathThe platform dependent Vulkan loader library name, or NULL.
Возвращает
0 on success, or -1 if the library couldn't be loaded.

If path is NULL SDL will use the value of the environment variable SDL_VULKAN_LIBRARY, if set, otherwise it loads the default Vulkan loader library.

This should be called after initializing the video driver, but before creating any Vulkan windows. If no Vulkan loader library is loaded, the default library will be loaded upon creation of the first Vulkan window.

Заметки
It is fairly common for Vulkan applications to link with libvulkan instead of explicitly loading it at run time. This will work with SDL provided the application links to a dynamic library and both it and SDL use the same search path.
If you specify a non-NULL path, an application should retrieve all of the Vulkan functions it uses from the dynamic library using SDL_Vulkan_GetVkGetInstanceProcAddr() unless you can guarantee path points to the same vulkan loader library the application linked to.
On Apple devices, if path is NULL, SDL will attempt to find the vkGetInstanceProcAddr address within all the mach-o images of the current process. This is because it is fairly common for Vulkan applications to link with libvulkan (and historically MoltenVK was provided as a static library). If it is not found then, on macOS, SDL will attempt to load vulkan.framework/vulkan, libvulkan.1.dylib, followed by libvulkan.dylib, in that order. On iOS SDL will attempt to load libvulkan.dylib only. Applications using a dynamic framework or .dylib must ensure it is included in its application bundle.
On non-Apple devices, application linking with a static libvulkan is not supported. Either do not link to the Vulkan loader or link to a dynamic library version.
This function will fail if there are no working Vulkan drivers installed.
См. также
SDL_Vulkan_GetVkGetInstanceProcAddr()
SDL_Vulkan_UnloadLibrary()

◆ SDL_Vulkan_GetVkGetInstanceProcAddr()

DECLSPEC void* SDLCALL SDL_Vulkan_GetVkGetInstanceProcAddr ( void  )

Get the address of the vkGetInstanceProcAddr function.

Заметки
This should be called after either calling SDL_Vulkan_LoadLibrary or creating an SDL_Window with the SDL_WINDOW_VULKAN flag.

◆ SDL_Vulkan_UnloadLibrary()

DECLSPEC void SDLCALL SDL_Vulkan_UnloadLibrary ( void  )

Unload the Vulkan loader library previously loaded by SDL_Vulkan_LoadLibrary().

См. также
SDL_Vulkan_LoadLibrary()

◆ 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_CreateSurface().

Аргументы
[in]

◆ 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.

Аргументы
[in]windowSDL_Window to which to attach the rendering surface.
[in]instancehandle to the Vulkan instance to use.
[out]surfacepointer to a VkSurfaceKHR handle to receive the handle of the newly created surface.
Возвращает
SDL_TRUE on success, SDL_FALSE on error.
VkInstance instance;
// create instance and window
// create the Vulkan surface
VkSurfaceKHR surface;
handle_error();
Заметки
window should have been created with the SDL_WINDOW_VULKAN flag.
instance should have been created with the extensions returned by SDL_Vulkan_CreateSurface() enabled.
См. также
SDL_Vulkan_GetInstanceExtensions()

◆ 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, scissor & etc).

Аргументы
windowSDL_Window from which the drawable size should be queried
wPointer to variable for storing the width in pixels, may be NULL
hPointer to variable for storing the height in pixels, may be NULL

This may differ from SDL_GetWindowSize() if we're rendering to a high-DPI drawable, i.e. the window was created with SDL_WINDOW_ALLOW_HIGHDPI on a platform with high-DPI support (Apple calls this "Retina"), and not disabled by the SDL_HINT_VIDEO_HIGHDPI_DISABLED hint.

Заметки
On macOS high-DPI support must be enabled for an application by setting NSHighResolutionCapable to true in its Info.plist.
См. также
SDL_GetWindowSize()
SDL_CreateWindow()
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.
surface
EGLSurface surface
Definition: SDL_egl.h:992
window
EGLSurface EGLNativeWindowType * window
Definition: SDL_egl.h:1580
SDL_Window
struct SDL_Window SDL_Window
The type used to identify a window.
Definition: SDL_video.h:90