rayfract

view src/utktext.h @ 2:87b6a11c920b

added gui stuff
author John Tsiombikas <nuclear@siggraph.org>
date Tue, 26 Oct 2010 08:49:09 +0300
parents
children bf1d56975cc9
line source
1 #ifndef TEXT_H
2 #define TEXT_H
4 #if defined(WIN32) || defined(__WIN32__)
5 #include <windows.h>
6 #endif
8 #include <vmath.h>
10 class Color {
11 public:
12 float r, g, b, a;
14 Color() {r = g = b = a = 1.0f;}
15 Color(float r, float g, float b, float a = 1.0f) {this->r = r; this->g = g; this->b = b; this->a = a;}
16 };
19 unsigned int CreateFont(const char *fname, int font_size);
20 void DeleteFont(unsigned int fid);
21 unsigned int GetFont(const char *fname, int sz);
22 bool BindFont(unsigned int fid);
25 void SetTextPos(const Vector2 &pos);
26 Vector2 GetTextPos();
28 void TextLineAdvance(int adv = 1);
29 void TextCRet();
31 void SetTextSize(float sz);
32 float GetTextSize();
34 void SetTextColor(const Color &col);
35 Color GetTextColor();
37 float PrintChar(char c);
38 float PrintString(const char *text, bool standalone = true);
39 void PrintStringLines(const char **str, int lines);
41 float GetMaxDescent();
42 float GetLineAdvance();
43 float GetTextWidth(const char *str);
45 #endif // TEXT_H