C# 클래스 Nuclex.Testing.Xna.MockedGraphicsDeviceService

Helper for unit tests requiring a mocked graphics device
This doesn't actually mock the graphics device, but creates a real graphics device on an invisible window. Tests have shown this method to be fast enough for usage in a unit test.
상속: IGraphicsDeviceService
파일 보기 프로젝트 열기: csce3513/Team18 1 사용 예제들

공개 메소드들

메소드 설명
CreateDevice ( ) : IDisposable

Creates a new graphics device

Make sure to call DestroyGraphicsDevice() either manually, or by disposing the returned object. A typical usage of this method is shown in the following code.

using(IDisposable keeper = CreateDevice()) { GraphicsDevice.DoSomethingThatCouldFail(); }
DestroyDevice ( ) : void

Destroys the created graphics device again

MockedGraphicsDeviceService ( )

Initializs a new mocked graphics device service

MockedGraphicsDeviceService ( DeviceType deviceType )

Initializs a new mocked graphics device service

MockedGraphicsDeviceService ( DeviceType deviceType, GraphicsProfile graphicsProfile )

Initializs a new mocked graphics device service

ResetDevice ( ) : void

Performs a graphics device reset

보호된 메소드들

메소드 설명
OnDeviceCreated ( ) : void

Fires the DeviceCreated event

OnDeviceDisposing ( ) : void

Fires the DeviceDisposing event

OnDeviceReset ( ) : void

Fires the DeviceReset event

OnDeviceResetting ( ) : void

Fires the DeviceResetting event

비공개 메소드들

메소드 설명
disposeEverything ( ) : void

Shuts down and disposes all resources used by the mocked graphics device service

메소드 상세

CreateDevice() 공개 메소드

Creates a new graphics device

Make sure to call DestroyGraphicsDevice() either manually, or by disposing the returned object. A typical usage of this method is shown in the following code.

using(IDisposable keeper = CreateDevice()) { GraphicsDevice.DoSomethingThatCouldFail(); }
public CreateDevice ( ) : IDisposable
리턴 IDisposable

DestroyDevice() 공개 메소드

Destroys the created graphics device again
public DestroyDevice ( ) : void
리턴 void

MockedGraphicsDeviceService() 공개 메소드

Initializs a new mocked graphics device service

MockedGraphicsDeviceService() 공개 메소드

Initializs a new mocked graphics device service
public MockedGraphicsDeviceService ( DeviceType deviceType )
deviceType DeviceType Type of graphics device that will be created

MockedGraphicsDeviceService() 공개 메소드

Initializs a new mocked graphics device service
public MockedGraphicsDeviceService ( DeviceType deviceType, GraphicsProfile graphicsProfile )
deviceType DeviceType Type of graphics device that will be created
graphicsProfile GraphicsProfile Profile the graphics device will be initialized for

OnDeviceCreated() 보호된 메소드

Fires the DeviceCreated event
protected OnDeviceCreated ( ) : void
리턴 void

OnDeviceDisposing() 보호된 메소드

Fires the DeviceDisposing event
protected OnDeviceDisposing ( ) : void
리턴 void

OnDeviceReset() 보호된 메소드

Fires the DeviceReset event
protected OnDeviceReset ( ) : void
리턴 void

OnDeviceResetting() 보호된 메소드

Fires the DeviceResetting event
protected OnDeviceResetting ( ) : void
리턴 void

ResetDevice() 공개 메소드

Performs a graphics device reset
public ResetDevice ( ) : void
리턴 void