void __attribute__((noreturn)) gl_main_loop(global_context *ctx){ int i,j,k; while(!gl_window_should_close(ctx->window)){ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); if(ctx->update_userdata){ ctx->update_userdata(ctx->userdata); } for(i=0;i<ctx->num_scenes;i++){ gl_scene *scene = &(ctx->scenes[i]); //or gl_scene scene = ctx->scenes[i]; bind_scene(scene); if(scene->update_scene){ scene->update_scene(scene, ctx->userdata); } //bind uniform blocks for(j=0;j<scene->num_buffers;j++){ gl_buffer *buf = scene->buffers + j*sizeof(gl_buffer); bind_buffer(buf); if(buf->update_buffer){ buf->update_buffer(buf, ctx->userdata); } /* TODO: update the buffer struct to contain index limits and optimze this by calling glDrawRangeElements instead. */ glDrawElements(buf->draw_mode, buf->draw_count, buf->index_type, (void*)buf->index_offset); } } gl_swap_buffers(ctx->window); gl_poll_events(); } exit(0);//need a way to specify an exit value }
extern "C" void bind_appleseed_python_classes() { boost::python::scope().attr("APPLESEED_VERSION") = APPLESEED_VERSION; boost::python::scope().attr("APPLESEED_VERSION_MAJOR") = APPLESEED_VERSION_MAJOR; boost::python::scope().attr("APPLESEED_VERSION_MINOR") = APPLESEED_VERSION_MINOR; boost::python::scope().attr("APPLESEED_VERSION_PATCH") = APPLESEED_VERSION_PATCH; boost::python::scope().attr("APPLESEED_VERSION_MATURITY") = APPLESEED_VERSION_MATURITY; boost::python::scope().attr("APPLESEED_VERSION_STRING") = APPLESEED_VERSION_STRING; bind_utility(); bind_murmurhash(); bind_logger(); bind_vector(); bind_basis(); bind_quaternion(); bind_bbox(); bind_matrix(); bind_transform(); bind_entity(); bind_color(); bind_texture(); bind_bsdf(); bind_bssrdf(); bind_edf(); bind_shader_group(); bind_surface_shader(); bind_material(); bind_light(); bind_object(); bind_mesh_object(); bind_assembly(); bind_camera(); bind_environment(); bind_scene(); bind_image(); bind_aov(); bind_frame(); bind_fresnel(); bind_display(); bind_project(); bind_renderer_controller(); bind_tile_callback(); bind_master_renderer(); }