Renamed handles.
This commit is contained in:
parent
276f429b2f
commit
e2c2b0adc0
@ -1,10 +1,10 @@
|
|||||||
using System;
|
using System;
|
||||||
using OpenTK.Graphics.OpenGL;
|
using OpenTK.Graphics.OpenGL;
|
||||||
namespace RecrownedGTK.Graphics {
|
namespace RecrownedGTK.Graphics {
|
||||||
public class ElementBufferHandle : IDisposable {
|
public class ElementBufferArrayHandle : IDisposable {
|
||||||
private bool disposed;
|
private bool disposed;
|
||||||
private int handle;
|
private int handle;
|
||||||
public ElementBufferHandle() {
|
public ElementBufferArrayHandle() {
|
||||||
handle = GL.GenBuffer();
|
handle = GL.GenBuffer();
|
||||||
}
|
}
|
||||||
public void Bind() {
|
public void Bind() {
|
||||||
@ -34,7 +34,7 @@ namespace RecrownedGTK.Graphics {
|
|||||||
GL.DeleteBuffer(handle);
|
GL.DeleteBuffer(handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
~ElementBufferHandle() {
|
~ElementBufferArrayHandle() {
|
||||||
Dispose(false);
|
Dispose(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -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="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>
|
/// <param name="colorAttribName">The name of the attribute for color mixture. Default is "aColor".</param>
|
||||||
/// <returns>The built <see cref="RecrownedGTK.Graphics.VertexAttributesArrayHandle"/>.</returns>
|
/// <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)) {
|
public static VertexAttributesArrayHandle CreateBasicVA(ref Matrix4 transformMat, Shader shader = null, string positionAttribName = "aPosition", string textureAttribName = "aTexture", string colorAttribName = "aColor", string transformUnifName = "transform") {
|
||||||
if (shader == null) shader = Shader.CreateBasicShader();
|
|
||||||
VertexAttributesArrayHandle vertexAttribs = new VertexAttributesArrayHandle();
|
VertexAttributesArrayHandle vertexAttribs = new VertexAttributesArrayHandle();
|
||||||
vertexAttribs.Bind();
|
vertexAttribs.Bind();
|
||||||
if (transformMat == default(Matrix4)) transformMat = Matrix4.Identity;
|
if (transformMat == default(Matrix4)) transformMat = Matrix4.Identity;
|
||||||
|
Loading…
Reference in New Issue
Block a user