Graphics Reference
In-Depth Information
CDXUTTextHelper txtHelper(g_pFont, g_pTextSprite, 15);
//Output statistics
txtHelper.Begin();
txtHelper.SetInsertionPos(5, 5);
txtHelper.SetForegroundColour(D3DXCOLOUR(1.0f, 1.0f, 0.0f, 1.0f));
txtHelper.DrawTextLine(DXUTGetFrameStats(DXUTIsVsyncEnabled()));
txtHelper.DrawTextLine(DXUTGetDeviceStats());
//Draw help
if(g_bShowHelp)
{
const D3DSURFACE_DESC* pd3dsdBackBuffer =
DXUTGetD3D9BackBufferSurfaceDesc();
txtHelper.SetInsertionPos(10, pd3dsdBackBuffer->Height - 15 * 9);
txtHelper.SetForegroundColour(D3DXCOLOUR(1.0f, 0.75f, 0.0f, 1.0f));
txtHelper.DrawTextLine(L”Controls (F1 to hide):”);
txtHelper.SetInsertionPos(40, pd3dsdBackBuffer->Height - 15 * 8);
txtHelper.DrawTextLine(L”F4: Load next mesh\n”
L”1,2,3,4,5,6: Load mesh\n”
L”Rotate mesh: Left click drag\n”
L”Rotate camera: right click drag\n”
L”Zoom: Mouse wheel\n”
L”Quit: ESC”);
}
else
{
txtHelper.SetForegroundColour(D3DXCOLOUR(1.0f, 1.0f, 1.0f, 1.0f));
txtHelper.DrawTextLine(L”Press F1 for help”);
}
float fps = DXUTGetFPS();
//Write to logfile
//logfile << fps << “ “ << g_pMeshEnhanced->GetNumVertices() <<
std::endl; //SISO
logfile << fps << “ “ << g_pMeshEnhanced->GetNumVertices()/*<< “
“ << g_CurrentTechnique*/<< std::endl; //MISO/MIMO
txtHelper.SetForegroundColour(D3DXCOLOUR(1.0f, 0.75f, 0.0f, 1.0f));
txtHelper.SetInsertionPos(10, 65);
txtHelper.DrawFormattedTextLine(L”NumSegs:%d\n”, g_dwNumSegs);
txtHelper.DrawFormattedTextLine(L”NumFaces:%d\n”,
(g_pMeshEnhanced = = NULL) ? 0 : g_pMeshEnhanced->GetNumFaces());
txtHelper.DrawFormattedTextLine(L”NumVertices:%d\n”,
(g_pMeshEnhanced = = NULL) ? 0 : g_pMeshEnhanced->GetNumVertices());
txtHelper.DrawFormattedTextLine(L”FPS:%f\n”, fps);
txtHelper.End();
}
//—————————————————————————————————————————————————————————————————————————
//Handle messages to the application
//—————————————————————————————————————————————————————————————————————————
LRESULT CALLBACK MsgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM
lParam, bool* pbNoFurtherProcessing, void* pUserContext)
Search WWH ::




Custom Search