[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    playground/games/astrododge/src
From:       Rivo Laks <rivolaks () hot ! ee>
Date:       2009-07-08 21:42:26
Message-ID: 1247089346.979893.23250.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 993563 by rivol:

Readd HDR rendering mode.
There are now menu actions to toggle and configure HDR rendering. It's not working \
very well yet, but you  have to start somewhere...

 M  +1 -0      CMakeLists.txt  
 A             astrododgeui.rc  
 M  +10 -0     displaywidget.cpp  
 M  +3 -0      displaywidget.h  
 M  +12 -0     mainwindow.cpp  


--- trunk/playground/games/astrododge/src/CMakeLists.txt #993562:993563
@@ -21,3 +21,4 @@
 target_link_libraries(astrododge ${KDE4_KDEUI_LIBS} ${KGLLIB_LIBRARY} \
${KGLLIB_EXTRAS_LIBRARY} ${ODE_LIBRARIES} ${KDEGAMES_LIBRARY})  install(TARGETS \
astrododge ${INSTALL_TARGETS_DEFAULT_ARGS}})  install(FILES astrododge.desktop \
DESTINATION ${XDG_APPS_INSTALL_DIR}) +install(FILES astrododgeui.rc DESTINATION \
                ${DATA_INSTALL_DIR}/astrododge)
--- trunk/playground/games/astrododge/src/displaywidget.cpp #993562:993563
@@ -22,6 +22,7 @@
 #include <kgllib/camera.h>
 #include <kgllib/widgetproxy.h>
 #include <kgllib/textrenderer.h>
+#include <kgllib/hdrglwidgetcontrol.h>
 
 #include <KDebug>
 #include <KStandardDirs>
@@ -172,3 +173,12 @@
     mActiveWidget = proxy()->addWidget(mMainMenu);
 }
 
+
+void DisplayWidget::showHdrConfig()
+{
+    QWidget* hdrControlWin = mProxy->createWindow("HDR Controls");
+    hdrControlWin->layout()->addWidget(new HdrGLWidgetControl(this, hdrControlWin));
+    hdrControlWin->move(10, 300);
+    mProxy->addWidget(hdrControlWin);
+}
+
--- trunk/playground/games/astrododge/src/displaywidget.h #993562:993563
@@ -49,6 +49,9 @@
         void showMainMenu();
         void hideMenus();
 
+    public slots:
+        void showHdrConfig();
+
     signals:
         void startNewGame();
 
--- trunk/playground/games/astrododge/src/mainwindow.cpp #993562:993563
@@ -37,6 +37,7 @@
 #include <KAction>
 #include <KActionCollection>
 #include <KStandardGameAction>
+#include <KToggleAction>
 
 
 MainWindow::MainWindow() : KXmlGuiWindow()
@@ -99,6 +100,17 @@
     KStandardGameAction::gameNew(this, SLOT(startNewGame()), actionCollection());
     KStandardGameAction::pause(this, SLOT(setGamePaused(bool)), actionCollection());
     KStandardGameAction::quit(this, SLOT(close()), actionCollection());
+
+    // Graphics actions
+    KToggleAction* enableHDRAction = new KToggleAction("Use HDR rendering", this);
+    enableHDRAction->setChecked(false);
+    enableHDRAction->setShortcut(Qt::CTRL + Qt::Key_H);
+    actionCollection()->addAction("hdr_enable", enableHDRAction);
+    connect(enableHDRAction, SIGNAL(triggered(bool)), mDisplay, \
SLOT(setHdrRenderingActive(bool))); +
+    KAction* showHDRConfigAction = new KAction("Show HDR config", this);
+    actionCollection()->addAction("hdr_config", showHDRConfigAction);
+    connect(showHDRConfigAction, SIGNAL(triggered(bool)), mDisplay, \
SLOT(showHdrConfig()));  }
 
 void MainWindow::startNewGame()


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic