----------------------------------------------------------------------------- Name: Render() Desc: Called once per frame, the call is the entry point for 3d rendering. This function sets up render states, clears the viewport, and renders the scene. -----------------------------------------------------------------------------
| 170 | // viewport, and renders the scene. |
| 171 | //----------------------------------------------------------------------------- |
| 172 | HRESULT CMyD3DApplication::Render() |
| 173 | { |
| 174 | // Clear the viewport |
| 175 | m_pd3dDevice->Clear( 0L, NULL, D3DCLEAR_TARGET|D3DCLEAR_ZBUFFER, |
| 176 | 0x00000000, 1.0f, 0L ); |
| 177 | |
| 178 | // Begin the scene |
| 179 | if( SUCCEEDED( m_pd3dDevice->BeginScene() ) ) |
| 180 | { |
| 181 | // Draw the quad, with the volume texture |
| 182 | m_pd3dDevice->SetTexture( 0, m_pTexture ); |
| 183 | // m_pd3dDevice->SetVertexShader( D3DFVF_VERTEX ); |
| 184 | m_pd3dDevice->SetStreamSource( 0, m_pVB, sizeof(VERTEX) ); |
| 185 | m_pd3dDevice->DrawPrimitive( D3DPT_TRIANGLESTRIP, 0, 2); |
| 186 | |
| 187 | // Output statistics |
| 188 | m_pFont->DrawText( 2, 0, D3DCOLOR_ARGB(255,255,255,0), m_strFrameStats ); |
| 189 | m_pFont->DrawText( 2, 20, D3DCOLOR_ARGB(255,255,255,0), m_strDeviceStats ); |
| 190 | |
| 191 | // End the scene. |
| 192 | m_pd3dDevice->EndScene(); |
| 193 | } |
| 194 | |
| 195 | return S_OK; |
| 196 | } |
| 197 | |
| 198 | |
| 199 |