Realtime visual benchmark (VBL & Rasterlines)

Share your advanced PureBasic knowledge/code with the community.
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Re: Realtime visual benchmark (VBL & Rasterlines)

Post by djes »

Thanks to fig (in this topic http://www.purebasic.fr/english/viewtop ... 57#p502057), modified to compile both on x86 and x64
#NULL
Addict
Addict
Posts: 1497
Joined: Thu Aug 30, 2007 11:54 pm
Location: right here

Re: Realtime visual benchmark (VBL & Rasterlines)

Post by #NULL »

thank you, very interesting. i didn't know they measured instruction time in pixels but it makes sense.
kvitaliy
Enthusiast
Enthusiast
Posts: 162
Joined: Mon May 10, 2010 4:02 pm

Re: Realtime visual benchmark (VBL & Rasterlines)

Post 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)
Damion12
User
User
Posts: 81
Joined: Tue Oct 30, 2012 1:39 am

Re: Realtime visual benchmark (VBL & Rasterlines)

Post 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)
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Re: Realtime visual benchmark (VBL & Rasterlines)

Post 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 ?
Damion12
User
User
Posts: 81
Joined: Tue Oct 30, 2012 1:39 am

Re: Realtime visual benchmark (VBL & Rasterlines)

Post 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.
Post Reply