]> git.sesse.net Git - ccbs/blob - bigscreen/fonts.h
Parametrize color scheme into a separate header file.
[ccbs] / bigscreen / fonts.h
1 #ifndef _FONTS_H
2 #define _FONTS_H 1
3
4 #include <ft2build.h>
5 #include FT_FREETYPE_H
6 #include <vector>
7 #include "widestring.h"
8 #include "design.h"
9
10 struct TextDefer {
11         widestring str;
12         double size;
13         unsigned xpos, ypos;
14         int r, g, b;
15         int rn, gn, bn;
16
17         bool changed;
18 };
19
20 void init_freetype();
21 void set_screen_size(unsigned width, unsigned height);
22 unsigned my_draw_text(const widestring &str, unsigned char *buf, double size, int xpos = 0, int ypos = 0, int r = DATA_RED, int g = DATA_GREEN, int b = DATA_BLUE);
23
24 // draw_all_deferred_text draws every string in current that is not the same in old, in red
25 void my_draw_text_deferred(std::vector<TextDefer> &td, const widestring &str, double size, int xpos, int ypos, int r = DATA_RED, int g = DATA_GREEN, int b = DATA_BLUE, int rn = FRESH_DATA_RED, int gn = FRESH_DATA_GREEN, int bn = FRESH_DATA_BLUE);
26 void draw_all_deferred_text(unsigned char *buf, std::vector<TextDefer> &current, std::vector<TextDefer> &old);
27
28 #endif /* !defined(_FONTS_H) */