-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommon.h
More file actions
68 lines (55 loc) · 1.37 KB
/
common.h
File metadata and controls
68 lines (55 loc) · 1.37 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
#ifndef HEADER_COMMON
#define HEADER_COMMON
#define GLEW_STATIC
#include <GL/glew.h>
#include <GLFW/glfw3.h>
#define PI 3.141592653589793
#define SQRT_2 1.4142135623730951
#define radians(v) (v / 180.0 * PI)
#define MAX(x, y) (((x) > (y)) ? (x) : (y))
#define MIN(x, y) (((x) < (y)) ? (x) : (y))
struct Dim2D {
float width;
float height;
};
typedef struct Dim2D Dim2D;
struct ColorRGBf {
float r;
float g;
float b;
};
typedef struct ColorRGBf ColorRGBf;
struct ColorRGBAf {
float r;
float g;
float b;
float a;
};
typedef struct ColorRGBAf ColorRGBAf;
enum Side {TOP, BOTTOM, LEFT, RIGHT};
typedef enum Side Side;
struct UsableShaderData {
GLuint shaderProgram;
GLuint vao;
void (*drawFunction)();
};
typedef struct UsableShaderData UsableShaderData;
struct UsableShaderDataInput {
GLuint shaderProgram;
GLuint vao;
void (*drawFunction)(void*);
};
typedef struct UsableShaderDataInput UsableShaderDataInput;
struct Character {
unsigned int textureID; // ID handle of the glyph texture
Dim2D size; // Size of glyph
Dim2D bearing; // Offset from baseline to left/top of glyph
unsigned int advance; // Offset to advance to next glyph
};
typedef struct Character Character;
struct CharacterList {
Character * characters;
unsigned int count;
};
typedef struct CharacterList CharacterList;
#endif