feat: initial version
This commit is contained in:
parent
0a67fb21d1
commit
ee790e99d6
12 changed files with 798 additions and 0 deletions
29
hdrs/graphics.h
Normal file
29
hdrs/graphics.h
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue