mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-05-30 04:34:49 +00:00
Renderer - Added 'SetViewportSize'
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
* 3. This notice may not be removed or altered from any source distribution.
|
||||
**/
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using OpenTK.Graphics.OpenGL;
|
||||
using PckStudio.Rendering.Shader;
|
||||
|
||||
@@ -30,5 +31,10 @@ namespace PckStudio.Rendering
|
||||
context.IndexBuffer.Bind();
|
||||
GL.DrawElements(context.PrimitiveType, context.IndexBuffer.GetCount(), DrawElementsType.UnsignedInt, 0);
|
||||
}
|
||||
|
||||
public static void SetViewportSize(Size size)
|
||||
{
|
||||
GL.Viewport(size);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,6 +78,7 @@ namespace PckStudio.Rendering
|
||||
Camera.ViewportSize = ClientSize;
|
||||
Camera.Update();
|
||||
}
|
||||
Renderer.SetViewportSize(Camera.ViewportSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -676,8 +676,6 @@ namespace PckStudio.Rendering
|
||||
|
||||
MakeCurrent();
|
||||
|
||||
GL.Viewport(Size);
|
||||
|
||||
framebuffer.Bind();
|
||||
GL.ClearColor(BackColor);
|
||||
GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
|
||||
|
||||
Reference in New Issue
Block a user