protected ShaderProgram(ShaderProgram program) { int errorCode = PsmShaderProgram.AddRef(program.handle); if (errorCode != 0) { Error.ThrowNativeException(errorCode); } this.handle = program.handle; this.state = program.state; }
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); } }