libgui 2.01
libgui is a GUI library for the GameCube, Wii, and Wii U
 
Loading...
Searching...
No Matches
GuiMeshCache Class Reference

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)
 

Detailed Description

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.

Member Function Documentation

◆ acquire()

GuiSharedMesh * GuiMeshCache::acquire ( const GuiMeshKey & key)
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.

◆ draw()

void GuiMeshCache::draw ( GuiSharedMesh * mesh,
float x,
float y,
float scaleX,
float scaleY,
uint8_t alpha,
std::vector< MeshVertex > & scratch )
static

Draws a mesh with its (0,0) at (x, y), stretched by scaleX/scaleY about that point.

Parameters
alpha255 for opaque; anything less draws through the slower path that rewrites each vertex's alpha
scratchWorking space for that path, kept by the caller so it isn't reallocated per frame

Definition at line 143 of file GuiMeshCache.cpp.

◆ flush()

void GuiMeshCache::flush ( )
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)

Examples
demo.cpp.

Definition at line 120 of file GuiMeshCache.cpp.

◆ release()

void GuiMeshCache::release ( GuiSharedMesh * mesh)
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.


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