Class Dxgi
java.lang.Object
oshi.jna.platform.windows.Dxgi
Minimal JNA binding to
dxgi.dll for enumerating display adapters and reading
DXGI_ADAPTER_DESC.DedicatedVideoMemory.
DXGI is the authoritative Windows API for dedicated GPU memory. It is not subject to the 2 GiB cap that affects the
32-bit registry value HardwareInformation.MemorySize.
COM vtable layout used here:
IUnknown (vtable slots 0-2): QueryInterface, AddRef, Release
IDXGIObject (slots 3-6): SetPrivateData, SetPrivateDataInterface, GetPrivateData, GetParent
IDXGIFactory (slots 7-13): EnumAdapters, MakeWindowAssociation, GetWindowAssociation,
CreateSwapChain, CreateSoftwareAdapter, (IDXGIFactory1 adds 2 more)
IDXGIAdapter (slots 3-5 on adapter): EnumOutputs, GetDesc, CheckInterfaceSupport
This class should be considered non-API as it may be removed if/when its code is incorporated into the JNA project.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classMaps to the WindowsDXGI_ADAPTER_DESCstructure. -
Method Summary
Modifier and TypeMethodDescriptionstatic List<oshi.driver.common.windows.gpu.DxgiAdapterInfo> Enumerates all DXGI display adapters and returns their identity and dedicated video memory.
-
Method Details
-
queryAdapters
Enumerates all DXGI display adapters and returns their identity and dedicated video memory.Fails gracefully: if
dxgi.dllis unavailable or any COM call fails, returns an empty list so callers can fall back to registry-based detection.- Returns:
- list of
DxgiAdapterInfo, one per adapter; empty if DXGI is unavailable
-