Table of Contents

Method GetDeviceFromNumber

Namespace
LMKit.Graphics.Gpu
Assembly
LM-Kit.NET.dll

GetDeviceFromNumber(int)

Retrieves a GpuDeviceInfo object by its deviceNumber from the static Devices list.

public static GpuDeviceInfo GetDeviceFromNumber(int deviceNumber)

Parameters

deviceNumber int

Zero-based index of the device.

Returns

GpuDeviceInfo

The GpuDeviceInfo for the specified deviceNumber, or null if the device number is out of range or the list is not initialized.

Examples

Accessing a Device By Index

GpuDeviceInfo device = GpuDeviceInfo.GetDeviceFromNumber(0);
if (device != null)
{
    Console.WriteLine($"Device 0: {device.DeviceName}");
}
else
{
    Console.WriteLine("No device found at index 0.");
}