...

Post your FreeBASIC source, examples, tips and tricks here. Please don’t post code without including an explanation.
Post Reply
L_O_J
Posts: 181
Joined: Aug 20, 2005 9:05

...

Post by L_O_J »

Hi I found this accidently while testing my engine, don't know if this work for all ppl tho....

instead of CLS you can replace it with these inside your rendering loop

Code: Select all

#include "crt.bi"
'
'
'
SCREENLOCK
Memset SCREENPTR, 0, w * h * bpp '(1/2/4) depending on BPP
'
' rendering
'
SCREENUNLOCK
here some result of blitting 32x16 sprite to cover the whole screen (20x30=600times)

Average FPS is (sum of 10 sec FPS) / 10

640x480 16
- Fullscreen
Average FPS : 426 Frame - NORMAL CLS WITH 2 PAGE
Average FPS : 534 Frame - CUSTOM 2 PAGE [+108]
Average FPS : 544 Frame - CUSTOM [+118]

- Windowed
Average FPS : 325 Frame - NORMAL CLS WITH 2 PAGE
Average FPS : 436 Frame - CUSTOM 2 PAGE [+111]
Average FPS : 418 Frame - CUSTOM [+93]
DrV
Site Admin
Posts: 2116
Joined: May 27, 2005 18:39
Location: Midwestern USA
Contact:

Post by DrV »

You could also do Line (0, 0)-(w - 1, h - 1), 0, BF... not sure how that would stack up, but I'd guess it's close to using memset.
Z!re

Post by Z!re »

[Content removed at author's request]
Thrawn89
Posts: 477
Joined: Oct 08, 2005 13:12

Post by Thrawn89 »

So, just use Locate 0,0...

Plus that'll give you the option if you even want to reset it or not....depending on speed or algo....with cls, it uses it automatically, which is a waste if you dont need it...


~Thrawn~
Post Reply