00001 /*************************************************************************** 00002 * Copyright (C) 1998-2008 by authors (see AUTHORS.txt ) * 00003 * * 00004 * This file is part of LuxRender. * 00005 * * 00006 * Lux Renderer is free software; you can redistribute it and/or modify * 00007 * it under the terms of the GNU General Public License as published by * 00008 * the Free Software Foundation; either version 3 of the License, or * 00009 * (at your option) any later version. * 00010 * * 00011 * Lux Renderer is distributed in the hope that it will be useful, * 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00014 * GNU General Public License for more details. * 00015 * * 00016 * You should have received a copy of the GNU General Public License * 00017 * along with this program. If not, see <http://www.gnu.org/licenses/>. * 00018 * * 00019 * This project is based on PBRT ; see http://www.pbrt.org * 00020 * Lux Renderer website : http://www.luxrender.net * 00021 ***************************************************************************/ 00022 00023 #ifndef LUX_GUI_H 00024 #define LUX_GUI_H 00025 00026 #include <FL/Fl.H> 00027 #include <FL/Fl_Double_Window.H> 00028 #include <FL/Fl_Group.H> 00029 #include <FL/Fl_Tabs.H> 00030 #include <FL/Fl_Box.H> 00031 #include <FL/Fl_Menu_Button.H> 00032 #include <FL/Fl_Button.H> 00033 #include <FL/Fl_Menu_Bar.H> 00034 #include <FL/Fl_Choice.H> 00035 #include <FL/Fl_Value_Slider.H> 00036 #include <FL/Fl_File_Chooser.H> 00037 #include <FL/Fl_Image.H> 00038 #include <FL/x.H> 00039 #include <FL/filename.H> 00040 00041 #include <boost/thread.hpp> 00042 00043 #include "renderwindow.h" 00044 00045 bool GuiSceneReady = false; 00046 float framebufferUpdate; 00047 Fl_RGB_Image* rgb_image; 00048 Fl_Window* window; 00049 //Fl_Thread e_thr; 00050 00051 RenderWindow *renderview; 00052 Fl_Group *info_render; 00053 Fl_Group *info_render_group; 00054 Fl_Group *info_tonemap; 00055 Fl_Group *info_tonemap_group; 00056 Fl_Group *info_statistics; 00057 Fl_Group *info_statistics_group; 00058 00059 Fl_Button *button_play; 00060 Fl_Button *button_pause; 00061 Fl_Button *button_restart; 00062 00063 boost::thread *engine_thread; 00064 boost::thread *fb_update_thread; 00065 int gui_nrthreads = 1; 00066 char gui_current_scenefile[256]; 00067 00068 #define STATUS_RENDER_NONE 0 00069 #define STATUS_RENDER_IDLE 1 00070 #define STATUS_RENDER_RENDER 2 00071 00072 int status_render = STATUS_RENDER_NONE; 00073 00074 // functions 00075 void AddThread(); 00076 void RemoveThread(); 00077 void RenderStart(); 00078 void RenderPause(); 00079 int RenderScenefile(); 00080 void message_window(const char *label, const char *msg); 00081 00082 // callbacks 00083 void open_cb(Fl_Widget*, void*); 00084 void exit_cb(Fl_Widget*, void*); 00085 void about_cb(Fl_Widget*, void*); 00086 void addthread_cb(Fl_Widget*, void*); 00087 void removethread_cb(Fl_Widget*, void*); 00088 void start_cb(Fl_Widget*, void*); 00089 void stop_cb(Fl_Widget*, void*); 00090 void restart_cb(Fl_Widget*, void*); 00091 00092 #endif // LUX_GUI_H