Пример #1
0
        protected ShaderProgram(ShaderProgram program)
        {
            int errorCode = PsmShaderProgram.AddRef(program.handle);

            if (errorCode != 0)
            {
                Error.ThrowNativeException(errorCode);
            }
            this.handle = program.handle;
            this.state  = program.state;
        }
Пример #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);
     }
 }