# Cycles
option(WITH_CYCLES "Enable cycles Render Engine" ON)
option(WITH_CYCLES_STANDALONE "Build cycles standalone application" OFF)
+option(WITH_CYCLES_STANDALONE_GUI "Build cycles standalone with GUI" OFF)
option(WITH_CYCLES_OSL "Build Cycles with OSL support" OFF)
option(WITH_CYCLES_CUDA_BINARIES "Build cycles CUDA binaries" OFF)
set(CYCLES_CUDA_BINARIES_ARCH sm_20 sm_21 sm_30 sm_35 CACHE STRING "CUDA architectures to build binaries for")
#include "util_progress.h"
#include "util_string.h"
#include "util_time.h"
+
+#ifdef WITH_CYCLES_STANDALONE_GUI
#include "util_view.h"
+#endif
#include "cycles_xml.h"
if(options.session_params.background && !options.quiet)
options.session->progress.set_update_callback(function_bind(&session_print_status));
+#ifdef WITH_CYCLES_STANDALONE_GUI
else
options.session->progress.set_update_callback(function_bind(&view_redraw));
+#endif
options.session->start();
}
}
+#ifdef WITH_CYCLES_STANDALONE_GUI
static void display_info(Progress& progress)
{
static double latency = 0.0;
else if(key == 27) // escape
options.session->progress.set_cancel("Cancelled");
}
+#endif
static int files_parse(int argc, const char *argv[])
{
else if(ssname == "svm")
options.scene_params.shadingsystem = SceneParams::SVM;
- /* Progressive rendering */
- options.session_params.progressive = true;
+#ifdef WITH_CYCLES_STANDALONE_GUI
+ /* Progressive rendering for GUI */
+ if(!options.session_params.background)
+ options.session_params.progressive = true;
+#else
+ /* When building without GUI, set background */
+ options.session_params.background = true;
+#endif
/* find matching device */
DeviceType device_type = Device::type_from_string(devicename.c_str());
int main(int argc, const char **argv)
{
path_init();
-
options_parse(argc, argv);
-
+
+#ifdef WITH_CYCLES_STANDALONE_GUI
if(options.session_params.background) {
+#endif
session_init();
options.session->wait();
session_exit();
+#ifdef WITH_CYCLES_STANDALONE_GUI
}
else {
string title = "Cycles: " + path_filename(options.filepath);
view_main_loop(title.c_str(), options.width, options.height,
session_init, session_exit, resize, display, keyboard);
}
+#endif
return 0;
}