Index: GTP/trunk/App/Demos/Illum/MultipleReflections/MultipleReflections.cpp
===================================================================
--- GTP/trunk/App/Demos/Illum/MultipleReflections/MultipleReflections.cpp	(revision 2242)
+++ GTP/trunk/App/Demos/Illum/MultipleReflections/MultipleReflections.cpp	(revision 2244)
@@ -20,4 +20,5 @@
 ID3DXFont*					g_pFont;					///< Font for drawing text
 ID3DXSprite*				g_pTextSprite;				///< Sprite for batching draw text calls
+bool g_showWelcomeScreen = true;
 	//slider ids
 #define FIRST_SLIDER 10
@@ -125,5 +126,36 @@
 }
 
-
+void compileShaders()
+{
+	HRESULT hr;
+	//load effect files
+	DWORD dwShaderFlags = 0;
+	ID3DXBuffer* errBuff;	// buffer for error message
+	if (FAILED(hr = D3DXCreateEffectFromFile( g_pd3dDevice, L"Media\\Shaders\\basicShaders.fx", NULL, NULL, dwShaderFlags, 
+                                        NULL, &g_basicShaders, &errBuff )))	// if compilation error occurs
+	{
+		int BufSize = errBuff->GetBufferSize();
+
+		wchar_t* wbuf = new wchar_t[BufSize];
+		mbstowcs( wbuf, (const char*)errBuff->GetBufferPointer(), BufSize );
+		MessageBox(NULL, wbuf, L".fx Compilation Error", MB_ICONERROR);		// error message
+
+		delete wbuf;
+		exit(-1);
+	}
+	dwShaderFlags += D3DXSHADER_PREFER_FLOW_CONTROL;
+	if (FAILED(hr = D3DXCreateEffectFromFile( g_pd3dDevice, L"Media\\Shaders\\MultipleReflection.fx", NULL, NULL, dwShaderFlags, 
+                                        NULL, &g_reflectionShaders, &errBuff )))	// if compilation error occurs
+	{
+		int BufSize = errBuff->GetBufferSize();
+
+		wchar_t* wbuf = new wchar_t[BufSize];
+		mbstowcs( wbuf, (const char*)errBuff->GetBufferPointer(), BufSize );
+		MessageBox(NULL, wbuf, L".fx Compilation Error", MB_ICONERROR);		// error message
+
+		delete wbuf;
+		exit(-1);
+	}
+}
 //--------------------------------------------------------------------------------------
 // Create any D3DPOOL_MANAGED resources here 
@@ -142,34 +174,4 @@
 	g_objectMesh->SetContainerSize(environmentSize);
     
-	//load effect files
-	DWORD dwShaderFlags = 0;
-	ID3DXBuffer* errBuff;	// buffer for error message
-	if (FAILED(hr = D3DXCreateEffectFromFile( g_pd3dDevice, L"Media\\Shaders\\basicShaders.fx", NULL, NULL, dwShaderFlags, 
-                                        NULL, &g_basicShaders, &errBuff )))	// if compilation error occurs
-	{
-		int BufSize = errBuff->GetBufferSize();
-
-		wchar_t* wbuf = new wchar_t[BufSize];
-		mbstowcs( wbuf, (const char*)errBuff->GetBufferPointer(), BufSize );
-		MessageBox(NULL, wbuf, L".fx Compilation Error", MB_ICONERROR);		// error message
-
-		delete wbuf;
-		exit(-1);
-	}
-	dwShaderFlags += D3DXSHADER_PREFER_FLOW_CONTROL;
-	if (FAILED(hr = D3DXCreateEffectFromFile( g_pd3dDevice, L"Media\\Shaders\\MultipleReflection.fx", NULL, NULL, dwShaderFlags, 
-                                        NULL, &g_reflectionShaders, &errBuff )))	// if compilation error occurs
-	{
-		int BufSize = errBuff->GetBufferSize();
-
-		wchar_t* wbuf = new wchar_t[BufSize];
-		mbstowcs( wbuf, (const char*)errBuff->GetBufferPointer(), BufSize );
-		MessageBox(NULL, wbuf, L".fx Compilation Error", MB_ICONERROR);		// error message
-
-		delete wbuf;
-		exit(-1);
-	}
-	
-
 	 // Initialize the font
     V_RETURN( D3DXCreateFont( g_pd3dDevice, 15, 0, FW_BOLD, 1, FALSE, DEFAULT_CHARSET, 
@@ -438,4 +440,16 @@
 }
 
+void renderWelcomeText()
+{
+	const D3DSURFACE_DESC* backBufferDesc = DXUTGetBackBufferSurfaceDesc();
+
+    CDXUTTextHelper txtHelper( g_pFont, g_pTextSprite, 20 );
+    txtHelper.Begin();
+
+	txtHelper.SetInsertionPos( backBufferDesc->Width / 2 - 100, backBufferDesc->Height /2 );
+	txtHelper.SetForegroundColor( D3DXCOLOR( 1.0f, 1.0f, 0.0f, 1.0f ) );
+
+	txtHelper.DrawFormattedTextLine( L"Compiling shaders. Please wait..." );
+}
 //--------------------------------------------------------------------------------------
 // Render the scene 
@@ -451,11 +465,21 @@
     if( SUCCEEDED( pd3dDevice->BeginScene() ) )
     {
-		renderEnvMaps();
-		renderToScreen();
-		renderText();
-		if(g_showGUI)
-			g_HUD.OnRender( fElapsedTime );
+		if(g_showWelcomeScreen)
+		{
+			renderWelcomeText();
+			g_showWelcomeScreen = false;
+		}
+		else
+		{
+			if(g_basicShaders == 0)
+				compileShaders();
+			renderEnvMaps();
+			renderToScreen();
+			renderText();
+			if(g_showGUI)
+				g_HUD.OnRender( fElapsedTime );
+		}
         V( pd3dDevice->EndScene() );
-    }
+    }	
 }
 
