PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

DrawLine()

Hi,

I was wondering how optimized is DrawLine(). I have a lot of plain lines to draw and I wanted to know if I should write my own function.

Does DrawLine() get/release the buffer on each call?

It might be a good idea to add a DrawLines() function that would take an array of parameters. This way it could be a lot more optimized for drawing lots of lines.

Thanks!

--Eric
If you are drawing to a video surface, you can call LockVideoSurface() before the batch of line drawings. Then GetBuffer() will only be called when you lock the surface.
Otherwise DrawLine is optimized and have three different threads (vertical, horizontal, and other angle).
I presume that works the same for PutPixel operations as well, Johan?
Yes, it's the same for all operations actually...