NWengine 0.9
Loading...
Searching...
No Matches
Batch Class Reference

The Batch class represents a batch of game objects to be rendered together. More...

#include <Batch.h>

Public Member Functions

 Batch ()
 Default constructor for the Batch class.
 
bool Render (GameObject *go, float *stride)
 Renders a game object using the batch.
 
void BindTextures ()
 Binds the textures associated with the batch.
 
void Draw ()
 Draws the batch.
 
void Delete ()
 Deletes the batch.
 

Static Public Member Functions

static void ComputeIndices ()
 Computes the indices for the batch.
 
static int DefaultBatchDrawCallback (void *data)
 Default batch draw callback function.
 

Public Attributes

std::string shader = ""
 
int layer = 0
 
bool isDynamic = 1
 
std::unordered_map< GameObject *, intobjs
 
std::vector< floatvertices
 
std::unordered_map< Texture *, inttextures
 

Static Public Attributes

static const uint32 strideSize = 9
 
static const uint32 strideSizeByte = 36
 
static uint32 * indices = nullptr
 
static int indicesSize = 0
 
static uint32 batchMaxQuads = 2048
 
static uint16 maxBatchTextures = 0
 
static std::unordered_map< int, std::vector< Batch * > > batchMap
 

Detailed Description

The Batch class represents a batch of game objects to be rendered together.

Member Function Documentation

◆ DefaultBatchDrawCallback()

int Batch::DefaultBatchDrawCallback ( void * data)
static

Default batch draw callback function.

Parameters
dataThe data for the draw callback.
Returns
The result of the draw callback.

◆ Render()

bool Batch::Render ( GameObject * go,
float * stride )

Renders a game object using the batch.

Parameters
goThe game object to render.
strideThe stride of the vertex data.
Returns
True if the rendering is successful, false otherwise.

The documentation for this class was generated from the following files: