//--------------------------------------------------------------------------------------
// Create any D3D10 resources that depend on the back buffer
//--------------------------------------------------------------------------------------
HRESULT CALLBACK OnD3D10ResizedSwapChain(ID3D10Device* pd3dDevice,
		IDXGISwapChain* pSwapChain,
		const DXGI_SURFACE_DESC* pBackBufferSurfaceDesc, void* pUserContext)
{
	HRESULT hr;
	V_RETURN(g_DialogResourceManager.OnD3D10ResizedSwapChain(pd3dDevice,
			 pBackBufferSurfaceDesc));
	V_RETURN(g_D3DSettingsDlg.OnD3D10ResizedSwapChain(pd3dDevice,
			 pBackBufferSurfaceDesc));
	// Setup the camera's projection parameters
	float fAspectRatio =
		1.0;//pBackBufferSurfaceDesc->Width / (FLOAT)pBackBufferSurfaceDesc->Height;
	g_Camera.SetProjParams(D3DX_PI / 4, fAspectRatio, 0.1f, 10.0f);
	g_Camera.SetWindow(pBackBufferSurfaceDesc->Width,
					   pBackBufferSurfaceDesc->Height);
	g_Camera.SetButtonMasks(MOUSE_RIGHT_BUTTON, MOUSE_WHEEL, MOUSE_MIDDLE_BUTTON);
	g_HUD.SetLocation(pBackBufferSurfaceDesc->Width - 170, 0);
	g_HUD.SetSize(170, 170);
	g_SampleUI.SetLocation(pBackBufferSurfaceDesc->Width - 170,
						   pBackBufferSurfaceDesc->Height - 300);
	g_SampleUI.SetSize(170, 300);
	// resize the texture so that it fits to the current screen size
	UINT width = (DXUTIsAppRenderingWithD3D9()) ?
				 DXUTGetD3D9BackBufferSurfaceDesc()->Width :
				 DXUTGetDXGIBackBufferSurfaceDesc()->Width;
	UINT height = (DXUTIsAppRenderingWithD3D9()) ?
				  DXUTGetD3D9BackBufferSurfaceDesc()->Height :
				  DXUTGetDXGIBackBufferSurfaceDesc()->Height;
	g_vsObj->SetupTextures(pd3dDevice, g_pEffect10, width, height);
	return S_OK;
}
Esempio n. 2
0
//--------------------------------------------------------------------------------------
// Handles the GUI events
//--------------------------------------------------------------------------------------
void CALLBACK OnGUIEvent( UINT nEvent, int nControlID, CDXUTControl* pControl, void* pUserContext )
{

    switch( nControlID )
    {
        case IDC_TOGGLEFULLSCREEN:
            DXUTToggleFullScreen(); break;
        case IDC_TOGGLEREF:
            DXUTToggleREF(); break;
        case IDC_CHANGEDEVICE:
            g_SettingsDlg.SetActive( !g_SettingsDlg.IsActive() ); break;

        case IDC_ENABLE_PRESHADER:
        {
            g_bEnablePreshader = g_SampleUI.GetCheckBox( IDC_ENABLE_PRESHADER )->GetChecked();

            if( DXUTGetD3D9Device() != NULL )
            {
                OnLostDevice( NULL );
                OnDestroyDevice( NULL );
                OnCreateDevice( DXUTGetD3D9Device(), DXUTGetD3D9BackBufferSurfaceDesc(), NULL );
                OnResetDevice( DXUTGetD3D9Device(), DXUTGetD3D9BackBufferSurfaceDesc(), NULL );
            }
            break;
        }

        case IDC_ACTIVE_LIGHT:
            if( !g_LightControl[g_nActiveLight].IsBeingDragged() )
            {
                g_nActiveLight++;
                g_nActiveLight %= g_nNumActiveLights;
            }
            break;

        case IDC_NUM_LIGHTS:
            if( !g_LightControl[g_nActiveLight].IsBeingDragged() )
            {
                WCHAR sz[100];
                swprintf_s( sz, 100, L"# Lights: %d", g_SampleUI.GetSlider( IDC_NUM_LIGHTS )->GetValue() );
                g_SampleUI.GetStatic( IDC_NUM_LIGHTS_STATIC )->SetText( sz );

                g_nNumActiveLights = g_SampleUI.GetSlider( IDC_NUM_LIGHTS )->GetValue();
                g_nActiveLight %= g_nNumActiveLights;
            }
            break;

        case IDC_LIGHT_SCALE:
            g_fLightScale = ( float )( g_SampleUI.GetSlider( IDC_LIGHT_SCALE )->GetValue() * 0.10f );

            WCHAR sz[100];
            swprintf_s( sz, 100, L"Light scale: %0.2f", g_fLightScale );
            g_SampleUI.GetStatic( IDC_LIGHT_SCALE_STATIC )->SetText( sz );
            break;
    }

}
//--------------------------------------------------------------------------------------
// Create any D3D10 resources that aren't dependant on the back buffer
//--------------------------------------------------------------------------------------
HRESULT CALLBACK OnD3D10CreateDevice(ID3D10Device* pd3dDevice,
									 const DXGI_SURFACE_DESC* pBackBufferSurfaceDesc, void* pUserContext)
{
	HRESULT hr;
	g_device = pd3dDevice;
	V_RETURN(g_DialogResourceManager.OnD3D10CreateDevice(pd3dDevice));
	V_RETURN(g_D3DSettingsDlg.OnD3D10CreateDevice(pd3dDevice));
	V_RETURN(D3DX10CreateFont(pd3dDevice, 15, 0, FW_BOLD, 1, FALSE, DEFAULT_CHARSET,
							  OUT_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE,
							  L"Arial", &g_pFont10));
	V_RETURN(D3DX10CreateSprite(pd3dDevice, 512, &g_pSprite10));
	g_pTxtHelper = new CDXUTTextHelper(NULL, NULL, g_pFont10, g_pSprite10, 15);
	V_RETURN(CDXUTDirectionWidget::StaticOnD3D10CreateDevice(pd3dDevice));
	// Read the D3DX effect file
	WCHAR str[MAX_PATH];
	ID3D10Blob* pErrBlob = NULL;
	V_RETURN(DXUTFindDXSDKMediaFileCch(str, MAX_PATH, L"Effect_Undistort.fx"));
	hr = D3DX10CreateEffectFromFile(str, NULL, NULL, "fx_4_0",
									D3D10_SHADER_ENABLE_STRICTNESS, 0,
									pd3dDevice, NULL, NULL, &g_pEffect10, &pErrBlob, NULL);

	if (FAILED(hr))
	{
		std::string errStr((LPCSTR)pErrBlob->GetBufferPointer(),
						   pErrBlob->GetBufferSize());
		WCHAR err[256];
		MultiByteToWideChar(CP_ACP, 0, errStr.c_str(), (int)errStr.size(), err,
							errStr.size());
		MessageBox(NULL, (LPCWSTR)err, L"Error", MB_OK);
		return hr;
	}

	// Setup the vector image and the display
	UINT width = (DXUTIsAppRenderingWithD3D9()) ?
				 DXUTGetD3D9BackBufferSurfaceDesc()->Width :
				 DXUTGetDXGIBackBufferSurfaceDesc()->Width;
	UINT height = (DXUTIsAppRenderingWithD3D9()) ?
				  DXUTGetD3D9BackBufferSurfaceDesc()->Height :
				  DXUTGetDXGIBackBufferSurfaceDesc()->Height;
	g_vsObj = new VSObject(pd3dDevice);
	D3D10_RASTERIZER_DESC rasterizerState;
	rasterizerState.FillMode = D3D10_FILL_SOLID;
	rasterizerState.CullMode = D3D10_CULL_NONE;
	rasterizerState.FrontCounterClockwise = true;
	rasterizerState.DepthBias = false;
	rasterizerState.DepthBiasClamp = 0;
	rasterizerState.SlopeScaledDepthBias = 0;
	rasterizerState.DepthClipEnable = true;
	rasterizerState.ScissorEnable = false;
	rasterizerState.MultisampleEnable = false;
	rasterizerState.AntialiasedLineEnable = false;
	pd3dDevice->CreateRasterizerState(&rasterizerState, &g_pRasterState);
	return S_OK;
}
Esempio n. 4
0
bool TerrainPager::createPatches(int nbVerticesPerPatch)
{
	assert(NULL != pDevice);

	IDirect3DTexture9 *texture = NULL;
	const D3DSURFACE_DESC * pBBDesc = DXUTGetD3D9BackBufferSurfaceDesc();

	// create patches and assign them to their files
	pPatches = new Patch*[nbAllocatedPatches];
	int baseVertexIndex = 0;

	HRESULT hr;

	for (unsigned int i = 0; i < nbAllocatedPatches; ++i)
	{
		if (utilizeTextures)
			V(pDevice->CreateTexture(PATCH_TEXTURE_WIDTH, PATCH_TEXTURE_HEIGHT, 1, D3DUSAGE_DYNAMIC, pBBDesc->Format, D3DPOOL_DEFAULT, &texture, NULL));

		pPatches[i] = new Patch(*this, i, baseVertexIndex, texture);
		if (utilizeTextures)
		{
			V(pDevice->CreateTexture(PATCH_TEXTURE_WIDTH, PATCH_TEXTURE_HEIGHT, 1, D3DUSAGE_DYNAMIC, pBBDesc->Format, D3DPOOL_SYSTEMMEM, &texture, NULL));
			pPatches[i]->textureSysMem = texture;
		}

		pPatches[i]->imageBuffer = new char[maxImageSize];
		pPatches[i]->vertexBufferSysMem = new char[nbVerticesPerPatch * sizeof(TerrainVertex)];
		pPatches[i]->patchHeights = new float[nbVerticesPerPatch];

		baseVertexIndex += nbVerticesPerPatch;
	}

	return true;
}
Esempio n. 5
0
//--------------------------------------------------------------------------------------
// Render the help and statistics text. This function uses the ID3DXFont interface for 
// efficient text rendering.
//--------------------------------------------------------------------------------------
void RenderText()
{
    CDXUTTextHelper txtHelper( g_pFont, g_pTextSprite, 15 );

    // Output statistics
    txtHelper.Begin();
    txtHelper.SetInsertionPos( 5, 5 );
    txtHelper.SetForegroundColor( D3DXCOLOR( 1.0f, 1.0f, 0.0f, 1.0f ) );
    txtHelper.DrawTextLine( DXUTGetFrameStats( DXUTIsVsyncEnabled() ) );
    txtHelper.DrawTextLine( DXUTGetDeviceStats() );

    txtHelper.SetForegroundColor( D3DXCOLOR( 1.0f, 1.0f, 1.0f, 1.0f ) );

    // Draw help
    const D3DSURFACE_DESC* pd3dsdBackBuffer = DXUTGetD3D9BackBufferSurfaceDesc();
    txtHelper.SetInsertionPos( 10, pd3dsdBackBuffer->Height - 15 * 6 );
    txtHelper.SetForegroundColor( D3DXCOLOR( 1.0f, 0.75f, 0.0f, 1.0f ) );
    txtHelper.DrawTextLine( L"Controls:" );
    txtHelper.SetInsertionPos( 40, pd3dsdBackBuffer->Height - 15 * 5 );
    txtHelper.DrawTextLine( L"Rotate model: Left mouse button\n"
                            L"Rotate camera: Right mouse button\n"
                            L"Zoom camera: Mouse wheel scroll\n"
                            L"Quit: ESC" );
    txtHelper.End();
}
Esempio n. 6
0
// Render the help and statistics text
void RenderText()
{
    UINT nBackBufferHeight = ( DXUTIsAppRenderingWithD3D9() ) ? DXUTGetD3D9BackBufferSurfaceDesc()->Height :
            DXUTGetDXGIBackBufferSurfaceDesc()->Height;

    gTxtHelper->Begin();
    gTxtHelper->SetInsertionPos( 2, 0 );
    gTxtHelper->SetForegroundColor( D3DXCOLOR( 1.0f, 1.0f, 0.0f, 1.0f ) );
    gTxtHelper->DrawTextLine( DXUTGetFrameStats( false ) );
    gTxtHelper->DrawTextLine( DXUTGetDeviceStats() );

    // Draw help
    if( gShowHelp )
    {
        gTxtHelper->SetInsertionPos( 2, nBackBufferHeight - 20 * 6 );
        gTxtHelper->SetForegroundColor( D3DXCOLOR( 1.0f, 0.75f, 0.0f, 1.0f ) );
        gTxtHelper->DrawTextLine( L"Controls:" );

        gTxtHelper->SetInsertionPos( 20, nBackBufferHeight - 20 * 5 );
        gTxtHelper->DrawTextLine(	L"Switch Compressed/Uncompressed views: TAB\n"
									L"Hide help: F1\n"
                                    L"Quit: ESC\n" );
    }
    else
    {
        gTxtHelper->SetForegroundColor( D3DXCOLOR( 1.0f, 1.0f, 1.0f, 1.0f ) );
        gTxtHelper->DrawTextLine( L"Press F1 for help" );
    }

    gTxtHelper->End();
}
Esempio n. 7
0
void RenderText()
{
    const D3DSURFACE_DESC* pd3dsdBackBuffer = DXUTGetD3D9BackBufferSurfaceDesc();
    CDXUTTextHelper txtHelper(g_pFont, g_pTextSprite, 15);

    // Output statistics
    txtHelper.Begin();
    txtHelper.SetInsertionPos(5, 5);
    txtHelper.SetForegroundColor(D3DXCOLOR(1.0f, 1.0f, 0.0f, 1.0f));
    txtHelper.DrawTextLine(DXUTGetFrameStats());
    txtHelper.DrawTextLine(DXUTGetDeviceStats());

    txtHelper.SetForegroundColor(D3DXCOLOR(1.0f, 1.0f, 1.0f, 1.0f));
    txtHelper.DrawTextLine(L"Put whatever misc status here");

    if(g_bShowHelp)
    {
        txtHelper.SetInsertionPos(10, pd3dsdBackBuffer->Height - 15 * 6);
        txtHelper.SetForegroundColor(D3DXCOLOR(1.0f, 0.75f, 0.0f, 1.0f));
        txtHelper.DrawTextLine(L"Controls (F1 to hide):");

        txtHelper.SetInsertionPos(40, pd3dsdBackBuffer->Height - 15 * 5);
        txtHelper.DrawTextLine(L"Blah: X\n"
                                L"Quit: ESC");
    }
    else
    {
        txtHelper.SetInsertionPos(10, pd3dsdBackBuffer->Height - 15 * 2);
        txtHelper.SetForegroundColor(D3DXCOLOR(1.0f, 1.0f, 1.0f, 1.0f));
        txtHelper.DrawTextLine(L"Press F1 for help");
    }
    txtHelper.End();
}
Esempio n. 8
0
//--------------------------------------------------------------------------------------
// Render the help and statistics text. This function uses the ID3DXFont interface for 
// efficient text rendering.
//--------------------------------------------------------------------------------------
void RenderText()
{
    // The helper object simply helps keep track of text position, and color
    // and then it calls pFont->DrawText( m_pSprite, strMsg, -1, &rc, DT_NOCLIP, m_clr );
    // If NULL is passed in as the sprite object, then it will work however the 
    // pFont->DrawText() will not be batched together.  Batching calls will improves performance.
    CDXUTTextHelper txtHelper( g_pFont, g_pTextSprite, 15 );

    // Output statistics
    txtHelper.Begin();
    txtHelper.SetInsertionPos( 5, 5 );
    txtHelper.SetForegroundColor( D3DXCOLOR( 1.0f, 1.0f, 0.0f, 1.0f ) );
    txtHelper.DrawTextLine( DXUTGetFrameStats( DXUTIsVsyncEnabled() ) );
    txtHelper.DrawTextLine( DXUTGetDeviceStats() );

    txtHelper.SetForegroundColor( D3DXCOLOR( 1.0f, 1.0f, 1.0f, 1.0f ) );
    txtHelper.DrawTextLine( g_strFileSaveMessage );

    // Draw help
    if( g_bShowHelp )
    {
        const D3DSURFACE_DESC* pd3dsdBackBuffer = DXUTGetD3D9BackBufferSurfaceDesc();
        txtHelper.SetInsertionPos( 10, pd3dsdBackBuffer->Height - 15 * 5 );
        txtHelper.SetForegroundColor( D3DCOLOR_ARGB( 200, 50, 50, 50 ) );
        txtHelper.DrawTextLine( L"Controls (F1 to hide):" );

        txtHelper.SetInsertionPos( 20, pd3dsdBackBuffer->Height - 15 * 4 );
        txtHelper.DrawTextLine( L"Rotate model: Left mouse button\n"
                                L"Rotate camera: Right mouse button\n"
                                L"Zoom camera: Mouse wheel scroll\n" );

        txtHelper.SetInsertionPos( 250, pd3dsdBackBuffer->Height - 15 * 4 );
        txtHelper.DrawTextLine( L"Hide help: F1\n" );
        txtHelper.DrawTextLine( L"Quit: ESC\n" );
    }
    else
    {
        txtHelper.SetForegroundColor( D3DXCOLOR( 1.0f, 1.0f, 1.0f, 1.0f ) );
        txtHelper.DrawTextLine( L"Press F1 for help" );
    }

    txtHelper.End();
}
Esempio n. 9
0
//--------------------------------------------------------------------------------------
// Render the help and statistics text. This function uses the ID3DXFont interface for 
// efficient text rendering.
//--------------------------------------------------------------------------------------
void RenderText()
{
    // The helper object simply helps keep track of text position, and color
    // and then it calls pFont->DrawText( m_pSprite, strMsg, -1, &rc, DT_NOCLIP, m_clr );
    // If NULL is passed in as the sprite object, then it will work however the 
    // pFont->DrawText() will not be batched together.  Batching calls will improves performance.
    const D3DSURFACE_DESC* pd3dsdBackBuffer = DXUTGetD3D9BackBufferSurfaceDesc();
    CDXUTTextHelper txtHelper( g_pFont, g_pTextSprite, 15 );

    // Output statistics
    txtHelper.Begin();
    txtHelper.SetInsertionPos( 5, 5 );
    txtHelper.SetForegroundColor( D3DXCOLOR( 1.0f, 1.0f, 0.0f, 1.0f ) );
    txtHelper.DrawTextLine( DXUTGetFrameStats( DXUTIsVsyncEnabled() ) );
    txtHelper.DrawTextLine( DXUTGetDeviceStats() );

    // Draw help
    if( g_bShowHelp )
    {
        txtHelper.SetInsertionPos( 10, pd3dsdBackBuffer->Height - 15 * 8 );
        txtHelper.SetForegroundColor( D3DXCOLOR( 1.0f, 0.75f, 0.0f, 1.0f ) );
        txtHelper.DrawTextLine( L"Controls (F1 to hide):" );

        txtHelper.SetInsertionPos( 40, pd3dsdBackBuffer->Height - 15 * 7 );
        txtHelper.DrawTextLine( L"Rotate Model: Left Mouse" );
        txtHelper.DrawTextLine( L"Rotate Light: Middle Mouse" );
        txtHelper.DrawTextLine( L"Rotate Camera and Model: Right Mouse" );
        txtHelper.DrawTextLine( L"Rotate Camera: Ctrl + Right Mouse" );
        txtHelper.DrawTextLine( L"Wireframe: W" );
        txtHelper.DrawTextLine( L"Quit: ESC" );
    }
    else
    {
        txtHelper.SetInsertionPos( 10, pd3dsdBackBuffer->Height - 15 * 2 );
        txtHelper.SetForegroundColor( D3DXCOLOR( 1.0f, 1.0f, 1.0f, 1.0f ) );
        txtHelper.DrawTextLine( L"Press F1 for help" );
    }
    txtHelper.End();
}
//--------------------------------------------------------------------------------------
// Render the help and statistics text
//--------------------------------------------------------------------------------------
void RenderText()
{
    UINT nBackBufferHeight = ( DXUTIsAppRenderingWithD3D9() ) ? DXUTGetD3D9BackBufferSurfaceDesc()->Height :
            DXUTGetDXGIBackBufferSurfaceDesc()->Height;

    g_pTxtHelper->Begin();
    g_pTxtHelper->SetInsertionPos( 2, 0 );
    g_pTxtHelper->SetForegroundColor( D3DXCOLOR( 1.0f, 1.0f, 0.0f, 1.0f ) );
    g_pTxtHelper->DrawTextLine( DXUTGetFrameStats( DXUTIsVsyncEnabled() ) );
    g_pTxtHelper->DrawTextLine( DXUTGetDeviceStats() );

    // Draw help
    if( g_bShowHelp )
    {
        g_pTxtHelper->SetInsertionPos( 2, nBackBufferHeight - 20 * 6 );
        g_pTxtHelper->SetForegroundColor( D3DXCOLOR( 1.0f, 0.75f, 0.0f, 1.0f ) );
        g_pTxtHelper->DrawTextLine( L"Controls:" );

        g_pTxtHelper->SetInsertionPos( 20, nBackBufferHeight - 20 * 5 );
        g_pTxtHelper->DrawTextLine( L"Rotate model: Left mouse button\n"
                                    L"Rotate light: Right mouse button\n"
                                    L"Rotate camera: Middle mouse button\n"
                                    L"Zoom camera: Mouse wheel scroll\n" );

        g_pTxtHelper->SetInsertionPos( 550, nBackBufferHeight - 20 * 5 );
        g_pTxtHelper->DrawTextLine( L"Hide help: F1\n"
                                    L"Quit: ESC\n" );
    }
    else
    {
        g_pTxtHelper->SetForegroundColor( D3DXCOLOR( 1.0f, 1.0f, 1.0f, 1.0f ) );
        g_pTxtHelper->DrawTextLine( L"Press F1 for help" );
    }

    g_pTxtHelper->End();
}
//--------------------------------------------------------------------------------------
// Render the scene using the D3D9 device
//--------------------------------------------------------------------------------------
void CALLBACK OnD3D9FrameRender( IDirect3DDevice9* pd3dDevice, double fTime, float fElapsedTime, void* pUserContext )
{
	// If the settings dialog is being shown, then render it instead of rendering the app's scene
	if( g_SettingsDlg.IsActive() )
	{
		g_SettingsDlg.OnRender( fElapsedTime );
		return;
	}

	HRESULT hr;

	// Clear the render target and the zbuffer 
	V( pd3dDevice->Clear( 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0x8dadd4, 1.0f, 0 ) );

	// Render the scene
	if( SUCCEEDED( pd3dDevice->BeginScene() ) )
	{
		freeCamera.Update( fElapsedTime );
		D3DXMATRIXA16 mtxView = freeCamera.GetView();

		// Get back buffer description and determine aspect ratio
		const D3DSURFACE_DESC* pBackBufferSurfaceDesc = DXUTGetD3D9BackBufferSurfaceDesc();
		float Width = (float)pBackBufferSurfaceDesc->Width;
		float Height = (float)pBackBufferSurfaceDesc->Height;
		float fAspectRatio = Width / Height;

		float fovHorizontal = D3DX_PI / 4.0f;
		float nearZ = 0.05f;
		float farZ = 500.0f;

		D3DXMATRIXA16 mtxProj;
		D3DXMatrixPerspectiveFovLH( &mtxProj, fovHorizontal, fAspectRatio, nearZ, farZ );

		// Convert projection matrix to right handed coordinate system
		D3DXMATRIX mtxMirror;
		D3DXMatrixScaling(&mtxMirror, -1.0, 1.0, 1.0);
		D3DXMatrixMultiply( &mtxProj, &mtxMirror, &mtxProj);

		// Build view projection matrix
		D3DXMATRIX mtxViewProj;
		D3DXMatrixMultiply( &mtxViewProj, &mtxView, &mtxProj );

		d3dFloor.Draw(mtxViewProj);
		d3dMesh.Draw(mtxViewProj, freeCamera.GetForward(), fElapsedTime);

		g_pTxtHelper->Begin();
		g_pTxtHelper->SetInsertionPos( 5, 5 );
		g_pTxtHelper->SetForegroundColor( D3DXCOLOR( 1.0f, 1.0f, 0.0f, 1.0f ) );
		g_pTxtHelper->DrawTextLine( DXUTGetFrameStats( DXUTIsVsyncEnabled() ) );
		g_pTxtHelper->DrawTextLine( DXUTGetDeviceStats() );
		
		g_pTxtHelper->SetForegroundColor( D3DXCOLOR( 1.0f, 0.9f, 0.0f, 1.0f ) );

		float frameTimeMs = DXUTGetElapsedTime() * 1000.0f;




		g_pTxtHelper->DrawFormattedTextLine(L"\n\n"
			L"Frame time : %3.2f ms\n\n"
			L"Navigation:\n"
			L" Click and Hold Right Mouse Button (RMB) and move the mouse to look around\n"
			L" As you hold Right Mouse Button (RMB) use the W A S D to movement", frameTimeMs);

		g_pTxtHelper->SetForegroundColor( D3DXCOLOR( 1.0f, 1.0f, 1.0f, 1.0f ) );
		g_pTxtHelper->SetInsertionPos((int)Width - 350, 10);

		if (g_DisableSkining)
		{
			if (g_TechniqueIndex == 0)
			{
				g_pTxtHelper->DrawTextLine (L"Vertex size 56 bytes\n\n"
					L"struct Vertex\n"
					L"{\n"
					L"   float3 pos;\n"
					L"   float2 uv;\n"
					L"   float3 tangent;\n"
					L"   float3 normal;\n"
					L"   float3 binormal;\n"
					L"};\n");
			} else
			{
				if (g_TechniqueIndex == 1)
				{
					g_pTxtHelper->DrawTextLine (L"Vertex size 28 bytes\n\n"
						L"struct Vertex\n"
						L"{\n"
						L"   float3 pos;\n"
						L"   short2 uv;\n"
						L"   ubyte4 tangent;\n"
						L"   ubyte4 normal;\n"
						L"   ubyte4 binormal;\n"
						L"};\n");
				} else
				{
					if (g_TechniqueIndex == 2)
					{
						g_pTxtHelper->DrawTextLine (L"Vertex size 32 bytes\n\n"
							L"struct Vertex\n"
							L"{\n"
							L"   float3 pos;\n"
							L"   short2 uv;\n"
							L"   float4 tbn;\n"
							L"};\n");
					} else
					{
						if (g_TechniqueIndex == 3)
						{
							g_pTxtHelper->DrawTextLine (L"Vertex size 20 bytes\n\n"
								L"struct Vertex\n"
								L"{\n"
								L"   float3 pos;\n"
								L"   short2 uv;\n"
								L"   ubyte4 tbn;\n"
								L"};\n");
						}
					}
				}
			}
		} else
		{
			if (g_TechniqueIndex == 0)
			{
				g_pTxtHelper->DrawTextLine (L"Vertex size 76 bytes\n\n"
					L"struct Vertex\n"
					L"{\n"
					L"   float3 pos;\n"
					L"   float2 uv;\n"
					L"   float3 tangent;\n"
					L"   float3 normal;\n"
					L"   float3 binormal;\n"
					L"   float4 weights;\n"
					L"   ubyte4 indices;\n"
					L"};\n");
			} else
			{
				if (g_TechniqueIndex == 1)
				{
					g_pTxtHelper->DrawTextLine (L"Vertex size 40 bytes\n\n"
						L"struct Vertex\n"
						L"{\n"
						L"   float3 pos;\n"
						L"   short2 uv;\n"
						L"   ubyte4 tangent;\n"
						L"   ubyte4 normal;\n"
						L"   ubyte4 binormal;\n"
						L"   short4 weights;\n"
						L"   ubyte4 indices;\n"
						L"};\n");
				} else
				{
					if (g_TechniqueIndex == 2)
					{
						g_pTxtHelper->DrawTextLine (L"Vertex size 44 bytes\n\n"
							L"struct Vertex\n"
							L"{\n"
							L"   float3 pos;\n"
							L"   short2 uv;\n"
							L"   float4 tbn;\n"
							L"   short4 weights;\n"
							L"   ubyte4 indices;\n"
							L"};\n");
					} else
					{
						if (g_TechniqueIndex == 3)
						{
							g_pTxtHelper->DrawTextLine (L"Vertex size 32 bytes\n\n"
								L"struct Vertex\n"
								L"{\n"
								L"   float3 pos;\n"
								L"   short2 uv;\n"
								L"   ubyte4 tbn;\n"
								L"   short4 weights;\n"
								L"   ubyte4 indices;\n"
								L"};\n");
						}
					}
				}
			}
		}


		g_pTxtHelper->End();

		V( g_HUD.OnRender( fElapsedTime ) );
		V( g_SampleUI.OnRender( fElapsedTime ) );
		V( pd3dDevice->EndScene() );
	}
}