erebus

annotate liberebus/src/erebus.h @ 32:b1fc96c71bcc

- lambert BRDF importance sampling - UI + commandline arguments - font rendering for showing status/progress
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 07 Jun 2014 13:36:36 +0300
parents d38e13d6063c
children db8a90307386
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@2 31 void erb_setopti(struct erebus *ctx, enum erb_option opt, int val);
nuclear@2 32 void erb_setoptf(struct erebus *ctx, enum erb_option opt, float val);
nuclear@2 33 void erb_setoptfv(struct erebus *ctx, enum erb_option opt, float *vec);
nuclear@2 34
nuclear@2 35 int erb_getopti(struct erebus *ctx, enum erb_option opt);
nuclear@2 36 float erb_getoptf(struct erebus *ctx, enum erb_option opt);
nuclear@2 37 float *erb_getoptfv(struct erebus *ctx, enum erb_option opt);
nuclear@2 38
nuclear@2 39 float *erb_get_framebuffer(struct erebus *ctx);
nuclear@2 40
nuclear@2 41 void erb_begin_frame(struct erebus *ctx, long ms);
nuclear@2 42 int erb_render(struct erebus *ctx, long timeout);
nuclear@2 43 int erb_render_rect(struct erebus *ctx, int x, int y, int width, int height, long timeout);
nuclear@2 44
nuclear@2 45 int erb_get_progress(struct erebus *ctx);
nuclear@32 46 int erb_get_status(struct erebus *ctx, struct erb_render_status *stat);
nuclear@2 47
nuclear@2 48 int erb_load_scene(struct erebus *ctx, const char *fname);
nuclear@2 49
nuclear@9 50 bool erb_input_keyboard(struct erebus *ctx, int key, bool pressed);
nuclear@9 51 bool erb_input_mouse_button(struct erebus *ctx, int bn, bool pressed, int x, int y);
nuclear@9 52 bool erb_input_mouse_motion(struct erebus *ctx, int x, int y);
nuclear@9 53 bool erb_input_6dof_button(struct erebus *ctx, int bn, bool pressed);
nuclear@9 54 bool erb_input_6dof_motion(struct erebus *ctx, float x, float y, float z);
nuclear@9 55
nuclear@2 56 #ifdef __cplusplus
nuclear@2 57 }
nuclear@2 58 #endif
nuclear@2 59
nuclear@2 60
nuclear@2 61 #endif /* LIBEREBUS_H_ */