GraphicHandler¶
GraphicHandler interface.
Overview¶
Typical use cases:
Defining a common interface for graphic batch handling
Header¶
<RaeptorCogs/GAPI/Common/Core/GraphicHandler.hpp>
Metadata¶
- Author
Estorc
- Version
v1.0
- Copyright
Copyright (c) 2025 Estorc MIT License.
Structs¶
Struct |
Description |
|---|---|
|
Batch key structure. |
|
Graphic batch handler structure. |
-
struct BatchKey¶
Batch key structure.
Represents a unique key for graphic batching based on rendering parameters.
Public Functions
-
inline bool operator<(const BatchKey &other) const noexcept¶
Less-than operator for ordering.
Note
Used for sorting BatchKeys in collections.
-
inline bool operator>(const BatchKey &other) const noexcept¶
Greater-than operator for ordering.
Note
Used for sorting BatchKeys in collections.
Public Members
-
int writingMask¶
Writing mask.
Indicates which buffers are written to during rendering.
Note
Used for batching graphics with similar write operations.
-
int readingMask¶
Reading mask.
Indicates which buffers are read from during rendering.
Note
Used for batching graphics with similar read operations.
-
int zindex¶
Z-index for rendering order.
Determines the rendering order of graphics, with lower values rendered first.
Note
Used for batching graphics with similar depth.
-
bool isOpaque¶
Opaqueness flag.
Indicates whether the graphic is opaque or transparent.
Note
Used for batching graphics with similar transparency.
-
inline bool operator<(const BatchKey &other) const noexcept¶
-
struct GraphicBatchHandler¶
Graphic batch handler structure.
Manages batching information for a graphic during rendering.
Public Functions
Public Members
-
unsigned int staticDataCursor¶
Static data cursor.
Indicates the position in the static instance data buffer.
Note
Not size_t to replicate GL buffer offset limitations.
-
unsigned int dynamicDataCursor¶
Dynamic data cursor.
Indicates the position in the dynamic instance data buffer.
Note
Not size_t to replicate GL buffer offset limitations.
-
unsigned int dynamicDataSize¶
Dynamic data size.
Indicates the size of the dynamic instance data for this graphic.
Note
Not size_t to replicate GL buffer size limitations.
-
Graphic2D *graphic¶
Pointer to the associated graphic.
The graphic being managed by this batch handler.
-
bool isDirty¶
Dirty flag.
Indicates whether the graphic’s data has changed and needs to be re-uploaded.
-
unsigned int staticDataCursor¶
Functions¶
Function |
Description |
|---|---|
|
Stream output operator for BatchKey. |
|
Stream output operator for GraphicBatchHandler. |
-
inline std::ostream &std::operator<<(std::ostream &os, const RaeptorCogs::BatchKey &key)¶
Stream output operator for BatchKey.
Note
Outputs the BatchKey in a human-readable format.
- Parameters:
os – Output stream.
key – BatchKey instance to output.
- Returns:
Reference to the output stream.
-
inline std::ostream &std::operator<<(std::ostream &os, const RaeptorCogs::GAPI::Common::GraphicBatchHandler &handler)¶
Stream output operator for GraphicBatchHandler.
Note
Outputs the GraphicBatchHandler in a human-readable format.
- Parameters:
os – Output stream.
handler – GraphicBatchHandler instance to output.
- Returns:
Reference to the output stream.