1 | /* |
---|
2 | orxonox - the future of 3D-vertical-scrollers |
---|
3 | |
---|
4 | Copyright (C) 2004 orx |
---|
5 | |
---|
6 | This program is free software; you can redistribute it and/or modify |
---|
7 | it under the terms of the GNU General Public License as published by |
---|
8 | the Free Software Foundation; either version 2, or (at your option) |
---|
9 | any later version. |
---|
10 | |
---|
11 | This program is distributed in the hope that it will be useful, |
---|
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
14 | GNU General Public License for more details. |
---|
15 | |
---|
16 | You should have received a copy of the GNU General Public License |
---|
17 | along with this program; if not, write to the Free Software Foundation, |
---|
18 | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
---|
19 | |
---|
20 | |
---|
21 | ### File Specific: |
---|
22 | main-programmer: Benjamin Grauer |
---|
23 | |
---|
24 | */ |
---|
25 | |
---|
26 | |
---|
27 | #include "orxonox_gui_video.h" |
---|
28 | |
---|
29 | /** |
---|
30 | \brief Creates the Video-Option-Frame |
---|
31 | */ |
---|
32 | OrxonoxGuiVideo::OrxonoxGuiVideo(void) |
---|
33 | { |
---|
34 | this->videoFrame = new Frame("Video-Options:"); |
---|
35 | this->videoBox = new Box('v'); |
---|
36 | this->videoFrame->setGroupName("video"); |
---|
37 | |
---|
38 | this->fullscreen = new CheckButton("Fullscreen-mode"); |
---|
39 | this->fullscreen->setFlagName("windowed", "q", 1); |
---|
40 | this->fullscreen->saveability(); |
---|
41 | this->videoBox->fill(this->fullscreen); |
---|
42 | this->resolution = new Menu("Resolution", "640x480", "800x600", "1024x768", "1280x1024", "1400x1050", "1600x1200", "1920x1200", "lastItem"); |
---|
43 | this->resolution->saveability(); |
---|
44 | this->videoBox->fill(this->resolution); |
---|
45 | this->wireframe = new CheckButton("WireFrame-mode"); |
---|
46 | this->wireframe->setFlagName("wireframe", "w", 0); |
---|
47 | this->wireframe->saveability(); |
---|
48 | this->videoBox->fill(this->wireframe); |
---|
49 | |
---|
50 | this->advancedWindowCreate(); |
---|
51 | this->videoBox->fill(this->advancedWindowGetButton()); |
---|
52 | |
---|
53 | this->videoFrame->fill(videoBox); |
---|
54 | } |
---|
55 | |
---|
56 | /** |
---|
57 | \brief Destructs the Video-stuff |
---|
58 | */ |
---|
59 | OrxonoxGuiVideo::~OrxonoxGuiVideo(void) |
---|
60 | { |
---|
61 | // nothing to do here. |
---|
62 | } |
---|
63 | |
---|
64 | /** |
---|
65 | \return Returns the Video-frame |
---|
66 | */ |
---|
67 | Widget* OrxonoxGuiVideo::getWidget(void) |
---|
68 | { |
---|
69 | return this->videoFrame; |
---|
70 | } |
---|
71 | |
---|
72 | |
---|
73 | /** |
---|
74 | \brief Creates a window, and all it contains for the Source-update. |
---|
75 | */ |
---|
76 | void OrxonoxGuiVideo::advancedWindowCreate(void) |
---|
77 | { |
---|
78 | // the button, that opens this Window. |
---|
79 | this->advancedButton = new Button("advanced"); |
---|
80 | |
---|
81 | // the Window itself |
---|
82 | this->advancedWindow = new Window("Advanced Video Options"); |
---|
83 | this->advancedWindow->setGroupName("advancedVideoOptions"); |
---|
84 | |
---|
85 | this->advancedBox = new Box('v'); |
---|
86 | |
---|
87 | // Advanced Performance Options |
---|
88 | this->shadows = new CheckButton("Shadows"); |
---|
89 | this->shadows->saveability(); |
---|
90 | this->advancedBox->fill(this->shadows); |
---|
91 | |
---|
92 | this->fog = new CheckButton("Fog"); |
---|
93 | this->fog->saveability(); |
---|
94 | this->advancedBox->fill(this->fog); |
---|
95 | |
---|
96 | this->reflections = new CheckButton("Reflections"); |
---|
97 | this->reflections->saveability(); |
---|
98 | this->advancedBox->fill(this->reflections); |
---|
99 | |
---|
100 | this->textures = new CheckButton("Textures"); |
---|
101 | this->textures->saveability(); |
---|
102 | this->advancedBox->fill(this->textures); |
---|
103 | |
---|
104 | this->textureDetail = new Menu("Texture Detail", "low", "medium", "high", "lastItem"); |
---|
105 | this->textureDetail->saveability(); |
---|
106 | this->advancedBox->fill(this->textureDetail); |
---|
107 | |
---|
108 | this->modelDetailLabel = new Label("Model Detail"); |
---|
109 | this->advancedBox->fill(this->modelDetailLabel); |
---|
110 | this->modelDetail = new Menu("Model Detail", "low", "medium", "high", "lastItem"); |
---|
111 | this->modelDetail->saveability(); |
---|
112 | this->advancedBox->fill(this->modelDetail); |
---|
113 | |
---|
114 | this->antiAliasingLabel = new Label("Anti-Aliasing-depth:"); |
---|
115 | this->advancedBox->fill(this->antiAliasingLabel); |
---|
116 | this->antiAliasing = new Menu("Anti Aliasing", "0", "1", "2", "4", "8", "lastItem"); |
---|
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->saveability(); |
---|
124 | this->advancedBox->fill(this->filterMethod); |
---|
125 | |
---|
126 | this->closeButton = new Button("close"); |
---|
127 | this->advancedBox->fill(this->closeButton); |
---|
128 | |
---|
129 | this->advancedWindow->fill(advancedBox); |
---|
130 | #ifdef HAVE_GTK2 |
---|
131 | this->advancedButton->connectSignal("button_press_event", this->advancedWindow, Window::windowOpen); |
---|
132 | this->closeButton->connectSignal("button_press_event", this->advancedWindow, Window::windowClose); |
---|
133 | this->advancedWindow->connectSignal("destroy", this->advancedWindow, Window::windowClose); |
---|
134 | this->advancedWindow->connectSignal("delete_event", this->advancedWindow, Window::windowClose); |
---|
135 | #endif /* HAVE_GTK2 */ |
---|
136 | Window::addWindow(this->advancedWindow); |
---|
137 | |
---|
138 | } |
---|
139 | |
---|
140 | /** |
---|
141 | \returns A Pointer to the Button of the UpdaterSourceWindow |
---|
142 | */ |
---|
143 | Button* OrxonoxGuiVideo::advancedWindowGetButton(void) |
---|
144 | { |
---|
145 | return this->advancedButton; |
---|
146 | } |
---|
147 | |
---|