Ejemplo n.º 1
0
        public void PostRender()
        {
            GL.BindFramebuffer(FramebufferTarget.Framebuffer, 0);
            GL.ClearColor(Color4.Black);
            GL.Clear(ClearBufferMask.ColorBufferBit);
            GL.Disable(EnableCap.DepthTest);
            GL.Viewport(0, 0, drawWidth, drawHeight);
            if (textureBufferTexture == null)
            {
                Console.WriteLine("???");
                return;
            }
            depthBufferTexture.Bind();
            colorTexture.Bind();
            var scale = (float)BaseGame.Size.Height / GlobalSettings.Default.renderResolutionY;

            if (GlobalSettings.Default.renderResolutionX <= 0)
            {
                width = (int)windowSize.X;
            }
            if (GlobalSettings.Default.renderResolutionY <= 0)
            {
                height = (int)windowSize.Y;
            }
            Renderer2D.DrawFramebuffer(new Vector2(0.0f, 0.0f), new Vector2(GlobalSettings.Default.renderResolutionX * scale, GlobalSettings.Default.renderResolutionY * scale), textureBufferTexture, frameBufferMaterial);
        }
Ejemplo n.º 2
0
 public static void Init(Vector2 desiredResolution)
 {
     renderResolution = desiredResolution;
     if (desiredResolution.X < 0 || desiredResolution.Y < 0)
     {
         renderResolution = new Vector2(BaseGame.Size.Width, BaseGame.Size.Height);
     }
     Renderer3D.Init();
     Renderer2D.Init();
 }