Start adding preliminary implementation for vulkan_surface_create

This commit is contained in:
twinaphex 2016-02-19 12:00:52 +01:00
parent 96c9687a8a
commit 1c412eea5a

View File

@ -912,18 +912,18 @@ static bool vulkan_surface_create(gfx_ctx_vulkan_data_t *vk,
case VULKAN_WSI_WAYLAND:
#ifdef HAVE_WAYLAND
{
VkWaylandSurfaceCreateInfoKHR wl_info;
VkWaylandSurfaceCreateInfoKHR surf_info;
memset(&wl_info, 0, sizeof(VkWaylandSurfaceCreateInfoKHR));
memset(&surf_info, 0, sizeof(VkWaylandSurfaceCreateInfoKHR));
wl_info.sType = VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR;
wl_info.pNext = NULL;
wl_info.flags = 0;
wl_info.display = (struct wl_display*)display;
wl_info.surface = (struct wl_surface*)surface;
surf_info.sType = VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR;
surf_info.pNext = NULL;
surf_info.flags = 0;
surf_info.display = (struct wl_display*)display;
surf_info.surface = (struct wl_surface*)surface;
vk->fpCreateWaylandSurfaceKHR(vk->context.instance,
&wl_info, NULL, &vk->vk_surface);
&surf_info, NULL, &vk->vk_surface);
if (!vulkan_create_swapchain(
vk, width, height, swap_interval))
@ -934,6 +934,30 @@ static bool vulkan_surface_create(gfx_ctx_vulkan_data_t *vk,
#else
break;
#endif
case VULKAN_WSI_ANDROID:
#ifdef ANDROID
{
VkAndroidSurfaceCreateInfoKHR surf_info;
memset(&surf_info, 0, sizeof(VkWaylandSurfaceCreateInfoKHR));
surf_info.sType = VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR;
surf_info.flags = 0;
surf_info.window = (ANativeWindow*)surface;
/* TODO - should go through function pointer */
if (vktsCreateAndroidSurfaceKHR(vk->context.instance,
&surf_info, NULL, &vk->vk_surface) != VK_SUCCESS)
return false;
if (!vulkan_create_swapchain(
vk, width, height, swap_interval))
return false;
}
return true;
#else
break;
#endif
case VULKAN_WSI_NONE:
default:
break;