C4 Engine Terathon Software C4 Engine API Documentation

• Graphics Manager

API Links
Developer Links

class Renderable

Defined in:  C4Renderable.h
The Renderable class stores general rendering information for a renderable object.
Definition

class Renderable : public ListElement<Renderable>

Member Functions
Renderable::GetRenderType Returns the primitive render type.
Renderable::SetRenderType Sets the primitive render type.
Renderable::GetRenderState Returns the render state flags that pertain to rendering.
Renderable::SetRenderState Sets the render state flags that pertain to rendering.
Renderable::GetRenderableFlags Returns the miscellaneous renderable flags.
Renderable::SetRenderableFlags Sets the miscellaneous renderable flags.
Renderable::GetShaderFlags Returns the shader initialization flags.
Renderable::SetShaderFlags Sets the shader initialization flags.
Renderable::GetBlendState Returns the ambient pass blend state.
Renderable::SetBlendState Sets the ambient pass blend state.
Renderable::GetDepthOffsetDelta Returns the depth offset delta value.
Renderable::GetDepthOffsetPoint Returns the depth offset center point.
Renderable::SetDepthOffset Sets the depth offset parameters.
 
Renderable::GetTransformable Returns a pointer to the Transformable object.
Renderable::SetTransformable Sets a pointer to the Transformable object.
Renderable::GetTransparentAttachment Returns the transparent attachment.
Renderable::SetTransparentAttachment Sets the transparent attachment.
Renderable::GetTransparentPosition Returns the transparent position pointer.
Renderable::SetTransparentPosition Sets the transparent position pointer.
 
Renderable::GetVertexCount Returns the vertex count.
Renderable::SetVertexCount Sets the vertex count.
Renderable::GetAttributeArray Returns one of the vertex attribute arrays.
Renderable::SetAttributeArray Sets one of the vertex attribute arrays.
Renderable::GetComponentCount Returns the number of components used by one of the vertex attribute arrays.
Renderable::GetFaceCount Returns the face count.
Renderable::SetFaceCount Sets the face count.
Renderable::GetFaceArray Returns the face array.
Renderable::SetFaceArray Sets the face array.
Renderable::GetOcclusionQuery Returns the pointer to an occlusion query object.
Renderable::SetOcclusionQuery Sets the pointer to an occlusion query object.
Renderable::GetFirstRenderSegment Returns the first render segment belonging to a renderable object.
Renderable::InvalidateShaderData Invalidates the shader data for all render segments belonging to a renderable object.
Constructor

Renderable(RenderType type, unsigned long state = 0);

Parameters
type The primitive type of the renderable object. See below for possible values.
state Flags that determine various render states to be applied. See below for possible values.
Description
The Renderable class stores general rendering information about a single renderable object. The use of the Renderable class is the sole means by which an object can be rendered by the Graphics Manager. Objects are rendered by storing their associated Renderable objects (which may be base classes of more specialized structures) in a list and passing the list to the GraphicsMgr::DrawRenderList function.

The type parameter passed to the constructor specifies the rendering primitive used by the object and may be any one of the following values, where n represents the number of vertices.
kRenderPoints A set of n points.
kRenderLines A set of n / 2 unconnected line segments.
kRenderLineStrip A set of n − 1 connected line segments.
kRenderLineLoop A set of n connected line segments forming a closed loop.
kRenderIndexedLines A set of line segments with indexed vertices.
kRenderTriangles A set of n / 3 unconnected triangles.
kRenderTriangleFan A set of n − 2 triangles connected as a fan.
kRenderTriangleStrip A set of n − 2 triangles connected as a strip.
kRenderIndexedTriangles A set of triangles with indexed vertices.
kRenderQuads A set of n / 4 unconnected quads.
kRenderQuadStrip A set of n − 3 quads connected as a strip.
kRenderIndexedQuads A set of quads with indexed vertices.
When an object is rendered, the current light (as established using the GraphicsMgr::SetLight function) determines how the object is shaded. The state parameter specifies light-independent rendering state and may be any combination of the following bit flags.
kRenderDepthTest The depth test is enabled. If the depth test is disabled, then depth is also not written.
kRenderColorInhibit Writes to the color buffer are disabled.
kRenderDepthInhibit Writes to the depth buffer are disabled.
kRenderDepthOffset Apply depth offset. See the Renderable::SetDepthOffset function.
kRenderLineSmooth Line smoothing is enabled (only valid if rendering lines).
kRenderWireframe Render wireframe instead of filled polygons.
Base Classes
ListElement<Renderable> Renderable objects are stored in a list that is passed to the GraphicsMgr::DrawRenderList function.