Simple test problem

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.
Post Reply
Featzen
Prole
Posts: 7
Joined: Tue Jul 07, 2015 2:14 am

Simple test problem

Post by Featzen »

I made a simple spritebatch draw test and it is stopping windows(7) Window manager everytime i run.
What is wrong?

The test:
Test.love
(79.68 KiB) Downloaded 273 times
User avatar
MadByte
Party member
Posts: 533
Joined: Fri May 03, 2013 6:42 pm
Location: Braunschweig, Germany

Re: Simple test problem

Post by MadByte »

The problem may be your declared spritebatch size of width*height (800x600 = 480k!!) sprites.
-> Try to use smaller values(<1000).
User avatar
slime
Solid Snayke
Posts: 3166
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Simple test problem

Post by slime »

That's one part of the issue, although you don't need to limit the max number of items in a sprite batch to < 1000, even tens of thousands is fine.

The main reason your system slows down is the code draws the entire 832x896 spritesheet overlapped on itself about 3,000 (52 * 56) times, since the code doesn't use any Quads so each batch:add call makes it draw the entire spritesheet.

Even though it's all done in a single draw call because a SpriteBatch is used, the GPU still has to blend everything together. It's effectively trying to process 800*600*1000 (or so) pixels every frame, which is way more than low end GPUs are designed to handle and prevents the GPU from being used to render the rest of the OS in a timely manner.
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 7 guests