C# Class TransvoxelXnaStudio.Host.GraphicsDeviceService

Helper class responsible for creating and managing the GraphicsDevice. All GraphicsDeviceControl instances share the same GraphicsDeviceService, so even though there can be many controls, there will only ever be a single underlying GraphicsDevice. This implements the standard IGraphicsDeviceService interface, which provides notification events for when the device is reset or disposed.
Inheritance: IGraphicsDeviceService
Mostra file Open project: BinaryConstruct/Transvoxel-XNA Class Usage Examples

Public Methods

Method Description
AddRef ( IntPtr windowHandle, int width, int height ) : GraphicsDeviceService

Gets a reference to the singleton instance.

Release ( bool disposing ) : void

Releases a reference to the singleton instance.

ResetDevice ( int width, int height ) : void

Resets the graphics device to whichever is bigger out of the specified resolution or its current size. This behavior means the device will demand-grow to the largest of all its GraphicsDeviceControl clients.

Private Methods

Method Description
GraphicsDeviceService ( IntPtr windowHandle, int width, int height ) : System

Constructor is private, because this is a singleton class: client controls should use the public AddRef method instead.

Method Details

AddRef() public static method

Gets a reference to the singleton instance.
public static AddRef ( IntPtr windowHandle, int width, int height ) : GraphicsDeviceService
windowHandle System.IntPtr
width int
height int
return GraphicsDeviceService

Release() public method

Releases a reference to the singleton instance.
public Release ( bool disposing ) : void
disposing bool
return void

ResetDevice() public method

Resets the graphics device to whichever is bigger out of the specified resolution or its current size. This behavior means the device will demand-grow to the largest of all its GraphicsDeviceControl clients.
public ResetDevice ( int width, int height ) : void
width int
height int
return void