erebus

annotate liberebus/src/erebus.h @ 47:4b91c9a501d8

minor fix of strange code structure in the thread func
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 01 Feb 2016 14:56:15 +0200
parents db8a90307386
children
rev   line source
nuclear@2 1 #ifndef LIBEREBUS_H_
nuclear@2 2 #define LIBEREBUS_H_
nuclear@2 3
nuclear@2 4 struct erebus;
nuclear@2 5
nuclear@2 6 enum erb_option {
nuclear@2 7 ERB_OPT_WIDTH,
nuclear@2 8 ERB_OPT_HEIGHT,
nuclear@2 9 ERB_OPT_MAX_ITER,
nuclear@8 10 ERB_OPT_MAX_SAMPLES,
nuclear@2 11 ERB_OPT_NUM_THREADS,
nuclear@2 12 ERB_OPT_GAMMA,
nuclear@2 13
nuclear@2 14 ERB_NUM_OPTIONS
nuclear@2 15 };
nuclear@2 16
nuclear@32 17 struct erb_render_status {
nuclear@32 18 long progress_percent; // derived from the data below
nuclear@32 19 long blocks, max_blocks; // completed pixel blocks in current sample pass
nuclear@32 20 long samples, max_samples; // completed samples in current frame
nuclear@32 21 long frames, max_frames; // completed frames in multi-frame job
nuclear@32 22 };
nuclear@32 23
nuclear@2 24 #ifdef __cplusplus
nuclear@2 25 extern "C" {
nuclear@2 26 #endif
nuclear@2 27
nuclear@2 28 struct erebus *erb_init(void);
nuclear@2 29 void erb_destroy(struct erebus *ctx);
nuclear@2 30
nuclear@40 31 void erb_clear(struct erebus *ctx);
nuclear@40 32
nuclear@2 33 void erb_setopti(struct erebus *ctx, enum erb_option opt, int val);
nuclear@2 34 void erb_setoptf(struct erebus *ctx, enum erb_option opt, float val);
nuclear@2 35 void erb_setoptfv(struct erebus *ctx, enum erb_option opt, float *vec);
nuclear@2 36
nuclear@2 37 int erb_getopti(struct erebus *ctx, enum erb_option opt);
nuclear@2 38 float erb_getoptf(struct erebus *ctx, enum erb_option opt);
nuclear@2 39 float *erb_getoptfv(struct erebus *ctx, enum erb_option opt);
nuclear@2 40
nuclear@2 41 float *erb_get_framebuffer(struct erebus *ctx);
nuclear@2 42
nuclear@2 43 void erb_begin_frame(struct erebus *ctx, long ms);
nuclear@40 44 void erb_end_frame(struct erebus *ctx);
nuclear@40 45
nuclear@2 46 int erb_render(struct erebus *ctx, long timeout);
nuclear@2 47 int erb_render_rect(struct erebus *ctx, int x, int y, int width, int height, long timeout);
nuclear@2 48
nuclear@2 49 int erb_get_progress(struct erebus *ctx);
nuclear@32 50 int erb_get_status(struct erebus *ctx, struct erb_render_status *stat);
nuclear@2 51
nuclear@2 52 int erb_load_scene(struct erebus *ctx, const char *fname);
nuclear@37 53 int erb_proc_cmd(struct erebus *ctx, const char *cmd);
nuclear@2 54
nuclear@9 55 bool erb_input_keyboard(struct erebus *ctx, int key, bool pressed);
nuclear@9 56 bool erb_input_mouse_button(struct erebus *ctx, int bn, bool pressed, int x, int y);
nuclear@9 57 bool erb_input_mouse_motion(struct erebus *ctx, int x, int y);
nuclear@9 58 bool erb_input_6dof_button(struct erebus *ctx, int bn, bool pressed);
nuclear@9 59 bool erb_input_6dof_motion(struct erebus *ctx, float x, float y, float z);
nuclear@9 60
nuclear@2 61 #ifdef __cplusplus
nuclear@2 62 }
nuclear@2 63 #endif
nuclear@2 64
nuclear@2 65
nuclear@2 66 #endif /* LIBEREBUS_H_ */