public bool Render(DDX11 D3DDevice, DShaderManager shaderManager, Matrix worldMatrix, Matrix baseViewMatrix, Matrix orthoMatrix) { // Turn off the Z buffer and enable alpha blending to begin 2D rendering. D3DDevice.TurnZBufferOff(); D3DDevice.TurnOnAlphaBlending(); // Render the fps string. FpsString.Render(D3DDevice.DeviceContext, shaderManager, worldMatrix, baseViewMatrix, orthoMatrix, Font1.Texture.TextureResource); // Render the position and rotation strings. foreach (DText position in PositionStrings) { position.Render(D3DDevice.DeviceContext, shaderManager, worldMatrix, baseViewMatrix, orthoMatrix, Font1.Texture.TextureResource); } // Render the video card strings. foreach (DText vidString in VideoStrings) { vidString.Render(D3DDevice.DeviceContext, shaderManager, worldMatrix, baseViewMatrix, orthoMatrix, Font1.Texture.TextureResource); } // Turn the Z buffer back on and disable alpha blending now that the 2D rendering has completed. D3DDevice.TurnZBufferOn(); D3DDevice.TurnOffAlphaBlending(); return(true); }
public void Render(DirectX directXDevice, ShaderManager shaderManager, Matrix worldMatrix, Matrix viewMatrix, Matrix orthoMatrix) { directXDevice.SetZBuffer(false); directXDevice.SetAlphaBlending(true); FpsString.Render(directXDevice.DeviceContext, shaderManager, worldMatrix, viewMatrix, orthoMatrix, Font.Texture.TextureResource); foreach (var positionString in PositionStrings) { positionString.Render(directXDevice.DeviceContext, shaderManager, worldMatrix, viewMatrix, orthoMatrix, Font.Texture.TextureResource); } foreach (var videoString in VideoStrings) { videoString.Render(directXDevice.DeviceContext, shaderManager, worldMatrix, viewMatrix, orthoMatrix, Font.Texture.TextureResource); } directXDevice.SetZBuffer(true); directXDevice.SetAlphaBlending(false); }