Mercurial > repos > simple16
view 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 |
line wrap: on
line source
#ifndef SYSTEM_H_ #define SYSTEM_H_ //initializes audio and video output with the given parameters int system_init(int width, int height, int desired_sample_rate); //Should be called once per frame to get a pointer to the output buffer at the start of rendering uint16_t *system_get_framebuffer(int *pitch); //Should be called once per frame at the competion of rendering //The pointer returned by system_get_framebuffer should be discarded after calling this function void system_framebuffer_updated(); //Pumps the event queue and processes events void system_poll_events(); //Presents an audio buffer to the system for playback //Will block until the system is ready for more samples //The buffer passed to this function should not be used again //by the caller until the next call to system_present_audio void system_present_audio(int16_t *buffer); //Returns the audio sample rate, which may be different than what was requested int system_sample_rate(); //Returns the number of samples that should be provided in a call to system_present_audio int system_buffer_size(); #endif //SYSTEM_H_