summaryrefslogtreecommitdiff
path: root/src/til_stream.h
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2023-11-18 13:51:34 -0800
committerVito Caputo <vcaputo@pengaru.com>2023-11-18 13:51:34 -0800
commitc1f1006d3cfecb724d9a8040f1dcf6e4ebee9e2a (patch)
tree98331cb125041723e96bfd7346f6212a44e54b54 /src/til_stream.h
parent1d11a76d8361b52e0f7a489afe99ff08583a8333 (diff)
til_stream: add til_stream_render()
This introduces a concept of a stream's module context, which is used to render the stream via til_stream_render(). The context is set using til_stream_set_module_context(), but at this time no reference is taken - it just puts the context into the stream for use by the render calls. The caller is responsible for ensuring it persist as long as the stream uses it. This is a preparatory commit for implementing pre/post render module contexts that get hooked into a stream. The impetus for this is supporting background music via modules like playit, without requiring stuff like rkt scenes to always include the bgm context in the scene's module context heirarchy. Nothing is functionally different here, the commit only adds the new interfaces for setting the context and rendering via stream instead of til_module_render() of the context you'd now set on the stream.
Diffstat (limited to 'src/til_stream.h')
-rw-r--r--src/til_stream.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/til_stream.h b/src/til_stream.h
index a0dde31..bae5abb 100644
--- a/src/til_stream.h
+++ b/src/til_stream.h
@@ -25,6 +25,7 @@
#include "til_setup.h"
typedef struct til_audio_context_t til_audio_context_t;
+typedef struct til_fb_fragment_t til_fb_fragment_t;
typedef struct til_stream_t til_stream_t;
typedef struct til_stream_module_context_t til_stream_module_context_t;
typedef struct til_stream_pipe_t til_stream_pipe_t;
@@ -80,4 +81,7 @@ int til_stream_find_module_contexts(til_stream_t *stream, const char *path, size
unsigned til_stream_gc_module_contexts(til_stream_t *stream);
void til_stream_fprint_module_contexts(til_stream_t *stream, FILE *out);
+void til_stream_set_module_context(til_stream_t *stream, til_module_context_t *context);
+void til_stream_render(til_stream_t *stream, unsigned ticks, til_fb_fragment_t **fragment_ptr);
+
#endif
© All Rights Reserved