Author Topic: Code, Y U Run So Slow?  (Read 3078 times)

0 Members and 1 Guest are viewing this topic.

Offline valis

  • C= 64
  • **
  • Posts: 35
  • Karma: -6
    • View Profile
Code, Y U Run So Slow?
« 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.

« Last Edit: January 28, 2011 by valis »

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: Code, Y U Run So Slow?
« Reply #1 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
Challenge Trophies Won: