Tesla Graphics Engine Documentation (January 2012)
IRenderer Interface
TeslaTesla.GraphicsIRenderer
Interface defining the methods responsible for drawing graphics and initializing the graphics device. The renderer is the central component in creating graphics objects, manages render states (including preventing redundant state switching), and includes a render queue to organize and sort geometry that are to be rendered.
Declaration Syntax
C#
public interface IRenderer : IDisposable
Members
All Members Methods Properties Events



Icon Member Description
Adapter
Gets the graphics adapter that was used to create the renderer.

ApplyRenderState(RenderStateType, RenderState)
Applies the render state to the device. If the state is null, then the default state for its type is used instead. If the renderer is enforcing a state for the specified state type, that is used instead. If the state to be applied already is present in the cache, the renderer returns, preventing redundant state switching. It is important to let the renderer take care of state management, and not to set states directly in your shader program, in your effect pass. Otherwise, the render states may be inconsistent to what is present in the cache.

BlendFactor
Gets or sets the blend factor which is a constant color used for alpha blending. Default is Color.White. This is a "high frequency" render state, and setting a BlendState to the renderer will override this value.

BlendState
Gets or sets the BlendState currently active on the device and in the cache. Default is BlendState.Opaque. This is equivalent to using the Get/ApplyRenderState methods.

Clear(Color)
Clears all bounded render targets.

Clear(ClearOptions, Color, Single, Int32)
Clears all bounded render targets.

ClearEnforcedState(RenderStateType)
Clears the specific render state from the renderer.

ClearEnforcedStates()()()()
Clears all enforced states from the renderer.

ClearRenderState(RenderStateType)
Clears a specific render state, setting it to its default value on the device.

ClearRenderStates()()()()
Clears the renderer's render states, setting all state objects to their default values.

CurrentCamera
Gets or sets the current camera. A camera owns a viewport and is used to perform culling.

DepthStencilState
Gets or sets the DepthStencilState currently active on the device and in the cache. Default is DepthStencilState.Default. This is equivalent to using the Get/ApplyRenderState methods.

Dispose()()()()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
(Inherited from IDisposable.)
Disposing
Event for when the renderer is in the process of disposing itself, where it will clean up all resources.

Draw(PrimitiveType, Int32, Int32)
Draws non-indexed geometry.

DrawIndexed(PrimitiveType, Int32, Int32, Int32)
Draws indexed geometry.

DrawIndexedInstanced(PrimitiveType, Int32, Int32, Int32, Int32)
Draws indexed, instanced geometry.

EnforcedBlendState
Gets or sets the enforced BlendState, this will override the cached BlendState when ApplyRenderState() is called. This is equivalent to using the Get/SetEnforcedState methods.

EnforcedDepthStencilState
Gets or sets the enforced DepthStencilState, this will override the cached DepthStencilState when ApplyRenderState() is called. This is equivalent to using the Get/SetEnforcedState methods.

EnforcedMaterial
Gets or sets the enforced material. This may or may not be ignored when the IRenderable's Render() method is called. If this is not null, it lets the renderable know what material to use instead of its default material. Set this value to null for default behavior.

EnforcedRasterizerState
Gets or sets the enforced RasterizerState, this will override the cached RasterizerState when ApplyRenderState() is called. This is equivalent to using the Get/SetEnforcedState methods.

GetEnforcedState(RenderStateType)
Returns the enforced state specified by its type, if it exists.

GetIndexBuffer()()()()
Gets the currently bound index buffer.

GetRenderState(RenderStateType)
Returns the current renderstate of the specified type that has been set to the device, and is present in the cache.

GetRenderTargets()()()()
Gets the currently bounded render targets.

GetVertexBuffers()()()()
Gets the currently bounded vertex buffers.

IsDisposed
Gets if the renderer has been disposed.

MultiSampleMask
Gets or sets the bitmask which defines which samples can be written during multisampling. Default is -1 (0xffffffff). This is a "high frequency" render state, and setting a BlendState to the renderer will override this value.

RasterizerState
Gets or sets the RasterizerState currently active on the device and in the cache. Default is RasterizerState.CullBackClockwiseFront. This is the equivalent to using the Get/ApplyRenderState methods.

ReferenceStencil
Gets or sets the reference value for stencil testing. Default is zero. This is a "high frequency" render state, and setting a BlendState to the renderer will override this value.

RenderQueue
Gets or sets the render queue that will be used to place renderables, sort them, and render them to the render target.

SamplerStates
Gets the sampler state collection for setting/getting sampler states used by the pixel shader.

ScissorRectangle
Gets or sets the rectangle used for scissor testing.

SetEnforcedState(RenderState)
Sets the enforced state that will override the incoming state in ApplyRenderState() method.

SetIndexBuffer(IndexBuffer)
Sets the active index buffer used for drawing indexed geometry.

SetRenderTarget(RenderTarget2D)
Sets a 2D render target to the first render target slot and unbinds all currently bound targets. Setting this to null unbinds all targets and sets the target to the currently active swap chain's back buffer.

SetRenderTarget(RenderTargetCube, CubeMapFace)
Sets a Cube render target, to the first render target slot and unbinds all currently bound targets. Setting this to null unbinds all targets and sets the target to the currently active swap chain's back buffer.

SetRenderTargets(array<RenderTargetBinding>[]()[][])
Sets the render targets to the device and unbinds all currently bound targets. The first target in the array is bound to the first slot and so forth. The first render target's depth-stencil buffer is used for all targets.

SetVertexBuffer(VertexBuffer)
Sets the vertex buffer to the first input slot onto the device.

SetVertexBuffer(VertexBuffer, Int32)
Sets the vertex buffer to the first input slot onto the device

SetVertexBuffers(array<VertexBufferBinding>[]()[][])
Sets an array of vertex buffers starting from the first input slot.

Textures
Gets the texture collection for setting/getting textures used by the pixel shader.

VertexSamplerStates
Gets the sampler state collection for setting/getting sampler states used by the vertex shader.

VertexTextures
Gets the texture collection for setting/getting textures used by the vertex shader.

Viewport
Gets or sets the viewport which identifies the portion of the render target which we will be rendering onto.

Assembly: Tesla (Module: Tesla) Version: 0.5.0.0 (0.5.0.0)