Changeset 4139 in orxonox.OLD for orxonox/branches/md2_loader/src/lib/gui/gui/gui_video.cc
- Timestamp:
- May 10, 2005, 10:39:01 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/md2_loader/src/lib/gui/gui/gui_video.cc
r4063 r4139 27 27 #include "gui_video.h" 28 28 29 #include "gui_gtk.h" 29 30 #include "glincl.h" 30 31 #include <stdlib.h> … … 35 36 GuiVideo::GuiVideo(void) 36 37 { 37 this->videoFrame = new Frame("Video-Options:"); 38 this->videoBox = new Box('v'); 39 this->videoFrame->setGroupName("video"); 40 41 this->fullscreen = new CheckButton("Fullscreen-mode"); 42 this->fullscreen->setFlagName("windowed", "q", 1); 43 this->fullscreen->saveability(); 44 this->videoBox->fill(this->fullscreen); 45 this->resolution = new Menu("Resolution"); 46 this->getResolutions(this->resolution); 47 this->resolution->saveability(); 48 this->resolution->setFlagName("resolution", "r", 0); 49 this->videoBox->fill(this->resolution); 50 this->wireframe = new CheckButton("WireFrame-mode"); 51 this->wireframe->setFlagName("wireframe", "w", 0); 52 this->wireframe->saveability(); 53 this->videoBox->fill(this->wireframe); 54 55 this->advancedWindowCreate(); 56 this->videoBox->fill(this->advancedWindowGetButton()); 57 58 this->videoFrame->fill(videoBox); 59 this->setMainWidget(this->videoFrame); 38 Frame* videoFrame; //!< The Frame that holds the video options. 39 40 videoFrame = new Frame("Video-Options:"); 41 videoFrame->setGroupName("video"); 42 { 43 Box* videoBox; //!< The Box that holds the video options. 44 45 videoBox = new Box('v'); 46 { 47 CheckButton* fullscreen; //!< CheckButton for fullscreen-mode 48 Menu* resolution; //!< Menu for the resolution 49 CheckButton* wireframe; //!< CheckButton for wireframe Mode. 50 51 fullscreen = new CheckButton(CONFIG_NAME_FULLSCREEN); 52 fullscreen->setFlagName("windowed", "q", 1); 53 fullscreen->setDescription("Starts orxonox in windowed mode"); 54 fullscreen->saveability(); 55 videoBox->fill(fullscreen); 56 resolution = new Menu(CONFIG_NAME_RESOLUTION); 57 getResolutions(resolution); 58 resolution->saveability(); 59 resolution->setFlagName("resolution", "r", 0); 60 resolution->setDescription("Sets the resolution of orxonox"); 61 videoBox->fill(resolution); 62 wireframe = new CheckButton(CONFIG_NAME_WIREFRAME); 63 wireframe->setFlagName("wireframe", "w", 0); 64 wireframe->setDescription("Starts orxonox in wireframe mode"); 65 wireframe->saveability(); 66 videoBox->fill(wireframe); 67 68 videoBox->fill(advancedWindowCreate()); 69 } 70 videoFrame->fill(videoBox); 71 } 72 setMainWidget(videoFrame); 60 73 } 61 74 … … 71 84 \brief Creates a window, and all it contains for the Source-update. 72 85 */ 73 void GuiVideo::advancedWindowCreate(void) 74 { 86 Widget* GuiVideo::advancedWindowCreate(void) 87 { 88 // advanced-Performance-Options 89 Window* advancedWindow; //!< A Window to display advanced options. 90 Button* advancedButton; //!< A Button to open the Advanced Video Performance Window. 75 91 // the button, that opens this Window. 76 this->advancedButton = new Button("advanced");92 advancedButton = new Button("advanced"); 77 93 78 94 // the Window itself 79 this->advancedWindow = new Window("Advanced Video Options"); 80 this->advancedWindow->setGroupName("advancedVideoOptions"); 81 82 this->advancedBox = new Box('v'); 83 84 // Advanced Performance Options 85 this->shadows = new CheckButton("Shadows"); 86 this->shadows->saveability(); 87 this->advancedBox->fill(this->shadows); 88 89 this->fog = new CheckButton("Fog"); 90 this->fog->saveability(); 91 this->advancedBox->fill(this->fog); 92 93 this->reflections = new CheckButton("Reflections"); 94 this->reflections->saveability(); 95 this->advancedBox->fill(this->reflections); 96 97 this->textures = new CheckButton("Textures"); 98 this->textures->saveability(); 99 this->advancedBox->fill(this->textures); 100 101 this->textureDetail = new Menu("Texture Detail", "low", "medium", "high", "lastItem"); 102 this->textureDetail->setDefaultValue(1); 103 this->textureDetail->saveability(); 104 this->advancedBox->fill(this->textureDetail); 105 106 this->modelDetailLabel = new Label("Model Detail"); 107 this->advancedBox->fill(this->modelDetailLabel); 108 this->modelDetail = new Menu("Model Detail", "low", "high", "lastItem"); 109 this->modelDetail->setDefaultValue(1); 110 this->modelDetail->saveability(); 111 this->advancedBox->fill(this->modelDetail); 112 113 this->antiAliasingLabel = new Label("Anti-Aliasing-depth:"); 114 this->advancedBox->fill(this->antiAliasingLabel); 115 this->antiAliasing = new Menu("Anti Aliasing", "0", "1", "2", "4", "8", "lastItem"); 116 this->antiAliasing->setDefaultValue(2); 117 this->antiAliasing->saveability(); 118 this->advancedBox->fill(this->antiAliasing); 119 120 this->filterMethodLabel = new Label("Filtering Method:"); 121 this->advancedBox->fill(this->filterMethodLabel); 122 this->filterMethod = new Menu("Filtering Method", "none", "linear", "bilinear", "trilinear", "anisortopic", "lastItem"); 123 this->filterMethod->setDefaultValue(1); 124 this->filterMethod->saveability(); 125 this->advancedBox->fill(this->filterMethod); 126 127 this->closeButton = new Button("close"); 128 this->advancedBox->fill(this->closeButton); 129 130 this->advancedWindow->fill(advancedBox); 131 #ifdef HAVE_GTK2 132 this->advancedButton->connectSignal("button_press_event", this->advancedWindow, Window::windowOpen); 133 this->closeButton->connectSignal("button_press_event", this->advancedWindow, Window::windowClose); 134 this->advancedWindow->connectSignal("destroy", this->advancedWindow, Window::windowClose); 135 this->advancedWindow->connectSignal("delete_event", this->advancedWindow, Window::windowClose); 95 advancedWindow = new Window("Advanced Video Options"); 96 advancedWindow->setGroupName(CONFIG_SECTION_VIDEO_ADVANCED); 97 { 98 Box* advancedBox; //!< A Box to pack the options into. 99 100 advancedBox = new Box('v'); 101 { 102 CheckButton* shadows; //!< CheckButton for shadows 103 CheckButton* fog; //!< CheckButton for fog. 104 CheckButton* reflections; //!< CheckButton for reflections 105 CheckButton* textures; //!< CheckButton for textures 106 Menu* textureDetail; //!< Menu for the Texture-Detail. 107 Label* modelDetailLabel; //!< Label for model-detail. 108 Menu* modelDetail; //!< model-detail. 109 Label* antiAliasingLabel; //!< Label for the anti-aliasing mode. 110 Menu* antiAliasing; //!< Menu for the Antialiasing-mode. 111 Label* filterMethodLabel; //!< Label for filtering-Method. 112 Menu* filterMethod; //!< Menu for filtering Method. 113 Button* closeButton; //!< A Button to close the Advanced-settingsWindow. 114 115 // Advanced Performance Options 116 shadows = new CheckButton(CONFIG_NAME_SHADOWS); 117 shadows->saveability(); 118 advancedBox->fill(shadows); 119 120 fog = new CheckButton(CONFIG_NAME_FOG); 121 fog->saveability(); 122 advancedBox->fill(fog); 123 124 reflections = new CheckButton(CONFIG_NAME_REFLECTIONS); 125 reflections->saveability(); 126 advancedBox->fill(reflections); 127 128 textures = new CheckButton(CONFIG_NAME_TEXTURES); 129 textures->saveability(); 130 advancedBox->fill(textures); 131 132 textureDetail = new Menu(CONFIG_NAME_TEXTURE_DETAIL, "low", "medium", "high", "lastItem"); 133 textureDetail->setDefaultValue(1); 134 textureDetail->saveability(); 135 advancedBox->fill(textureDetail); 136 137 modelDetailLabel = new Label(CONFIG_NAME_MODEL_DETAIL); 138 advancedBox->fill(modelDetailLabel); 139 modelDetail = new Menu(CONFIG_NAME_MODEL_DETAIL, "low", "high", "lastItem"); 140 modelDetail->setDefaultValue(1); 141 modelDetail->saveability(); 142 advancedBox->fill(modelDetail); 143 144 antiAliasingLabel = new Label("Anti-Aliasing-depth:"); 145 advancedBox->fill(antiAliasingLabel); 146 antiAliasing = new Menu(CONFIG_NAME_ANTI_ALIASING, "0", "1", "2", "4", "8", "lastItem"); 147 antiAliasing->setDefaultValue(2); 148 antiAliasing->saveability(); 149 advancedBox->fill(antiAliasing); 150 151 filterMethodLabel = new Label("Filtering Method:"); 152 advancedBox->fill(filterMethodLabel); 153 filterMethod = new Menu(CONFIG_NAME_FILTER_METHOD, "none", "linear", "bilinear", "trilinear", "anisortopic", "lastItem"); 154 filterMethod->setDefaultValue(1); 155 filterMethod->saveability(); 156 advancedBox->fill(filterMethod); 157 158 closeButton = new Button("close"); 159 #ifdef HAVE_GTK2 160 closeButton->connectSignal("button_press_event", advancedWindow, Window::windowClose); 136 161 #endif /* HAVE_GTK2 */ 137 Window::addWindow(this->advancedWindow); 138 139 } 140 141 /** 142 \returns A Pointer to the Button of the UpdaterSourceWindow 143 */ 144 Button* GuiVideo::advancedWindowGetButton(void) 145 { 146 return this->advancedButton; 147 } 148 162 163 advancedBox->fill(closeButton); 164 } 165 advancedWindow->fill(advancedBox); 166 } 167 #ifdef HAVE_GTK2 168 advancedButton->connectSignal("button_press_event", advancedWindow, Window::windowOpen); 169 advancedWindow->connectSignal("destroy", advancedWindow, Window::windowClose); 170 advancedWindow->connectSignal("delete_event", advancedWindow, Window::windowClose); 171 #endif /* HAVE_GTK2 */ 172 Window::addWindow(advancedWindow); 173 174 return advancedButton; 175 } 176 177 /** 178 \brief sets all resolutions to the menu 179 \param menu the Menu to set The resolutions to. 180 */ 149 181 void GuiVideo::getResolutions(Menu* menu) 150 182 { … … 170 202 else{ 171 203 /* Print valid modes */ 172 PRINT( 4)("Available Modes\n");204 PRINT(5)("Available Modes\n"); 173 205 for(i = 0; modes[i] ;++i) 174 206 { 175 207 if (x != modes[i]->w || y != modes[i]->h) 176 208 { 177 PRINT (4)(" %d x %d\n", modes[i]->w, modes[i]->h);209 PRINTF(5)(" %d x %d\n", modes[i]->w, modes[i]->h); 178 210 sprintf(tmpChar, "%dx%d", modes[i]->w, modes[i]->h); 179 211 menu->addItem(tmpChar);
Note: See TracChangeset
for help on using the changeset viewer.