Ignore:
Timestamp:
Apr 17, 2019, 12:58:41 AM (5 years ago)
Author:
chronos
Message:
  • Modified: Propagate project build mode options to used packages.
  • Added: Check memory leaks using heaptrc.
  • Modified: Update BGRABitmap package.
Location:
GraphicTest
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • GraphicTest

    • Property svn:ignore
      •  

        old new  
        88GraphicTest.lps
        99GraphicTest.dbg
         10heaptrclog.trc
  • GraphicTest/Packages/bgrabitmap/bglvirtualscreen.pas

    r494 r521  
    1616  TBGLElapseEvent = procedure (Sender: TObject; BGLContext: TBGLContext; ElapsedMs: integer) of object;
    1717  TBGLFramesPerSecondEvent = procedure (Sender: TObject; BGLContext: TBGLContext; FramesPerSecond: integer) of object;
     18  TBGLUseContextCallback = procedure (Sender: TObject; BGLContext: TBGLContext; Data: Pointer) of object;
    1819
    1920  { TCustomBGLVirtualScreen }
     
    6061    procedure QueryLoadTextures; virtual;
    6162    procedure UnloadTextures; virtual;
     63    procedure UseContext(ACallback: TBGLUseContextCallback; AData: Pointer = nil);
    6264    constructor Create(TheOwner: TComponent); override;
    6365    destructor Destroy; override;
     
    350352end;
    351353
     354procedure TCustomBGLVirtualScreen.UseContext(ACallback: TBGLUseContextCallback; AData: Pointer);
     355var
     356  ctx: TBGLContext;
     357begin
     358  if not MakeCurrent then
     359    raise exception.Create('Unable to switch to the OpenGL context');
     360  ctx := PrepareBGLContext;
     361  try
     362    ACallback(self, ctx, AData);
     363  finally
     364    ReleaseBGLContext(ctx);
     365  end;
     366end;
     367
    352368procedure TCustomBGLVirtualScreen.RedrawContent(ctx: TBGLContext);
    353369var
Note: See TracChangeset for help on using the changeset viewer.