Added ui labels for debugging and playability
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using OpenTK.Graphics.OpenGL4;
|
||||
using OpenTK.Mathematics;
|
||||
using Voxel.Core;
|
||||
using Voxel.UI;
|
||||
|
||||
namespace Voxel.Graphics
|
||||
{
|
||||
@@ -131,11 +132,11 @@ namespace Voxel.Graphics
|
||||
|
||||
_uiShader.Use();
|
||||
|
||||
Matrix4 projection = Matrix4.CreateOrthographicOffCenter(0, WindowWidth, WindowHeight, 0, -1, 1);
|
||||
Matrix4 projection = Matrix4.CreateOrthographicOffCenter(0, Camera.Width, Camera.Height, 0, -1, 1);
|
||||
_uiShader.SetMatrix4("projection", projection);
|
||||
|
||||
_uiTexture.Bind(TextureUnit.Texture0);
|
||||
_guiBatcher.DrawString("Voxel Engine v0.1", 15, 70, 20, Vector4.One);
|
||||
_guiBatcher.DrawString("Voxel Engine v0.1", 16, 112, 24, Vector4.One);
|
||||
|
||||
_guiBatcher.Render();
|
||||
|
||||
@@ -174,5 +175,11 @@ namespace Voxel.Graphics
|
||||
{
|
||||
_buffersDirty = true;
|
||||
}
|
||||
|
||||
//temp
|
||||
public static void RenderLabel(Label label)
|
||||
{
|
||||
_guiBatcher.DrawString(label.Text, label.X, label.Y, label.Size, label.Color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user