public override void Render(Device device, DeviceContext deviceContext, Camera camera, LightClass light) { if (!DoRender) { return; } BoundingBox.Render(device, deviceContext, camera, light); deviceContext.InputAssembler.SetVertexBuffers(0, new VertexBufferBinding(vertexBuffer, Utilities.SizeOf <VertexLayouts.BasicLayout.Vertex>(), 0)); deviceContext.InputAssembler.SetIndexBuffer(indexBuffer, SharpDX.DXGI.Format.R32_UInt, 0); deviceContext.InputAssembler.PrimitiveTopology = PrimitiveTopology.TriangleList; Shader.SetSceneVariables(deviceContext, Transform, camera); Shader.Render(deviceContext, PrimitiveTopology.TriangleList, (int)numTriangles, 0); }
public override void Render(Device device, DeviceContext deviceContext, Camera camera) { if (!DoRender) { return; } deviceContext.InputAssembler.SetVertexBuffers(0, new VertexBufferBinding(vertexBuffer, Utilities.SizeOf <VertexLayouts.CollisionLayout.Vertex>(), 0)); deviceContext.InputAssembler.SetIndexBuffer(indexBuffer, SharpDX.DXGI.Format.R32_UInt, 0); deviceContext.InputAssembler.PrimitiveTopology = PrimitiveTopology.TriangleList; Shader.SetSceneVariables(deviceContext, Transform, camera); Shader.SetShaderParameters(device, deviceContext, new BaseShader.MaterialParameters(null, SelectionColour.Normalize())); Shader.Render(deviceContext, PrimitiveTopology.TriangleList, Indices.Length, 0); }
public override void Render(ID3D11Device device, ID3D11DeviceContext deviceContext, Camera camera) { if (!DoRender) { return; } VertexBufferView VertexBufferView = new VertexBufferView(vertexBuffer, Unsafe.SizeOf <VertexLayouts.CollisionLayout.Vertex>(), 0); deviceContext.IASetVertexBuffers(0, VertexBufferView); deviceContext.IASetIndexBuffer(indexBuffer, Vortice.DXGI.Format.R32_UInt, 0); deviceContext.IASetPrimitiveTopology(PrimitiveTopology.TriangleList); Shader.SetSceneVariables(deviceContext, Transform, camera); Shader.SetShaderParameters(device, deviceContext, new BaseShader.MaterialParameters(null, SelectionColour.Normalize())); Shader.Render(deviceContext, PrimitiveTopology.TriangleList, Indices.Length, 0); }