A background disproportionately consumes CPU

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Milwaukee, WI
Contact:

Re: A background disproportionately consumes CPU

Post by TechnoCat »

When I take out the 3 image calls you have. I get 155FPS. Cool landscape generation.
User avatar
miko
Party member
Posts: 410
Joined: Fri Nov 26, 2010 2:25 pm
Location: PL

Re: A background disproportionately consumes CPU

Post by miko »

Batrachus wrote:Without background image the FPS stabilized on 61. With background image it was less than 1.
Are you sure? I think the problem is that you draw 1000 polygons every frame (and recompute their coordinates).
I am attaching a version which uses a framebuffer, and while not moving, it uses almost no CPU.
Attachments
main.lua
Using framebuffer to reduce CPU load
(2.11 KiB) Downloaded 65 times
My lovely code lives at GitHub: http://github.com/miko/Love2d-samples
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 3 guests