public static void InitRenderer() { renderer.SetTextures(SheetManager.Sheets, SheetManager.SheetsUsed); debugRenderer.SetTextures(new[] { 0 }); WorldRenderer.Initialize(); UIRenderer.Initialize(); }
public static void UpdateViewport() { lock (GLLock) { GL.Viewport(0, 0, WindowInfo.Width, WindowInfo.Height); Program.CheckGraphicsError("View_Viewport"); GL.Scissor(0, 0, WindowInfo.Width, WindowInfo.Height); Program.CheckGraphicsError("View_Scissor"); } Camera.Update(); UIRenderer.Update(); }
public static void Render() { lock (GLLock) { RenderCalls = 0; BatchCalls = 0; Batches = 0; if (Settings.EnablePixeling) { GL.BindFramebuffer(FramebufferTarget.Framebuffer, frameBuffer); GL.Clear(ClearBufferMask.ColorBufferBit); var width = (int)(Camera.DefaultZoom * WindowInfo.Ratio * PixelSize); var height = (int)(Camera.DefaultZoom * PixelSize); GL.Viewport(0, 0, width, height); GL.Scissor(0, 0, width, height); WorldRenderer.Render(); GL.BindFramebuffer(FramebufferTarget.Framebuffer, 0); GL.Clear(ClearBufferMask.ColorBufferBit); UpdateViewport(); renderable.Bind(); var iden = Matrix4.CreateScale(1f); Shaders.Uniform(Shaders.TextureShader, ref iden, Color.White); renderable.Render(); Program.CheckGraphicsError("GLRendering_World"); } else { GL.BindFramebuffer(FramebufferTarget.Framebuffer, 0); GL.Clear(ClearBufferMask.ColorBufferBit); WorldRenderer.Render(); Program.CheckGraphicsError("GLRendering_World"); } UIRenderer.Render(); Program.CheckGraphicsError("GLRendering_UI"); } }
public static void ResetRenderer(Game game) { PauseSequences = false; WorldRenderer.Reset(game); UIRenderer.Reset(game); }