mirror of
https://github.com/amerkoleci/Vortice.Win32.git
synced 2026-01-14 16:16:04 +08:00
New separated Direct2D bindings.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
|
||||
<EnablePreviewFeatures>true</EnablePreviewFeatures>
|
||||
|
||||
<VersionPrefix>1.7.3</VersionPrefix>
|
||||
<VersionPrefix>1.7.4</VersionPrefix>
|
||||
<VersionSuffix Condition="'$(VersionSuffix)' == ''"></VersionSuffix>
|
||||
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
|
||||
@@ -30,6 +30,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Vortice.Win32.Direct3D11on1
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Vortice.Win32.Dxc", "src\Vortice.Win32.Dxc\Vortice.Win32.Dxc.csproj", "{DF5C7A6F-8E17-41EC-A7F1-9FE03ACD75F3}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Vortice.Win32.Direct2D", "src\Vortice.Win32.Direct2D\Vortice.Win32.Direct2D.csproj", "{942D599C-CDAC-479A-825E-1B7B84DE1328}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -64,6 +66,10 @@ Global
|
||||
{DF5C7A6F-8E17-41EC-A7F1-9FE03ACD75F3}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{DF5C7A6F-8E17-41EC-A7F1-9FE03ACD75F3}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{DF5C7A6F-8E17-41EC-A7F1-9FE03ACD75F3}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{942D599C-CDAC-479A-825E-1B7B84DE1328}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{942D599C-CDAC-479A-825E-1B7B84DE1328}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{942D599C-CDAC-479A-825E-1B7B84DE1328}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{942D599C-CDAC-479A-825E-1B7B84DE1328}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -1041,6 +1041,7 @@ public static class Program
|
||||
string d3d11Path = Path.Combine(new DirectoryInfo(repoRoot).Parent.FullName, "Vortice.Win32.Direct3D11");
|
||||
string d3d12Path = Path.Combine(new DirectoryInfo(repoRoot).Parent.FullName, "Vortice.Win32.Direct3D12");
|
||||
string d3d11on12Path = Path.Combine(new DirectoryInfo(repoRoot).Parent.FullName, "Vortice.Win32.Direct3D11on12");
|
||||
string d2dPath = Path.Combine(new DirectoryInfo(repoRoot).Parent.FullName, "Vortice.Win32.Direct2D");
|
||||
string dxcPath = Path.Combine(new DirectoryInfo(repoRoot).Parent.FullName, "Vortice.Win32.Dxc");
|
||||
|
||||
// Generate docs
|
||||
@@ -1061,6 +1062,8 @@ public static class Program
|
||||
|
||||
string outputPath = repoRoot;
|
||||
bool useSubFolders = true;
|
||||
bool cleanFolder = true;
|
||||
|
||||
if (jsonFile.EndsWith("Direct3D11.json"))
|
||||
{
|
||||
outputPath = d3d11Path;
|
||||
@@ -1076,6 +1079,17 @@ public static class Program
|
||||
outputPath = d3d11on12Path;
|
||||
useSubFolders = false;
|
||||
}
|
||||
else if (jsonFile.EndsWith("Direct2D.json"))
|
||||
{
|
||||
outputPath = d2dPath;
|
||||
useSubFolders = false;
|
||||
}
|
||||
else if (jsonFile == "Graphics.Imaging.D2D.json")
|
||||
{
|
||||
outputPath = d2dPath;
|
||||
useSubFolders = false;
|
||||
cleanFolder = false;
|
||||
}
|
||||
else if (jsonFile.EndsWith("Direct3D.Dxc.json"))
|
||||
{
|
||||
outputPath = dxcPath;
|
||||
@@ -1089,13 +1103,13 @@ public static class Program
|
||||
Directory.CreateDirectory(outputPath);
|
||||
}
|
||||
|
||||
Generate(api!, outputPath, jsonFile, useSubFolders);
|
||||
Generate(api!, outputPath, jsonFile, useSubFolders, cleanFolder);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
private static void Generate(ApiData api, string outputPath, string jsonFile, bool useSubFolders)
|
||||
private static void Generate(ApiData api, string outputPath, string jsonFile, bool useSubFolders, bool cleanFolder)
|
||||
{
|
||||
string[] splits = jsonFile.Split(".", StringSplitOptions.RemoveEmptyEntries);
|
||||
string folderRoot = splits[0];
|
||||
@@ -1130,6 +1144,19 @@ public static class Program
|
||||
docFile = string.Empty;
|
||||
}
|
||||
|
||||
if (jsonFile == "Graphics.Direct2D.Common.json")
|
||||
{
|
||||
docFile = $"../../../Vortice.Win32.Direct2D/Direct2D";
|
||||
}
|
||||
else if (jsonFile == "Graphics.Imaging.D2D.json")
|
||||
{
|
||||
docFile = $"../Vortice.Win32/Generated/Graphics/Imaging";
|
||||
}
|
||||
else if (jsonFile == "Graphics.Direct3D11on12.json")
|
||||
{
|
||||
docFile = $"../Vortice.Win32.Direct3D11/Direct3D11";
|
||||
}
|
||||
|
||||
string apiName = ns;
|
||||
string apiFolder;
|
||||
if (useSubFolders)
|
||||
@@ -1146,12 +1173,18 @@ public static class Program
|
||||
apiFolder = outputPath;
|
||||
}
|
||||
|
||||
if (Directory.Exists(apiFolder))
|
||||
if (cleanFolder)
|
||||
{
|
||||
Directory.Delete(apiFolder, true);
|
||||
if (Directory.Exists(apiFolder))
|
||||
{
|
||||
Directory.Delete(apiFolder, true);
|
||||
}
|
||||
}
|
||||
|
||||
Directory.CreateDirectory(apiFolder);
|
||||
if (!Directory.Exists(apiFolder))
|
||||
{
|
||||
Directory.CreateDirectory(apiFolder);
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(docFile) == false)
|
||||
{
|
||||
|
||||
21
src/Vortice.Win32.Direct2D/Apis.WIC.cs
Normal file
21
src/Vortice.Win32.Direct2D/Apis.WIC.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
// Copyright © Amer Koleci and Contributors.
|
||||
// Licensed under the MIT License (MIT). See LICENSE in the repository root for more information.
|
||||
|
||||
using static Win32.Apis;
|
||||
using static Win32.Graphics.Imaging.Apis;
|
||||
|
||||
namespace Win32.Graphics.Imaging.D2D;
|
||||
|
||||
public static unsafe partial class Apis
|
||||
{
|
||||
|
||||
public static HResult CreateWICImagingFactory(IWICImagingFactory2** factory)
|
||||
{
|
||||
return CoCreateInstance(
|
||||
(Guid*)Unsafe.AsPointer(ref Unsafe.AsRef(in CLSID_WICImagingFactory2)),
|
||||
null,
|
||||
CLSCTX_INPROC_SERVER,
|
||||
__uuidof<IWICImagingFactory2>(),
|
||||
(void**)factory);
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user