Drawing a large number of individual pixels per frame
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Drawing a large number of individual pixels per frame
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.
- slime
- Solid Snayke
- Posts: 3166
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Drawing a large number of individual pixels per frame
Having any sort of draw calls in another thread is a really bad idea in LÖVE, if that's what you're suggesting.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.
Re: Drawing a large number of individual pixels per frame
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().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?
My lovely code lives at GitHub: http://github.com/miko/Love2d-samples
Re: Drawing a large number of individual pixels per frame
The main issue here is really that drawing a large number of individual pixels per frame is a bad idea in itself
My game called Hat Cat and the Obvious Crimes Against the Fundamental Laws of Physics is out now!
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 2 guests