Index: trunk/VUT/OcclusionCullingSceneManager/include/OgreOcclusionCullingSceneManager.h
===================================================================
--- trunk/VUT/OcclusionCullingSceneManager/include/OgreOcclusionCullingSceneManager.h	(revision 28)
+++ trunk/VUT/OcclusionCullingSceneManager/include/OgreOcclusionCullingSceneManager.h	(revision 29)
@@ -53,4 +53,19 @@
 		void _updateSceneGraph(Camera* cam);
 
+		/** Sets the given option for the SceneManager
+			       @remarks
+			Options are:
+			"Algorithm", int *;			
+		*/
+		virtual bool setOption( const String &, const void * );
+		/** Gets the given option for the Scene Manager.
+	        @remarks
+		    See setOption
+		*/
+		virtual bool getOption( const String &, void * );
+
+		bool getOptionValues( const String & key, StringVector &refValueList );
+		bool getOptionKeys( StringVector &refKeys );
+
 	protected:
 		enum {MODE_QUERY, MODE_RENDER};
@@ -85,10 +100,5 @@
 		*/
 		SolidHalfBoundingBox *getSolidHalfBoundingBox(int half);
-		/** sets the type of the algorithm
-		@param algorithm type
-		*/
-		void setAlgorithmType(int type);
-	
-		int getAlgorithmType();
+		
 
 		// we use a priority queue rather than a renderstack
@@ -104,5 +114,5 @@
 		// two halfes of a aabb
 		SolidHalfBoundingBox *mHalfBoundingBox[2];	
-		int mAlgorithmType;
+		int mCurrentAlgorithm;
 	};
 
