Introduce float3 type.

This commit is contained in:
Paul Chote
2016-04-04 16:07:08 -04:00
parent aac4820ac7
commit a8dda39a72
7 changed files with 93 additions and 2 deletions

View File

@@ -215,6 +215,9 @@ namespace OpenRA.Platforms.Default
public delegate void Uniform2f(int location, float v0, float v1);
public static Uniform2f glUniform2f { get; private set; }
public delegate void Uniform3f(int location, float v0, float v1, float v2);
public static Uniform3f glUniform3f { get; private set; }
public delegate void Uniform1fv(int location, int count, IntPtr value);
public static Uniform1fv glUniform1fv { get; private set; }
@@ -395,6 +398,7 @@ namespace OpenRA.Platforms.Default
glUniform1i = Bind<Uniform1i>("glUniform1i");
glUniform1f = Bind<Uniform1f>("glUniform1f");
glUniform2f = Bind<Uniform2f>("glUniform2f");
glUniform3f = Bind<Uniform3f>("glUniform3f");
glUniform1fv = Bind<Uniform1fv>("glUniform1fv");
glUniform2fv = Bind<Uniform2fv>("glUniform2fv");
glUniform3fv = Bind<Uniform3fv>("glUniform3fv");

View File

@@ -189,6 +189,17 @@ namespace OpenRA.Platforms.Default
OpenGL.CheckGLError();
}
public void SetVec(string name, float x, float y, float z)
{
VerifyThreadAffinity();
OpenGL.glUseProgram(program);
OpenGL.CheckGLError();
var param = OpenGL.glGetUniformLocation(program, name);
OpenGL.CheckGLError();
OpenGL.glUniform3f(param, x, y, z);
OpenGL.CheckGLError();
}
public void SetVec(string name, float[] vec, int length)
{
VerifyThreadAffinity();