|
MTek-GDL 0.100.4-muffintrap
|
Functions for basic 2D drawing operations. More...
Go to the source code of this file.
Functions | |
| Rect | Rect_Create (short x, short y, short w, short h) |
| Creates a rectangle struct. | |
| Rect | Rect_CreateV2f (vec2 position, vec2 size) |
| Creates a rectangle struct. | |
| void | Draw2D_OrigoTo (short x, short y) |
| Translates the origo to given point. | |
| void | Draw2D_OrigoToV2f (vec2 origo) |
| void | Draw2D_RectLines (short x, short y, short x2, short y2, Color4f *color) |
| Draws a box border. | |
| void | Draw2D_RectLinesWH (short x, short y, short w, short h, Color4f *color) |
| void | Draw2D_RectLinesRec (Rect rect, Color4f *color) |
| void | Draw2D_Rect (short x, short y, short x2, short y2, Color4f *color) |
| Draws a filled box. | |
| void | Draw2D_RectR (Rect rect, Color4f *color) |
| void | Draw2D_Quad (short xtl, short ytl, short xbl, short ybl, short xbr, short ybr, short xtr, short ytr, Color4f *color) |
| Draws a filled quad with freely positioned corners. | |
| void | Draw2D_QuadV2f (vec2 tl, vec2 bl, vec2 br, vec2 tr, Color4f *color) |
| void | Draw2D_Line (short int x, short int y, short int x2, short int y2, Color4f *color) |
| Draws a line. | |
| void | Draw2D_LineV2f (vec2 start, vec2 end, Color4f *color) |
| Draws a line. | |
| void | Draw2D_Text (short x, short y, const char *text, Color4f *color) |
| Draws text using the default font. | |
| void | Draw2D_TextV2f (vec2 position, const char *text, Color4f *color) |
| Draws text using the default font. | |
Functions for basic 2D drawing operations.
2D drawing functions for debugging and ui elements and simple games. These functions expect the ortographic projection be set
| void Draw2D_Line | ( | short int | x, |
| short int | y, | ||
| short int | x2, | ||
| short int | y2, | ||
| Color4f * | color | ||
| ) |
Draws a line.
| x | Start point x |
| y | Start point y |
| x2 | End point x |
| y2 | End point y |
| color | Color of the line. |
| void Draw2D_LineV2f | ( | vec2 | start, |
| vec2 | end, | ||
| Color4f * | color | ||
| ) |
Draws a line.
| start | Start point |
| end | Start point |
| color | Color of the line. |
| void Draw2D_OrigoTo | ( | short | x, |
| short | y | ||
| ) |
Translates the origo to given point.
| x | Origo x in screen units. |
| x | Origo y in screen units. |
| void Draw2D_Quad | ( | short | xtl, |
| short | ytl, | ||
| short | xbl, | ||
| short | ybl, | ||
| short | xbr, | ||
| short | ybr, | ||
| short | xtr, | ||
| short | ytr, | ||
| Color4f * | color | ||
| ) |
Draws a filled quad with freely positioned corners.
| xtl | Upper left corner x in screen units. |
| ytl | Upper left corner y in screen units. |
| xbl | Lower left corner x in screen units. |
| ybl | Lower left corner y in screen units. |
| xbr | Lower right corner x in screen units. |
| ybr | Lower right corner y in screen units. |
| xtr | Upper right corner x in screen units. |
| ytr | Upper right corner y in screen units. |
| color | Color of the quad. |
| void Draw2D_Rect | ( | short | x, |
| short | y, | ||
| short | x2, | ||
| short | y2, | ||
| Color4f * | color | ||
| ) |
Draws a filled box.
| x | Upper left corner x in screen units. |
| y | Upper left corner y in screen units. |
| x2 | Lower right corner x in screen units. |
| y2 | Lower right corner y in screen units. |
| color | Color of the box. |
| void Draw2D_RectLines | ( | short | x, |
| short | y, | ||
| short | x2, | ||
| short | y2, | ||
| Color4f * | color | ||
| ) |
Draws a box border.
The box is drawn using GL_LINES so the width is 1 pixel by default
| x | Upper left corner x in screen units. |
| y | Upper left corner y in screen units. |
| x2 | Lower right corner x in screen units. |
| y2 | Lower right corner y in screen units. |
| color | Color of the border |
| void Draw2D_Text | ( | short | x, |
| short | y, | ||
| const char * | text, | ||
| Color4f * | color | ||
| ) |
Draws text using the default font.
| x | Upper left x of first letter. |
| y | Upper left y of first letter. |
| text | Text to be drawn. |
| color | Color of the text. |
| void Draw2D_TextV2f | ( | vec2 | position, |
| const char * | text, | ||
| Color4f * | color | ||
| ) |
Draws text using the default font.
| position | Upper left corner of first letter |
| text | Text to be drawn. |
| color | Color of the text. |
| Rect Rect_Create | ( | short | x, |
| short | y, | ||
| short | w, | ||
| short | h | ||
| ) |
Creates a rectangle struct.
| x | Top left corner x |
| y | Top left corner y |
| w | Width of rectangle |
| h | Height of rectangle |
| Rect Rect_CreateV2f | ( | vec2 | position, |
| vec2 | size | ||
| ) |
Creates a rectangle struct.
| position | Top left corner |
| size | Size of rectangle: x is width, y is height |