class
GUIMeshBatches
Maintains a set of meshes used for drawing GUI elements.
When possible GUI render elements will be merged into the same mesh (i.e. a batch) in order to reduce render time. Additionally, each batch maintains a list of dirty regions that need to be updated by the GUI renderer.
Public
Constructors
GUIMeshBatches
Methods
Add
Iterates over all the render elements in the GUI elements and adds them to suitable batches.
Remove
Removes all render elements in the provided GUI element from their current set of batches.
RebuildDirty
Rebuilds any dirty internal data and returns the data structure required for updating the GUI renderer.
MarkContentDirty
Notifies the system that element's contents were marked as dirty.
MarkMeshDirty
Notifies the system that element's mesh was marked as dirty.
Private
Methods
AllocateBatchId
Returns a unique batch id.
SplitDepthRange
Splits the provided depth range at the specified depth.
Returns the index of second half of the depth range.
CollapseDepthRange
Attempts to collapse the provided depth range and the previous depth range into a single depth range.
Returns true if the merge was performed.
RebuildMeshes
Rebuilds the GUI element meshes.
Add
Adds a specific render element of a GUI element to a batch in the depth range at the provided index.
Caller is responsible for ensuring the element falls within the correct depth range.
Add
Adds a specific render element of a GUI element to a batch in a suitable depth range.
Add
Adds the specified render element of a GUI element to the specified depth range.
Based on the provided material information a new batch will be created in the depth range, or the render element will be appended to an existing batch. Batch it was added to will be returned.
Remove
Removes a specific render element in the provided GUI element from their batch in the provided depth range.
Caller is responsible for ensuring the provided draw group is contained in the provided depth range.
Remove
Removes a specific render element in the provided GUI element from their current batch.
MarkBoundsDirty
Marks region covered by of all the batches associated with the element as dirty, so they will be redrawn on the next frame.
If element is being resized or moved, this should be called on the old position/size, as well as on the new position/size.
MarkBoundsDirty
Marks region covered by of a particular batch associated with the element as dirty, so it will be redrawn on the next frame.
If element is being resized or moved, this should be called on the old position/size, as well as on the new position/size.
staticGetRenderData
Builds a structure with information required for rendering the provided batch.
staticCalculateBounds
Calculates the bounds of all elements in all the batches in the provided batch.
staticCreateBatchedMaterial
Creates information about a material for the provided render element.
staticCreateBatchedMaterial
Creates information about a material for the provided render element.