Changeset 448 for GraphicTest/UDrawMethod.pas
- Timestamp:
- Nov 22, 2012, 2:45:14 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GraphicTest/UDrawMethod.pas
r447 r448 7 7 uses 8 8 Classes, SysUtils, ExtCtrls, UPlatform, UFastBitmap, Graphics, Controls, 9 LCLType, IntfGraphics, fpImage, GraphType, 9 LCLType, IntfGraphics, fpImage, GraphType, DateUtils, 10 10 LclIntf{$IFDEF opengl}, GL, GLExt, OpenGLContext{$ENDIF}; 11 11 … … 19 19 private 20 20 FControl: TControl; 21 function GetFPS: Real; 21 22 public 22 23 Caption: string; … … 27 28 PaintObject: TPaintObject; 28 29 TempBitmap: TBitmap; 30 FrameCounter: Integer; 31 FrameCounterStart: TDateTime; 32 property FPS: Real read GetFPS; 29 33 procedure Init(Parent: TWinControl; Size: TPoint); virtual; 30 34 procedure Done; virtual; … … 173 177 { TDrawMethod } 174 178 179 function TDrawMethod.GetFPS: Real; 180 begin 181 Result := FrameCounter / ((NowPrecise - FrameCounterStart) / OneSecond); 182 FrameCounter := 0; 183 FrameCounterStart := NowPrecise; 184 end; 185 175 186 procedure TDrawMethod.Init(Parent: TWinControl; Size: TPoint); 176 187 begin
Note:
See TracChangeset
for help on using the changeset viewer.