Static, since there is one video backend. More...
#include <GuiMeshCache.h>
Static Public Member Functions | |
| static GuiSharedMesh * | acquire (const GuiMeshKey &key) |
| Finds or builds the mesh for a key and takes a reference to it. Pair with release(). | |
| static void | release (GuiSharedMesh *mesh) |
| Gives back a reference from acquire(). | |
| static void | draw (GuiSharedMesh *mesh, float x, float y, float scaleX, float scaleY, uint8_t alpha, std::vector< MeshVertex > &scratch) |
| Draws a mesh with its (0,0) at (x, y), stretched by scaleX/scaleY about that point. | |
| static void | flush () |
| Frees every mesh nothing is holding, including the backend's copies (call when leaving the menu to give the memory back to whatever runs next) | |
Static, since there is one video backend.
Safe to call from any thread except draw(), which must be called from the thread that draws.
Definition at line 53 of file GuiMeshCache.h.
|
static |
Finds or builds the mesh for a key and takes a reference to it. Pair with release().
Definition at line 61 of file GuiMeshCache.cpp.
|
static |
Draws a mesh with its (0,0) at (x, y), stretched by scaleX/scaleY about that point.
| alpha | 255 for opaque; anything less draws through the slower path that rewrites each vertex's alpha |
| scratch | Working space for that path, kept by the caller so it isn't reallocated per frame |
Definition at line 143 of file GuiMeshCache.cpp.
|
static |
Frees every mesh nothing is holding, including the backend's copies (call when leaving the menu to give the memory back to whatever runs next)
Definition at line 120 of file GuiMeshCache.cpp.
|
static |
Gives back a reference from acquire().
The mesh stays cached, ready for the next shape that wants it, until the cache needs the room.
Definition at line 83 of file GuiMeshCache.cpp.