Index: GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.cpp
===================================================================
--- GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.cpp	(revision 2121)
+++ GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.cpp	(revision 2145)
@@ -162,5 +162,6 @@
 mViewCellsLoaded(false),
 mUseVisibilityFilter(false),
-mFloorDist(2)
+mFloorDist(2),
+mFlushQueue(false)
 {
 	//mInputDevice = PlatformManager::getSingleton().createInputReader();
@@ -261,6 +262,19 @@
 	setTestGeometryForVisibleLeaves(mTestGeometryForVisibleLeaves);
 
-	mSceneMgr->setOption("UseDepthPass", &mUseDepthPass);
-	
+	//mSceneMgr->setOption("UseDepthPass", &mUseDepthPass);
+	mSceneMgr->getOption("UseDepthPass", &mUseDepthPass);
+
+	if (mUseDepthPass)
+		mUseDepthPassInfo->setCaption(": true");
+	else
+		mUseDepthPassInfo->setCaption(": false");
+	
+	mSceneMgr->getOption("FlushQueue", &mFlushQueue);
+	
+	if (mFlushQueue)
+		LogManager::getSingleton().logMessage("initial setting: flushing queue");
+	else
+		LogManager::getSingleton().logMessage("initial setting: not flushing queue");
+
 	mSceneMgr->setOption("ShowOctree", &mShowOctree);
 	mSceneMgr->setOption("ShowViewCells", &mShowViewCells);
@@ -1289,4 +1303,23 @@
 }
 //-----------------------------------------------------------------------
