|
1 |
| -#include <SDL2/SDL.h> |
2 | 1 | #include <GL/glew.h>
|
3 |
| -#include <vector> |
| 2 | +#include <SDL2/SDL.h> |
4 | 3 | #include <array>
|
| 4 | +#include <vector> |
5 | 5 | #ifndef _RENDERER_H
|
6 | 6 | #define _RENDERER_H
|
7 | 7 | struct Renderer {
|
8 |
| - SDL_Window* WINDOW = nullptr; |
9 |
| - const int32_t WINDOW_WIDTH = 300; |
10 |
| - const int32_t WINDOW_HEIGHT = 600; |
11 |
| - const int32_t PLAYFIELD_WIDTH = 300; |
12 |
| - const int32_t PLAYFIELD_HEIGHT = 600; |
13 |
| - int32_t BLOCKSIZE; |
14 |
| - GLuint vertex_shader; |
15 |
| - GLuint fragment_shader; |
16 |
| - GLuint current_vao; |
17 |
| - GLuint current_program; |
18 |
| - std::vector<GLuint> programs; |
19 |
| - std::vector<GLuint> vertex_buffer_objects; |
20 |
| - std::vector<GLuint> vertex_array_objects; |
21 |
| - std::vector<std::pair<GLuint, size_t>> element_buffer_objects; |
22 |
| - void render_tetromino(Tetromino); |
23 |
| - void update_tetromino(Tetromino); |
24 |
| - void update_playfield(int32_t); |
25 |
| - void delete_row(int32_t); |
26 |
| - void render(); |
27 |
| - void create_program(); |
28 |
| - std::vector<float> convert_coords_to_vertices(Tetromino); |
29 |
| - Renderer(); |
30 |
| - ~Renderer(); |
| 8 | + SDL_Window *WINDOW = nullptr; |
| 9 | + const int32_t WINDOW_WIDTH = 300; |
| 10 | + const int32_t WINDOW_HEIGHT = 600; |
| 11 | + const int32_t PLAYFIELD_WIDTH = 300; |
| 12 | + const int32_t PLAYFIELD_HEIGHT = 600; |
| 13 | + int32_t BLOCKSIZE; |
| 14 | + GLuint vertex_shader; |
| 15 | + GLuint fragment_shader; |
| 16 | + GLuint current_vao; |
| 17 | + GLuint current_program; |
| 18 | + std::vector<GLuint> programs; |
| 19 | + std::vector<GLuint> vertex_buffer_objects; |
| 20 | + std::vector<GLuint> vertex_array_objects; |
| 21 | + std::vector<std::pair<GLuint, size_t>> element_buffer_objects; |
| 22 | + void render_tetromino(Tetromino); |
| 23 | + void update_tetromino(Tetromino); |
| 24 | + void update_playfield(int32_t); |
| 25 | + void delete_row(int32_t); |
| 26 | + void render(); |
| 27 | + void create_program(); |
| 28 | + std::vector<float> convert_coords_to_vertices(Tetromino); |
| 29 | + Renderer(); |
| 30 | + ~Renderer(); |
31 | 31 | };
|
32 | 32 | #endif
|
0 commit comments