cleanup
This commit is contained in:
@@ -32,7 +32,7 @@ namespace Voxel.Core
|
||||
while (_tickTime >= TICK_LENGTH)
|
||||
{
|
||||
_tickTime -= TICK_LENGTH;
|
||||
Tick(); // run exactly once per tick
|
||||
Tick();
|
||||
}
|
||||
|
||||
if (Input.GetKey(Keys.Escape))
|
||||
|
||||
@@ -136,7 +136,6 @@ namespace Voxel.Graphics
|
||||
_uiShader.SetMatrix4("projection", projection);
|
||||
|
||||
_uiTexture.Bind(TextureUnit.Texture0);
|
||||
_guiBatcher.DrawString("Voxel Engine v0.1", 16, 112, 24, Vector4.One);
|
||||
|
||||
_guiBatcher.Render();
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ in vec4 Color;
|
||||
|
||||
out vec4 FragColor;
|
||||
|
||||
uniform sampler2D uTexture; // Ensure this name matches C# exactly
|
||||
uniform sampler2D uTexture;
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
@@ -7,11 +7,10 @@ layout (location = 2) in vec4 aColor;
|
||||
out vec2 TexCoord;
|
||||
out vec4 Color;
|
||||
|
||||
uniform mat4 projection; // Ensure this name matches C# exactly
|
||||
uniform mat4 projection;
|
||||
|
||||
void main()
|
||||
{
|
||||
// If you don't multiply by projection, the compiler deletes the uniform
|
||||
gl_Position = projection * vec4(aPos, 0.0, 1.0);
|
||||
TexCoord = aTexCoord;
|
||||
Color = aColor;
|
||||
|
||||
@@ -3,12 +3,9 @@ public static class CharWidth
|
||||
private static readonly Dictionary<char, float> CharWidths = new Dictionary<char, float>();
|
||||
|
||||
static CharWidth()
|
||||
{
|
||||
// Default for all ASCII
|
||||
for (char c = (char)32; c <= (char)126; c++)
|
||||
{ for (char c = (char)32; c <= (char)126; c++)
|
||||
CharWidths[c] = 5.0f;
|
||||
|
||||
// Override exceptions
|
||||
CharWidths[' '] = 3.0f;
|
||||
CharWidths['!'] = 1.0f;
|
||||
CharWidths['"'] = 3.0f;
|
||||
|
||||
@@ -28,7 +28,6 @@ public class GuiBatcher
|
||||
|
||||
public void DrawQuad(float x, float y, float w, float h, Vector4 uv, Vector4 color)
|
||||
{
|
||||
// Two triangles (Standard Minecraft Blit)
|
||||
_vertices.Add(new UiVertex(x, y, uv.X, uv.Y, color)); // TL
|
||||
_vertices.Add(new UiVertex(x + w, y, uv.Z, uv.Y, color)); // TR
|
||||
_vertices.Add(new UiVertex(x, y + h, uv.X, uv.W, color)); // BL
|
||||
|
||||
@@ -13,6 +13,9 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="Assets\ascii.png">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Assets\atlas.png">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
@@ -22,6 +25,12 @@
|
||||
<None Update="Shaders\shader.vert">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Shaders\ui.frag">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Shaders\ui.vert">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user