SDL
2.0
|
Go to the source code of this file.
Macros | |
#define | VK_DEFINE_HANDLE(object) typedef struct object##_T* object; |
#define | VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef uint64_t object; |
Typedefs | |
typedef VkInstance | SDL_vulkanInstance |
typedef VkSurfaceKHR | SDL_vulkanSurface |
Functions | |
Vulkan support functions | |
| |
int | SDL_Vulkan_LoadLibrary (const char *path) |
Dynamically load a Vulkan loader library. More... | |
void * | SDL_Vulkan_GetVkGetInstanceProcAddr (void) |
Get the address of the vkGetInstanceProcAddr function. More... | |
void | SDL_Vulkan_UnloadLibrary (void) |
Unload the Vulkan loader library previously loaded by SDL_Vulkan_LoadLibrary() . More... | |
SDL_bool | 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() . More... | |
SDL_bool | SDL_Vulkan_CreateSurface (SDL_Window *window, VkInstance instance, VkSurfaceKHR *surface) |
Create a Vulkan rendering surface for a window. More... | |
void | 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). More... | |
Header file for functions to creating Vulkan surfaces on SDL windows.
Definition in file SDL_vulkan.h.
Definition at line 44 of file SDL_vulkan.h.
Definition at line 49 of file SDL_vulkan.h.
typedef VkInstance SDL_vulkanInstance |
Definition at line 57 of file SDL_vulkan.h.
typedef VkSurfaceKHR SDL_vulkanSurface |
Definition at line 58 of file SDL_vulkan.h.
SDL_bool SDL_Vulkan_CreateSurface | ( | SDL_Window * | window, |
VkInstance | instance, | ||
VkSurfaceKHR * | surface | ||
) |
Create a Vulkan rendering surface for a window.
[in] | window | SDL_Window to which to attach the rendering surface. |
[in] | instance | handle to the Vulkan instance to use. |
[out] | surface | pointer to a VkSurfaceKHR handle to receive the handle of the newly created surface. |
SDL_TRUE
on success, SDL_FALSE
on error.SDL_WINDOW_VULKAN
flag.SDL_Vulkan_CreateSurface()
enabled.Definition at line 4042 of file SDL_video.c.
References CHECK_WINDOW_MAGIC, SDL_Window::flags, NOT_A_VULKAN_WINDOW, SDL_FALSE, SDL_InvalidParamError, SDL_SetError, SDL_WINDOW_VULKAN, and SDL_VideoDevice::Vulkan_CreateSurface.
void 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).
window | SDL_Window from which the drawable size should be queried |
w | Pointer to variable for storing the width in pixels, may be NULL |
h | Pointer 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.
Definition at line 4066 of file SDL_video.c.
References CHECK_WINDOW_MAGIC, SDL_GetWindowSize(), and SDL_VideoDevice::Vulkan_GetDrawableSize.
SDL_bool 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] | window | Window for which the required Vulkan instance extensions should be retrieved |
[in,out] | count | pointer to an unsigned related to the number of required Vulkan instance extensions |
[out] | names | NULL or a pointer to an array to be filled with the required Vulkan instance extensions |
SDL_TRUE
on success, SDL_FALSE
on error.If pNames is NULL
, then the number of required Vulkan instance extensions is returned in pCount. Otherwise, pCount must point to a variable set to the number of elements in the pNames array, and on return the variable is overwritten with the number of names actually written to pNames. If pCount is less than the number of required extensions, at most pCount structures will be written. If pCount is smaller than the number of required extensions, SDL_FALSE
will be returned instead of SDL_TRUE
, to indicate that not all the required extensions were returned.
VK_KHR_surface
and zero or more platform specific extensionswindow
should have been created with the SDL_WINDOW_VULKAN
flag.Get the address of the vkGetInstanceProcAddr
function.
Definition at line 3996 of file SDL_video.c.
References SDL_VideoDevice::loader_loaded, NULL, SDL_SetError, SDL_UninitializedVideo(), SDL_VideoDevice::vkGetInstanceProcAddr, and SDL_VideoDevice::vulkan_config.
int SDL_Vulkan_LoadLibrary | ( | const char * | path | ) |
Dynamically load a Vulkan loader library.
[in] | path | The 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.
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.vulkan.framework/vulkan
, libvulkan.1.dylib
, MoltenVK.framework/MoltenVK
and libMoltenVK.dylib
in that order. On iOS SDL will attempt to load libMoltenVK.dylib
. Applications using a dynamic framework or .dylib must ensure it is included in its application bundle.Definition at line 3972 of file SDL_video.c.
References SDL_VideoDevice::loader_loaded, SDL_VideoDevice::loader_path, retval, SDL_SetError, SDL_strcmp, SDL_UninitializedVideo(), SDL_VideoDevice::vulkan_config, and SDL_VideoDevice::Vulkan_LoadLibrary.
Referenced by SDL_CreateWindow().
Unload the Vulkan loader library previously loaded by SDL_Vulkan_LoadLibrary()
.
Definition at line 4009 of file SDL_video.c.
References SDL_VideoDevice::loader_loaded, SDL_UninitializedVideo(), SDL_VideoDevice::vulkan_config, and SDL_VideoDevice::Vulkan_UnloadLibrary.
Referenced by SDL_DestroyWindow().