CUGL 2.3
Cornell University Game Library
|
#include <CUOrderedNode.h>
Public Member Functions | |
Context (OrderedNode *parent) | |
Context (const Context ©) | |
~Context () | |
Static Public Member Functions | |
static bool | sortCompare (Context *a, Context *b) |
Public Attributes | |
OrderedNode * | parent |
std::shared_ptr< SceneNode > | node |
std::shared_ptr< Scissor > | scissor |
Affine2 | transform |
Color4 | tint |
Uint32 | canonical |
A class storing the drawing context for the render queue.
The challenge with reordering a scene graph is that you have state on the stack that must be managed: the drawing transform, the tint color, and the scissor value. Normally these are managed by the call stack during a recursive call. To reorder rendering, we have to make this explicit.
This class is essentially a struct with a sort order.
cugl::scene2::OrderedNode::Context::Context | ( | OrderedNode * | parent | ) |
Creates a drawing context with the given parent object
parent | The parent object for the inner class |
cugl::scene2::OrderedNode::Context::Context | ( | const Context & | copy | ) |
Creates a copy of the given drawing context
copy | The drawing context to copy |
cugl::scene2::OrderedNode::Context::~Context | ( | ) |
Deletes this drawing context, disposing of all resources.
Returns the value *a < *b
This function implements a sort order on drawing contexts and is used to sort the render queue.
a | The first (pointer) to compare |
b | The first (pointer) to compare |
Uint32 cugl::scene2::OrderedNode::Context::canonical |
The canonical order (for pre-order and post-order traversals)
std::shared_ptr<SceneNode> cugl::scene2::OrderedNode::Context::node |
The node to be drawn at this step
OrderedNode* cugl::scene2::OrderedNode::Context::parent |
The parent of this inner class (as C++ does not have this Java feature)
std::shared_ptr<Scissor> cugl::scene2::OrderedNode::Context::scissor |
The scissor value (possibly nullptr)
Color4 cugl::scene2::OrderedNode::Context::tint |
The tint color
Affine2 cugl::scene2::OrderedNode::Context::transform |
The drawing transform