libc8
CHIP-8 utility library
Loading...
Searching...
No Matches
graphics.h
Go to the documentation of this file.
1
10#ifndef C8_GRAPHICS_H
11#define C8_GRAPHICS_H
12
13#include <stdint.h>
14
18#define C8_LOW_DISPLAY_WIDTH 64
19
23#define C8_LOW_DISPLAY_HEIGHT 32
24
28#define C8_HIGH_DISPLAY_WIDTH 128
29
33#define C8_HIGH_DISPLAY_HEIGHT 64
34
38#define C8_DEFAULT_WINDOW_WIDTH 800
39
43#define C8_DEFAULT_WINDOW_HEIGHT 400
44
48#define C8_DISPLAYMODE_LOW 0
49
53#define C8_DISPLAYMODE_HIGH 1
54
60typedef struct {
62 uint8_t mode;
64
65uint8_t* c8_get_pixel(C8_Display*, int, int);
66
67extern int c8_sound_play(void);
68extern int c8_sound_stop(void);
69extern int c8_deinit_graphics(void);
70extern int c8_init_graphics(void);
71extern int c8_render(C8_Display*, int*);
72extern int c8_tick(int*);
73
74#endif
int c8_tick(int *)
Process keypresses.
Definition: graphics_ncurses.c:161
int c8_sound_stop(void)
Stop the sound playing.
Definition: graphics_ncurses.c:87
int c8_render(C8_Display *, int *)
Definition: graphics_ncurses.c:120
int c8_deinit_graphics(void)
Deinitialize the graphics library.
Definition: graphics_ncurses.c:95
int c8_sound_play(void)
Start playing the sound.
Definition: graphics_ncurses.c:77
uint8_t * c8_get_pixel(C8_Display *, int, int)
Get the value of (x,y) from display
Definition: graphics.c:108
int c8_init_graphics(void)
Initialize the graphics library.
Definition: graphics_ncurses.c:38
#define C8_HIGH_DISPLAY_HEIGHT
Height of the high-resolution display.
Definition: graphics.h:33
#define C8_HIGH_DISPLAY_WIDTH
Width of the high-resolution display.
Definition: graphics.h:28
Represents a graphics display.
Definition: graphics.h:60
uint8_t mode
Display mode (C8_DISPLAYMODE_LOW or C8_DISPLAYMODE_HIGH)
Definition: graphics.h:62