Index: trunk/VUT/OcclusionCullingSceneManager/scripts/OcclusionDemo.overlay
===================================================================
--- trunk/VUT/OcclusionCullingSceneManager/scripts/OcclusionDemo.overlay	(revision 29)
+++ trunk/VUT/OcclusionCullingSceneManager/scripts/OcclusionDemo.overlay	(revision 29)
@@ -0,0 +1,129 @@
+Example/OcclusionDemoOverlay
+{
+	zorder 500
+	// Stats block
+	container BorderPanel(Example/Occlusion/OcclusionPanel)
+	{
+		metrics_mode pixels
+		vert_align top
+		left 5 
+		top 5
+		width 450
+		height 55
+		material Core/StatsBlockCenter
+        	border_size 1 1 1 1
+        	border_material Core/StatsBlockBorder
+        	border_topleft_uv     0.0000 1.0000 0.0039 0.9961
+	    	border_top_uv         0.0039 1.0000 0.9961 0.9961
+	    	border_topright_uv    0.9961 1.0000 1.0000 0.9961
+	    	border_left_uv        0.0000 0.9961 0.0039 0.0039
+	    	border_right_uv       0.9961 0.9961 1.0000 0.0039
+	    	border_bottomleft_uv  0.0000 0.0039 0.0039 0.0000
+        	border_bottom_uv      0.0039 0.0039 0.9961 0.0000
+	    	border_bottomright_uv 0.9961 0.0039 1.0000 0.0000
+
+
+		element TextArea(Example/Occlusion/OcclusionTechnique)
+		{
+			metrics_mode pixels
+			left 5
+			top 5
+			width 180
+			height 30
+			font_name TrebuchetMSBold
+			char_height 16
+			caption [O] Algorithm
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+		element TextArea(Example/Occlusion/OcclusionTechniqueInfo)
+		{
+			metrics_mode pixels
+			left 155
+			top 5
+			width 90
+			height 30
+			font_name TrebuchetMSBold
+			char_height 16
+			caption :
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+		element TextArea(Example/Occlusion/Materials)
+		{
+			metrics_mode pixels
+			left 5
+			top 20
+			width 90
+			height 30
+			font_name TrebuchetMSBold
+			char_height 16
+			caption [M] Athene Material
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+		element TextArea(Example/Occlusion/MaterialInfo)
+		{
+			metrics_mode pixels
+			left 155
+			top 20
+			width 90
+			height 30
+			font_name TrebuchetMSBold
+			char_height 16
+			caption :
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+		element TextArea(Example/Occlusion/OcclusionInfo)
+		{
+			metrics_mode pixels
+			left 5
+			top 35
+			width 250
+			height 30
+			font_name TrebuchetMSBold
+			char_height 16
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+	}
+
+	container BorderPanel(Example/Occlusion/OcclusionStatsPanel)
+	{
+		metrics_mode pixels
+		vert_align top
+		horz_align right
+		left -455 
+		top 5
+		width 450
+		height 55
+		material Core/StatsBlockCenter
+        	border_size 1 1 1 1
+        	border_material Core/StatsBlockBorder
+        	border_topleft_uv     0.0000 1.0000 0.0039 0.9961
+	    	border_top_uv         0.0039 1.0000 0.9961 0.9961
+	    	border_topright_uv    0.9961 1.0000 1.0000 0.9961
+	    	border_left_uv        0.0000 0.9961 0.0039 0.0039
+	    	border_right_uv       0.9961 0.9961 1.0000 0.0039
+	    	border_bottomleft_uv  0.0000 0.0039 0.0039 0.0000
+        	border_bottom_uv      0.0039 0.0039 0.9961 0.0000
+	    	border_bottomright_uv 0.9961 0.0039 1.0000 0.0000
+
+
+		element TextArea(Example/Occlusion/CulledNodes)
+		{
+			metrics_mode pixels
+			left 5
+			top 5
+			width 180
+			height 30
+			font_name TrebuchetMSBold
+			char_height 16
+			caption Culled Nodes
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}	
+	}
+}
Index: trunk/VUT/OcclusionCullingSceneManager/src/OgreOcclusionCullingSceneManager.cpp
===================================================================
--- trunk/VUT/OcclusionCullingSceneManager/src/OgreOcclusionCullingSceneManager.cpp	(revision 28)
+++ trunk/VUT/OcclusionCullingSceneManager/src/OgreOcclusionCullingSceneManager.cpp	(revision 29)
@@ -15,5 +15,5 @@
 	OcclusionCullingSceneManager::OcclusionCullingSceneManager(): 
 	mFrameId(1), mDistanceQueue(NULL), mVisibilityThreshold(0), mCurrentTestIdx(0),
-	mQueryMode(MODE_RENDER), mNumSceneNodes(0), mAlgorithmType(RENDER_COHERENT)
+	mQueryMode(MODE_RENDER), mNumSceneNodes(0), mCurrentAlgorithm(RENDER_COHERENT)
 	{		
 		mHalfBoundingBox[0] = mHalfBoundingBox[1] = 0;
@@ -44,5 +44,5 @@
 		//renderZPass();
 
-		switch(mAlgorithmType)
+		switch(mCurrentAlgorithm)
 		{
 			case RENDER_CULL_FRUSTUM:
@@ -346,12 +346,37 @@
 	}
 	//-----------------------------------------------------------------------
-	void OcclusionCullingSceneManager::setAlgorithmType(int type)
-	{
-		mAlgorithmType = type;
-	}
-	//-----------------------------------------------------------------------
-	int OcclusionCullingSceneManager::getAlgorithmType()
-	{
-		return mAlgorithmType;
+	bool OcclusionCullingSceneManager::setOption( const String & key, const void * val )
+	{
+		if ( key == "Algorithm" )
+		{
+			mCurrentAlgorithm = * static_cast < const int * > ( val );
+			return true;
+		}
+	
+		return SceneManager::setOption( key, val );
+	}
+	//-----------------------------------------------------------------------
+	bool OcclusionCullingSceneManager::getOption( const String & key, void *val )
+	{
+		if ( key == "Algorithm" )
+		{
+			* static_cast < int * > ( val ) = mCurrentAlgorithm;
+			return true;
+		}
+
+		return SceneManager::getOption( key, val );
+	}
+	//-----------------------------------------------------------------------
+	bool OcclusionCullingSceneManager::getOptionValues( const String & key, StringVector  &refValueList )
+	{
+		return SceneManager::getOptionValues( key, refValueList );
+	}
+	//-----------------------------------------------------------------------
+	bool OcclusionCullingSceneManager::getOptionKeys( StringVector & refKeys )
+	{
+		SceneManager::getOptionKeys( refKeys );
+		refKeys.push_back( "Algorithm" );
+	
+		return true;
 	}
 }	
Index: trunk/VUT/OcclusionCullingSceneManager/TestCulling/TestCulling.vcproj
===================================================================
--- trunk/VUT/OcclusionCullingSceneManager/TestCulling/TestCulling.vcproj	(revision 23)
+++ trunk/VUT/OcclusionCullingSceneManager/TestCulling/TestCulling.vcproj	(revision 29)
@@ -41,4 +41,5 @@
 				ProgramDatabaseFile="$(OutDir)/TestCulling.pdb"
 				SubSystem="2"
+				ImportLibrary=""
 				TargetMachine="1"/>
 			<Tool
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 )
Index: trunk/VUT/OcclusionCullingSceneManager/TestCulling/TestCullingApplication.h
===================================================================
--- trunk/VUT/OcclusionCullingSceneManager/TestCulling/TestCullingApplication.h	(revision 28)
+++ trunk/VUT/OcclusionCullingSceneManager/TestCulling/TestCullingApplication.h	(revision 29)
@@ -17,5 +17,5 @@
 }
 
-String mAlgorithmTypeCaptions[OcclusionCullingSceneManager::NUM_RENDERMODES] = 
+String mCurrentAlgorithmCaptions[OcclusionCullingSceneManager::NUM_RENDERMODES] = 
 {
     "Cull Frustum", 
@@ -29,35 +29,6 @@
 
     MouseQueryListener(RenderWindow* win, Camera* cam, SceneManager *sceneManager, CEGUI::Renderer *renderer,
-					   SceneNode* shipNode)
-        : ExampleFrameListener(win, cam, false, true), mGUIRenderer(renderer), mShipNode(shipNode)//,  mShutdownRequested(false)
-    {
+					   SceneNode* shipNode);
 
-		// Setup default variables
-        mCurrentObject = NULL;
-        mLMouseDown = false;
-        mRMouseDown = false;
-        mSceneMgr = sceneManager;
-
-        // Reduce move speed
-        mMoveSpeed = 50;
-        mRotateSpeed *= 2;
-	
-		mAlgorithmType = 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/ShadowsOverlay");    
-        mAlgorithmInfo = OverlayManager::getSingleton().getOverlayElement("Example/Shadows/ShadowTechniqueInfo");
-        //mMaterialInfo = OverlayManager::getSingleton().getOverlayElement("Example/Shadows/MaterialInfo");
-        //mInfo = OverlayManager::getSingleton().getOverlayElement("Example/Shadows/Info");
-
-		mAlgorithmInfo->setCaption("Algorithm: " + mAlgorithmTypeCaptions[mAlgorithmType]);
-        //mMaterialInfo->setCaption("Current: " + mAtheneMaterials[mCurrentAtheneMaterial]);
-        pOver->show();
-    } // MouseQueryListener
 
     ~MouseQueryListener( )
@@ -65,14 +36,5 @@
     }
 
-   bool frameEnded(const FrameEvent& evt)
-    {
-        if (timeDelay >= 0) 
-            timeDelay -= evt.timeSinceLastFrame;
-
-        KEY_PRESSED(KC_O, 1, changeAlgorithm());
-      
-        return ExampleFrameListener::frameStarted(evt) && ExampleFrameListener::frameEnded(evt);        
-    }
-
+	bool frameEnded(const FrameEvent& evt);
     /* MouseListener callbacks. */
     virtual void mouseClicked(MouseEvent* e) { }
@@ -125,9 +87,5 @@
     }
 */
-	 void changeAlgorithm()
-    {
-        mAlgorithmType = ++mAlgorithmType % OcclusionCullingSceneManager::NUM_RENDERMODES;
-        mAlgorithmInfo->setCaption("Algorithm: " + mAlgorithmTypeCaptions[mAlgorithmType]);
-    }
+	void changeAlgorithm();
 
 
@@ -139,5 +97,5 @@
 	SceneNode* mShipNode;
 //	bool mShutdownRequested;
-	int mAlgorithmType;
+	int mCurrentAlgorithm;
 	OverlayElement *mAlgorithmInfo;
 };
@@ -154,11 +112,5 @@
 protected:
 	void createScene(void);
-
-	void createFrameListener(void)
-    {
-		mFrameListener= new MouseQueryListener(mWindow, mCamera, mSceneMgr, mGUIRenderer, mShipNode);
-		mFrameListener->showDebugOverlay(true);
-		mRoot->addFrameListener(mFrameListener);
-    }
+	void createFrameListener(void);
 
 	CEGUI::OgreCEGUIRenderer *mGUIRenderer;
@@ -166,4 +118,6 @@
 
 private:
+	void chooseSceneManager(void);
+
 	Entity* mShip;
 	SceneNode* mShipNode;
@@ -189,8 +143,6 @@
     }*/
     // Override scene manager (use indoor instead of generic)
-    void chooseSceneManager(void)
-    {
-        mSceneMgr = mRoot->getSceneManager(ST_GENERIC);
-    }
+    
+
 	
 };
