From a0cc9147034fffde006566fbece3c7d060e086ae Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Sat, 18 Nov 2023 13:57:03 -0800 Subject: main: use new til_stream_render() api Instead of just calling til_module_render() with the top-level module context, use the newly added til_stream_render() and til_stream_set_module_context() to achieve the same thing. This is a preparatory commit for handling pre/post-render module contexts automagically in til_stream_render(). e.g. stuff like background music would be hooked into the stream as a pre-render context. --- src/main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index f350a1f..c4e4c4e 100644 --- a/src/main.c +++ b/src/main.c @@ -424,9 +424,8 @@ static void * rototiller_thread(void *_rt) continue; } - til_stream_start_frame(rt->stream); ticks = MAX(til_ticks_now() + delay, last_ticks); - til_module_render(rt->module_context, rt->stream, ticks, &rt->fragment); + til_stream_render(rt->stream, ticks, &rt->fragment); til_fb_fragment_submit(rt->fragment); last_ticks = ticks; @@ -509,6 +508,8 @@ int main(int argc, const char *argv[]) /* this determines if we need to "control" the audio (unpause it, really) */ rototiller.audio_control = til_stream_get_audio_context_control(rototiller.stream); + til_stream_set_module_context(rototiller.stream, rototiller.module_context); + pexit_if(pthread_create(&rototiller.thread, NULL, rototiller_thread, &rototiller) != 0, "unable to create dispatch thread"); -- cgit v1.2.3