C# Class Fusion.Drivers.Graphics.GraphicsDevice

Inheritance: System.DisposableBase
Mostra file Open project: demiurghg/FusionEngine Class Usage Examples

Public Properties

Property Type Description
Game Game

Private Properties

Property Type Description
Initialize void
NotifyViewportChanges void
Present void

Public Methods

Method Description
ApplyGpuState ( ) : void

Applies all GPU states before draw, dispatch or clear. Method assumes that deviceContext is already locked.

Clear ( DepthStencilSurface surface, float depth = 1, byte stencil ) : void

Clear depth stencil surface

Clear ( RenderTargetSurface surface, Color4 color ) : void

Clears render target using given color

Clear ( StructuredBuffer buffer, Int4 values ) : void

Fills structured buffer with given values

ClearBackbuffer ( Color4 color, float depth = 1, byte stencil ) : void

Dispatch ( int threadGroupCountX, int threadGroupCountY = 1, int threadGroupCountZ = 1 ) : void

Draw ( int vertexCount, int firstIndex ) : void

Draws primitives.

DrawAuto ( ) : void

DrawIndexed ( int indexCount, int firstIndex, int baseVertexOffset ) : void

DrawInstanced ( int vertexCountPerInstance, int instanceCount, int startVertexLocation, int startInstanceLocation ) : void

DrawInstancedIndexed ( int indexCountPerInstance, int instanceCount, int startIndexLocation, int baseVertexLocation, int startInstanceLocation ) : void

GetTargets ( DepthStencilSurface &depthStencil, RenderTargetSurface &renderTargets ) : void

GraphicsDevice ( Game game ) : System

ResetStates ( ) : void

Resets all devices states including RTs and DS

Resolve ( RenderTarget2D source, RenderTarget2D destination ) : void

Resolve ( RenderTargetSurface source, RenderTargetSurface destination ) : void

RestoreBackbuffer ( ) : void

Screenshot ( string path = null ) : void

Makes screenshot and saves image at specified path. If path is null image will be stored at MyPicures\AppName\Shot-CurrentDate.bmp

SetCSRWBuffer ( int register, StructuredBuffer buffer, int initialCount = -1 ) : void

SetCSRWTexture ( int register, RenderTargetSurface surface ) : void

SetCSRWBuffer & SetCSRWTexture share same registers.

SetCSRWTexture ( int register, VolumeRWTexture volumeTexture ) : void

SetPSRWBuffer ( int register, StructuredBuffer buffer, int initialCount = -1 ) : void

SetPSRWTexture ( int register, RenderTargetSurface surface ) : void

SetPSRWBuffer & SetPSRWTexture share same registers.

SetPSRWTexture ( int register, VolumeRWTexture volumeTexture ) : void

SetTargets ( DepthStencil2D depthStencil, RenderTarget2D renderTarget ) : void

Analogue of SetTargets( depthStencil.Surface, renderTarget.Surface )

SetTargets ( DepthStencilSurface depthStencil ) : void

Sets targets.

SetViewport ( Viewport viewport ) : void

SetViewport ( ViewportF viewport ) : void

SetViewport ( int x, int y, int w, int h ) : void

SetupVertexInput ( VertexBuffer vertexBuffer, IndexBuffer indexBuffer ) : void

Sets index and vertex buffer.

SetupVertexInput ( VertexBuffer vertexBuffers, int offsets, IndexBuffer indexBuffer ) : void

Sets index and vertex buffers.

SetupVertexOutput ( VertexBuffer vertexBuffer, int offset ) : void

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Private Methods

Method Description
Initialize ( GraphicsParameters parameters ) : void

Initializes graphics device

NotifyViewportChanges ( ) : void

Present ( int syncInterval ) : void

Method Details

ApplyGpuState() public method

Applies all GPU states before draw, dispatch or clear. Method assumes that deviceContext is already locked.
public ApplyGpuState ( ) : void
return void

Clear() public method

Clear depth stencil surface
public Clear ( DepthStencilSurface surface, float depth = 1, byte stencil ) : void
surface DepthStencilSurface
depth float
stencil byte
return void

Clear() public method

Clears render target using given color
public Clear ( RenderTargetSurface surface, Color4 color ) : void
surface RenderTargetSurface
color Color4
return void

Clear() public method

Fills structured buffer with given values
public Clear ( StructuredBuffer buffer, Int4 values ) : void
buffer StructuredBuffer
values Int4
return void

ClearBackbuffer() public method

public ClearBackbuffer ( Color4 color, float depth = 1, byte stencil ) : void
color Color4
depth float
stencil byte
return void

Dispatch() public method

public Dispatch ( int threadGroupCountX, int threadGroupCountY = 1, int threadGroupCountZ = 1 ) : void
threadGroupCountX int
threadGroupCountY int
threadGroupCountZ int
return void

Dispose() protected method

protected Dispose ( bool disposing ) : void
disposing bool
return void

Draw() public method

Draws primitives.
public Draw ( int vertexCount, int firstIndex ) : void
vertexCount int
firstIndex int
return void

