Drawing routines. More...
Classes | |
struct | Disable |
Disables rendering capabilities. More... | |
struct | Enable |
Enables rendering capabilities. More... | |
Enumerations | |
enum | |
Primitives. | |
enum | |
Capabilities (for disable() and enable()). | |
enum | |
Attribute masks. | |
enum | |
Transform matrices. | |
Functions | |
int | printError (const char *pre="", bool verbose=true, FILE *out=stdout) |
Print rendering errors to file. | |
void | fog (float end, float start, const Color &c=Color(0)) |
Set linear fog parameters. | |
void | grid (float l, float t, float w, float h, float divx, float divy, bool incEnds=true) |
Parallel horizontal and vertical lines. | |
void | linesH (float l, float t, float w, float h, int n) |
Parallel horizontal lines. | |
void | paint (int prim, const GraphicsData &gb) |
Render graphics data. | |
void | pgon (float l, float t, float w, float h, int sides, float angleNorm=0, double loops=1) |
Regular polygon. | |
void | push2D (float w, float h) |
Push 2-D pixel space. | |
void | pop2D () |
Pop 2-D pixel space. | |
void | push3D (float w, float h, float near=0.1, float far=100, float fovy=45) |
Push 3-D signed normalized cartesian space. | |
void | pop3D () |
Pop 3-D signed normalized cartesian space. | |
void | text (const char *s, float l=0, float t=0, unsigned fontSize=8, float lineSpacing=1, unsigned tabSpaces=4) |
Draws a text string, including new lines and tabs. | |
void | blendFunc (int sfactor, int dfactor) |
Set blending function. | |
void | blendTrans () |
Set blending function to transparent. | |
void | blendAdd () |
Set blending function to additive. | |
void | clear (int mask) |
Clear drawing buffers. | |
void | clearColor (float r, float g, float b, float a=1) |
Set clear color. | |
void | clearColor (const Color &c) |
Set clear color. | |
void | color (float gray, float a=1) |
Set current draw color. | |
void | color (float r, float g, float b, float a=1) |
Set current draw color. | |
void | color (const Color &c) |
Set current draw color. | |
void | color (const Color &c, float a) |
Set current draw color, but override alpha component. | |
void | identity () |
Load identity transform matrix. | |
void | lineStipple (char factor, short pattern) |
Specify line stipple pattern. | |
void | lineWidth (float val) |
Set width of lines. | |
void | matrixMode (int mode) |
Set current transform matrix. | |
void | ortho (float l, float r, float b, float t) |
Set orthographic projection mode. | |
void | paint (int prim, Point2 *verts, int numVerts) |
Draw array of 2D vertices. | |
void | paint (int prim, Point2 *verts, unsigned *indices, int numIndices) |
Draw indexed array of 2D vertices. | |
void | paint (int prim, Point3 *verts, int numVerts) |
Draw array of 3D vertices. | |
void | paint (int prim, Point3 *verts, unsigned *indices, int numIndices) |
Draw indexed array of 3D vertices. | |
void | pointSize (float val) |
Set size of points. | |
void | pointAtten (float c2=0, float c1=0, float c0=1) |
Set distance attenuation of points. The scaling formula is clamp(size * sqrt(1/(c0 + c1*d + c2*d^2))). | |
void | pop () |
Pop current transform matrix stack. | |
void | pop (int matrixMode) |
Pop a transform matrix stack also setting as current matrix. | |
void | popAttrib () |
Pop last pushed attributes from stack. | |
void | push () |
Push current transform matrix stack. | |
void | push (int matrixMode) |
Push a transform matrix stack also setting as current matrix. | |
void | pushAttrib (int attribs) |
Push current attributes onto stack. | |
void | scale (float v) |
Scale all dimensions by amount. | |
void | stroke (float w) |
Sets width of lines and points. | |
void | check (float l, float t, float r, float b) |
Check mark. | |
template<int N> | |
void | circle (float l, float t, float r, float b) |
Circle with N edges. | |
template<int N> | |
void | disc (float l, float t, float r, float b) |
Disc with N edges. | |
void | frame (float l, float t, float r, float b) |
Rectangular frame. | |
void | minus (float l, float t, float r, float b) |
Minus. | |
void | plus (float l, float t, float r, float b) |
Plus. | |
void | rectangle (float l, float t, float r, float b) |
Solid rectangle. | |
template<int N, int M, int L> | |
void | rose (float l, float t, float r, float b) |
Rose curve with N edges and M+L loops. | |
template<int N, int M> | |
void | star (float l, float t, float r, float b) |
Star polygon with N edges and M loops. | |
void | triangleR (float l, float t, float r, float b) |
Right pointing triangle. | |
void | triangleL (float l, float t, float r, float b) |
Left pointing triangle. | |
void | triangleU (float l, float t, float r, float b) |
Upward pointing triangle. | |
void | triangleD (float l, float t, float r, float b) |
Downward pointing triangle. | |
void | x (float l, float t, float r, float b) |
X mark. | |
int | pix (float v) |
Converts a float to its pixel value. |
Drawing routines.
void glv::draw::text | ( | const char * | s, | |
float | l = 0 , |
|||
float | t = 0 , |
|||
unsigned | fontSize = 8 , |
|||
float | lineSpacing = 1 , |
|||
unsigned | tabSpaces = 4 | |||
) |
Draws a text string, including new lines and tabs.
The spacing between characters is fixed.