public void SetUniformValue(int index, int offset, float value) { int errorCode = PsmShaderProgram.SetUniformValue(this.handle, index, offset, ref value, ShaderUniformType.Float); if (errorCode != 0) { Error.ThrowNativeException(errorCode); } }
public void SetUniformValue(int index, int offset, int[] value) { int errorCode = PsmShaderProgram.SetUniformValue2(this.handle, index, value, ShaderUniformType.Int, offset, 0, -1); if (errorCode != 0) { Error.ThrowNativeException(errorCode); } }
public void SetUniformValue(int index, ref Matrix4 value) { int errorCode = PsmShaderProgram.SetUniformValue(this.handle, index, 0, ref value, ShaderUniformType.Float4x4); if (errorCode != 0) { Error.ThrowNativeException(errorCode); } }
protected virtual void Dispose(bool disposing) { if (disposing) { this.state = null; } PsmShaderProgram.Delete(this.handle); this.handle = 0; }
public void SetAttributeValue(int index, params float[] value) { int errorCode = PsmShaderProgram.SetAttributeValue2(this.handle, index, value); if (errorCode != 0) { Error.ThrowNativeException(errorCode); } GraphicsContext.NotifyUpdate(GraphicsUpdate.VertexBuffer); }
public void SetAttributeStream(int index, int stream) { int errorCode = PsmShaderProgram.SetAttributeStream(this.handle, index, stream); if (errorCode != 0) { Error.ThrowNativeException(errorCode); } GraphicsContext.NotifyUpdate(GraphicsUpdate.VertexBuffer); }
public void SetUniformBinding(int index, string name) { int errorCode = PsmShaderProgram.SetUniformBinding(this.handle, index, name); if (errorCode != 0) { Error.ThrowNativeException(errorCode); } PsmShaderProgram.GetUniformCount(this.handle, out this.state.uniformCount); }
public int GetUniformTexture(int index) { int result; int uniformTexture = PsmShaderProgram.GetUniformTexture(this.handle, index, out result); if (uniformTexture != 0) { Error.ThrowNativeException(uniformTexture); } return(result); }
public string GetAttributeName(int index) { string result; int attributeName = PsmShaderProgram.GetAttributeName(this.handle, index, out result); if (attributeName != 0) { Error.ThrowNativeException(attributeName); } return(result); }
public ShaderAttributeType GetAttributeType(int index) { ShaderAttributeType result; int attributeType = PsmShaderProgram.GetAttributeType(this.handle, index, out result); if (attributeType != 0) { Error.ThrowNativeException(attributeType); } return(result); }
public ShaderUniformType GetUniformType(int index) { ShaderUniformType result; int uniformType = PsmShaderProgram.GetUniformType(this.handle, index, out result); if (uniformType != 0) { Error.ThrowNativeException(uniformType); } return(result); }
public void SetAttributeBinding(int index, string name) { int errorCode = PsmShaderProgram.SetAttributeBinding(this.handle, index, name); if (errorCode != 0) { Error.ThrowNativeException(errorCode); } PsmShaderProgram.GetAttributeCount(this.handle, out this.state.attributeCount); GraphicsContext.NotifyUpdate(GraphicsUpdate.VertexBuffer); }
public string GetUniformBinding(int index) { string uniformBinding; int errorCode = PsmShaderProgram.GetUniformBinding(this.handle, index, out uniformBinding); if (errorCode != 0) { Error.ThrowNativeException(errorCode); } return(uniformBinding); }
public int FindAttribute(string name) { int attribute; int errorCode = PsmShaderProgram.FindAttribute(this.handle, name, out attribute); if (errorCode != 0) { Error.ThrowNativeException(errorCode); } return(attribute); }
public int FindUniform(string name) { int uniform; int errorCode = PsmShaderProgram.FindUniform(this.handle, name, out uniform); if (errorCode != 0) { Error.ThrowNativeException(errorCode); } return(uniform); }
public int GetAttributeStream(int index) { int result; int attributeStream = PsmShaderProgram.GetAttributeStream(this.handle, index, out result); if (attributeStream != 0) { Error.ThrowNativeException(attributeStream); } return(result); }
protected ShaderProgram(ShaderProgram program) { int errorCode = PsmShaderProgram.AddRef(program.handle); if (errorCode != 0) { Error.ThrowNativeException(errorCode); } this.handle = program.handle; this.state = program.state; }
public ShaderProgram(byte[] vpFileImage, byte[] fpFileImage, ShaderProgramOption option) { string[] constKeys = ShaderProgram.GetConstKeys(option); int[] constVals = ShaderProgram.GetConstVals(option); int errorCode = PsmShaderProgram.FromImage(vpFileImage, fpFileImage, constKeys, constVals, out this.handle); if (errorCode != 0) { Error.ThrowNativeException(errorCode); } this.state = new ShaderProgramState(this.handle); }
public void SetUniformValue(int index, int[] value, int to, int from, int count) { if (count < 0) { count = int.MaxValue; } int errorCode = PsmShaderProgram.SetUniformValue2(this.handle, index, value, ShaderUniformType.Int, to, from, count); if (errorCode != 0) { Error.ThrowNativeException(errorCode); } }
protected void SwapShader(ShaderProgram program) { if (program.handle != this.handle) { int errorCode = PsmShaderProgram.AddRef(program.handle); if (errorCode != 0) { Error.ThrowNativeException(errorCode); } PsmShaderProgram.Delete(this.handle); this.handle = program.handle; this.state = program.state; GraphicsContext.NotifyUpdate(GraphicsUpdate.ShaderProgram); } }
public ShaderProgramState(int handle) { PsmShaderProgram.GetUniformCount(handle, out this.uniformCount); PsmShaderProgram.GetAttributeCount(handle, out this.attributeCount); }