diff --git a/RecrownedGTK/Graphics/ElementBufferHandle.cs b/RecrownedGTK/Graphics/ElementBufferArrayHandle.cs similarity index 87% rename from RecrownedGTK/Graphics/ElementBufferHandle.cs rename to RecrownedGTK/Graphics/ElementBufferArrayHandle.cs index e1410b0..c0c07fc 100644 --- a/RecrownedGTK/Graphics/ElementBufferHandle.cs +++ b/RecrownedGTK/Graphics/ElementBufferArrayHandle.cs @@ -1,10 +1,10 @@ using System; using OpenTK.Graphics.OpenGL; namespace RecrownedGTK.Graphics { - public class ElementBufferHandle : IDisposable { + public class ElementBufferArrayHandle : IDisposable { private bool disposed; private int handle; - public ElementBufferHandle() { + public ElementBufferArrayHandle() { handle = GL.GenBuffer(); } public void Bind() { @@ -34,7 +34,7 @@ namespace RecrownedGTK.Graphics { GL.DeleteBuffer(handle); } - ~ElementBufferHandle() { + ~ElementBufferArrayHandle() { Dispose(false); } } diff --git a/RecrownedGTK/Graphics/VertexAttributesArrayHandle.cs b/RecrownedGTK/Graphics/VertexAttributesArrayHandle.cs index 785875a..a8fa407 100644 --- a/RecrownedGTK/Graphics/VertexAttributesArrayHandle.cs +++ b/RecrownedGTK/Graphics/VertexAttributesArrayHandle.cs @@ -23,8 +23,7 @@ namespace RecrownedGTK.Graphics { /// The name of the attribute for the texture's coordinate. Default is "aTexture". /// The name of the attribute for color mixture. Default is "aColor". /// The built . - public static VertexAttributesArrayHandle CreateBasicVA(Shader shader = null, string positionAttribName = "aPosition", string textureAttribName = "aTexture", string colorAttribName = "aColor", string transformUnifName = "transform", Matrix4 transformMat = default(Matrix4)) { - if (shader == null) shader = Shader.CreateBasicShader(); + public static VertexAttributesArrayHandle CreateBasicVA(ref Matrix4 transformMat, Shader shader = null, string positionAttribName = "aPosition", string textureAttribName = "aTexture", string colorAttribName = "aColor", string transformUnifName = "transform") { VertexAttributesArrayHandle vertexAttribs = new VertexAttributesArrayHandle(); vertexAttribs.Bind(); if (transformMat == default(Matrix4)) transformMat = Matrix4.Identity;