Nugget
|
#include <psyqo/primitives/common.hh>
Public Attributes | ||
struct { | ||
union { | ||
int16_t x | ||
int16_t u | ||
int16_t s | ||
int16_t w | ||
} | ||
union { | ||
int16_t y | ||
int16_t v | ||
int16_t t | ||
int16_t h | ||
} | ||
}; | ||
uint32_t | packed | |
The Vertex struct.
Represents a vertex in the VRAM space. Its binary representation is meant to be the same as the vertices that GPU commands await. It should fit in a single register, and the MIPS ABI ought to pass it as argument or return value gracefully, making it a nice general purpose utility.
Accessors can be either {x, y}, {u, v}, {s, t}, or {w, h}, for readability purposes.
Using C++ list-initializations, one can create a vertex directly using such syntax:
Vertex{{.x = 18, .y = 42}};
struct { ... } psyqo::Vertex |
int16_t psyqo::Vertex::h |
uint32_t psyqo::Vertex::packed |
int16_t psyqo::Vertex::s |
int16_t psyqo::Vertex::t |
int16_t psyqo::Vertex::u |
int16_t psyqo::Vertex::v |
int16_t psyqo::Vertex::w |
int16_t psyqo::Vertex::x |
int16_t psyqo::Vertex::y |