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 *)
Grab current keypresses and delay execution to match clockspeed.
Definition: graphics.c:92
int c8_sound_stop(void)
Play sound.
Definition: graphics.c:35
int c8_render(C8_Display *, int *)
Render graphics.
Definition: graphics.c:77
int c8_deinit_graphics(void)
Deinitialize graphics system.
Definition: graphics.c:49
int c8_sound_play(void)
Stop sound.
Definition: graphics.c:21
uint8_t * c8_get_pixel(C8_Display *, int, int)
Get the value of (x,y) from display
Definition: graphics.c:106
int c8_init_graphics(void)
Initialize graphics system.
Definition: graphics.c:63
#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