Commit Graph

19 Commits

Author SHA1 Message Date
lifning 725a5d8f03 more struct docs 2021-11-01 21:14:25 -07:00
lifning ebea5ffd22 video and audio callback API change:
fn video_refresh(&mut self, data: &[u8], width: c_uint, height: c_uint, pitch: c_uint);
    fn video_refresh_dupe(&mut self, width: c_uint, height: c_uint, pitch: c_uint);
    fn video_refresh_hw(&mut self, width: c_uint, height: c_uint);
    fn audio_sample(&mut self, left: i16, right: i16);
    fn audio_sample_batch(&mut self, stereo_pcm: &[i16]) -> usize;

have been replaced with

    fn video_refresh(&mut self, frame: &VideoFrame);
    fn audio_samples(&mut self, stereo_pcm: &[i16]) -> usize;

where VideoFrame is

    pub enum VideoFrame<'a> {
        XRGB1555 { data: &'a [u16], width: c_uint, height: c_uint, pitch_u16: usize },
        RGB565 { data: &'a [u16], width: c_uint, height: c_uint, pitch_u16: usize },
        XRGB8888 { data: &'a [u32], width: c_uint, height: c_uint, pitch_u32: usize },
        Duplicate { width: c_uint, height: c_uint, pitch_u8: usize, },
        HardwareRender { width: c_uint, height: c_uint, },
    }

use `pub fn VideoFrame::data_pitch_as_bytes(&self) -> Option<(&'a [u8], usize)>` for things that need to access the framebuffer data as a byte array rather than a pixel array.
2021-11-01 00:56:23 -07:00
lifning 9d3e74b7cb make do_sleep pub & add a "stuff the buffer with silence" method useful when you wish to pause an interactive emulator 2021-10-19 00:07:34 -07:00
lifning 1b311837d4 that's not what that word means 2021-10-17 22:13:20 -07:00
lifning 2ff0444854 get rid of "component id" business 2021-10-17 22:08:49 -07:00
lifning f1a9f7dd23 add a non-mut version, component_ref 2021-10-17 21:56:53 -07:00
lifning 268f1b4ff8 add scary-looking-but-safe dynamic downcast for a component_mut accessor 2021-10-17 21:46:12 -07:00
lifning 26ff040136 adding plain sdl2 surface component 2021-10-16 02:26:33 -07:00
lifning b735e5f4e5 make example deps properly optional 2021-10-15 21:42:51 -07:00
lifning 41c0864bef misc cleanup for SDL+GL 2021-08-21 21:45:57 -07:00
lifning 71240de38c Support 2D video_refresh in the SDL+GL component
...and alter the behavior of ThreadSleep component a bit.
2021-08-21 20:37:47 -07:00
lifning 0c5d0b5338 clear color buffer on vid refresh 2021-08-20 22:17:38 -07:00
lifning f954fe9ffb tell parallel-n64 to use glide64 when using the SDL_GL component 2021-08-20 21:47:48 -07:00
lifning 2b3409318b trace api-logging component 2021-08-20 21:47:26 -07:00
lifning 013cc247b9 wip messing around with SDL_GL as a possible hw render provider to later mix in with the existing 2D codepaths 2021-08-20 00:14:41 -07:00
lifning 0501812ae9 Split Sdl2Component into audio/video/input/framelimit 2021-08-18 22:05:19 -07:00
Vivian Lim 54bd5de72e update authors for ferretro_components 2021-08-18 16:17:38 -07:00
Vivian Lim 7b850c1800 ferretro_core -> ferretro_base 2021-08-18 14:47:57 -07:00
Vivian Lim 5d2692262c Split into two crates in one workspace: ferretro_core & ferretro_components 2021-08-18 14:32:55 -07:00