public static class GraphicsHostChoosing a graphics device, and saying which one was chosen and why.
Remarks
PlatformHost's counterpart: it walks Backends in order, asks each candidate to open, and returns the first that does. A head that wants a device it already owns hands one to WithGraphics and never reaches this; a head that wants an API this package does not reference implements IGraphicsBackend itself.
⚠ Every rejection is reported, not just the last. A chain that fell all the way through used to leave one sentence about whichever candidate happened to be final, which is the least useful of the answers available — "no Vulkan" says nothing about why WebGPU was not used either. Create joins them, so one log line explains the whole decision.
The fallback to a device that draws nothing is opt-in, and is not a failure. Doc 17 makes Vixen.Graphics.Null a shipping backend rather than only a test one: it is what the dedicated server runs on, and running the whole frame against it is what keeps a server and a client one program rather than two code paths that drift. It happens when Null is in the list — which Default puts there — and not otherwise, because an operator who asked for Vulkan alone is owed the answer rather than a silent downgrade.
Fields and properties (2)
public static IReadOnlyList<GraphicsBackend> DefaultWhat is tried when an application named no preference.
public static IGraphicsBackend InstanceThis class as an IGraphicsBackend, which is what a builder takes.
Methods (4)
public static IGraphicsDevice? Create(GraphicsOptions options, IWindow? window, ILoggerFactory? logs, out string? reason)Opens the first backend in the preference list that will open.
public static IGraphicsDevice Create(IWindow? window, ILoggerFactory? logs, out string? reason)Opens a device on the default order, for a caller with no options to hand.
public static ISwapChain CreateSwapChain(IGraphicsDevice device, IWindow? window, GraphicsOptions options)Creates the swapchain a device presents through.
public static Int2 Framebuffer(IWindow window, GraphicsOptions options)The window's framebuffer size, never zero in either axis.
Used by (3)
- AppBackendTestsVixen.App.Tests
- BackendVixen.App
- VixenAppVixen.App