UnityEngine.RenderTexture.MarkRestoreExpected C# (CSharp) Method

MarkRestoreExpected() public method

Indicate that there's a RenderTexture restore operation expected.

public MarkRestoreExpected ( ) : void
return void
        public void MarkRestoreExpected()
        {
            INTERNAL_CALL_MarkRestoreExpected(this);
        }

Usage Example

Example #1
0
    void PaintTexture(RenderTexture _canvas, Material _brush, float _size, float _posX, float _posY)
    {
        Debug.Log (string.Format("_size = {0}, _posX = {1}, _posY = {2}",_size,_posX,_posY));

        float halfSize = _size / 2F;

        _canvas.MarkRestoreExpected ();
        Graphics.SetRenderTarget(_canvas);

        GL.PushMatrix();

        _brush.SetPass (0);

        GL.LoadOrtho();

        GL.Begin(GL.QUADS);

        GL.TexCoord(new Vector3(0, 0, 0));
        GL.Vertex3(_posX - halfSize, _posY - halfSize, 0);

        GL.TexCoord(new Vector3(0, 1, 0));
        GL.Vertex3(_posX - halfSize, _posY + halfSize, 0);

        GL.TexCoord(new Vector3(1, 1, 0));
        GL.Vertex3(_posX + halfSize, _posY + halfSize, 0);

        GL.TexCoord(new Vector3(1, 0, 0));
        GL.Vertex3(_posX + halfSize, _posY - halfSize, 0);

        GL.End();

        GL.PopMatrix();

        Graphics.SetRenderTarget(null);
    }
All Usage Examples Of UnityEngine.RenderTexture::MarkRestoreExpected