/// <summary> /// Override if you want to change the core rendering functionality of Monocle Engine. /// By default, this simply sets the render target to null, clears the screen, and renders the current Scene /// </summary> protected virtual void RenderCore() { if (scene != null) { scene.BeforeRender(); } GraphicsDevice.SetRenderTarget(RenderBuffer); GraphicsDevice.Clear(ClearColor); if (scene != null) { scene.Render(); scene.AfterRender(); } //Draw the buffer scaled up to the screen if (RenderBuffer != null) { GraphicsDevice.SetRenderTarget(null); GraphicsDevice.Viewport = viewport; GraphicsDevice.Clear(ClearColor); Monocle.Draw.SpriteBatch.Begin(SpriteSortMode.Texture, BlendState.Opaque, SamplerState.PointClamp, DepthStencilState.None, RasterizerState.CullNone, null, screenMatrix); Monocle.Draw.SpriteBatch.Draw(RenderBuffer, Vector2.Zero, Color.White); Monocle.Draw.SpriteBatch.End(); } }
/// <summary> /// Override if you want to change the core rendering functionality of Monocle Engine. /// By default, this simply sets the render target to null, clears the screen, and renders the current Scene /// </summary> protected virtual void RenderCore() { if (scene != null) { scene.BeforeRender(); } GraphicsDevice.SetRenderTarget(null); GraphicsDevice.Clear(ClearColor); if (scene != null) { scene.Render(); scene.AfterRender(); } }