Add SDL_Vulkan_DestroySurface functionality (#9817)

Added SDL_Vulkan_DestroySurface, its documentation and corresponding platform specific implementations. Fixed some header inclusion orders to improve consistency between platforms. Added TODOs regarding MetalView creation and destruction which will benefit from the new functionality.
This commit is contained in:
Ali Emre Gülcü authored and GitHub committed 2024-05-16 17:41:15 -07:00
1 parent a69eaae32e
commit f17b556c76
32 files changed
+211 -13

No files matched your search

+1
View File
@@ -137,6 +137,7 @@ static SDL_VideoDevice *Android_CreateDevice(void)
device->Vulkan_UnloadLibrary = Android_Vulkan_UnloadLibrary;
device->Vulkan_GetInstanceExtensions = Android_Vulkan_GetInstanceExtensions;
device->Vulkan_CreateSurface = Android_Vulkan_CreateSurface;
device->Vulkan_DestroySurface = Android_Vulkan_DestroySurface;
#endif
/* Screensaver */
+10
View File
@@ -162,4 +162,14 @@ SDL_bool Android_Vulkan_CreateSurface(SDL_VideoDevice *_this,
return SDL_TRUE;
}
void Android_Vulkan_DestroySurface(SDL_VideoDevice *_this,
VkInstance instance,
VkSurfaceKHR surface,
const struct VkAllocationCallbacks *allocator)
{
if (_this->vulkan_config.loader_handle) {
SDL_Vulkan_DestroySurface_Internal(_this->vulkan_config.vkGetInstanceProcAddr, instance, surface, allocator);
}
}
#endif
+5 -1
View File
@@ -37,12 +37,16 @@
int Android_Vulkan_LoadLibrary(SDL_VideoDevice *_this, const char *path);
void Android_Vulkan_UnloadLibrary(SDL_VideoDevice *_this);
char const* const* Android_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this,
Uint32 *count);
Uint32 *count);
SDL_bool Android_Vulkan_CreateSurface(SDL_VideoDevice *_this,
SDL_Window *window,
VkInstance instance,
const struct VkAllocationCallbacks *allocator,
VkSurfaceKHR *surface);
void Android_Vulkan_DestroySurface(SDL_VideoDevice *_this,
VkInstance instance,
VkSurfaceKHR surface,
const struct VkAllocationCallbacks *allocator);
#endif