Renamed handles.

This commit is contained in:
Harrison Deng 2020-02-22 14:41:44 -05:00
parent 276f429b2f
commit e2c2b0adc0
2 changed files with 4 additions and 5 deletions

View File

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

View File

@ -23,8 +23,7 @@ namespace RecrownedGTK.Graphics {
/// <param name="textureAttribName">The name of the attribute for the texture's coordinate. Default is "aTexture".</param>
/// <param name="colorAttribName">The name of the attribute for color mixture. Default is "aColor".</param>
/// <returns>The built <see cref="RecrownedGTK.Graphics.VertexAttributesArrayHandle"/>.</returns>
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;