erebus

view liberebus/src/erebus.h @ 37:db8a90307386

implemented console and rudimentary commandline parser
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 09 Jun 2014 16:01:00 +0300
parents b1fc96c71bcc
children 9d6368850fe1
line source
1 #ifndef LIBEREBUS_H_
2 #define LIBEREBUS_H_
4 struct erebus;
6 enum erb_option {
7 ERB_OPT_WIDTH,
8 ERB_OPT_HEIGHT,
9 ERB_OPT_MAX_ITER,
10 ERB_OPT_MAX_SAMPLES,
11 ERB_OPT_NUM_THREADS,
12 ERB_OPT_GAMMA,
14 ERB_NUM_OPTIONS
15 };
17 struct erb_render_status {
18 long progress_percent; // derived from the data below
19 long blocks, max_blocks; // completed pixel blocks in current sample pass
20 long samples, max_samples; // completed samples in current frame
21 long frames, max_frames; // completed frames in multi-frame job
22 };
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
28 struct erebus *erb_init(void);
29 void erb_destroy(struct erebus *ctx);
31 void erb_setopti(struct erebus *ctx, enum erb_option opt, int val);
32 void erb_setoptf(struct erebus *ctx, enum erb_option opt, float val);
33 void erb_setoptfv(struct erebus *ctx, enum erb_option opt, float *vec);
35 int erb_getopti(struct erebus *ctx, enum erb_option opt);
36 float erb_getoptf(struct erebus *ctx, enum erb_option opt);
37 float *erb_getoptfv(struct erebus *ctx, enum erb_option opt);
39 float *erb_get_framebuffer(struct erebus *ctx);
41 void erb_begin_frame(struct erebus *ctx, long ms);
42 int erb_render(struct erebus *ctx, long timeout);
43 int erb_render_rect(struct erebus *ctx, int x, int y, int width, int height, long timeout);
45 int erb_get_progress(struct erebus *ctx);
46 int erb_get_status(struct erebus *ctx, struct erb_render_status *stat);
48 int erb_load_scene(struct erebus *ctx, const char *fname);
49 int erb_proc_cmd(struct erebus *ctx, const char *cmd);
51 bool erb_input_keyboard(struct erebus *ctx, int key, bool pressed);
52 bool erb_input_mouse_button(struct erebus *ctx, int bn, bool pressed, int x, int y);
53 bool erb_input_mouse_motion(struct erebus *ctx, int x, int y);
54 bool erb_input_6dof_button(struct erebus *ctx, int bn, bool pressed);
55 bool erb_input_6dof_motion(struct erebus *ctx, float x, float y, float z);
57 #ifdef __cplusplus
58 }
59 #endif
62 #endif /* LIBEREBUS_H_ */