-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfonts.h
45 lines (39 loc) · 1.13 KB
/
fonts.h
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
40
41
42
43
44
45
// fonts.h
#ifndef FONTS_H
#define FONTS_H
#include <iostream>
#include <vector>
#include <string>
#include "SDL.h"
#include <SDL_ttf.h>
#include "framebuffer.h"
class Font
{
public:
//constructor with an int ref (to change dynamically)
Font(const std::vector<int>& location_in,
const int& text_in_int,
const char*& dummy, //needed to initialize m_text
const std::vector<int>& color_in = { 0, 0, 0, 255 },
const int& size_in = 25,
const char* path_font = "../pixelz.ttf");
//constructor with a char pointer (text)
Font(const std::vector<int>& location_in,
const char*& text_in,
const std::vector<int>& color_in = { 0, 0, 0, 255 },
const int& size_in = 25,
const char* path_font = "../pixelz.ttf");
~Font();
void render(SDL_Renderer* renderer_in);
const char*& m_text;
const int& m_size;
const int& m_text_int;
protected:
const std::vector<int> m_location;
const std::vector<int> m_color;
TTF_Font * m_font;
SDL_Color m_colorSDL;
SDL_Surface * m_surface;
SDL_Texture * m_texture;
};
#endif /* FONTS_H */