July 2017
Beginner to intermediate
390 pages
10h 53m
English
If you look at the code in SpinningCubeRenderer, you will see the main app code calls update and render on that class. We will do the same for our SpatialSurfaceRenderer, so let us add these two methods to our class:
public void Update() { var allMeshes = _surfaceMeshList.GetAllUpdatedMeshes(); foreach (var mesh in allMeshes) mesh.Update(_deviceResources.D3DDeviceContext); } public void Render() { if (!_loadingComplete) return; var context = _deviceResources.D3DDeviceContext; // Attach the vertex shader. context.VertexShader.SetShader(_vertexShader, null, 0); if (!_usingVprtShaders) context.GeometryShader.SetShader(_geometryShader, null, 0); // Attach the pixel shader. context.PixelShader.SetShader(_pixelShader, null, ...Read now
Unlock full access