Dark Bit Factory & Gravity

PROGRAMMING => Other languages => Blitz => Topic started by: valis on January 28, 2011

Title: Code, Y U Run So Slow?
Post by: valis on January 28, 2011
Does this run crawlingly slowly for anyone else or is it just me?

Hint: the problem has nothing to do with the distance function.  Remove the distance check entirely and have it just plot random dots and it will still run at a snail's pace.

Does it have anything to do with the fact that I'm not clearing the buffer every frame?  There is no cls in there...

Code: [Select]
Source removed; not everyone has blitz installed.  Sorry to be a bother
Maybe it's just that it doesn't like to flip the buffer, and that takes some amount of time, therefore "batching" the draws would make things faster.

Edit: Yes, it did.  It just seems very strange to me that the above code would run (for me) at maybe 5 frames per second.  If anything, batched draws run at a grossly higher framerate-- not just a faster fill rate.

Blitz is strange.

Title: Re: Code, Y U Run So Slow?
Post by: Jim on January 28, 2011
Shame you removed the source, I just came on with my laptop to try it :)
I think you might need to call
SetBuffer BackBuffer()
before your main loop, else you end up drawing on the front buffer and flipping it to the back.
Also
sqrt(a)<b is the same as a < b*b, which is a lot faster.

Jim