// Renders the menu to a surface void CMenuBase::Render(HSURFACE hDestSurf) { if (!hDestSurf) { return; } DDWORD dwDestinationWidth=0; DDWORD dwDestinationHeight=0; // Get the dims of the destination surface m_pClientDE->GetSurfaceDims (hDestSurf, &dwDestinationWidth, &dwDestinationHeight); // Render the title if (m_pMainMenus->IsEnglish()) { if ( m_hTitleSurf != DNULL ) { m_pClientDE->DrawSurfaceToSurface(hDestSurf, m_hTitleSurf, DNULL, m_titlePos.x, m_titlePos.y); } } else { // The non-english version renders a text string instead of a title surface CLTGUIFont *pTitleFont=m_pMainMenus->GetTitleFont(); if (pTitleFont && m_hTitleString) { pTitleFont->DrawSolid(m_hTitleString, hDestSurf, m_titlePos.x, m_titlePos.y, CF_JUSTIFY_LEFT, SETRGB(100,75,50)); } } // Render the list of options m_listOption.EnableBoxFormat(m_bBoxFormat); m_listOption.Render(hDestSurf); // Render the arrows if (m_bShowArrows) { RenderArrows(hDestSurf); } }
void CALLBACK OnFrameRender(IDirect3DDevice9* pd3dDevice, double fTime, float fElapsedTime, void* pUserContext) { HRESULT hr; V(pd3dDevice->Clear(0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, D3DCOLOR_ARGB(0, 33, 64, 145), 1.0f, 0)); if(SUCCEEDED(pd3dDevice->BeginScene())) { g_BackgroundQuad.Render(); g_Board.Render(pd3dDevice); RenderArrows(fElapsedTime); RenderWinner(fElapsedTime); DXUT_BeginPerfEvent(DXUT_PERFEVENTCOLOR, L"HUD / Stats"); //RenderText(); V(g_HUD.OnRender(fElapsedTime)); V(g_SampleUI.OnRender(fElapsedTime)); DXUT_EndPerfEvent(); V(pd3dDevice->EndScene()); } }