Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / [SOLVED] Box is much faster than dot !

Author
Message
Hannibal
17
Years of Service
User Offline
Joined: 5th Mar 2007
Location:
Posted: 29th Aug 2021 21:46
Regardless of box having two sets of data....

The author of this post has marked a post as an answer.

Go to answer

Seditious
10
Years of Service
User Offline
Joined: 2nd Aug 2013
Location: France
Posted: 31st Aug 2021 14:55
Yes.
2002 - Present
Raven
19
Years of Service
User Offline
Joined: 23rd Mar 2005
Location: Hertfordshire, England
Posted: 1st Sep 2021 01:00


small tweak... a "bit" faster
Hannibal
17
Years of Service
User Offline
Joined: 5th Mar 2007
Location:
Posted: 1st Sep 2021 01:07 Edited at: 1st Sep 2021 01:08
So box makes your DOT obsolete, as in...my BOX is gonna bring your DOT down......

So why even have DOT?

Of course it may be faster to use memblock plots....
Raven
19
Years of Service
User Offline
Joined: 23rd Mar 2005
Location: Hertfordshire, England
Posted: 1st Sep 2021 12:00
The edit doesn't use Memblock Plots... I'm just use a Pixel (Back Buffer) Lock., this allows the Plot and Dot functions to work "As Intended"
Remember these Functions are always DIRECTLY addressing the Back Buffer (Bitmap 0), but without Locking the Memory., these command have to wait until it's "Safe" to access said Memory; this might happen immediately, it might happen 2-3 Cycles later.

When we Lock the Memory., well we're saying "We want exclusive access until we're done..." this allows the Plot and Dot Commands to run, well as fast as they're going to.
There are some faster ways mind... such-as directly addressing the Back Buffer / Bitmap 0., or using a Secondary Buffer and just using the Lock to do a Copy Operation.
Still., the Pixel Lock is the easiest way to gain performance without actually changing much code.

Now keep in mind the other Draw Commands (Line / Box / Circle) will not see any performance increase and won't actually do anything within a Pixel Lock.
Reason for this is because they're using DirectDraw, which instead Draws to a Surface then Draws the Surface to the Back Buffer for you; this by-passes the need to Lock Memory; but they also can't do "Real Time" as it were., they actually draw during the initial Frame Draw; as opposed to when you call the Command.
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 3rd Sep 2021 02:02
I did some drawing functions that write directly to memblocks.
https://forum.thegamecreators.com/thread/207987

I had another thread with a lot more drawing routines but I can't find it. Those didn't have anti-aliasing though like above.
Tiled TMX Importer V.2
XML Parser V.2
Base64 Encoder/Decoder
Purple Token - Free online hi-score database
Legend of Zelda

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
Hannibal
17
Years of Service
User Offline
Joined: 5th Mar 2007
Location:
Posted: 6th Sep 2021 16:10
Excellent, ty Phaelax
Mage
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: Canada
Posted: 14th Sep 2021 01:01
This post has been marked by the post author as the answer.
I have in the past posted about optimizing for performance.
I remember realizing that pasting a picture of a aiming crosshair was faster than drawing it with 2d commands.
You should cut out all 2D commands, INK, Dot, Box, Text all of it. You'll get a speed boost.


Mage's Modular Code - Get awesome UI controls and powerful Bitmap Fonts!
Screen Device Recovery - Stop your apps from crashing when minimized/tabbed/screen locked.
CPU Friendly Frame Limiter - Make your app generate less computer heat + noise, and use less battery life!

Login to post a reply

Server time is: 2024-04-24 09:40:55
Your offset time is: 2024-04-24 09:40:55