Skip to content
Permalink
Browse files

[Graphics] Update SharpVulkan (works on OSX and easier to access Nati…

…veHandle)
  • Loading branch information
xen2 committed Jan 14, 2019
1 parent 6e12e80 commit 6522836725d9d693634c074969b958f61188442e
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
@@ -0,0 +1,38 @@
@echo off

if "%1" == "" (
echo Missing Debug or Release argument
EXIT /B 1
)

pushd ..\..\externals\SharpVulkan\Source\SharpVulkan

REM SDL2-CS
call "%PROGRAMFILES(X86)%\Microsoft Visual Studio\2017\Community\Common7\Tools\VsMSBuildCmd.bat"
msbuild /p:Configuration="%1" /p:SharpVulkanPlatformDefine=PLATFORM_WINDOWS /p:SharpVulkanPlatformName=Windows SharpVulkan.csproj /restore
if %ERRORLEVEL% neq 0 (
echo Error during compilation
popd
EXIT /B %ERRORLEVEL%
)

msbuild /p:Configuration="%1" /p:SharpVulkanPlatformDefine=PLATFORM_MACOS /p:SharpVulkanPlatformName=macOS SharpVulkan.csproj /restore
if %ERRORLEVEL% neq 0 (
echo Error during compilation
popd
EXIT /B %ERRORLEVEL%
)

msbuild /p:Configuration="%1" /p:SharpVulkanPlatformName=Other SharpVulkan.csproj /restore
if %ERRORLEVEL% neq 0 (
echo Error during compilation
popd
EXIT /B %ERRORLEVEL%
)

popd

rem Copying assemblies
copy ..\..\externals\SharpVulkan\Source\SharpVulkan\bin\%1\Windows\*.* Windows
copy ..\..\externals\SharpVulkan\Source\SharpVulkan\bin\%1\macOS\*.* macOS
copy ..\..\externals\SharpVulkan\Source\SharpVulkan\bin\%1\Other\*.* Other
@@ -0,0 +1,8 @@
CALL ..\find_git.cmd
IF NOT ERRORLEVEL 0 (
ECHO "Could not find git.exe"
EXIT /B %ERRORLEVEL%
)
%GIT_CMD% clone https://github.com/xenko3d/SharpVulkan ../../externals/SharpVulkan
IF NOT ERRORLEVEL 0 PAUSE

Git LFS file not shown
Git LFS file not shown
@@ -351,11 +351,8 @@ private unsafe void CreateSurface()
// Create surface
#if XENKO_UI_SDL
var control = Description.DeviceWindowHandle.NativeWindow as SDL.Window;
IntPtr surfacePtr;
var instance = GraphicsDevice.NativeInstance;
Console.WriteLine($"{Description.DeviceWindowHandle.Handle} {control.SdlHandle} {instance}");
SDL2.SDL.SDL_Vulkan_CreateSurface(control.SdlHandle, *((IntPtr*)&instance), out surfacePtr);
surface = *((Surface*)&surfacePtr);
SDL2.SDL.SDL_Vulkan_CreateSurface(control.SdlHandle, GraphicsDevice.NativeInstance.NativeHandle, out IntPtr surfacePtr);
surface = new Surface(surfacePtr);
#elif XENKO_PLATFORM_WINDOWS
var controlHandle = Description.DeviceWindowHandle.Handle;
if (controlHandle == IntPtr.Zero)
@@ -24,11 +24,11 @@
<Choose>
<When Condition=" '$(XenkoGraphicsApi)' == 'Vulkan' ">
<Choose>
<When Condition=" '$(XenkoPlatform)' == 'Windows'">
<When Condition=" '$(XenkoPlatform)' == 'Windows' Or '$(XenkoPlatform)' == 'macOS' ">
<ItemGroup>
<Reference Include="SharpVulkan">
<SpecificVersion>False</SpecificVersion>
<HintPath>$(XenkoDependenciesDir)\SharpVulkan\Windows\SharpVulkan.dll</HintPath>
<HintPath>$(XenkoDependenciesDir)\SharpVulkan\$(XenkoPlatform)\SharpVulkan.dll</HintPath>
</Reference>
</ItemGroup>
</When>

0 comments on commit 6522836

Please sign in to comment.
You can’t perform that action at this time.