add colour

This commit is contained in:
2025-01-19 21:05:31 +01:00
parent 9362cb092c
commit 2933f5bdd8
4 changed files with 42 additions and 13 deletions

View File

@@ -1,12 +1,26 @@
#pragma once
#include <SDL2/SDL.h>
#include "../game/game.h"
#define SCREEN_WIDTH 256
#define SCREEN_HEIGHT (SCREEN_WIDTH * 2)
#define BLOCK_WIDTH (SCREEN_WIDTH / 16)
#define BLOCK_WIDTH (SCREEN_WIDTH / COLUMNS)
#define BLOCK_HEIGHT (SCREEN_HEIGHT / (BLOCK_WIDTH * 2))
// fits colours in a 3 bit length
// 4th bit is unused
typedef enum {
BLACK = 0,
RED = 1,
GREEN = 2,
BLUE = 4,
YELLOW = RED | GREEN,
CYAN = GREEN | BLUE,
MAGENTA = BLUE | RED,
WHITE = RED | GREEN | BLUE,
} Colour;
typedef struct {
SDL_Window* window;
SDL_Renderer* renderer;