Results 1 to 3 of 3

Thread: About TCustomLockableTexture.Lock

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    About TCustomLockableTexture.Lock

    function Lock(out Surface: TPixelSurface): Boolean; overload; inline;
    ---------------------------------------------------------------------------------------------------------------------
    Code:
    procedure TForm1.CacheTexture(const ATexture: TCustomLockableTexture);
    var
      LSurface: TPixelSurface;
    begin
      if not ATexture.Lock(LSurface) then       //The code is optimized off the mobile platform   TPixelSurface is a TObject?
      begin
        ShowMessage('lock failed');
        Exit;
      end else
        ShowMessage('lock success');
      //
      try
         if LSurface = nil then
            ShowMessage('surface is null');
      finally
         ATexture.Unlock;
      end;
    end;
    ----------print----------
    --surface is null
    --lock success
    Last edited by devchenxip; 06-12-2018 at 11:40 AM. Reason: format

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •