MCPcopy Create free account
hub / github.com/assimp/assimp / OnPostRender

Method OnPostRender

tools/assimp_view/Background.cpp:306–342  ·  view source on GitHub ↗

-------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

304}
305//-------------------------------------------------------------------------------
306void CBackgroundPainter::OnPostRender() {
307 if (TEXTURE_CUBE == eMode) {
308 aiMatrix4x4 pcProj;
309 GetProjectionMatrix(pcProj);
310
311 aiMatrix4x4 pcCam;
312 aiVector3D vPos = GetCameraMatrix(pcCam);
313
314 aiMatrix4x4 aiMe;
315 aiMe[3][0] = vPos.x;
316 aiMe[3][1] = vPos.y;
317 aiMe[3][2] = vPos.z;
318 aiMe = mMatrix * aiMe;
319
320 pcProj = (aiMe * pcCam) * pcProj;
321
322 piSkyBoxEffect->SetMatrix("WorldViewProjection",
323 (const D3DXMATRIX *)&pcProj);
324
325 UINT dwPasses;
326 piSkyBoxEffect->Begin(&dwPasses, 0);
327 piSkyBoxEffect->BeginPass(0);
328
329 DWORD dw2;
330 g_piDevice->GetFVF(&dw2);
331 g_piDevice->SetFVF(D3DFVF_XYZ | D3DFVF_TEX1 | D3DFVF_TEXCOORDSIZE3(0));
332
333 g_piDevice->DrawIndexedPrimitiveUP(
334 D3DPT_TRIANGLELIST, 0, 8, 12, g_cubeIndices, D3DFMT_INDEX16,
335 g_cubeVertices_indexed, sizeof(SkyBoxVertex));
336
337 g_piDevice->SetFVF(dw2);
338
339 piSkyBoxEffect->EndPass();
340 piSkyBoxEffect->End();
341 }
342}
343//-------------------------------------------------------------------------------
344void CBackgroundPainter::ReleaseNativeResource() {
345 if (piSkyBoxEffect) {

Callers 1

RenderFullSceneMethod · 0.80

Calls 5

GetProjectionMatrixFunction · 0.85
GetCameraMatrixFunction · 0.85
GetFVFMethod · 0.80
BeginMethod · 0.45
EndMethod · 0.45

Tested by

no test coverage detected