コード例 #1
0
        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);
        }
コード例 #2
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);
        }
コード例 #3
0
        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);
        }
コード例 #4
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);
     }
 }
コード例 #5
0
ファイル: FrameBuffer.cs プロジェクト: OpenPSS/PssIL
        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);
        }