Index: trunk/VUT/OcclusionCullingSceneManager/TestCulling/TestCullingApplication.cpp
===================================================================
--- trunk/VUT/OcclusionCullingSceneManager/TestCulling/TestCullingApplication.cpp	(revision 28)
+++ trunk/VUT/OcclusionCullingSceneManager/TestCulling/TestCullingApplication.cpp	(revision 29)
@@ -6,6 +6,6 @@
 */
 
-#pragma warning (push)
-#pragma warning( disable : 4267 )
+//#pragma warning (push)
+//#pragma warning( disable : 4267 )
 
 #include <OgreNoMemoryMacros.h>
@@ -15,5 +15,5 @@
 #include <../CEGUIRenderer/include/OgreCEGUITexture.h>
 #include <OgreMemoryMacros.h>
-#pragma warning (pop)
+//#pragma warning (pop)
 /*
 #include <CEGUI/CEGUIImageset.h>
@@ -39,4 +39,10 @@
 #include "windows.h"
 
+/***********************************************/
+/* TestCullingApplication implementation       */
+/***********************************************/
+
+
+//-----------------------------------------------------------------------
 void TestCullingApplication::createScene(void)
 {
@@ -67,7 +73,55 @@
      mGUISystem->setGUISheet(sheet);*/
 }
-
-
-/* MouseMotionListener callbacks */
+//-----------------------------------------------------------------------
+void TestCullingApplication::createFrameListener(void)
+{
+	mFrameListener= new MouseQueryListener(mWindow, mCamera, mSceneMgr, mGUIRenderer, mShipNode);
+	mFrameListener->showDebugOverlay(true);
+	mRoot->addFrameListener(mFrameListener);
+}
+//-----------------------------------------------------------------------
+void TestCullingApplication::chooseSceneManager(void)
+{
+    mSceneMgr = mRoot->getSceneManager(ST_GENERIC);
+}
+
+/***********************************************/
+/* MouseQueryListener implementation           */
+/***********************************************/
+
+//-----------------------------------------------------------------------
+MouseQueryListener::MouseQueryListener(RenderWindow* win, Camera* cam, SceneManager *sceneManager, CEGUI::Renderer *renderer,
+					   SceneNode* shipNode)
+        : ExampleFrameListener(win, cam, false, true), mGUIRenderer(renderer), mShipNode(shipNode)//,  mShutdownRequested(false)
+{
+
+		// Setup default variables
+        mCurrentObject = NULL;
+        mLMouseDown = false;
+        mRMouseDown = false;
+        mSceneMgr = sceneManager;
+
+        // Reduce move speed
+        mMoveSpeed = 50;
+        mRotateSpeed *= 2;
+	
+		mCurrentAlgorithm = OcclusionCullingSceneManager::RENDER_COHERENT;
+
+		// Register this so that we get mouse events.
+        mEventProcessor->addMouseListener(this);
+        mEventProcessor->addMouseMotionListener(this);
+		mEventProcessor->addKeyListener(this);
+
+		// show overlay
+        Overlay* pOver = OverlayManager::getSingleton().getByName("Example/OcclusionDemoOverlay");    
+        mAlgorithmInfo = OverlayManager::getSingleton().getOverlayElement("Example/Occlusion/OcclusionTechniqueInfo");
+        //mMaterialInfo = OverlayManager::getSingleton().getOverlayElement("Example/Shadows/MaterialInfo");
+        //mInfo = OverlayManager::getSingleton().getOverlayElement("Example/Shadows/Info");
+
+		mAlgorithmInfo->setCaption(": " + mCurrentAlgorithmCaptions[mCurrentAlgorithm]);
+        //mMaterialInfo->setCaption(": " + mAtheneMaterials[mCurrentAtheneMaterial]);
+        pOver->show();
+} // MouseQueryListener
+//-----------------------------------------------------------------------
 void MouseQueryListener::mouseMoved (MouseEvent *e)
 {
@@ -75,6 +129,5 @@
     CEGUI::System::getSingleton().injectMouseMove(e->getRelX() * mGUIRenderer->getWidth(), e->getRelY() * mGUIRenderer->getHeight());
 }
-
-
+//-----------------------------------------------------------------------
 void MouseQueryListener::mousePressed(MouseEvent* e)
 {
@@ -93,5 +146,5 @@
 } // mousePressed
 
- 
+ //-----------------------------------------------------------------------
 void MouseQueryListener::mouseReleased(MouseEvent* e)
 {
@@ -109,7 +162,5 @@
     } // else if
 } // mouseReleased
-
-
- // This is when the mouse is clicked, held and dragged.
+//-----------------------------------------------------------------------
 void MouseQueryListener::mouseDragged (MouseEvent *e)
  {
@@ -127,5 +178,22 @@
     } // else if
 } // mouseDragged
-
+//-----------------------------------------------------------------------
+bool MouseQueryListener::frameEnded(const FrameEvent& evt)
+{
+    if (timeDelay >= 0) 
+        timeDelay -= evt.timeSinceLastFrame;
+
+    KEY_PRESSED(KC_O, 1, changeAlgorithm());
+      
+    return ExampleFrameListener::frameStarted(evt) && ExampleFrameListener::frameEnded(evt);        
+}
+//-----------------------------------------------------------------------
+void MouseQueryListener::changeAlgorithm()
+{
+    mCurrentAlgorithm = ++mCurrentAlgorithm % OcclusionCullingSceneManager::NUM_RENDERMODES;
+    mAlgorithmInfo->setCaption(": " + mCurrentAlgorithmCaptions[mCurrentAlgorithm]);
+
+	mSceneMgr->setOption("Algorithm", &mCurrentAlgorithm);
+}
 
 INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
