summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2023-11-18 13:57:03 -0800
committerVito Caputo <vcaputo@pengaru.com>2023-11-18 13:57:03 -0800
commita0cc9147034fffde006566fbece3c7d060e086ae (patch)
tree01e91d5748e527c40d5cfaee5e17345a652e93f5
parentc1f1006d3cfecb724d9a8040f1dcf6e4ebee9e2a (diff)
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.
-rw-r--r--src/main.c5
1 files 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");
© All Rights Reserved