Mercurial > repos > simple16
annotate src/system.h @ 34:4a093f15fb1b
Finish controller test for controller 1
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sun, 03 Apr 2016 19:03:35 -0700 |
parents | 4c9dbfa30a66 |
children |
rev | line source |
---|---|
15 | 1 #ifndef SYSTEM_H_ |
2 #define SYSTEM_H_ | |
3 | |
24 | 4 //initializes audio and video output with the given parameters |
5 int system_init(int width, int height, int desired_sample_rate); | |
6 //Should be called once per frame to get a pointer to the output buffer at the start of rendering | |
15 | 7 uint16_t *system_get_framebuffer(int *pitch); |
24 | 8 //Should be called once per frame at the competion of rendering |
9 //The pointer returned by system_get_framebuffer should be discarded after calling this function | |
15 | 10 void system_framebuffer_updated(); |
24 | 11 //Pumps the event queue and processes events |
16
ae58e7c3c328
Poll events regularly to avoid unresponsive app warnings. Handle quit event
Michael Pavone <pavone@retrodev.com>
parents:
15
diff
changeset
|
12 void system_poll_events(); |
24 | 13 //Presents an audio buffer to the system for playback |
14 //Will block until the system is ready for more samples | |
15 //The buffer passed to this function should not be used again | |
16 //by the caller until the next call to system_present_audio | |
17 void system_present_audio(int16_t *buffer); | |
18 //Returns the audio sample rate, which may be different than what was requested | |
19 int system_sample_rate(); | |
20 //Returns the number of samples that should be provided in a call to system_present_audio | |
21 int system_buffer_size(); | |
15 | 22 |
23 #endif //SYSTEM_H_ |