I made a simple spritebatch draw test and it is stopping windows(7) Window manager everytime i run.
What is wrong?
The test:
Simple test problem
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Simple test problem
The problem may be your declared spritebatch size of width*height (800x600 = 480k!!) sprites.
-> Try to use smaller values(<1000).
-> Try to use smaller values(<1000).
- slime
- Solid Snayke
- Posts: 3166
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Simple test problem
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.
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.
Who is online
Users browsing this forum: Google [Bot] and 7 guests