erebus
view liberebus/src/erebus.h @ 33:2c768a49e86e
- added -ldrawtext to the makefile
- removed -rpath from osx build
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sat, 07 Jun 2014 14:21:56 +0300 |
parents | d38e13d6063c |
children | db8a90307386 |
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);
50 bool erb_input_keyboard(struct erebus *ctx, int key, bool pressed);
51 bool erb_input_mouse_button(struct erebus *ctx, int bn, bool pressed, int x, int y);
52 bool erb_input_mouse_motion(struct erebus *ctx, int x, int y);
53 bool erb_input_6dof_button(struct erebus *ctx, int bn, bool pressed);
54 bool erb_input_6dof_motion(struct erebus *ctx, float x, float y, float z);
56 #ifdef __cplusplus
57 }
58 #endif
61 #endif /* LIBEREBUS_H_ */