MCPcopy Create free account
hub / github.com/DentonW/DevIL / Render

Method Render

DevIL/examples/direct3d_example/d3dtest.cpp:172–196  ·  view source on GitHub ↗

----------------------------------------------------------------------------- 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. -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

170// viewport, and renders the scene.
171//-----------------------------------------------------------------------------
172HRESULT 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

Callers

nothing calls this directly

Calls 1

ClearMethod · 0.45

Tested by

no test coverage detected