[Orxonox-commit 3330] r8018 - in code/branches/usability: data/gui/layouts data/gui/scripts data/overlays src/libraries/core
landauf at orxonox.net
landauf at orxonox.net
Sat Mar 5 17:31:27 CET 2011
Author: landauf
Date: 2011-03-05 17:31:27 +0100 (Sat, 05 Mar 2011)
New Revision: 8018
Modified:
code/branches/usability/data/gui/layouts/GraphicsMenu.layout
code/branches/usability/data/gui/scripts/GUISheet.lua
code/branches/usability/data/gui/scripts/GraphicsMenu.lua
code/branches/usability/data/gui/scripts/SheetManager.lua
code/branches/usability/data/overlays/debug.oxo
code/branches/usability/src/libraries/core/CMakeLists.txt
code/branches/usability/src/libraries/core/GraphicsManager.cc
code/branches/usability/src/libraries/core/GraphicsManager.h
Log:
added new graphics menu
Modified: code/branches/usability/data/gui/layouts/GraphicsMenu.layout
===================================================================
--- code/branches/usability/data/gui/layouts/GraphicsMenu.layout 2011-03-04 10:33:18 UTC (rev 8017)
+++ code/branches/usability/data/gui/layouts/GraphicsMenu.layout 2011-03-05 16:31:27 UTC (rev 8018)
@@ -14,78 +14,197 @@
<Property Name="HorzFormatting" Value="HorzCentred" />
<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="VertFormatting" Value="TopAligned" />
- <Property Name="UnifiedAreaRect" Value="{{0.25,0},{0.2,0},{0.75,0},{0.6375,0}}" />
- <Window Type="MenuWidgets/StaticText" Name="orxonox/Resolution" >
- <Property Name="Text" Value="Resolution" />
- <Property Name="InheritsAlpha" Value="False" />
- <Property Name="HorzFormatting" Value="HorzCentred" />
+ <Property Name="UnifiedAreaRect" Value="{{0.25,0},{0.15,0},{0.75,0},{0.6375,0}}" />
+ <Window Type="MenuWidgets/TabControl" Name="orxonox/GraphicsTabControl" >
+ <Property Name="TabHeight" Value="{0,26.4388}" />
<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
- <Property Name="VertFormatting" Value="TopAligned" />
- <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.10,0},{0.475,0},{0.65,0}}" />
- <Window Type="MenuWidgets/Listbox" Name="orxonox/ResolutionListbox" >
+ <Property Name="TabPanePosition" Value="Top" />
+ <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.1,0},{0.95,0},{0.925,0}}" />
+ <Window Type="DefaultWindow" Name="orxonox/Display" >
+ <Property Name="Text" Value="Display" />
<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
- <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.2,0},{0.95,0},{0.95,0}}" />
- <Event Name="ItemSelectionChanged" Function="GraphicsMenu.GraphicsResolutionListbox_changed"/>
+ <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
+ <Window Type="MenuWidgets/StaticText" Name="orxonox/Display/Resolution" >
+ <Property Name="Text" Value="Resolution" />
+ <Property Name="HorzFormatting" Value="HorzCentred" />
+ <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+ <Property Name="VertFormatting" Value="TopAligned" />
+ <Property Name="UnifiedAreaRect" Value="{{0.025,0},{0.035,0},{0.4875,0},{0.96,0}}" />
+ <Window Type="MenuWidgets/Checkbox" Name="orxonox/Display/Resolution/Fullscreen" >
+ <Property Name="Text" Value="Fullscreen" />
+ <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+ <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.15,0},{0.95,0},{0.27,0}}" />
+ <Event Name="CheckStateChanged" Function="GraphicsMenu.callback_FullscreenCheckbox_CheckStateChanged" />
+ </Window>
+ <Window Type="MenuWidgets/Combobox" Name="orxonox/Display/Resolution/Combobox" >
+ <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+ <Property Name="ClippedByParent" Value="False" />
+ <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.3,0},{0.95,0},{1.2,0}}" />
+ <Property Name="MaxEditTextLength" Value="1073741823" />
+ <Event Name="ListSelectionAccepted" Function="GraphicsMenu.callback_ResolutionCombobox_ListSelectionAccepted" />
+ </Window>
+ <Window Type="MenuWidgets/Editbox" Name="orxonox/Display/Resolution/EditboxWidth" >
+ <Property Name="MaxTextLength" Value="1073741823" />
+ <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+ <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.45,0},{0.45,0},{0.57,0}}" />
+ <Event Name="TextChanged" Function="GraphicsMenu.callback_ResolutionEditboxWidth_TextChanged" />
+ </Window>
+ <Window Type="MenuWidgets/Editbox" Name="orxonox/Display/Resolution/EditboxHeight" >
+ <Property Name="MaxTextLength" Value="1073741823" />
+ <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+ <Property Name="UnifiedAreaRect" Value="{{0.55,0},{0.45,0},{0.95,0},{0.57,0}}" />
+ <Event Name="TextChanged" Function="GraphicsMenu.callback_ResolutionEditboxHeight_TextChanged" />
+ </Window>
+ <Window Type="MenuWidgets/StaticText" Name="orxonox/Display/Resolution/x" >
+ <Property Name="Text" Value="x" />
+ <Property Name="FrameEnabled" Value="False" />
+ <Property Name="HorzFormatting" Value="HorzCentred" />
+ <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+ <Property Name="UnifiedAreaRect" Value="{{0.45,0},{0.45,0},{0.55,0},{0.57,0}}" />
+ <Property Name="BackgroundEnabled" Value="False" />
+ </Window>
+ <Window Type="MenuWidgets/Button" Name="orxonox/Display/Resolution/Apply" >
+ <Property Name="Text" Value="Apply" />
+ <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+ <Property Name="UnifiedAreaRect" Value="{{0.25,0},{0.61,0},{0.75,0},{0.73,0}}" />
+ <Event Name="Clicked" Function="GraphicsMenu.callback_Apply_Clicked" />
+ </Window>
+ <Window Type="MenuWidgets/StaticText" Name="orxonox/Display/Resolution/AspectRatioLabel" >
+ <Property Name="Text" Value="Aspect Ratio" />
+ <Property Name="FrameEnabled" Value="False" />
+ <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+ <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.825,0},{0.6,0},{0.95,0}}" />
+ <Property Name="BackgroundEnabled" Value="False" />
+ </Window>
+ <Window Type="MenuWidgets/Editbox" Name="orxonox/Display/Resolution/AspectRatio" >
+ <Property Name="Text" Value="1" />
+ <Property Name="MaxTextLength" Value="1073741823" />
+ <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+ <Property Name="UnifiedAreaRect" Value="{{0.65,0},{0.825,0},{0.95,0},{0.95,0}}" />
+ </Window>
+ </Window>
+ <Window Type="MenuWidgets/StaticText" Name="orxonox/Display/Theme" >
+ <Property Name="Text" Value="Theme" />
+ <Property Name="HorzFormatting" Value="HorzCentred" />
+ <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+ <Property Name="VertFormatting" Value="TopAligned" />
+ <Property Name="UnifiedAreaRect" Value="{{0.5125,0},{0.035,0},{0.975,0},{0.32,0}}" />
+ <Window Type="MenuWidgets/Combobox" Name="orxonox/Display/Theme/Combobox" >
+ <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+ <Property Name="ClippedByParent" Value="False" />
+ <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.5,0},{0.95,0},{1.6,0}}" />
+ <Property Name="MaxEditTextLength" Value="1073741823" />
+ <Event Name="ListSelectionAccepted" Function="GraphicsMenu.callback_ThemeCombobox_ListSelectionAccepted" />
+ </Window>
+ </Window>
+ <Window Type="MenuWidgets/StaticText" Name="orxonox/Display/More" >
+ <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+ <Property Name="UnifiedAreaRect" Value="{{0.5125,0},{0.37,0},{0.975,0},{0.7,0}}" />
+ <Window Type="MenuWidgets/Checkbox" Name="orxonox/Display/More/VSync" >
+ <Property Name="Text" Value="VSync" />
+ <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+ <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.1,0},{0.95,0},{0.45,0}}" />
+ <Event Name="CheckStateChanged" Function="GraphicsMenu.callback_VSyncCheckbox_CheckStateChanged" />
+ </Window>
+ <Window Type="MenuWidgets/StaticText" Name="orxonox/Display/More/FSAALabel" >
+ <Property Name="Text" Value="FSAA" />
+ <Property Name="FrameEnabled" Value="False" />
+ <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+ <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.55,0},{0.3,0},{0.9,0}}" />
+ <Property Name="BackgroundEnabled" Value="False" />
+ </Window>
+ <Window Type="MenuWidgets/Combobox" Name="orxonox/Display/More/FSAA" >
+ <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+ <Property Name="ClippedByParent" Value="False" />
+ <Property Name="UnifiedAreaRect" Value="{{0.3,0},{0.55,0},{0.95,0},{2.1,0}}" />
+ <Property Name="MaxEditTextLength" Value="1073741823" />
+ <Event Name="ListSelectionAccepted" Function="GraphicsMenu.callback_FSAACombobox_ListSelectionAccepted" />
+ </Window>
+ </Window>
+ <Window Type="MenuWidgets/StaticText" Name="orxonox/Display/Notice" >
+ <Property Name="Font" Value="BlueHighway-12" />
+ <Property Name="Text" >Changing the theme, FSAA,
+or VSync requires a restart</Property>
+ <Property Name="HorzFormatting" Value="HorzCentred" />
+ <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+ <Property Name="UnifiedAreaRect" Value="{{0.5125,0},{0.75,0},{0.975,0},{0.96,0}}" />
+ </Window>
+ <Window Type="MenuWidgets/StaticText" Name="orxonox/Display/NoticeRed" >
+ <Property Name="Font" Value="BlueHighway-12" />
+ <Property Name="Text" >Changing the theme, FSAA,
+or VSync requires a restart</Property>
+ <Property Name="TextColours" Value="tl:FFFF0000 tr:FFFF8888 bl:FFFF8888 br:FFFFFFFF" />
+ <Property Name="HorzFormatting" Value="HorzCentred" />
+ <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+ <Property Name="UnifiedAreaRect" Value="{{0.5125,0},{0.75,0},{0.975,0},{0.96,0}}" />
+ </Window>
</Window>
- </Window>
- <Window Type="MenuWidgets/StaticText" Name="orxonox/Themes" >
- <Property Name="Text" Value="Themes" />
- <Property Name="InheritsAlpha" Value="False" />
- <Property Name="HorzFormatting" Value="HorzCentred" />
- <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
- <Property Name="VertFormatting" Value="TopAligned" />
- <Property Name="UnifiedAreaRect" Value="{{0.525,0},{0.10,0},{0.95,0},{0.35,0}}" />
- <Window Type="MenuWidgets/Listbox" Name="orxonox/ThemeDropBox" >
+ <Window Type="DefaultWindow" Name="orxonox/Settings" >
+ <Property Name="Text" Value="Settings" />
+ <Property Name="Visible" Value="False" />
<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
- <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.3,0},{0.95,0},{0.95,0}" />
- <Event Name="ItemSelectionChanged" Function="GraphicsMenu.ThemeDropBox_changed"/>
+ <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
+ <Window Type="MenuWidgets/StaticText" Name="orxonox/Settings/FovLabel" >
+ <Property Name="Text" Value="Vertical field of view (FOV)" />
+ <Property Name="FrameEnabled" Value="False" />
+ <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+ <Property Name="UnifiedAreaRect" Value="{{0.035,0},{0.05,0},{0.5,0},{0.12,0}}" />
+ <Property Name="BackgroundEnabled" Value="False" />
+ </Window>
+ <Window Type="MenuWidgets/StaticText" Name="orxonox/Settings/FpsLimitLabel" >
+ <Property Name="Text" Value="Maximal frame rate" />
+ <Property Name="FrameEnabled" Value="False" />
+ <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+ <Property Name="UnifiedAreaRect" Value="{{0.035,0},{0.18,0},{0.5,0},{0.25,0}}" />
+ <Property Name="BackgroundEnabled" Value="False" />
+ </Window>
+ <Window Type="MenuWidgets/StaticText" Name="orxonox/Settings/ParticleLodLabel" >
+ <Property Name="Text" Value="Particle detail level" />
+ <Property Name="FrameEnabled" Value="False" />
+ <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+ <Property Name="UnifiedAreaRect" Value="{{0.035,0},{0.31,0},{0.5,0},{0.38,0}}" />
+ <Property Name="BackgroundEnabled" Value="False" />
+ </Window>
+ <Window Type="MenuWidgets/Editbox" Name="orxonox/Settings/Fov" >
+ <Property Name="MaxTextLength" Value="1073741823" />
+ <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+ <Property Name="UnifiedAreaRect" Value="{{0.5,0},{0.03,0},{0.65,0},{0.14,0}}" />
+ </Window>
+ <Window Type="MenuWidgets/Editbox" Name="orxonox/Settings/FpsLimit" >
+ <Property Name="MaxTextLength" Value="1073741823" />
+ <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+ <Property Name="UnifiedAreaRect" Value="{{0.5,0},{0.16,0},{0.65,0},{0.27,0}}" />
+ </Window>
+ <Window Type="MenuWidgets/Combobox" Name="orxonox/Settings/ParticleLodCombobox" >
+ <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+ <Property Name="ClippedByParent" Value="False" />
+ <Property Name="UnifiedAreaRect" Value="{{0.5,0},{0.29,0},{0.7,0},{0.725,0}}" />
+ <Property Name="MaxEditTextLength" Value="1073741823" />
+ </Window>
+ <Window Type="MenuWidgets/Checkbox" Name="orxonox/Settings/ModelLodCheckbox" >
+ <Property Name="Text" Value="Enable model LOD" />
+ <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+ <Property Name="UnifiedAreaRect" Value="{{0.035,0},{0.44,0},{0.5,0},{0.51,0}}" />
+ </Window>
+ <Window Type="MenuWidgets/Checkbox" Name="orxonox/Settings/MotionBlurCheckbox" >
+ <Property Name="Text" Value="Enable motion blur" />
+ <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+ <Property Name="UnifiedAreaRect" Value="{{0.035,0},{0.57,0},{0.5,0},{0.64,0}}" />
+ </Window>
</Window>
</Window>
- <Window Type="MenuWidgets/StaticText" Name="orxonox/Brightness" >
- <Property Name="Text" Value="Brightness" />
- <Property Name="InheritsAlpha" Value="False" />
- <Property Name="HorzFormatting" Value="HorzCentred" />
- <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
- <Property Name="VertFormatting" Value="TopAligned" />
- <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.70,0},{0.475,0},{0.85,0}}" />
- <Window Type="MenuWidgets/HorizontalScrollbar" Name="orxonox/BrightnessScrollbar" >
- <Property Name="Disabled" Value="true" />
- <Property Name="PageSize" Value="0" />
- <Property Name="StepSize" Value="0.1" />
- <Property Name="OverlapSize" Value="0" />
- <Property Name="DocumentSize" Value="1" />
- <Property Name="ScrollPosition" Value="0" />
- <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
- <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.6,0},{0.95,0},{0.8,0}}" />
- <Event Name="ThumbTrackStarted" Function="GraphicsMenu.GraphicsBrightnessScrollbar_started" />
- <Event Name="ThumbTrackEnded" Function="GraphicsMenu.GraphicsBrightnessScrollbar_ended" />
- <Event Name="ScrollPosChanged" Function="GraphicsMenu.GraphicsBrightnessScrollbar_changed" />
- </Window>
- </Window>
- <Window Type="MenuWidgets/Checkbox" Name="orxonox/FullscreenCheckbox" >
- <Property Name="Text" Value="Fullscreen" />
- <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
- <Property Name="UnifiedAreaRect" Value="{{0.65,0},{0.35,0},{0.85,0},{0.425,0}}" />
- <Event Name="CheckStateChanged" Function="GraphicsMenu.GraphicsFullscreenCheckbox_clicked"/>
- </Window>
- <Window Type="MenuWidgets/StaticText" Name="orxonox/GraphicsInfo" >
- <Property Name="Text" >
-Changes in graphics
-settings require
-a game restart.</Property>
- <Property Name="TextColours" Value="FFFFFFFF" />
- <Property Name="InheritsAlpha" Value="False" />
- <Property Name="HorzFormatting" Value="HorzCentred" />
- <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
- <Property Name="VertFormatting" Value="TopAligned" />
- <Property Name="UnifiedAreaRect" Value="{{0.525,0},{0.425,0},{0.95,0},{0.85,0}}" />
- </Window>
</Window>
- <Window Type="MenuWidgets/Button" Name="orxonox/GraphicsBackButton" >
- <Property Name="Text" Value="Back" />
+ <Window Type="MenuWidgets/Button" Name="orxonox/GraphicsOkButton" >
+ <Property Name="Text" Value="OK" />
<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
- <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.6625,0},{0.6,0},{0.7125,0}}" />
- <Event Name="Clicked" Function="GraphicsMenu.GraphicsBackButton_clicked"/>
+ <Property Name="UnifiedAreaRect" Value="{{0.2875,0},{0.6625,0},{0.4875,0},{0.7125,0}}" />
+ <Event Name="Clicked" Function="GraphicsMenu.callback_Ok_Clicked" />
</Window>
+ <Window Type="MenuWidgets/Button" Name="orxonox/GraphicsCancelButton" >
+ <Property Name="Text" Value="Cancel" />
+ <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+ <Property Name="UnifiedAreaRect" Value="{{0.5125,0},{0.6625,0},{0.7125,0},{0.7125,0}}" />
+ <Event Name="Clicked" Function="GraphicsMenu.callback_Cancel_Clicked" />
+ </Window>
</Window>
</GUILayout>
Modified: code/branches/usability/data/gui/scripts/GUISheet.lua
===================================================================
--- code/branches/usability/data/gui/scripts/GUISheet.lua 2011-03-04 10:33:18 UTC (rev 8017)
+++ code/branches/usability/data/gui/scripts/GUISheet.lua 2011-03-05 16:31:27 UTC (rev 8018)
@@ -27,6 +27,14 @@
function P:onQuit()
end
+-- Override this function if you want to react on keystrokes
+function P:onKeyPressed()
+end
+
+-- Override this function if you want to update the gui after the window was resized
+function P:onWindowResized()
+end
+
-- show function for the GUI
function P:show()
self.window:show()
@@ -91,11 +99,11 @@
end
end
- self.onKeyPressed()
+ self:onKeyPressed()
end
--- Override this function if you want to ract on keystrokes
-function P:onKeyPressed()
+function P:windowResized()
+ self:onWindowResized()
end
Modified: code/branches/usability/data/gui/scripts/GraphicsMenu.lua
===================================================================
--- code/branches/usability/data/gui/scripts/GraphicsMenu.lua 2011-03-04 10:33:18 UTC (rev 8017)
+++ code/branches/usability/data/gui/scripts/GraphicsMenu.lua 2011-03-05 16:31:27 UTC (rev 8018)
@@ -2,225 +2,361 @@
local P = createMenuSheet("GraphicsMenu")
+P.resolutionList = {"custom", "640 x 480", "720 x 480", "720 x 576", "800 x 600", "1024 x 600", "1024 x 768", "1152 x 864", "1280 x 720", "1280 x 800", "1280 x 960", "1280 x 1024", "1360 x 768", "1440 x 900", "1600 x 900", "1600 x 1200", "1680 x 1050"}
P.schemeList = {"TaharezGreen", "Orxonox"}
+P.fsaaList = {"0", "2", "4", "8", "8 [Quality]"}
+P.particleLodList = {"None", "Low", "Normal", "High"}
-function P.onLoad()
- block = true
- file = orxonox.PathConfig:getConfigPathString() .. orxonox.getConfig("GraphicsManager", "ogreConfigFile_")
- search_mode = 0
- f = io.open(file, "r")
- firstline = f:read("*line")
- rendersystem = string.sub(firstline, 15)
- for line in f:lines() do
- if search_mode == 0 then
- if string.find(line, rendersystem) ~= nil then
- search_mode = 1
- end
- end
- if search_mode == 1 then
- if string.sub(line, 1, 11) == "Full Screen" then
- if string.sub(line, 13) == "Yes" then
- fullscreen = true
- else
- fullscreen = false
- end
- end
- if string.sub(line, 1, 10) == "Video Mode" then
- if string.match(line, "@") == "@" then
- resolution = string.sub(line, 12, string.find(line, "@")-2)
- else
- resolution = string.sub(line, 12)
- end
- break
- end
- end
+function P:onLoad()
+ -------------------
+ -- Button matrix --
+ -------------------
+
+ P:setButton(1, 1, {
+ ["button"] = winMgr:getWindow("orxonox/GraphicsOkButton"),
+ ["callback"] = P.callback_Ok_Clicked
+ })
+
+ P:setButton(1, 2, {
+ ["button"] = winMgr:getWindow("orxonox/GraphicsCancelButton"),
+ ["callback"] = P.callback_Cancel_Clicked
+ })
+
+ -- place apply button at the bottom in the matrix, even though it's in fact at the top, to make the OK button highlighted by default
+ P:setButton(2, 1, {
+ ["button"] = winMgr:getWindow("orxonox/Display/Resolution/Apply"),
+ ["callback"] = P.callback_Apply_Clicked
+ })
+
+ -----------------
+ -- Combo boxes --
+ -----------------
+
+ -- resolution combobox
+ local resolutionCombobox = winMgr:getWindow("orxonox/Display/Resolution/Combobox")
+ CEGUI.toCombobox(resolutionCombobox):setReadOnly(true)
+
+ for k,v in pairs(P.resolutionList) do
+ local item = CEGUI.createListboxTextItem(v)
+ item:setSelectionBrushImage(menuImageSet, "MultiListSelectionBrush")
+ resolutionCombobox:addItem(item)
end
- f:close()
- local fullscreenwindow = tolua.cast(winMgr:getWindow("orxonox/FullscreenCheckbox"),"CEGUI::Checkbox")
- fullscreenwindow:setSelected(fullscreen)
- listboxwindow = winMgr:getWindow("orxonox/ResolutionListbox")
- local resolutionList = {}
- table.insert(resolutionList, "640 x 480")
- table.insert(resolutionList, "720 x 480")
- table.insert(resolutionList, "720 x 576")
- table.insert(resolutionList, "800 x 480")
- table.insert(resolutionList, "800 x 600")
- table.insert(resolutionList, "1024 x 480")
- table.insert(resolutionList, "1024 x 600")
- table.insert(resolutionList, "1024 x 768")
- table.insert(resolutionList, "1152 x 864")
- table.insert(resolutionList, "1280 x 720")
- table.insert(resolutionList, "1280 x 768")
- table.insert(resolutionList, "1440 x 900")
- for k,v in pairs(resolutionList) do
- item = CEGUI.createListboxTextItem(v)
+
+ -- themes combobox
+ local themeCombobox = winMgr:getWindow("orxonox/Display/Theme/Combobox")
+ CEGUI.toCombobox(themeCombobox):setReadOnly(true)
+
+ for k,v in pairs(P.schemeList) do
+ local item = CEGUI.createListboxTextItem(v)
item:setSelectionBrushImage(menuImageSet, "MultiListSelectionBrush")
- CEGUI.toListbox(listboxwindow):addItem(item)
+ themeCombobox:addItem(item)
end
- if resolution == "640 x 480" then
- listboxwindow:setItemSelectState(0,true)
- elseif resolution == "720 x 480" then
- listboxwindow:setItemSelectState(1,true)
- elseif resolution == "720 x 576" then
- listboxwindow:setItemSelectState(2,true)
- elseif resolution == "800 x 480" then
- listboxwindow:setItemSelectState(3,true)
- elseif resolution == "800 x 600" then
- listboxwindow:setItemSelectState(4,true)
- elseif resolution == "1024 x 480" then
- listboxwindow:setItemSelectState(5,true)
- elseif resolution == "1024 x 600" then
- listboxwindow:setItemSelectState(6,true)
- elseif resolution == "1024 x 768" then
- listboxwindow:setItemSelectState(7,true)
- elseif resolution == "1152 x 864" then
- listboxwindow:setItemSelectState(8,true)
- elseif resolution == "1280 x 720" then
- listboxwindow:setItemSelectState(9,true)
- elseif resolution == "1280 x 768" then
- listboxwindow:setItemSelectState(10,true)
- elseif resolution == "1440 x 900" then
- listboxwindow:setItemSelectState(11,true)
+
+ -- fsaa combobox
+ local fsaaCombobox = winMgr:getWindow("orxonox/Display/More/FSAA")
+ CEGUI.toCombobox(fsaaCombobox):setReadOnly(true)
+
+ for k,v in pairs(P.fsaaList) do
+ local item = CEGUI.createListboxTextItem(v)
+ item:setSelectionBrushImage(menuImageSet, "MultiListSelectionBrush")
+ fsaaCombobox:addItem(item)
end
- scrollbar_active = false
- block = false
- P:setButton(1, 1, {
- ["button"] = winMgr:getWindow("orxonox/GraphicsBackButton"),
- ["callback"] = P.GraphicsBackButton_clicked
- })
+ -- particle lod combobox
+ local particleLodCombobox = winMgr:getWindow("orxonox/Settings/ParticleLodCombobox")
+ CEGUI.toCombobox(particleLodCombobox):setReadOnly(true)
- local dropbox = winMgr:getWindow("orxonox/ThemeDropBox")
- local scheme = orxonox.CommandExecutor:query("getConfig GUIManager guiScheme_")
- for k,v in pairs(P.schemeList) do
- local item = CEGUI.createListboxTextItem(P.schemeList[k])
+ for k,v in pairs(P.particleLodList) do
+ local item = CEGUI.createListboxTextItem(v)
item:setSelectionBrushImage(menuImageSet, "MultiListSelectionBrush")
- CEGUI.toListbox(dropbox):addItem(item)
- if v == scheme then
- dropbox:setItemSelectState(item, true)
+ particleLodCombobox:addItem(item)
+ end
+end
+
+function P:onShow()
+ -----------------
+ -- Display tab --
+ -----------------
+
+ -- fullscreen checkbox / resolution combobox / resolution editboxes
+ self:onWindowResized()
+
+ -- apply button
+ self.updateApplyButton()
+
+ -- aspect ratio editbox
+ local aspectRatioEditbox = winMgr:getWindow("orxonox/Display/Resolution/AspectRatio")
+ local currentAspectRatio = orxonox.CommandExecutor:query("getConfig Camera aspectRatio_")
+ aspectRatioEditbox:setText(currentAspectRatio)
+
+ -- themes combobox
+ local themeCombobox = winMgr:getWindow("orxonox/Display/Theme/Combobox")
+ local currentScheme = orxonox.CommandExecutor:query("getConfig GUIManager guiScheme_")
+
+ for i = 0, themeCombobox:getDropList():getItemCount() - 1 do
+ local item = themeCombobox:getListboxItemFromIndex(i)
+ themeCombobox:setItemSelectState(item, (item:getText() == currentScheme))
+ end
+
+ -- vsync checkbox
+ local vsyncCheckbox = winMgr:getWindow("orxonox/Display/More/VSync")
+ local hasVSync = orxonox.GraphicsManager:getInstance():hasVSyncEnabled()
+ CEGUI.toCheckbox(vsyncCheckbox):setSelected(hasVSync)
+
+ -- fsaa combobox
+ local fsaaCombobox = winMgr:getWindow("orxonox/Display/More/FSAA")
+ local currentFSAAMode = orxonox.GraphicsManager:getInstance():getFSAAMode()
+
+ for i = 0, fsaaCombobox:getDropList():getItemCount() - 1 do
+ local item = fsaaCombobox:getListboxItemFromIndex(i)
+ fsaaCombobox:setItemSelectState(item, (item:getText() == currentFSAAMode))
+ end
+
+ -- notice
+ local notice = winMgr:getWindow("orxonox/Display/Notice")
+ notice:setVisible(true)
+ local noticeRed = winMgr:getWindow("orxonox/Display/NoticeRed")
+ noticeRed:setVisible(false)
+
+ ------------------
+ -- Settings tab --
+ ------------------
+
+ -- fov editbox
+ local fovEditbox = winMgr:getWindow("orxonox/Settings/Fov")
+ local currentFov = orxonox.CommandExecutor:query("getConfig Camera fov_")
+ fovEditbox:setText(currentFov)
+
+ -- fps limit editbox
+ local fpsEditbox = winMgr:getWindow("orxonox/Settings/FpsLimit")
+ local currentFpsLimit = orxonox.CommandExecutor:query("getConfig GraphicsSettings fpsLimit")
+ fpsEditbox:setText(currentFpsLimit)
+
+ -- particle lod combobox
+ local particleLodCombobox = winMgr:getWindow("orxonox/Settings/ParticleLodCombobox")
+ local currentParticleLod = orxonox.CommandExecutor:query("getConfig GraphicsSettings particlesDetailLevel")
+
+ if currentParticleLod == "" then
+ particleLodCombobox:disable()
+ else
+ particleLodCombobox:enable()
+
+ for i = 0, particleLodCombobox:getDropList():getItemCount() - 1 do
+ local item = particleLodCombobox:getListboxItemFromIndex(i)
+ particleLodCombobox:setItemSelectState(item, (tostring(i) == currentParticleLod))
end
end
+ -- model lod checkbox
+ local modelLodCheckbox = winMgr:getWindow("orxonox/Settings/ModelLodCheckbox")
+ local hasModelLod = orxonox.CommandExecutor:query("getConfig GraphicsSettings enableModelLoD")
+ if hasModelLod == "true" then
+ hasModelLod = true
+ elseif hasModelLod == "false" then
+ hasModelLod = false
+ end
+ CEGUI.toCheckbox(modelLodCheckbox):setSelected(hasModelLod)
+
+ -- motion blur checkbox
+ local motionBlurCheckbox = winMgr:getWindow("orxonox/Settings/MotionBlurCheckbox")
+ local hasMotionBlur = orxonox.CommandExecutor:query("getConfig GraphicsSettings enableMotionBlur")
+ if hasMotionBlur == "true" then
+ hasMotionBlur = true
+ elseif hasMotionBlur == "false" then
+ hasMotionBlur = false
+ end
+ CEGUI.toCheckbox(motionBlurCheckbox):setSelected(hasMotionBlur)
end
-function P.ThemeDropBox_changed(e)
- local dropbox = winMgr:getWindow("orxonox/ThemeDropBox")
- local listbox = CEGUI.toListbox(dropbox)
- local choice = listbox:getFirstSelectedItem()
- local index = 0
- if choice ~= nil then
- index = listbox:getItemIndex(choice)
+function P:onWindowResized()
+ -- fullscreen checkbox
+ local fullscreenCheckbox = winMgr:getWindow("orxonox/Display/Resolution/Fullscreen")
+ local isFullscreen = orxonox.GraphicsManager:getInstance():isFullScreen()
+ CEGUI.toCheckbox(fullscreenCheckbox):setSelected(isFullscreen)
+
+ -- resolution combobox
+ local resolutionCombobox = winMgr:getWindow("orxonox/Display/Resolution/Combobox")
+
+ local currentWidth = orxonox.GraphicsManager:getInstance():getWindowWidth()
+ local currentHeight = orxonox.GraphicsManager:getInstance():getWindowHeight()
+ local currentResolution = currentWidth .. " x " .. currentHeight
+
+ for i = 0, resolutionCombobox:getDropList():getItemCount() - 1 do
+ local item = resolutionCombobox:getListboxItemFromIndex(i)
+ resolutionCombobox:setItemSelectState(item, item:getText() == currentResolution)
end
- orxonox.CommandExecutor:execute("config GUIManager guiScheme_ " .. P.schemeList[index+1])
+
+ -- resolution editboxes
+ self.updateResolutionEditboxes()
end
-function P.GraphicsResolutionListbox_changed(e)
- if listboxwindow:isItemSelected(0) then
- resolution = "640 x 480"
- elseif listboxwindow:isItemSelected(1) then
- resolution = "720 x 480"
- elseif listboxwindow:isItemSelected(2) then
- resolution = "720 x 576"
- elseif listboxwindow:isItemSelected(3) then
- resolution = "800 x 480"
- elseif listboxwindow:isItemSelected(4) then
- resolution = "800 x 600"
- elseif listboxwindow:isItemSelected(5) then
- resolution = "1024 x 480"
- elseif listboxwindow:isItemSelected(6) then
- resolution = "1024 x 600"
- elseif listboxwindow:isItemSelected(7) then
- resolution = "1024 x 768"
- elseif listboxwindow:isItemSelected(8) then
- resolution = "1152 x 864"
- elseif listboxwindow:isItemSelected(9) then
- resolution = "1280 x 720"
- elseif listboxwindow:isItemSelected(10) then
- resolution = "1280 x 768"
- elseif listboxwindow:isItemSelected(11) then
- resolution = "1440 x 900"
- end
- search_mode = 0
- f = io.open(file, "r")
- firstline = f:read("*line")
- text = firstline .. "\n"
- rendersystem = string.sub(firstline, 15)
- for line in f:lines() do
- if search_mode == 0 then
- if string.find(line, rendersystem) ~= nil then
- search_mode = 1
- end
+----------------------
+-- Helper functions --
+----------------------
+
+-- updates the text of the resolution checkboxes and checks if they should be enabled (only if the "custom" resolution was selected)
+function P.updateResolutionEditboxes()
+ -- resolution combobox
+ local resolutionCombobox = winMgr:getWindow("orxonox/Display/Resolution/Combobox")
+
+ local currentWidth = orxonox.GraphicsManager:getInstance():getWindowWidth()
+ local currentHeight = orxonox.GraphicsManager:getInstance():getWindowHeight()
+
+ -- resolution editboxes
+ local widthEditbox = winMgr:getWindow("orxonox/Display/Resolution/EditboxWidth")
+ local heightEditbox = winMgr:getWindow("orxonox/Display/Resolution/EditboxHeight")
+ widthEditbox:disable()
+ heightEditbox:disable()
+
+ -- selected combobox item
+ local item = resolutionCombobox:getSelectedItem()
+ if item then
+ local itemText = item:getText()
+ if itemText ~= "custom" then
+ currentWidth = string.sub(itemText, 1, string.find(itemText, "x") - 2)
+ currentHeight = string.sub(itemText, string.find(itemText, "x") + 2)
+ else
+ widthEditbox:enable()
+ heightEditbox:enable()
end
- if search_mode == 1 then
- if string.sub(line, 1, 10) == "Video Mode" then
- if string.match(line, "@") == "@" then
- line = "Video Mode=" .. resolution .. string.sub(line, string.find(line, "@")-1)
- else
- line = "Video Mode=" .. resolution
- end
- search_mode = 2
- end
- end
- text = text .. line .. "\n"
end
- f:close()
- f = io.open(file, "w")
- f:write(text)
- f:close()
+
+ widthEditbox:setText(currentWidth)
+ heightEditbox:setText(currentHeight)
end
-function P.GraphicsBrightnessScrollbar_changed(e)
- if scrollbar_active == false then
- -- brightness
- logMessage(0, "event: brightness")
+-- checks if the apply button should be enabled or disabled (only enabled if the current settings are different from the selected values)
+function P.updateApplyButton()
+ -- fullscreen checkbox
+ local fullscreenCheckbox = winMgr:getWindow("orxonox/Display/Resolution/Fullscreen")
+ local isFullscreen = orxonox.GraphicsManager:getInstance():isFullScreen()
+ local fullscreenChanged = (isFullscreen ~= CEGUI.toCheckbox(fullscreenCheckbox):isSelected())
+
+ -- resolution editboxes
+ local widthEditbox = winMgr:getWindow("orxonox/Display/Resolution/EditboxWidth")
+ local heightEditbox = winMgr:getWindow("orxonox/Display/Resolution/EditboxHeight")
+ local currentWidth = tostring(orxonox.GraphicsManager:getInstance():getWindowWidth())
+ local currentHeight = tostring(orxonox.GraphicsManager:getInstance():getWindowHeight())
+ local widthChanged = (currentWidth ~= widthEditbox:getText())
+ local heightChanged = (currentHeight ~= heightEditbox:getText())
+ local resolutionEditboxesEnabled = not widthEditbox:isDisabled()
+
+ -- apply button
+ local applyButton = winMgr:getWindow("orxonox/Display/Resolution/Apply")
+
+ if fullscreenChanged or widthChanged or heightChanged or resolutionEditboxesEnabled then
+ applyButton:enable()
+ else
+ applyButton:disable()
end
end
-function P.GraphicsBrightnessScrollbar_started(e)
- scrollbar_active = true
+function P.makeLabelRed()
+ local notice = winMgr:getWindow("orxonox/Display/Notice")
+ notice:setVisible(false)
+ local noticeRed = winMgr:getWindow("orxonox/Display/NoticeRed")
+ noticeRed:setVisible(true)
end
-function P.GraphicsBrightnessScrollbar_ended(e)
- -- brightness
- logMessage(0, "event: brightness")
- scrollbar_active = false
+---------------------
+-- Event callbacks --
+---------------------
+
+-- resolution
+
+function P.callback_FullscreenCheckbox_CheckStateChanged(e)
+ P.updateApplyButton()
end
-function P.GraphicsFullscreenCheckbox_clicked(e)
- if block == false then
- search_mode = 0
- f = io.open(file, "r")
- firstline = f:read("*line")
- text = firstline .. "\n"
- rendersystem = string.sub(firstline, 15)
- for line in f:lines() do
- if search_mode == 0 then
- if string.find(line, rendersystem) ~= nil then
- search_mode = 1
- end
- end
- if search_mode == 1 then
- if string.sub(line, 1, 11) == "Full Screen" then
- if fullscreen == true then
- line = "Full Screen=No"
- fullscreen = false
- else
- line = "Full Screen=Yes"
- fullscreen = true
- end
- search_mode = 2
- end
- end
- text = text .. line .. "\n"
- end
- f:close()
- f = io.open(file, "w")
- f:write(text)
- f:close()
+function P.callback_ResolutionCombobox_ListSelectionAccepted(e)
+ P.updateResolutionEditboxes()
+end
+
+function P.callback_ResolutionEditboxWidth_TextChanged(e)
+ P.updateApplyButton()
+end
+
+function P.callback_ResolutionEditboxHeight_TextChanged(e)
+ P.updateApplyButton()
+end
+
+-- theme
+
+function P.callback_ThemeCombobox_ListSelectionAccepted(e)
+ P.makeLabelRed()
+end
+
+-- vsync
+
+function P.callback_VSyncCheckbox_CheckStateChanged(e)
+ P.makeLabelRed()
+end
+
+-- fsaa
+
+function P.callback_FSAACombobox_ListSelectionAccepted(e)
+ P.makeLabelRed()
+end
+
+-- buttons
+
+function P.callback_Apply_Clicked(e)
+ -- resolution
+ local fullscreenCheckbox = winMgr:getWindow("orxonox/Display/Resolution/Fullscreen")
+ local checkedFullscreen = tostring(CEGUI.toCheckbox(fullscreenCheckbox):isSelected())
+
+ local widthEditbox = winMgr:getWindow("orxonox/Display/Resolution/EditboxWidth")
+ local heightEditbox = winMgr:getWindow("orxonox/Display/Resolution/EditboxHeight")
+
+ orxonox.CommandExecutor:execute("GraphicsManager setScreenResolution " .. widthEditbox:getText() .. " " .. heightEditbox:getText() .. " " .. checkedFullscreen)
+
+ P.updateApplyButton()
+end
+
+function P.callback_Ok_Clicked(e)
+ -- aspect ratio
+ local aspectRatioEditbox = winMgr:getWindow("orxonox/Display/Resolution/AspectRatio")
+ orxonox.CommandExecutor:execute("config Camera aspectRatio_ " .. aspectRatioEditbox:getText())
+
+ -- theme
+ local themeCombobox = winMgr:getWindow("orxonox/Display/Theme/Combobox")
+ orxonox.CommandExecutor:execute("config GUIManager guiScheme_ " .. themeCombobox:getText())
+
+ -- vsync
+ local vsyncCheckbox = winMgr:getWindow("orxonox/Display/More/VSync")
+ orxonox.CommandExecutor:execute("GraphicsManager setVSync " .. tostring(CEGUI.toCheckbox(vsyncCheckbox):isSelected()))
+
+ -- fsaa
+ local fsaaCombobox = winMgr:getWindow("orxonox/Display/More/FSAA")
+ orxonox.CommandExecutor:execute("GraphicsManager setFSAA {" .. fsaaCombobox:getText() .. "}") -- enclose argument in { ... } because it can contain [brackets] (conflicts with tcl)
+
+ -- fov
+ local fovEditbox = winMgr:getWindow("orxonox/Settings/Fov")
+ orxonox.CommandExecutor:execute("config Camera fov_ " .. fovEditbox:getText())
+
+ -- fps limit
+ local fpsEditbox = winMgr:getWindow("orxonox/Settings/FpsLimit")
+ orxonox.CommandExecutor:execute("config GraphicsSettings fpsLimit " .. fpsEditbox:getText())
+
+ -- particle lod
+ local particleLodCombobox = winMgr:getWindow("orxonox/Settings/ParticleLodCombobox")
+ local item = particleLodCombobox:getSelectedItem()
+ if item then
+ orxonox.CommandExecutor:execute("config GraphicsSettings particlesDetailLevel " .. particleLodCombobox:getItemIndex(item))
end
+
+ -- model lod
+ local modelLodCheckbox = winMgr:getWindow("orxonox/Settings/ModelLodCheckbox")
+ orxonox.CommandExecutor:execute("config GraphicsSettings enableModelLoD " .. tostring(CEGUI.toCheckbox(modelLodCheckbox):isSelected()))
+
+ -- motion blur
+ local motionBlurCheckbox = winMgr:getWindow("orxonox/Settings/MotionBlurCheckbox")
+ orxonox.CommandExecutor:execute("config GraphicsSettings enableMotionBlur " .. tostring(CEGUI.toCheckbox(motionBlurCheckbox):isSelected()))
+
+ hideMenuSheet(P.name)
end
-function P.GraphicsBackButton_clicked(e)
+function P.callback_Cancel_Clicked(e)
hideMenuSheet(P.name)
end
Modified: code/branches/usability/data/gui/scripts/SheetManager.lua
===================================================================
--- code/branches/usability/data/gui/scripts/SheetManager.lua 2011-03-04 10:33:18 UTC (rev 8017)
+++ code/branches/usability/data/gui/scripts/SheetManager.lua 2011-03-05 16:31:27 UTC (rev 8018)
@@ -7,6 +7,7 @@
local bInGameConsoleClosed = false
local mainMenuLoaded = false
orxonox.GUIManager:subscribeEventHelper(menuSheetsRoot, "KeyDown", "keyPressed")
+orxonox.GUIManager:subscribeEventHelper(menuSheetsRoot, "Sized", "windowResized")
-----------------------
--- Local functions ---
@@ -254,6 +255,13 @@
sheet.sheet:keyPressed()
end
+function windowResized(e)
+ local sheet = activeMenuSheets[activeMenuSheets.size]
+ if sheet then
+ sheet.sheet:windowResized()
+ end
+end
+
function setBackgroundImage(imageSet, imageName)
guiMgr:setBackgroundImage(imageSet, imageName)
end
Modified: code/branches/usability/data/overlays/debug.oxo
===================================================================
--- code/branches/usability/data/overlays/debug.oxo 2011-03-04 10:33:18 UTC (rev 8017)
+++ code/branches/usability/data/overlays/debug.oxo 2011-03-05 16:31:27 UTC (rev 8018)
@@ -67,7 +67,7 @@
<PauseNotice
name = "pausenotice"
- position = "0.5, 0.3"
+ position = "0.5, 0.1"
font = "VeraMono"
textsize = 0.03
colour = "1.0, 1.0, 1.0, 1.0"
Modified: code/branches/usability/src/libraries/core/CMakeLists.txt
===================================================================
--- code/branches/usability/src/libraries/core/CMakeLists.txt 2011-03-04 10:33:18 UTC (rev 8017)
+++ code/branches/usability/src/libraries/core/CMakeLists.txt 2011-03-05 16:31:27 UTC (rev 8018)
@@ -79,6 +79,7 @@
ConfigFileManager.h
Game.h
GameMode.h
+ GraphicsManager.h
GUIManager.h
Loader.h
LuaState.h
Modified: code/branches/usability/src/libraries/core/GraphicsManager.cc
===================================================================
--- code/branches/usability/src/libraries/core/GraphicsManager.cc 2011-03-04 10:33:18 UTC (rev 8017)
+++ code/branches/usability/src/libraries/core/GraphicsManager.cc 2011-03-05 16:31:27 UTC (rev 8018)
@@ -479,15 +479,36 @@
return this->renderWindow_->isFullScreen();
}
+ unsigned int GraphicsManager::getWindowWidth() const
+ {
+ return this->renderWindow_->getWidth();
+ }
+
+ unsigned int GraphicsManager::getWindowHeight() const
+ {
+ return this->renderWindow_->getHeight();
+ }
+
bool GraphicsManager::hasVSyncEnabled() const
{
Ogre::ConfigOptionMap& options = ogreRoot_->getRenderSystem()->getConfigOptions();
- if (options.find("VSync") != options.end())
- return (options["VSync"].currentValue == "Yes");
+ Ogre::ConfigOptionMap::iterator it = options.find("VSync");
+ if (it != options.end())
+ return (it->second.currentValue == "Yes");
else
return false;
}
+ std::string GraphicsManager::getFSAAMode() const
+ {
+ Ogre::ConfigOptionMap& options = ogreRoot_->getRenderSystem()->getConfigOptions();
+ Ogre::ConfigOptionMap::iterator it = options.find("FSAA");
+ if (it != options.end())
+ return it->second.currentValue;
+ else
+ return "";
+ }
+
std::string GraphicsManager::setScreenResolution(unsigned int width, unsigned int height, bool fullscreen)
{
this->ogreRoot_->getRenderSystem()->setConfigOption("Video Mode", multi_cast<std::string>(width) + " x " + multi_cast<std::string>(height) + " @ " + multi_cast<std::string>(this->getRenderWindow()->getColourDepth()) + "-bit colour");
Modified: code/branches/usability/src/libraries/core/GraphicsManager.h
===================================================================
--- code/branches/usability/src/libraries/core/GraphicsManager.h 2011-03-04 10:33:18 UTC (rev 8017)
+++ code/branches/usability/src/libraries/core/GraphicsManager.h 2011-03-05 16:31:27 UTC (rev 8018)
@@ -53,14 +53,17 @@
#include "util/Singleton.h"
#include "OrxonoxClass.h"
+// tolua_begin
namespace orxonox
{
/**
@brief
Graphics engine manager class
*/
- class _CoreExport GraphicsManager : public Singleton<GraphicsManager>, public OrxonoxClass, public Ogre::LogListener
- {
+ class _CoreExport GraphicsManager
+// tolua_end
+ : public Singleton<GraphicsManager>, public OrxonoxClass, public Ogre::LogListener
+ { // tolua_export
friend class Singleton<GraphicsManager>;
public:
GraphicsManager(bool bLoadRenderer = true);
@@ -73,8 +76,17 @@
Ogre::Viewport* getViewport() { return this->viewport_; }
Ogre::RenderWindow* getRenderWindow() { return this->renderWindow_; }
size_t getRenderWindowHandle();
+
+// tolua_begin
+ static GraphicsManager& getInstance() { return Singleton<GraphicsManager>::getInstance(); } // tolua_export
+
bool isFullScreen() const;
+ unsigned int getWindowWidth() const;
+ unsigned int getWindowHeight() const;
+
bool hasVSyncEnabled() const;
+ std::string getFSAAMode() const;
+// tolua_end
void upgradeToGraphics();
void loadDebugOverlay();
@@ -126,7 +138,9 @@
int ogreLogLevelCritical_; //!< Corresponding Orxonox debug level for LL_CRITICAL
static GraphicsManager* singletonPtr_s; //!< Pointer to the Singleton
+// tolua_begin
};
}
+// tolua_end
#endif /* _GraphicsManager_H__ */
More information about the Orxonox-commit
mailing list