Add a secondary texture coordinate to Vertex.
This commit is contained in:
@@ -81,6 +81,8 @@ namespace OpenRA.Platforms.Default
|
||||
OpenGL.CheckGLError();
|
||||
OpenGL.glEnableVertexAttribArray(Shader.TexCoordAttributeIndex);
|
||||
OpenGL.CheckGLError();
|
||||
OpenGL.glEnableVertexAttribArray(Shader.TexMetadataAttributeIndex);
|
||||
OpenGL.CheckGLError();
|
||||
|
||||
SDL.SDL_SetModState(SDL.SDL_Keymod.KMOD_NONE);
|
||||
input = new Sdl2Input();
|
||||
|
||||
@@ -20,6 +20,7 @@ namespace OpenRA.Platforms.Default
|
||||
{
|
||||
public const int VertexPosAttributeIndex = 0;
|
||||
public const int TexCoordAttributeIndex = 1;
|
||||
public const int TexMetadataAttributeIndex = 2;
|
||||
|
||||
readonly Dictionary<string, int> samplers = new Dictionary<string, int>();
|
||||
readonly Dictionary<int, ITexture> textures = new Dictionary<int, ITexture>();
|
||||
@@ -73,7 +74,8 @@ namespace OpenRA.Platforms.Default
|
||||
OpenGL.CheckGLError();
|
||||
OpenGL.glBindAttribLocation(program, TexCoordAttributeIndex, "aVertexTexCoord");
|
||||
OpenGL.CheckGLError();
|
||||
|
||||
OpenGL.glBindAttribLocation(program, TexMetadataAttributeIndex, "aVertexTexMetadata");
|
||||
OpenGL.CheckGLError();
|
||||
OpenGL.glAttachShader(program, vertexShader);
|
||||
OpenGL.CheckGLError();
|
||||
OpenGL.glAttachShader(program, fragmentShader);
|
||||
|
||||
@@ -87,6 +87,8 @@ namespace OpenRA.Platforms.Default
|
||||
OpenGL.CheckGLError();
|
||||
OpenGL.glVertexAttribPointer(Shader.TexCoordAttributeIndex, 4, OpenGL.GL_FLOAT, false, VertexSize, new IntPtr(12));
|
||||
OpenGL.CheckGLError();
|
||||
OpenGL.glVertexAttribPointer(Shader.TexMetadataAttributeIndex, 2, OpenGL.GL_FLOAT, false, VertexSize, new IntPtr(28));
|
||||
OpenGL.CheckGLError();
|
||||
}
|
||||
|
||||
~VertexBuffer()
|
||||
|
||||
Reference in New Issue
Block a user