feat: initial version

This commit is contained in:
Zoëy Noort 2025-05-05 18:50:56 +02:00
parent 0a67fb21d1
commit ee790e99d6
12 changed files with 798 additions and 0 deletions

29
hdrs/graphics.h Normal file
View file

@ -0,0 +1,29 @@
#ifndef GRAPHICS_H
#define GRAPHICS_H
#include <SDL2/SDL.h>
#include <stdint.h>
struct s_chip8;
typedef struct s_chip8 t_chip8;
#define SCREEN_WIDTH 64
#define SCREEN_HEIGHT 32
#define SCALE 12
typedef struct s_display
{
SDL_Window *window;
SDL_Renderer *renderer;
SDL_Texture *texture;
uint32_t pixels[SCREEN_WIDTH * SCREEN_HEIGHT];
} t_display;
int graphics_init(t_display *display);
void graphics_render(t_chip8 *emu);
void graphics_cleanup(t_display *display);
void graphics_draw_sprite(t_chip8 *emu, uint8_t x, uint8_t y, uint8_t n);
int graphics_display_ready();
#endif