Generator: Completed initial step of Com Types generation and various improvements.

This commit is contained in:
Amer Koleci
2022-09-02 18:03:31 +02:00
parent 9d535bd98e
commit 3737620e92
12 changed files with 12307 additions and 79 deletions

View File

@@ -1,8 +1,10 @@
// Copyright © Amer Koleci and Contributors.
// Licensed under the MIT License (MIT). See LICENSE in the repository root for more information.
using System.Runtime.InteropServices;
using Win32;
using Win32.Graphics.Dxgi;
using Win32.Graphics.Dxgi.Common;
using static Win32.Apis;
namespace ClearScreen;
@@ -10,5 +12,29 @@ public static unsafe class Program
{
public static void Main()
{
using ComPtr<IDXGIFactory1> factory = default;
HResult hr = CreateDXGIFactory1(__uuidof<IDXGIFactory4>(), (void**)&factory);
{
using ComPtr<IDXGIFactory5> factory5 = default;
if (factory.CopyTo(&factory5).Success)
{
Bool32 isTearingSupported = factory5.Get()->CheckFeatureSupport<Bool32>(Feature.PresentAllowTearing);
}
}
using ComPtr<IDXGIAdapter1> adapter = default;
for (uint adapterIndex = 0;
factory.Get()->EnumAdapters1(adapterIndex, adapter.ReleaseAndGetAddressOf()).Success;
adapterIndex++)
{
AdapterDescription1 desc = default;
adapter.Get()->GetDesc1(&desc);
}
}
[DllImport("dxgi", ExactSpelling = true)]
public static extern HResult CreateDXGIFactory1(Guid* riid, void** ppFactory);
}