New separated Direct2D bindings.

This commit is contained in:
Amer Koleci
2022-10-07 13:37:15 +02:00
parent 2e17f28f9a
commit 2f2724a073
366 changed files with 230 additions and 1750 deletions

View File

@@ -7,7 +7,7 @@
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage> <SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
<EnablePreviewFeatures>true</EnablePreviewFeatures> <EnablePreviewFeatures>true</EnablePreviewFeatures>
<VersionPrefix>1.7.3</VersionPrefix> <VersionPrefix>1.7.4</VersionPrefix>
<VersionSuffix Condition="'$(VersionSuffix)' == ''"></VersionSuffix> <VersionSuffix Condition="'$(VersionSuffix)' == ''"></VersionSuffix>
<GenerateDocumentationFile>true</GenerateDocumentationFile> <GenerateDocumentationFile>true</GenerateDocumentationFile>

View File

@@ -30,6 +30,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Vortice.Win32.Direct3D11on1
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Vortice.Win32.Dxc", "src\Vortice.Win32.Dxc\Vortice.Win32.Dxc.csproj", "{DF5C7A6F-8E17-41EC-A7F1-9FE03ACD75F3}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Vortice.Win32.Dxc", "src\Vortice.Win32.Dxc\Vortice.Win32.Dxc.csproj", "{DF5C7A6F-8E17-41EC-A7F1-9FE03ACD75F3}"
EndProject 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 Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU 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}.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.ActiveCfg = Release|Any CPU
{DF5C7A6F-8E17-41EC-A7F1-9FE03ACD75F3}.Release|Any CPU.Build.0 = 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 EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

View File

@@ -1041,6 +1041,7 @@ public static class Program
string d3d11Path = Path.Combine(new DirectoryInfo(repoRoot).Parent.FullName, "Vortice.Win32.Direct3D11"); 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 d3d12Path = Path.Combine(new DirectoryInfo(repoRoot).Parent.FullName, "Vortice.Win32.Direct3D12");
string d3d11on12Path = Path.Combine(new DirectoryInfo(repoRoot).Parent.FullName, "Vortice.Win32.Direct3D11on12"); 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"); string dxcPath = Path.Combine(new DirectoryInfo(repoRoot).Parent.FullName, "Vortice.Win32.Dxc");
// Generate docs // Generate docs
@@ -1061,6 +1062,8 @@ public static class Program
string outputPath = repoRoot; string outputPath = repoRoot;
bool useSubFolders = true; bool useSubFolders = true;
bool cleanFolder = true;
if (jsonFile.EndsWith("Direct3D11.json")) if (jsonFile.EndsWith("Direct3D11.json"))
{ {
outputPath = d3d11Path; outputPath = d3d11Path;
@@ -1076,6 +1079,17 @@ public static class Program
outputPath = d3d11on12Path; outputPath = d3d11on12Path;
useSubFolders = false; 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")) else if (jsonFile.EndsWith("Direct3D.Dxc.json"))
{ {
outputPath = dxcPath; outputPath = dxcPath;
@@ -1089,13 +1103,13 @@ public static class Program
Directory.CreateDirectory(outputPath); Directory.CreateDirectory(outputPath);
} }
Generate(api!, outputPath, jsonFile, useSubFolders); Generate(api!, outputPath, jsonFile, useSubFolders, cleanFolder);
} }
return 0; 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[] splits = jsonFile.Split(".", StringSplitOptions.RemoveEmptyEntries);
string folderRoot = splits[0]; string folderRoot = splits[0];
@@ -1130,6 +1144,19 @@ public static class Program
docFile = string.Empty; 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 apiName = ns;
string apiFolder; string apiFolder;
if (useSubFolders) if (useSubFolders)
@@ -1146,12 +1173,18 @@ public static class Program
apiFolder = outputPath; 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) if (string.IsNullOrWhiteSpace(docFile) == false)
{ {

View 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