forked from knela96/XMultiply-Arcade-Game
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModuleFonts.h
More file actions
39 lines (27 loc) · 672 Bytes
/
Copy pathModuleFonts.h
File metadata and controls
39 lines (27 loc) · 672 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef __ModuleFonts_H__
#define __ModuleFonts_H__
#include "Module.h"
#include "SDL\include\SDL_pixels.h"
#define MAX_FONTS 10
#define MAX_FONT_CHARS 256
struct SDL_Texture;
struct Font
{
char table[MAX_FONT_CHARS];
SDL_Texture* graphic = nullptr;
uint rows, len, char_w, char_h, row_chars;
};
class ModuleFonts : public Module
{
public:
ModuleFonts();
~ModuleFonts();
// Load Font
int Load(const char* texture_path, const char* characters, uint rows = 1);
void UnLoad(int font_id);
// Create a surface from text
void BlitText(int x, int y, int bmp_font_id, const char* text) const;
private:
Font fonts[MAX_FONTS];
};
#endif // __ModuleFonts_H__