Page 3 of 3

Re: Drawing a large number of individual pixels per frame

Posted: Thu Aug 18, 2011 7:18 am
by tsturzl
This wouldn't draw it any faster, but you could see it calculated in real time. Use threading to make a thread that draws the map out, and as you go you can see the progress, and this can all be done without sacrificing FPS because all the processing is done outside the main loop.

Re: Drawing a large number of individual pixels per frame

Posted: Thu Aug 18, 2011 5:07 pm
by slime
tsturzl wrote:This wouldn't draw it any faster, but you could see it calculated in real time. Use threading to make a thread that draws the map out, and as you go you can see the progress, and this can all be done without sacrificing FPS because all the processing is done outside the main loop.
Having any sort of draw calls in another thread is a really bad idea in LÖVE, if that's what you're suggesting.

Re: Drawing a large number of individual pixels per frame

Posted: Mon Aug 29, 2011 10:57 am
by miko
kefka wrote: So far its looking like to me like the best way to go about doing this would be maintaining an ImageData object and calling setPixel when i want to update a tile coordinate?

Thoughts?
You could speed it up by setting more than one pixel at once. For example, if you know that some rectangle area (or a line, which is a rectangle with width/height of 1 pixel) will have the same color, you could use ImageData:paste().

Re: Drawing a large number of individual pixels per frame

Posted: Tue Aug 30, 2011 12:42 pm
by T-Bone
The main issue here is really that drawing a large number of individual pixels per frame is a bad idea in itself :neko: