![]() |
CUGL 3.0
Cornell University Game Library
|
#include <CUObjBatch.h>
Public Member Functions | |
ObjBatch () | |
~ObjBatch () | |
void | dispose () override |
bool | init () |
bool | init (Uint32 key, Uint32 priority) override |
void | append (const std::shared_ptr< SceneNode > &node, const Mat4 &transform) override |
void | flush (const std::shared_ptr< Camera > &camera) override |
void | clear () override |
![]() | |
Scene3Batch () | |
virtual void | dispose () |
virtual bool | init (Uint32 key, Uint32 priority) |
Uint32 | getBatchKey () const |
Uint32 | getPriority () const |
virtual void | append (const std::shared_ptr< SceneNode > &node, const Mat4 &transform)=0 |
virtual void | flush (const std::shared_ptr< Camera > &camera)=0 |
virtual void | clear ()=0 |
Static Public Member Functions | |
static std::shared_ptr< ObjBatch > | alloc () |
static std::shared_ptr< ObjBatch > | alloc (Uint32 key, Uint32 priority) |
Static Public Attributes | |
static const Uint32 | BATCH_KEY = 1 |
Additional Inherited Members | |
![]() | |
Uint32 | _batchkey |
Uint32 | _priority |
This class is a batch for drawing ObjNode
objects.
This class is only designed for ObjNode
objects. Attempts to apply it to any other SceneNode
will be ignored. Objects are drawn in the order they are appended to the batch.
|
inline |
Creates a new degenerate batch on the stack.
The batch has no shader, and therefore cannot draw anything.
NEVER USE A CONSTRUCTOR WITH NEW. If you want to allocate an object on the heap, use one of the static constructors instead.
|
inline |
Deletes this batch, disposing all resources
|
inlinestatic |
Returns a newly allocated OBJ batch with the default key and priority.
This method can fail is the shader fails to compile.
|
inlinestatic |
Returns a newly allocated OBJ batch with the given key and priority.
This method can fail is the shader fails to compile.
key | The batch key |
priority | The batch priority |
|
overridevirtual |
Appends a scene node to this batch for drawing.
The scene node will be ignored if it not an instance of ObjNode
. Nodes will be drawn in the order appended.
node | The node to draw |
transform | The global transform |
Implements cugl::scene3::Scene3Batch.
|
inlineoverridevirtual |
Removes all appended nodes without drawing them.
Calling flush
after this method will draw nothing.
Implements cugl::scene3::Scene3Batch.
|
inlineoverridevirtual |
Disposes all of the resources used by this batch.
A disposed batch can be safely reinitialized. Any shader owned by this batch will be released. It will be deleted if no other object owns it.
Reimplemented from cugl::scene3::Scene3Batch.
|
overridevirtual |
Draws all appended nodes.
Nodes will be drawn in the order appended.
camera | The camera to draw with |
Implements cugl::scene3::Scene3Batch.
|
inline |
Initializes a new OBJ batch with the default key and priority.
This method can fail is the shader fails to compile.
|
overridevirtual |
Initializes a new OBJ batch with the given key and priority.
This method can fail is the shader fails to compile.
key | The batch key |
priority | The batch priority |
Reimplemented from cugl::scene3::Scene3Batch.
|
static |
The key for this batch type