blob: cb607f2e025ac43b3c421a8893ee3dcaf3892ea5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
#ifndef _TIL_MODULE_CONTEXT_H
#define _TIL_MODULE_CONTEXT_H
typedef struct til_module_context_t til_module_context_t;
typedef struct til_module_t til_module_t;
typedef struct til_setup_t til_setup_t;
typedef struct til_stream_t til_stream_t;
struct til_module_context_t {
const til_module_t *module;
til_stream_t *stream; /* optional stream this context is part of (module_contexts are discoverable @setup->path when part of a stream) */
unsigned seed;
unsigned last_ticks; /* this gets updated after every render finishes, starts as the ticks supplied @ context create */
unsigned n_cpus;
til_setup_t *setup; /* Baked setup this context was made from, reffed by context.
* Always present as it provides the path, which is generally derived from a settings instance.
*/
unsigned refcount;
/* for profiling */
unsigned last_render_duration, max_render_duration;
unsigned renders_count;
};
void * til_module_context_new(const til_module_t *module, size_t size, til_stream_t *stream, unsigned seed, unsigned ticks, unsigned n_cpus, til_setup_t *setup);
void * til_module_context_ref(til_module_context_t *module_context);
void * til_module_context_free(til_module_context_t *module_context);
#endif
|