Skip to content

Commit 2a7ed15

Browse files
committed
clang format and tetromino rotations
1 parent 593bd5d commit 2a7ed15

File tree

7 files changed

+976
-760
lines changed

7 files changed

+976
-760
lines changed

Renderer.cpp

Lines changed: 324 additions & 251 deletions
Large diffs are not rendered by default.

Renderer.h

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
1-
#include <SDL2/SDL.h>
21
#include <GL/glew.h>
3-
#include <vector>
2+
#include <SDL2/SDL.h>
43
#include <array>
4+
#include <vector>
55
#ifndef _RENDERER_H
66
#define _RENDERER_H
77
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();
3131
};
3232
#endif

0 commit comments

Comments
 (0)