nuclear@2: #ifndef LIBEREBUS_H_ nuclear@2: #define LIBEREBUS_H_ nuclear@2: nuclear@2: struct erebus; nuclear@2: nuclear@2: enum erb_option { nuclear@2: ERB_OPT_WIDTH, nuclear@2: ERB_OPT_HEIGHT, nuclear@2: ERB_OPT_MAX_ITER, nuclear@8: ERB_OPT_MAX_SAMPLES, nuclear@2: ERB_OPT_NUM_THREADS, nuclear@2: ERB_OPT_GAMMA, nuclear@2: nuclear@2: ERB_NUM_OPTIONS nuclear@2: }; nuclear@2: nuclear@32: struct erb_render_status { nuclear@32: long progress_percent; // derived from the data below nuclear@32: long blocks, max_blocks; // completed pixel blocks in current sample pass nuclear@32: long samples, max_samples; // completed samples in current frame nuclear@32: long frames, max_frames; // completed frames in multi-frame job nuclear@32: }; nuclear@32: nuclear@2: #ifdef __cplusplus nuclear@2: extern "C" { nuclear@2: #endif nuclear@2: nuclear@2: struct erebus *erb_init(void); nuclear@2: void erb_destroy(struct erebus *ctx); nuclear@2: nuclear@2: void erb_setopti(struct erebus *ctx, enum erb_option opt, int val); nuclear@2: void erb_setoptf(struct erebus *ctx, enum erb_option opt, float val); nuclear@2: void erb_setoptfv(struct erebus *ctx, enum erb_option opt, float *vec); nuclear@2: nuclear@2: int erb_getopti(struct erebus *ctx, enum erb_option opt); nuclear@2: float erb_getoptf(struct erebus *ctx, enum erb_option opt); nuclear@2: float *erb_getoptfv(struct erebus *ctx, enum erb_option opt); nuclear@2: nuclear@2: float *erb_get_framebuffer(struct erebus *ctx); nuclear@2: nuclear@2: void erb_begin_frame(struct erebus *ctx, long ms); nuclear@2: int erb_render(struct erebus *ctx, long timeout); nuclear@2: int erb_render_rect(struct erebus *ctx, int x, int y, int width, int height, long timeout); nuclear@2: nuclear@2: int erb_get_progress(struct erebus *ctx); nuclear@32: int erb_get_status(struct erebus *ctx, struct erb_render_status *stat); nuclear@2: nuclear@2: int erb_load_scene(struct erebus *ctx, const char *fname); nuclear@37: int erb_proc_cmd(struct erebus *ctx, const char *cmd); nuclear@2: nuclear@9: bool erb_input_keyboard(struct erebus *ctx, int key, bool pressed); nuclear@9: bool erb_input_mouse_button(struct erebus *ctx, int bn, bool pressed, int x, int y); nuclear@9: bool erb_input_mouse_motion(struct erebus *ctx, int x, int y); nuclear@9: bool erb_input_6dof_button(struct erebus *ctx, int bn, bool pressed); nuclear@9: bool erb_input_6dof_motion(struct erebus *ctx, float x, float y, float z); nuclear@9: nuclear@2: #ifdef __cplusplus nuclear@2: } nuclear@2: #endif nuclear@2: nuclear@2: nuclear@2: #endif /* LIBEREBUS_H_ */