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 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 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); }
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 void SetDepthTarget(RenderTarget target) { int depthBuffer = (target.Buffer == null) ? 0 : target.Buffer.handle; int status; int errorCode = PsmFrameBuffer.SetDepthTarget(this.handle, depthBuffer, target.Level, target.CubeFace, out status); if (errorCode != 0) { Error.ThrowNativeException(errorCode); } this.state.depthTarget = target; this.state.status = (status != 0); this.state.Update(); GraphicsContext.NotifyUpdate(GraphicsUpdate.FrameBuffer); }