DrawAuto() public method

public DrawAuto ( ) : void
return void

DrawIndexed() public method

public DrawIndexed ( int indexCount, int firstIndex, int baseVertexOffset ) : void
indexCount int
firstIndex int
baseVertexOffset int
return void

DrawInstanced() public method

public DrawInstanced ( int vertexCountPerInstance, int instanceCount, int startVertexLocation, int startInstanceLocation ) : void
vertexCountPerInstance int
instanceCount int
startVertexLocation int
startInstanceLocation int
return void

DrawInstancedIndexed() public method

public DrawInstancedIndexed ( int indexCountPerInstance, int instanceCount, int startIndexLocation, int baseVertexLocation, int startInstanceLocation ) : void
indexCountPerInstance int
instanceCount int
startIndexLocation int
baseVertexLocation int
startInstanceLocation int
return void

GetTargets() public method

public GetTargets ( DepthStencilSurface &depthStencil, RenderTargetSurface &renderTargets ) : void
depthStencil DepthStencilSurface
renderTargets RenderTargetSurface
return void

GraphicsDevice() public method

public GraphicsDevice ( Game game ) : System
game Game
return System

ResetStates() public method

Resets all devices states including RTs and DS
public ResetStates ( ) : void
return void

Resolve() public method

public Resolve ( RenderTarget2D source, RenderTarget2D destination ) : void
source RenderTarget2D
destination RenderTarget2D
return void

Resolve() public method

public Resolve ( RenderTargetSurface source, RenderTargetSurface destination ) : void
source RenderTargetSurface
destination RenderTargetSurface
return void

RestoreBackbuffer() public method

public RestoreBackbuffer ( ) : void
return void

Screenshot() public method

Makes screenshot and saves image at specified path. If path is null image will be stored at MyPicures\AppName\Shot-CurrentDate.bmp
public Screenshot ( string path = null ) : void
path string
return void

SetCSRWBuffer() public method

public SetCSRWBuffer ( int register, StructuredBuffer buffer, int initialCount = -1 ) : void
register int
buffer StructuredBuffer
initialCount int An array of append and consume buffer offsets. /// A value of -1 indicates to keep the current offset. /// Any other values set the hidden counter for that appendable and consumable UAV.
return void

SetCSRWTexture() public method

SetCSRWBuffer & SetCSRWTexture share same registers.
public SetCSRWTexture ( int register, RenderTargetSurface surface ) : void
register int
surface RenderTargetSurface
return void

SetCSRWTexture() public method

public SetCSRWTexture ( int register, VolumeRWTexture volumeTexture ) : void
register int
volumeTexture VolumeRWTexture
return void

SetPSRWBuffer() public method

public SetPSRWBuffer ( int register, StructuredBuffer buffer, int initialCount = -1 ) : void
register int
buffer StructuredBuffer
initialCount int An array of append and consume buffer offsets. /// A value of -1 indicates to keep the current offset. /// Any other values set the hidden counter for that appendable and consumable UAV.
return void

SetPSRWTexture() public method

SetPSRWBuffer & SetPSRWTexture share same registers.
public SetPSRWTexture ( int register, RenderTargetSurface surface ) : void
register int
surface RenderTargetSurface
return void

SetPSRWTexture() public method

public SetPSRWTexture ( int register, VolumeRWTexture volumeTexture ) : void
register int
volumeTexture VolumeRWTexture
return void

SetTargets() public method

Analogue of SetTargets( depthStencil.Surface, renderTarget.Surface )
public SetTargets ( DepthStencil2D depthStencil, RenderTarget2D renderTarget ) : void
depthStencil DepthStencil2D
renderTarget RenderTarget2D
return void

SetTargets() public method

Sets targets.
public SetTargets ( DepthStencilSurface depthStencil ) : void
depthStencil DepthStencilSurface
return void

SetViewport() public method

public SetViewport ( Viewport viewport ) : void
viewport Viewport
return void

SetViewport() public method

public SetViewport ( ViewportF viewport ) : void
viewport ViewportF
return void

SetViewport() public method

public SetViewport ( int x, int y, int w, int h ) : void
x int
y int
w int
h int
return void

SetupVertexInput() public method

Sets index and vertex buffer.
public SetupVertexInput ( VertexBuffer vertexBuffer, IndexBuffer indexBuffer ) : void
vertexBuffer VertexBuffer Vertex buffer to apply
indexBuffer IndexBuffer Index buffer to apply.
return void

SetupVertexInput() public method

Sets index and vertex buffers.
public SetupVertexInput ( VertexBuffer vertexBuffers, int offsets, IndexBuffer indexBuffer ) : void
vertexBuffers VertexBuffer Vertex buffers to apply. Provide null if no vertex buffers are required.
offsets int Offsets in each vertex buffer.
indexBuffer IndexBuffer Index buffers to apply.
return void

SetupVertexOutput() public method

public SetupVertexOutput ( VertexBuffer vertexBuffer, int offset ) : void
vertexBuffer VertexBuffer
offset int
return void

Property Details

Game public_oe property

Game
public Game Game
return Game