Interface IGraphicsDeviceFactory
Base interface for a factory that creates GraphicsDevice instances.
public interface IGraphicsDeviceFactory
- Extension Methods
Remarks
The implementers of IGraphicsDeviceFactory are responsible for creating GraphicsDevice instances, and for selecting the best device based on the preferred configuration.
A good example of a factory is the Stride.Games.GamePlatform class, which not only abstracts the platform, but also the windowing system and the Graphics Device creation.
Methods
ChangeOrCreateDevice(GraphicsDevice?, GraphicsDeviceInformation)
Changes an existing Graphics Device or creates a new one with the specified configuration.
GraphicsDevice ChangeOrCreateDevice(GraphicsDevice? currentDevice, GraphicsDeviceInformation deviceInformation)
Parameters
currentDeviceGraphicsDeviceAn optional GraphicsDevice instance to reconfigure. Specify null to create a new device.
deviceInformationGraphicsDeviceInformationThe GraphicsDeviceInformation containing the Graphics Adapter, Graphics Profile, and other relevant flags and parameters required to configure the Graphics Device.
Returns
- GraphicsDevice
The created (or changed) Graphics Device.
FindBestDevices(GameGraphicsParameters)
Returns a list of GraphicsDeviceInformation instances, representing the best found Graphics Adapters and their corresponding configuration to create a Graphics Device based on the given graphics parameters.
List<GraphicsDeviceInformation> FindBestDevices(GameGraphicsParameters graphicsParameters)
Parameters
graphicsParametersGameGraphicsParametersThe preferred graphics configuration.
Returns
- List<GraphicsDeviceInformation>
A list of the best found configurations for creating a Graphics Device.