internal void render() { // Renderers should always have those that require a RenderTarget first. They clear themselves and set themselves as // the current RenderTarget when they render. If the first Renderer wants the sceneRenderTarget we set and clear it now. if (_renderers[0].wantsToRenderToSceneRenderTarget) { Core.graphicsDevice.setRenderTarget(_sceneRenderTarget); Core.graphicsDevice.Clear(clearColor); } var lastRendererHadRenderTarget = false; for (var i = 0; i < _renderers.length; i++) { // MonoGame follows the XNA bullshit implementation so it will clear the entire buffer if we change the render target even if null. // Because of that, we track when we are done with our RenderTargets and clear the scene at that time. if (lastRendererHadRenderTarget && _renderers.buffer[i].wantsToRenderToSceneRenderTarget) { Core.graphicsDevice.setRenderTarget(_sceneRenderTarget); Core.graphicsDevice.Clear(clearColor); // force a Camera matrix update to account for the new Viewport size if (_renderers.buffer[i].camera != null) { _renderers.buffer[i].camera.forceMatrixUpdate(); } camera.forceMatrixUpdate(); } _renderers.buffer[i].render(this); lastRendererHadRenderTarget = _renderers.buffer[i].renderTexture != null; } }
internal void render() { var lastRendererHadRenderTarget = false; for (var i = 0; i < _renderers.Count; i++) { // MonoGame follows the XNA bullshit implementation so it will clear the entire buffer if we change the render target even if null. // Because of that, we track when we are done with our RenderTargets and clear the scene at that time. if (lastRendererHadRenderTarget) { Core.graphicsDevice.SetRenderTarget(_sceneRenderTarget); Core.graphicsDevice.Clear(clearColor); // force a Camera matrix update to account for the new Viewport size if (_renderers[i].camera != null) { _renderers[i].camera.forceMatrixUpdate(); } camera.forceMatrixUpdate(); } _renderers[i].render(this); lastRendererHadRenderTarget = _renderers[i].renderTarget != null; } }