style: apply code-style cleanup (explicit types, this-qualification, switch expressions)

This commit is contained in:
2026-05-28 13:29:13 +02:00
parent 8e3195ca37
commit 70c986529b
9 changed files with 110 additions and 102 deletions

View File

@@ -12,14 +12,14 @@ public sealed class ChunkRenderer : IDisposable
public ChunkRenderer(float[] vertices)
{
_vertexCount = vertices.Length / FloatsPerVertex;
int stride = FloatsPerVertex * sizeof(float);
this._vertexCount = vertices.Length / ChunkRenderer.FloatsPerVertex;
int stride = ChunkRenderer.FloatsPerVertex * sizeof(float);
_vao = GL.GenVertexArray();
GL.BindVertexArray(_vao);
this._vao = GL.GenVertexArray();
GL.BindVertexArray(this._vao);
_vbo = GL.GenBuffer();
GL.BindBuffer(BufferTarget.ArrayBuffer, _vbo);
this._vbo = GL.GenBuffer();
GL.BindBuffer(BufferTarget.ArrayBuffer, this._vbo);
GL.BufferData(BufferTarget.ArrayBuffer, vertices.Length * sizeof(float), vertices, BufferUsageHint.StaticDraw);
// location 0: position (vec3) at offset 0
@@ -39,14 +39,14 @@ public sealed class ChunkRenderer : IDisposable
public void Draw()
{
GL.BindVertexArray(_vao);
GL.DrawArrays(PrimitiveType.Triangles, 0, _vertexCount);
GL.BindVertexArray(this._vao);
GL.DrawArrays(PrimitiveType.Triangles, 0, this._vertexCount);
GL.BindVertexArray(0);
}
public void Dispose()
{
GL.DeleteBuffer(_vbo);
GL.DeleteVertexArray(_vao);
GL.DeleteBuffer(this._vbo);
GL.DeleteVertexArray(this._vao);
}
}