rework rendering slightly to include a border

This commit is contained in:
2025-02-03 15:59:33 +01:00
parent 150e811bdd
commit 9d648a747d
2 changed files with 12 additions and 5 deletions

View File

@@ -5,10 +5,14 @@
#include "../game/game.h"
#define SCREEN_WIDTH (COLUMNS * 25)
#define SCREEN_HEIGHT (SCREEN_WIDTH / COLUMNS * ROWS)
#define BLOCK_WIDTH (SCREEN_WIDTH / COLUMNS)
#define BLOCK_HEIGHT (SCREEN_HEIGHT / ROWS)
#define SCREEN_RESOLUTION 25 // pixels per block
#define SCREEN_WIDTH ((COLUMNS) * 25) // window width
#define SCREEN_HEIGHT (SCREEN_WIDTH / COLUMNS * ROWS) // window height
#define TET_PADDING 10 // padding around the tetris playing field
#define TET_WIDTH (SCREEN_WIDTH - TET_PADDING * 2) // tetris playing field width
#define TET_HEIGHT (SCREEN_HEIGHT - TET_PADDING * 2) // tetris playing field height
#define BLOCK_WIDTH (TET_WIDTH / COLUMNS) // width of a block
#define BLOCK_HEIGHT (TET_HEIGHT / ROWS) // height of a block
typedef struct {
SDL_Window* window;