summaryrefslogtreecommitdiff
path: root/src/rototiller.h
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2017-04-22 15:29:49 -0700
committerVito Caputo <vcaputo@pengaru.com>2017-04-22 15:29:49 -0700
commitd28ceb85a6b43a503c608116798945baab0e060f (patch)
tree1a96ae21cbab1ef8fdf831d588fd2c9477fb3f92 /src/rototiller.h
parent1ff4632e895202c4485818f6e748e773b6fd2859 (diff)
*: add module context machinery
introduces create_context() and destroy_context() methods, and adds a 'void *context' first parameter to the module methods. If a module doesn't supply create_context() then NULL is simply passed around as the context, so trivial modules can continue to only implement render_fragment(). A subsequent commit will update the modules to encapsulate their global state in module-specific contexts.
Diffstat (limited to 'src/rototiller.h')
-rw-r--r--src/rototiller.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/rototiller.h b/src/rototiller.h
index d1578fb..933f733 100644
--- a/src/rototiller.h
+++ b/src/rototiller.h
@@ -12,8 +12,10 @@ typedef struct rototiller_frame_t {
} rototiller_frame_t;
typedef struct rototiller_module_t {
- void (*prepare_frame)(unsigned n_cpus, fb_fragment_t *fragment, rototiller_frame_t *res_frame);
- void (*render_fragment)(fb_fragment_t *fragment);
+ void * (*create_context)(void);
+ void (*destroy_context)(void *context);
+ void (*prepare_frame)(void *context, unsigned n_cpus, fb_fragment_t *fragment, rototiller_frame_t *res_frame);
+ void (*render_fragment)(void *context, fb_fragment_t *fragment);
char *name;
char *description;
char *author;
© All Rights Reserved