VertexAttributesHandle doc updated; Made texture coordinates non-normal.

This commit is contained in:
Harrison Deng 2020-02-17 02:30:50 -05:00
parent 0cee4c3ffe
commit e58af8ce56

View File

@ -23,6 +23,7 @@ namespace RecrownedGTK.Graphics {
/// <summary>
/// Creates a basic vertex attributes object handle that takes in vertices, texture coordinates, and a color.
/// First 3 values are normalized vertex position (x, y, z), second two are texture coordinates, and last 4 are color values.
/// </summary>
/// <param name="shader">The shader program used. Default is the one created from <see cref="RecrownedGTK.Graphics.Render.Shader.Shader.CreateBasicShader"/>.</param>
/// <param name="positionAttribName">The name of the attribute for the vertex's position in the shader. Default is "aPosition".</param>
@ -33,7 +34,7 @@ namespace RecrownedGTK.Graphics {
if (shader == null) shader = Shader.CreateBasicShader();
VertexAttributesHandle vertexAttribs = new VertexAttributesHandle();
GL.VertexAttribPointer(shader.GetAttribLocation(positionAttribName), 3, VertexAttribPointerType.Float, false, 9 * sizeof(float), 0);
GL.VertexAttribPointer(shader.GetAttribLocation(textureAttribName), 2, VertexAttribPointerType.Float, false, 9 * sizeof(float), 3 * sizeof(float));
GL.VertexAttribPointer(shader.GetAttribLocation(textureAttribName), 2, VertexAttribPointerType.Float, true, 9 * sizeof(float), 3 * sizeof(float));
GL.VertexAttribPointer(shader.GetAttribLocation(colorAttribName), 4, VertexAttribPointerType.Float, false, 9 * sizeof(float), 5 * sizeof(float));
vertexAttribs.End();
return vertexAttribs;