mirror of
https://github.com/amerkoleci/Vortice.Win32.git
synced 2026-01-14 16:16:04 +08:00
Generator: Completed initial step of Com Types generation and various improvements.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user