Page 2 of 2

Re: Realtime visual benchmark (VBL & Rasterlines)

Posted: Tue Feb 07, 2017 11:26 am
by djes
Thanks to fig (in this topic http://www.purebasic.fr/english/viewtop ... 57#p502057), modified to compile both on x86 and x64

Re: Realtime visual benchmark (VBL & Rasterlines)

Posted: Tue Feb 07, 2017 5:13 pm
by #NULL
thank you, very interesting. i didn't know they measured instruction time in pixels but it makes sense.

Re: Realtime visual benchmark (VBL & Rasterlines)

Posted: Wed Feb 08, 2017 6:53 am
by kvitaliy
Insert the code to display the current FPS:

Code: Select all

;---- BENCHMARK END
 
  StartDrawing(ScreenOutput())
     ;************** for FPS************
      FrameCounter + 1
      Now = GetTickCount_() ; possible replacement ElapsedMilliseconds() ?
      If (Now-Ticks) > 999
        Ticks = Now
        FramePerSec.s = "FPS: " + Str( FrameCounter )
        FrameCounter = 0
      EndIf
     DrawText(2,2, FramePerSec )
     ;**************************************
  DrawingMode(#PB_2DDrawing_Transparent)

Re: Realtime visual benchmark (VBL & Rasterlines)

Posted: Wed Feb 08, 2017 7:45 pm
by Damion12
I get, when using 32 or 64, 5.60 beta2 or not; an invalid memory access at line 71:

Code: Select all

CreateSprint(0, 64, 64)

Re: Realtime visual benchmark (VBL & Rasterlines)

Posted: Thu Feb 09, 2017 11:33 am
by djes
kvitaliy wrote:Insert the code to display the current FPS:

Code: Select all

;---- BENCHMARK END
 
  StartDrawing(ScreenOutput())
     ;************** for FPS************
      FrameCounter + 1
      Now = GetTickCount_() ; possible replacement ElapsedMilliseconds() ?
      If (Now-Ticks) > 999
        Ticks = Now
        FramePerSec.s = "FPS: " + Str( FrameCounter )
        FrameCounter = 0
      EndIf
     DrawText(2,2, FramePerSec )
     ;**************************************
  DrawingMode(#PB_2DDrawing_Transparent)
Thank you ! I've implemented it with ElapsedMilliseconds().
Damion12 wrote:I get, when using 32 or 64, 5.60 beta2 or not; an invalid memory access at line 71:

Code: Select all

CreateSprint(0, 64, 64)
I've downloaded and tested it with 5.60 beta3 and I have no problem. The CreateSprite() should work, it's not a hack, like are some other parts of the code. Do you have tested with debugger enabled ? What is your configuration ?

Re: Realtime visual benchmark (VBL & Rasterlines)

Posted: Thu Feb 09, 2017 7:02 pm
by Damion12
djes wrote: Do you have tested with debugger enabled ? What is your configuration ?
well that is weird, I used the external debugger & it ran! weird. I'll try reinstalling pb.