added WinVulkan.cpp
This commit is contained in:
parent
df80b1af3b
commit
dd047c1644
2
CMCore
2
CMCore
@ -1 +1 @@
|
||||
Subproject commit ca3f7eb55f9e4c1fad44993b70a473f8e3c2ed00
|
||||
Subproject commit b43c236894f0740591d38916411b4bbd83bf351a
|
@ -1 +1 @@
|
||||
Subproject commit fdd40d7c7685c674541279154f0decb3fe156c36
|
||||
Subproject commit 1199a44dd3138eb0e65bf464b5e221c8a405ab80
|
2
CMUtil
2
CMUtil
@ -1 +1 @@
|
||||
Subproject commit f4d19fc898e9434e93f77843975369744e59350a
|
||||
Subproject commit 9ed3f1b6c33a881e8cca30313294f16c44fce368
|
@ -249,8 +249,12 @@ IF(WIN32)
|
||||
IF(FORCE_DISCETE_GPU)
|
||||
SET(RENDER_DEVICE_SOURCE ForceDiscreteGPU.c)
|
||||
ENDIF()
|
||||
|
||||
SET(VK_PLATFORM_SOURCE Vulkan/Platform/WinVulkan.cpp)
|
||||
ENDIF(WIN32)
|
||||
|
||||
SOURCE_GROUP("Vulkan\\Platform" FILES ${VK_PLATFORM_SOURCE})
|
||||
|
||||
SET(VULKAN_RENDER_SOURCE ${VK_RR_SOURCE}
|
||||
${VK_RR_SHADER_FILES}
|
||||
${VK_RR_MATERIAL_FILES}
|
||||
@ -270,7 +274,8 @@ SET(VULKAN_RENDER_SOURCE ${VK_RR_SOURCE}
|
||||
#${VK_RENDER_CONTEXT_SOURCE}
|
||||
${VK_CMD_BUFFER_SOURCE}
|
||||
${VK_RENDERABLE_SOURCE}
|
||||
${VK_RENDER_DEVICE_SOURCE})
|
||||
${VK_RENDER_DEVICE_SOURCE}
|
||||
${VK_PLATFORM_SOURCE})
|
||||
|
||||
add_cm_library(ULRE.SceneGraph "ULRE" ${SCENE_GRAPH_HEADER}
|
||||
${SCENE_GRAPH_SOURCE}
|
||||
|
30
src/SceneGraph/Vulkan/platform/WinVulkan.cpp
Normal file
30
src/SceneGraph/Vulkan/platform/WinVulkan.cpp
Normal file
@ -0,0 +1,30 @@
|
||||
#include<hgl/platform/Vulkan.h>
|
||||
#include<hgl/platform/WinWindow.h>
|
||||
#include<vulkan/vulkan_win32.h>
|
||||
|
||||
namespace hgl
|
||||
{
|
||||
VkSurfaceKHR CreateVulkanSurface(VkInstance vk_inst,Window *w)
|
||||
{
|
||||
if(vk_inst==VK_NULL_HANDLE)return(VK_NULL_HANDLE);
|
||||
if(!w)return(VK_NULL_HANDLE);
|
||||
|
||||
WinWindow *win=(WinWindow *)w;
|
||||
|
||||
VkWin32SurfaceCreateInfoKHR createInfo;
|
||||
createInfo.sType =VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR;
|
||||
createInfo.pNext =nullptr;
|
||||
createInfo.flags =0;
|
||||
createInfo.hinstance=win->GetInstance();
|
||||
createInfo.hwnd =win->GetWnd();
|
||||
|
||||
VkSurfaceKHR surface;
|
||||
|
||||
VkResult res=vkCreateWin32SurfaceKHR(vk_inst,&createInfo,nullptr,&surface);
|
||||
|
||||
if(res!=VK_SUCCESS)
|
||||
return(VK_NULL_HANDLE);
|
||||
|
||||
return(surface);
|
||||
}
|
||||
}//namespace hgl
|
Loading…
x
Reference in New Issue
Block a user