Changeset 451 for GraphicTest
- Timestamp:
- Nov 23, 2012, 2:09:49 PM (12 years ago)
- Location:
- GraphicTest
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
GraphicTest/Methods/UOpenGLMethod.pas
r447 r451 9 9 {$IFDEF opengl}, GL, GLExt, OpenGLContext{$ENDIF}; 10 10 11 {$IFDEF opengl} 11 12 type 12 {$IFDEF opengl}13 13 { TOpenGLMethod } 14 14 … … 23 23 implementation 24 24 25 {$IFDEF opengl} 25 26 { TOpenGLMethod } 26 27 … … 96 97 end; 97 98 99 {$ENDIF} 98 100 99 101 end. -
GraphicTest/Methods/UOpenGLPBOMethod.pas
r447 r451 9 9 {$IFDEF opengl}, GL, GLExt, OpenGLContext{$ENDIF}; 10 10 11 {$IFDEF opengl} 11 12 type 12 {$IFDEF opengl}13 13 { TOpenGLPBOMethod } 14 14 -
GraphicTest/UDrawMethod.pas
r449 r451 30 30 FrameCounter: Integer; 31 31 FrameCounterStart: TDateTime; 32 FrameCounterStop: TDateTime; 32 33 function GetFPS: Real; 33 34 property FPS: Real read FFPS write FFPS; … … 180 181 181 182 function TDrawMethod.GetFPS: Real; 182 begin 183 Result := FrameCounter / ((NowPrecise - FrameCounterStart) / OneSecond); 184 FrameCounter := 0; 185 FrameCounterStart := NowPrecise; 183 var 184 StopTime: TDateTime; 185 begin 186 if FrameCounterStop <> 0 then StopTime := FrameCounterStop 187 else StopTime := NowPrecise; 188 if FrameCounter > 0 then begin 189 Result := FrameCounter / ((StopTime - FrameCounterStart) / OneSecond); 190 //FrameCounter := 0; 191 //FrameCounterStart := NowPrecise; 192 end else Result := FFPS; 186 193 end; 187 194 -
GraphicTest/UMainForm.lfm
r450 r451 13 13 LCLVersion = '1.1' 14 14 object PageControl1: TPageControl 15 Left = 55515 Left = 459 16 16 Height = 411 17 17 Top = 0 18 Width = 3 0218 Width = 398 19 19 ActivePage = TabSheet1 20 20 Align = alRight … … 24 24 Caption = 'Description' 25 25 ClientHeight = 385 26 ClientWidth = 29426 ClientWidth = 390 27 27 object Memo1: TMemo 28 28 Left = 0 29 29 Height = 385 30 30 Top = 0 31 Width = 29431 Width = 390 32 32 Align = alClient 33 33 ReadOnly = True … … 526 526 Height = 411 527 527 Top = 0 528 Width = 550528 Width = 454 529 529 Align = alClient 530 530 BevelOuter = bvNone 531 531 ClientHeight = 411 532 ClientWidth = 550532 ClientWidth = 454 533 533 TabOrder = 1 534 534 object ListViewMethods: TListView … … 536 536 Height = 335 537 537 Top = 8 538 Width = 539538 Width = 443 539 539 Anchors = [akTop, akLeft, akRight, akBottom] 540 540 Columns = < … … 545 545 item 546 546 Caption = 'FPS' 547 Width = 75 547 548 end 548 549 item 549 Caption = 'Duration custom draw[ms]'550 Caption = 'Duration [ms]' 550 551 Width = 80 551 552 end … … 555 556 end 556 557 item 557 Caption = 'D uration step[ms]'558 Caption = 'Draw duration [ms]' 558 559 Width = 80 559 560 end … … 561 562 Caption = 'Step FPS' 562 563 Width = 75 564 end 565 item 566 Caption = 'Step duration [ms]' 567 Width = 80 563 568 end> 564 569 OwnerData = True … … 631 636 end 632 637 object SpinEditWidth: TSpinEdit 633 Left = 2 19638 Left = 204 634 639 Height = 21 635 640 Top = 382 … … 642 647 end 643 648 object SpinEditHeight: TSpinEdit 644 Left = 2 88649 Left = 273 645 650 Height = 21 646 651 Top = 382 … … 653 658 end 654 659 object Label3: TLabel 655 Left = 1 84660 Left = 169 656 661 Height = 13 657 662 Top = 387 … … 662 667 end 663 668 object Label4: TLabel 664 Left = 2 80669 Left = 265 665 670 Height = 13 666 671 Top = 386 … … 671 676 end 672 677 object CheckBoxDoubleBuffered: TCheckBox 673 Left = 408678 Left = 336 674 679 Height = 17 675 680 Top = 350 … … 681 686 end 682 687 object CheckBoxEraseBackground: TCheckBox 683 Left = 408688 Left = 336 684 689 Height = 17 685 690 Top = 367 … … 691 696 end 692 697 object CheckBox1: TCheckBox 693 Left = 408698 Left = 336 694 699 Height = 17 695 700 Top = 387 … … 702 707 end 703 708 object Splitter1: TSplitter 704 Left = 550709 Left = 454 705 710 Height = 411 706 711 Top = 0 -
GraphicTest/UMainForm.pas
r450 r451 130 130 StartTime := NowPrecise; 131 131 FrameCounterStart := NowPrecise; 132 FrameCounterStop := 0; 132 133 FrameCounter := 0; 133 134 repeat … … 140 141 until TestTerminated or 141 142 ((TestTimeout > 0) and ((NowPrecise - StartTime) > OneSecond * TestTimeout)); 142 FPS := GetFPS; 143 FrameCounterStop := NowPrecise; 144 //FPS := GetFPS; 143 145 Done; 144 146 end; … … 157 159 TestMethod(TDrawMethod(DrawMethods[MethodIndex])); 158 160 finally 159 TimerUpdateList.Enabled := False;161 //TimerUpdateList.Enabled := False; 160 162 SingleTestActive := False; 161 163 UpdateInterface; … … 234 236 with TDrawMethod(DrawMethods[Item.Index]) do begin 235 237 Item.Caption := Caption; 238 FPS := GetFPS; 236 239 Item.SubItems.Add(FloatToStr(RoundTo(FPS, -3))); 237 Item.SubItems.Add(FloatToStr(RoundTo(FrameDuration / OneMillisecond, -3))); 240 if FPS > 0 then 241 Item.SubItems.Add(FloatToStr(RoundTo(1 / FPS * 1000, -3))) 242 else Item.SubItems.Add('0'); 238 243 if FrameDuration > 0 then 239 244 Item.SubItems.Add(FloatToStr(RoundTo(1 / (FrameDuration / OneSecond), -3))) 240 245 else Item.SubItems.Add('0'); 241 Item.SubItems.Add(FloatToStr(RoundTo( StepDuration / OneMillisecond, -3)));246 Item.SubItems.Add(FloatToStr(RoundTo(FrameDuration / OneMillisecond, -3))); 242 247 if FrameDuration > 0 then 243 248 Item.SubItems.Add(FloatToStr(RoundTo(1 / (StepDuration / OneSecond), -3))) 244 249 else Item.SubItems.Add('0'); 250 Item.SubItems.Add(FloatToStr(RoundTo(StepDuration / OneMillisecond, -3))); 245 251 end; 246 252 end;
Note:
See TracChangeset
for help on using the changeset viewer.