nCine::RenderCommand class

Wraps all the information needed for issuing a draw command.

Public types

enum class Type { Unspecified = 0, Sprite, MeshSprite, TileMap, Particle, Lighting, Text, ImGui, Count }
Command types.

Public static functions

static auto calculateDepth(uint16_t layer, float nearClip, float farClip) -> float
Calculates the Z-depth of command layer using the specified near and far planes.

Constructors, destructors, conversion operators

RenderCommand(Type profilingType) explicit
RenderCommand()

Public functions

auto numInstances() const -> int
Returns the number of instances collected in the command or zero if instancing is not used.
void setNumInstances(int numInstances)
Sets the number of instances collected in the command.
auto batchSize() const -> int
Returns the number of elements collected by the command or zero if it's not a batch.
void setBatchSize(int batchSize)
Sets the number of batch elements collected by the command.
auto layer() const -> uint16_t
Returns the drawing layer for this command.
void setLayer(uint16_t layer)
Sets the drawing layer for this command.
auto visitOrder() const -> uint16_t
Returns the visit order index for this command.
void setVisitOrder(uint16_t visitOrder)
Sets the visit order index for this command.
auto materialSortKey() const -> uint64_t
Returns the material sort key for the queue.
auto lowerMaterialSortKey() const -> uint32_t
Returns the lower part of the material sort key, used for batch splitting logic.
void calculateMaterialSortKey()
Calculates a material sort key for the queue.
auto idSortKey() const -> unsigned int
Returns the id based secondary sort key for the queue.
void setIdSortKey(unsigned int idSortKey)
Sets the id based secondary sort key for the queue.
void issue()
Issues the render command.
auto type() const -> Type
Gets the command type (for profiling purposes)
void setType(Type type)
Sets the command type (for profiling purposes)
void setScissor(Recti scissorRect)
void setScissor(GLint x, GLint y, GLsizei width, GLsizei height)
auto transformation() const -> const Matrix4x4f&
void setTransformation(const Matrix4x4f& modelMatrix)
auto material() const -> const Material&
auto geometry() const -> const Geometry&
auto material() -> Material&
auto geometry() -> Geometry&
void commitNodeTransformation()
Commits the model matrix uniform block.
void commitCameraTransformation()
Commits the projection and view matrix uniforms.
void commitAll()
Calls all the commit methods except the camera uniforms commit.

Enum documentation

enum class nCine::RenderCommand::Type

Command types.

Its sole purpose is to allow separated profiling counters in the RenderStatistics class.