Abstraction of a 3D graphics rendering backend.
More...
|
|
void | ClearDepth () |
| | Clear the depth buffer.
|
| |
|
void | ClearStencilBuffer () |
| | Clear the stencil buffer.
|
| |
|
void | Present () |
| | Present the current frame.
|
| |
| void | Clear (Vector4 clearColor) |
| | Clear the screen with the given color.
|
| |
| void | SetFrameBuffer (FrameBuffer? newFramebuffer) |
| | Change the active frame buffer.
|
| |
| void | DrawElements (PrimitiveType primitiveType, int elementCount) |
| | Draw the specified number of elements from the active index buffer as a set of primitives of the specified type. In other words, triangle maker go vroom vroom.
|
| |
| void | SetShaderPipeline (ShaderPipeline newPipeline) |
| | Change the active shader pipeline.
|
| |
| void | SetSamplerState (int textureSlot, SamplerState samplerState) |
| | Set the sampler settings for the specified texture slot.
|
| |
| void | SetVertexBuffer< TElement > (VertexBuffer< TElement > newBuffer) |
| | Change the active vertex buffer.
|
| |
| void | SetIndexBuffer< TIndex > (IndexBuffer< TIndex > newBuffer) |
| | Change the active element buffer.
|
| |
| void | SetConstantBuffer (int slot, ConstantBuffer? newBuffer) |
| | Change the ConstantBuffer assigned to the given constant buffer slot.
|
| |
| void | SetTexture (int slot, Texture? newTexture) |
| | Change the texture to sample from when sampling the given slot.
|
| |
| virtual bool | SupportsShaderStage (ShaderStage stage) |
| | Determines whether the specified shader stage is supported on this graphics device's platform.
|
| |
|
void | Dispose () |
| |
|
| | GraphicsDevice (GraphicsPlatform platformType) |
| | Creates a new GraphicsDevice instance representing the specified platform.
|
| |
|
void | MakeCurrent () |
| | Make this instance the active one.
|
| |
|
void | Deactivate () |
| | Deactivate this device. Must be called on the active device before making a new device active.
|
| |
| virtual void | Dispose (bool disposing) |
| | Called when it's time to take out the trash.
|
| |
|
|
static bool | IsAvailable [get] |
| | Gets a value indicating whether a GraphicsDevice is currently active for rendering.
|
| |
|
FrameBuffer? | FrameBuffer [get] |
| | Gets the currently-active framebuffer.
|
| |
|
Rectangle | ScissorRectangle [get, set] |
| | Gets or sets the scissor test rectangle. This is a bounding box in window units where rendering is valid. In the next draw call, any fragments that fall outside of these bounds will be discarded if scissor testing is enabled.
|
| |
|
Rectangle | Viewport [get, set] |
| | Gets or sets the viewport rectangle. This is the area within the window that graphics will be drawn to.
|
| |
|
static ? GraphicsDevice | Current [get] |
| | Gets the currently-active GraphicsDevice instance.
|
| |
|
DepthStencilState | DepthStencilState [get, set] |
| | Gets or sets the DepthStencilState value indicating depth and stencil test settings for the next draw call.
|
| |
|
bool | IsCurrent [get] |
| | Gets a value indicating whether this GraphicsDevice is the current one."/>
|
| |
|
GraphicsPlatform | GraphicsPlatform [get] |
| | Gets a GraphicsPlatform val8ue indicating what graphics platform this instance implements.
|
| |
|
RasterizerState | RasterizerState [get, set] |
| | Gets or sets a RasterizerState value indicating rasterizer settings for the next draw operation.
|
| |
|
BlendState | BlendState [get, set] |
| | Gets or sets a BlendState value indicating blending settings for the next draw operation.
|
| |
Abstraction of a 3D graphics rendering backend.
◆ GraphicsDevice()
Creates a new GraphicsDevice instance representing the specified platform.
- Parameters
-
| platformType | A value indicating what graphics platform this instance implements. |
◆ Clear()
| void Clear |
( |
Vector4 | clearColor | ) |
|
|
abstract |
Clear the screen with the given color.
- Parameters
-
◆ Dispose()
| virtual void Dispose |
( |
bool | disposing | ) |
|
|
inlineprotectedvirtual |
Called when it's time to take out the trash.
- Parameters
-
| disposing | Value indicating whether it is time for you to take out your trash. |
◆ DrawElements()
| void DrawElements |
( |
PrimitiveType | primitiveType, |
|
|
int | elementCount ) |
|
abstract |
Draw the specified number of elements from the active index buffer as a set of primitives of the specified type. In other words, triangle maker go vroom vroom.
- Parameters
-
| primitiveType | The type of primitive to draw. Triangles? Dots? |
| elementCount | The number of elements to draw. This is not the number of triangles to draw, but rather the number of points to draw that form each triangle. |
◆ SetConstantBuffer()
Change the ConstantBuffer assigned to the given constant buffer slot.
- Parameters
-
| slot | The slot to change |
| newBuffer | The new buffer to assign to the slot. If null is given, the slot is deactivated. |
◆ SetFrameBuffer()
Change the active frame buffer.
- Parameters
-
| newFramebuffer | A new frame buffer to render to. If given null, the default frame buffer will be used. |
◆ SetIndexBuffer< TIndex >()
| void SetIndexBuffer< TIndex > |
( |
IndexBuffer< TIndex > | newBuffer | ) |
|
|
abstract |
Change the active element buffer.
- Parameters
-
| newBuffer | The new element buffer to use. |
- Template Parameters
-
| TIndex | Any numeric type used to store vertex indices |
- Type Constraints
-
| TIndex | : | unmanaged | |
| TIndex | : | INumber<TIndex> | |
◆ SetSamplerState()
| void SetSamplerState |
( |
int | textureSlot, |
|
|
SamplerState | samplerState ) |
|
abstract |
Set the sampler settings for the specified texture slot.
- Parameters
-
| textureSlot | Value indicating which texture slot to change. |
| samplerState | A SamplerState value indicating sampler settings for this slot. |
◆ SetShaderPipeline()
Change the active shader pipeline.
- Parameters
-
| newPipeline | A new ShaderPipeline to use. Must at least have a valid vertex and fragment shader stage. |
◆ SetTexture()
| void SetTexture |
( |
int | slot, |
|
|
Texture? | newTexture ) |
|
abstract |
Change the texture to sample from when sampling the given slot.
- Parameters
-
| slot | The slot to change |
| newTexture | A new texture to sample from. If given null, the slot is deactivated. |
◆ SetVertexBuffer< TElement >()
| void SetVertexBuffer< TElement > |
( |
VertexBuffer< TElement > | newBuffer | ) |
|
|
abstract |
Change the active vertex buffer.
- Parameters
-
| newBuffer | The new buffer to use. |
- Template Parameters
-
| TElement | Any vertex data type. |
◆ SupportsShaderStage()
Determines whether the specified shader stage is supported on this graphics device's platform.
- Parameters
-
- Returns
- True if supported, false otherwise.
You should use this before creating shaders of the given stage. Otherwise, you'll crash. Have fun!
The documentation for this class was generated from the following file:
- /builds/universe/graphics/src/Inertia.Platform/GraphicsDevice.cs