-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathScreen.h
63 lines (48 loc) · 1.16 KB
/
Screen.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#ifndef _SCREEN_H
#define _SCREEN_H
// For Windowing and input
#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include <string>
#define SCREEN_WIDTH 64
#define SCREEN_HEIGHT 32
const float screen_quad_vert[] = {
-1.0f, -1.0f, 0.0f,
1.0f, -1.0f, 0.0f,
1.0f, 1.0f, 0.0f,
-1.0f, -1.0f, 0.0f,
1.0f, 1.0f, 0.0f,
-1.0f, 1.0f, 0.0f,
};
const float screen_quad_uv[] = {
0.0f, 0.0f,
1.0f, 0.0f,
1.0f, 1.0f,
0.0f, 0.0f,
1.0f, 1.0f,
0.0f, 1.0f,
};
struct Screen
{
const uint32_t width = SCREEN_WIDTH;
const uint32_t height = SCREEN_HEIGHT;
GLFWwindow* window;
std::string window_title;
uint32_t window_width;
uint32_t window_height;
// Set the default GL version
uint32_t glContextMajorVersion = 3;
uint32_t glContextMinorVersion = 3;
// Screen backbuffer
uint32_t back_buffer;
// Screen Vertex Buffer Objects
uint32_t vertex_array_id;
uint32_t vertex_buffer_verts;
uint32_t vertex_buffer_uv;
// Screen Shaders
uint32_t shader_program;
uint32_t vertex_shader;
uint32_t fragment_shader;
uint32_t texture_sampler;
};
#endif