Changeset 7495 in orxonox.OLD for branches/qt_gui/src/lib
- Timestamp:
- May 3, 2006, 12:50:11 AM (19 years ago)
- Location:
- branches/qt_gui/src/lib/gui/qt_gui
- Files:
-
- 2 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/qt_gui/src/lib/gui/qt_gui/Makefile.am
r7489 r7495 17 17 qt_gui.cc \ 18 18 \ 19 gui_video.cc 19 gui_video.cc \ 20 gui_audio.cc 20 21 21 22 noinst_HEADERS= \ 22 23 qt_gui.h \ 23 24 \ 24 gui_video.h 25 gui_video.h \ 26 gui_audio.h 25 27 26 28 EXTRA_DIST = -
branches/qt_gui/src/lib/gui/qt_gui/gui_audio.cc
r7493 r7495 25 25 26 26 27 #include "gui_ video.h"27 #include "gui_audio.h" 28 28 29 29 #include <qlayout.h> … … 38 38 { 39 39 /** 40 * Creates the Video-Option-Frame40 * Creates the Audio-Option-Frame 41 41 */ 42 Gui Video::GuiVideo(QWidget* parent)43 : Element(" Video"), QGroupBox(parent)42 GuiAudio::GuiAudio(QWidget* parent) 43 : Element("Audio"), QGroupBox(parent) 44 44 { 45 45 QGridLayout* layout = new QGridLayout(this); 46 46 47 47 { 48 QCheckBox* fullscreen = new QCheckBox(QString(" FullScreen"), this);48 QCheckBox* fullscreen = new QCheckBox(QString("Enabled"), this); 49 49 //fullscreen->setName(); 50 50 layout->addWidget(fullscreen, 0, 0); 51 51 52 QCheckBox* wireframe = new QCheckBox(" Wireframe mode", this);52 QCheckBox* wireframe = new QCheckBox("Test", this); 53 53 layout->addWidget(wireframe, 1, 0); 54 54 55 QComboBox* resolution = new QComboBox(" Resolution", this);55 QComboBox* resolution = new QComboBox("SecondTest", this); 56 56 layout->addWidget(resolution, 2, 0); 57 57 … … 60 60 61 61 62 63 /* Frame* videoFrame; //!< The Frame that holds the video options.64 65 videoFrame = new Frame("Video-Options:");66 videoFrame->setGroupName("video");67 {68 Box* videoBox; //!< The Box that holds the video options.69 70 videoBox = new Box('v');71 {72 CheckButton* fullscreen; //!< CheckButton for fullscreen-mode73 Menu* resolution; //!< Menu for the resolution74 CheckButton* wireframe; //!< CheckButton for wireframe Mode.75 76 fullscreen = new CheckButton(CONFIG_NAME_FULLSCREEN);77 fullscreen->setFlagName("windowed", "q", 1);78 fullscreen->setDescription("Starts orxonox in windowed mode");79 fullscreen->saveability();80 videoBox->fill(fullscreen);81 resolution = new Menu(CONFIG_NAME_RESOLUTION);82 getResolutions(resolution);83 resolution->saveability();84 resolution->setFlagName("resolution", "r", 0);85 resolution->setDescription("Sets the resolution of orxonox");86 videoBox->fill(resolution);87 wireframe = new CheckButton(CONFIG_NAME_WIREFRAME);88 wireframe->setFlagName("wireframe", "w", 0);89 wireframe->setDescription("Starts orxonox in wireframe mode");90 wireframe->saveability();91 videoBox->fill(wireframe);92 93 videoBox->fill(advancedWindowCreate());94 }95 videoFrame->fill(videoBox);96 }97 setMainWidget(videoFrame);*/98 62 } 99 63 100 64 /** 101 * Destructs the Video-stuff65 * Destructs the Audio-stuff 102 66 */ 103 Gui Video::~GuiVideo()67 GuiAudio::~GuiAudio() 104 68 { 105 69 // nothing to do here. 106 70 } 107 71 108 /**109 * sets all resolutions to the menu110 * @param menu the Menu to set The resolutions to.111 */112 void GuiVideo::getResolutions(std::vector<std::string>& resolutionList)113 {114 SDL_Init(SDL_INIT_VIDEO);115 SDL_Rect **modes;116 int i;117 int x = 0,y =0; // check for difference118 char tmpChar[100];119 120 /* Get available fullscreen/hardware modes */121 modes=SDL_ListModes(NULL, SDL_FULLSCREEN|SDL_HWSURFACE);122 123 /* Check is there are any modes available */124 if(modes == (SDL_Rect **)0)125 {126 PRINTF(2)("No video-modes available!\n");127 exit(-1);128 }129 130 /* Check if our resolution is restricted */131 if(modes == (SDL_Rect **)-1)132 {133 PRINTF(2)("All resolutions available.\n");134 }135 else136 {137 /* Print valid modes */138 PRINT(5)("Available Modes\n");139 for(i = 0; modes[i] ;++i)140 {141 if (x != modes[i]->w || y != modes[i]->h)142 {143 PRINTF(5)(" %d x %d\n", modes[i]->w, modes[i]->h);144 sprintf(tmpChar, "%dx%d", modes[i]->w, modes[i]->h);145 resolutionList.push_back(std::string(tmpChar));146 x = modes[i]->w; y = modes[i]->h;147 }148 }149 }150 SDL_QuitSubSystem(SDL_INIT_VIDEO);151 SDL_Quit();152 }153 72 154 73 } -
branches/qt_gui/src/lib/gui/qt_gui/gui_audio.h
r7493 r7495 1 1 /*! 2 \file gui_ video.h3 \brief File that holds the class that creates the Video-Options.2 \file gui_audio.h 3 \brief File that holds the class that creates the Audio-Options. 4 4 */ 5 #ifndef _GUI_ VIDEO_H6 #define _GUI_ VIDEO_H5 #ifndef _GUI_AUDIO_H 6 #define _GUI_AUDIO_H 7 7 8 8 #include "../gui_element.h" … … 13 13 namespace OrxGui 14 14 { 15 //! Class that creates the Video-Options.16 class Gui Video : public OrxGui::Element, public QGroupBox15 //! Class that creates the Audio-Options. 16 class GuiAudio : public OrxGui::Element, public QGroupBox 17 17 { 18 18 public: 19 Gui Video(QWidget* parent = NULL);20 virtual ~Gui Video();19 GuiAudio(QWidget* parent = NULL); 20 virtual ~GuiAudio(); 21 21 22 private:23 void getResolutions(std::vector<std::string>& resolutionList);24 22 }; 25 23 } 26 24 27 #endif /* _GUI_ VIDEO_H */25 #endif /* _GUI_AUDIO_H */ -
branches/qt_gui/src/lib/gui/qt_gui/qt_gui.cc
r7493 r7495 26 26 27 27 #include "gui_video.h" 28 #include "gui_audio.h" 28 29 29 30 namespace OrxGui … … 43 44 44 45 toolBox->addItem(new GuiVideo(toolBox), "Video"); 46 toolBox->addItem(new GuiAudio(toolBox), "Audio"); 45 47 } 46 48 mainLayout->addWidget(toolBox,1,1);
Note: See TracChangeset
for help on using the changeset viewer.