Skip to content

Commit

Permalink
MeshRenderer updated effect pointer management.
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewRichards-Code committed Oct 28, 2024
1 parent 74e4610 commit 018425f
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions CrossPlatform/MeshRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ void MeshRenderer::RestoreDeviceObjects(RenderPlatform *r)
cameraConstants.RestoreDeviceObjects(r);
solidConstants.RestoreDeviceObjects(r);
perObjectConstants.RestoreDeviceObjects(r);
effect = r->GetEffect("solid");
}

void MeshRenderer::InvalidateDeviceObjects()
{
cameraConstants.InvalidateDeviceObjects();
solidConstants.InvalidateDeviceObjects();
perObjectConstants.InvalidateDeviceObjects();
delete effect;
effect = nullptr;
}

Expand Down Expand Up @@ -68,9 +68,6 @@ void MeshRenderer::DrawSubNode(GraphicsDeviceContext& deviceContext, Mesh* mesh,

void MeshRenderer::Render(GraphicsDeviceContext &deviceContext, Mesh *mesh, mat4 model, Texture *diffuseCubemap,Texture *specularCubemap,Texture *screenspaceShadowTexture)
{
if (renderPlatform)
effect = renderPlatform->GetEffect("solid");

if (!effect)
return;

Expand Down

0 comments on commit 018425f

Please sign in to comment.