From 5eadac72916ce9d53ffdc3f908a6e414858fe7e0 Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Tue, 26 Dec 2023 17:51:39 +0100 Subject: Cleaning repository --- src/screen.h | 40 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) (limited to 'src/screen.h') diff --git a/src/screen.h b/src/screen.h index 671285a..075d45a 100644 --- a/src/screen.h +++ b/src/screen.h @@ -3,7 +3,7 @@ #include "raylib.h" #define MODE_CHIP8 0 // Chip-8 64x32 -#define MODE_SCHIP 1 // Super-Chip 128x64 +#define MODE_SCHIP 1 // Super-Chip 128x64 (not supported yet) typedef struct SCREEN_DATA { int width, height; @@ -13,10 +13,46 @@ typedef struct SCREEN_DATA { char pixels[64*32]; } SCREEN_DATA; +/** + * @brief Must be called first! + * + * @param width + * @param height + */ void ScreenInit(int width, int height); + +/** + * @brief Clear the entire simulated screen + * + */ void ScreenClear(); + +/** + * @brief Set the pixel's state of the simulated screen (follow the chip-8 specification) + * + * @param x + * @param y + * @param state + * @return char 1 if pixel was already on and 0 otherwise + */ char ScreenPixelApply(int x, int y, unsigned char state); -void ScreenPixelFlip(int x, int y); + +/** + * @brief Get simulated screen dimensions + * + * @param width + * @param height + */ void ScreenWH(int *width, int *height); + +/** + * @brief Draw simulated screen instantly + * + */ void ScreenUpdate(); + +/** + * @brief Close screen (must be called before quit) + * + */ void ScreenClose(); -- cgit v1.2.3