-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathresources.h
More file actions
95 lines (70 loc) · 1.89 KB
/
Copy pathresources.h
File metadata and controls
95 lines (70 loc) · 1.89 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#pragma once
#ifndef RESOURCES_H
#define RESOURCES_H
#include "SDL.h"
#include "SDL_ttf.h"
#include "SDL_mixer.h"
#include "SDL_Image.h"
#include "SDL2_gfxPrimitives.h"
#include <iostream>
#include <math.h>
#include <vector>
#include <unordered_map>
#include <string>
#include <map>
#include <list>
#include "Functor.h"
#include "DrawingFunctions.h"
enum ShapeType {
SHAPE_ELLIPSE,
SHAPE_RECTANGLE,
SHAPE_ROUND_RECTANGLE
};
struct ShapeEllipse {
ShapeType shape_type;
Sint16 radx;
Sint16 rady;
};
struct ShapeRoundRectangle {
ShapeType shape_type;
Sint16 w;
Sint16 h;
Sint16 rad;
};
struct ShapeRectangle {
ShapeType shape_type;
Sint16 w;
Sint16 h;
};
union Shape {
ShapeType shape_type;
ShapeEllipse ellipse;
ShapeRectangle rectangle;
ShapeRoundRectangle round_rectangle;
};
struct font_data {
TTF_Font* face;
SDL_Color* color;
};
#include "GStylesheet.h"
SDL_Rect rect_maker(int x, int y, int w, int h);
SDL_Texture* load_image_from_path(SDL_Renderer* renderer, std::string path);
SDL_Texture* load_texture_from_text(SDL_Renderer* renderer, font_data* fontdata, std::string text);
SDL_Texture* load_texture_from_multiline_text(SDL_Renderer* renderer, font_data* fontdata, std::string text, int wrap_x);
SDL_Rect get_rect_from_texture(SDL_Texture* texture);
void fill_texture_with_color(SDL_Renderer*, SDL_Texture*, Uint8, Uint8, Uint8, Uint8);
void expand_rect(SDL_Rect* rect, int x, int y, int w, int h);
void expand_texture(SDL_Renderer* renderer, SDL_Texture** tex, int x1, int y1, int x2, int y2);
enum Direction {
DIRECTION_X,
DIRECTION_Y
};
extern SDL_BlendMode PRESERVE_DST_ALPHA;
extern SDL_BlendMode PRESERVE_SRC_ALPHA;
extern GStylesheet DEFAULT_STYLESHEET;
extern SDL_Color red;
extern SDL_Color blue;
extern SDL_Color green;
extern SDL_Color black;
extern SDL_Color white;
#endif