CommandBuffer
Inherited: None
Description
The CommandBuffer class represents a command buffer used in a graphics rendering pipeline. It provides methods for issuing rendering commands, setting global parameters, and managing textures.
Public Methods
void |
beginDebugMarker (const char * name) |
void |
clearRenderTarget (bool clearColor = true, const Vector4 & color = Vector4(0.0f), bool clearDepth = true, float depth = 1.0f) |
void |
|
void |
dispatchCompute (ComputeInstance * shader, int32_t groupsX, int32_t groupsY, int32_t groupsZ) |
void |
enableScissor (int32_t x, int32_t y, int32_t width, int32_t height) |
void |
|
projection () const |
|
void |
setGlobalTexture (const char * name, Texture * texture) |
void |
setGlobalValue (const char * name, const Variant & value) |
void |
setRenderTarget (RenderTarget * target, uint32_t level = 0) |
void |
setViewProjection (const Matrix4 & view, const Matrix4 & projection) |
void |
setViewport (int32_t x, int32_t y, int32_t width, int32_t height) |
Texture * |
texture (const char * name) const |
view () const |
|
viewport () const |
Static Methods
idToColor (uint32_t id) |
|
bool |
isInited () |
Methods Description
void CommandBuffer::beginDebugMarker (char * name)
Begins a debug marker with the specified name.
void CommandBuffer::clearRenderTarget (bool clearColor = true, Vector4 & color = Vector4(0.0f), bool clearDepth = true, float depth = 1.0f)
Clears the render target with the specified color and depth values. Flag clearColor indicating whether to clear the color buffer. Flag clearDepth indicating whether to clear the depth buffer.
void CommandBuffer::disableScissor ()
Disables scissor testing.
void CommandBuffer::dispatchCompute (ComputeInstance * shader, int32_t groupsX, int32_t groupsY, int32_t groupsZ)
Dispatches a compute shader with the specified workgroup dimensions. Parameters groupsX, groupsY and groupsZ alows to specify a size of workgroup in each demension.
void CommandBuffer::enableScissor (int32_t x, int32_t y, int32_t width, int32_t height)
Enables scissor testing with the specified parameters. Parameters x and y represents scissor coordinates. width and height scissor dimensions.
void CommandBuffer::endDebugMarker ()
Ends the current debug marker.
Vector4 CommandBuffer::idToColor (uint32_t id)
Converts a 32-bit id to a Vector4 color.
bool CommandBuffer::isInited ()
Returns true if the CommandBuffer is initialized; otherwise, false.
Matrix4 CommandBuffer::projection () const
Returns current projection matrix.
void CommandBuffer::setGlobalTexture (char * name, Texture * texture)
Sets a global texture based on its name.
void CommandBuffer::setGlobalValue (char * name, Variant & value)
Sets a global value based on its name.
void CommandBuffer::setRenderTarget (RenderTarget * target, uint32_t level = 0)
Sets the render target for subsequent rendering commands. Parameter level specifies the Mipmap level.
Sets the view and projection matrices.
void CommandBuffer::setViewport (int32_t x, int32_t y, int32_t width, int32_t height)
Sets the viewport dimensions. Parameters x and y represents viewport coordinates. width and height viewport dimensions.
See also viewport().
Texture * CommandBuffer::texture (char * name) const
Retrieves a global texture based on its name.
Matrix4 CommandBuffer::view () const
Returns current view matrix.
Vector2 CommandBuffer::viewport () const
Returns Vector2 representing the viewport dimensions.
See also setViewport().