예제 #1
0
 protected virtual void Dispose(bool disposing)
 {
     if (disposing)
     {
         this.state = null;
     }
     PsmShaderProgram.Delete(this.handle);
     this.handle = 0;
 }
예제 #2
0
 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);
     }
 }