+void TerrainFrameListener::toggleFlushQueue()
+{
+	mFlushQueue = !mFlushQueue;
+
+	mSceneMgr->setOption("FlushQueue", &mFlushQueue);
+	
+	if (mFlushQueue)
+	{
+		LogManager::getSingleton().logMessage("flushing queue");
+		//mFlushQueueInfo->setCaption(": true");
+	}
+	else
+	{
+		LogManager::getSingleton().logMessage("not flushing queue");
+		//mFlushQueueInfo->setCaption(": false");
+	}
+}
+
+//-----------------------------------------------------------------------
 void TerrainFrameListener::toggleShowViz()
 {
@@ -1363,4 +1396,12 @@
 	switch(e->getKey())
 	{
+	
+	case KC_SUBTRACT:
+		changeThreshold(-10);
+		break;
+	case KC_ADD:
+		changeThreshold(10);
+		break;
+
 	case KC_ESCAPE:
 		mShutdownRequested = true;
@@ -1371,38 +1412,12 @@
 		nextAlgorithm();
 		break;
-	
-    case KC_F:
-		nextFilter();
-		break;
-	case KC_R:
-		nextSceneDetailLevel();
-		break;
-	case KC_P:
-		toggleDisplayCameraDetails();
-		break;
-	case KC_G:
-		mTestGeometryForVisibleLeaves = !mTestGeometryForVisibleLeaves;
-		setTestGeometryForVisibleLeaves(mTestGeometryForVisibleLeaves);
-		break;
-	case KC_T:
-		toggleShowOctree();
-		break;
-	case KC_X:
-		toggleUseDepthPass();
-		break;
-	case KC_H:
-		toggleShowShadows();
-		break;
-
-	case KC_I:
-		mUseItemBuffer = !mUseItemBuffer;
-		break;
-	case KC_Z:
-		mCamNode->resetOrientation();
-		break;
-	case KC_U:
-		mCamNode->resetOrientation();
-		mCamNode->setPosition(mApplication->mInitialPosition);
-		break;
+
+	case KC_LSHIFT:
+		mShiftPressed = true;
+		break;
+	case KC_DELETE:
+		mDeleteObjects = true;
+		break;
+
 	case KC_C:
 		if (mItemBufferMode != GtpVisibility::QueryManager::GEOMETRY_VISIBILITY)
@@ -1415,14 +1430,60 @@
 		}
 		break;
-
-	case KC_SUBTRACT:
-		changeThreshold(-10);
-		break;
-	case KC_ADD:
-		changeThreshold(10);
-		break;
+	 case KC_E: // hack for recording demo using precomputed fps
+		mSavePrecomputedFps = !mSavePrecomputedFps;
+		break;
+
+    case KC_F:
+		nextFilter();
+		break;
+	case KC_G:
+		mTestGeometryForVisibleLeaves = !mTestGeometryForVisibleLeaves;
+		setTestGeometryForVisibleLeaves(mTestGeometryForVisibleLeaves);
+		break;
+	case KC_H:
+		toggleShowShadows();
+		break;
+	case KC_L:
+		toggleShowViewCells();
+		break;
+	case KC_M: // hack for recording demo using precomputed fps
+		mRecordDemo = !mRecordDemo;
+		break;
+   	case KC_O:
+		switchMouseMode();
+		break;
+	case KC_P:
+		toggleDisplayCameraDetails();
+		break;
+	case KC_V:
+		toggleUseViewCells();
+		break;
+	case KC_Q:
+		toggleUseVisibilityFilter();
+		break;
+	case KC_R:
+		nextSceneDetailLevel();
+		break;
+	case KC_T:
+		toggleShowOctree();
+		break;
+	case KC_U:
+		mCamNode->resetOrientation();
+		mCamNode->setPosition(mApplication->mInitialPosition);
+		break;
+	case KC_X:
+		toggleUseDepthPass();
+		break;
+	case KC_I:
+		toggleFlushQueue();
+		break;
+	case KC_Z:
+		mCamNode->resetOrientation();
+		break;
+
 
 	///////////////
 	//-- visualization
+
 	case KC_1:
 		toggleShowViz();
@@ -1431,5 +1492,20 @@
 		nextNodeVizMode();
 		break;
-
+	case KC_7:
+		mTerrainContentGenerator->WriteObjects(objects_out_filename);
+		break;
+	case KC_8:
+		changeAssumedVisibility(-5);
+		// changeAssumedVisibility(-500);
+		break;
+	case KC_9:
+		changeAssumedVisibility(5);
+		// changeAssumedVisibility(500);
+		break;
+
+//#if USE_PERFHUD
+	case KC_F1:
+		toggleShowHelp();
+		break;
 	case KC_F2:
 		mStatsOn = !mStatsOn;
@@ -1441,8 +1517,4 @@
 	case KC_F4:
 		toggleRecord();
-		break;
-//#if USE_PERFHUD
-	case KC_F1:
-		toggleShowHelp();
 		break;
 
@@ -1477,39 +1549,6 @@
 		takeScreenshot();
 		break;
-	case KC_7:
-		mTerrainContentGenerator->WriteObjects(objects_out_filename);
-		break;
-	case KC_8:
-		changeAssumedVisibility(-5);
-		// changeAssumedVisibility(-500);
-		break;
-	case KC_9:
-		changeAssumedVisibility(5);
-		// changeAssumedVisibility(500);
-		break;
-	case KC_LSHIFT:
-		mShiftPressed = true;
-		break;
-	case KC_DELETE:
-		mDeleteObjects = true;
-		break;
-	case KC_M: // hack for recording demo using precomputed fps
-		mRecordDemo = !mRecordDemo;
-		break;
-    case KC_E: // hack for recording demo using precomputed fps
-		mSavePrecomputedFps = !mSavePrecomputedFps;
-		break;
-	case KC_O:
-		switchMouseMode();
-		break;
-	case KC_V:
-		toggleUseViewCells();
-		break;
-	case KC_L:
-		toggleShowViewCells();
-		break;
-	case KC_Q:
-		toggleUseVisibilityFilter();
-		break;
+	
+	
 	//KEY_PRESSED(KC_F3, 0.3, writeFrames());
 	//KEY_PRESSED(KC_F4, 0.3, loadFrames());
Index: GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.h
===================================================================
--- GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.h	(revision 2108)
+++ GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TerrainFrameListener.h	(revision 2145)
@@ -225,7 +225,11 @@
 	*/
 	void toggleUseDepthPass();
+
+	void toggleFlushQueue();
+
 	/** Toggles whether the visualization is shown.
 	*/
 	void toggleShowViz();
+
 	/** Toggles whether the frames are recorded.
 	*/
@@ -360,4 +364,5 @@
 	bool mShowViewCells;
 	bool mUseDepthPass;
+	bool mFlushQueue;
 	bool mShowVisualization;
 	bool mCullCamera;
