Added ui labels for debugging and playability

This commit is contained in:
2026-04-22 17:18:15 +02:00
parent a324ff0d16
commit e1778fb446
8 changed files with 110 additions and 13 deletions

View File

@@ -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);
}
}
}