SFML community forums
Help => Graphics => Topic started by: Staggy on April 09, 2010, 04:06:56 pm
-
I'm drawing the background for a pacman clone, using a grid of tiles. Each Tile is a basic structure that holds a pointer to a sf::Sprite. My grid at the moment is 28 by 31 - so 868 sprites drawn each frame. The problem is this absolutely murders the framerate, taking it down from about 80 FPS to about 8.
Am I going about this in the right way, or am I missing the point of sf::Sprite? Or is it something else that I should be changing in my approach? This just seems like too big a slowdown when all I'm doing is drawing the background.
-
As usual : It's certainly your main loop that causes this slow down.
Can you put your code here ?
-
Try sfml 2.0. 1.x does a lot of useless state change when drawing sprites.
-
I don't think it's my main loop, as simply commenting out the one line that draws the sprites is enough to get the FPS back up to normal. It all comes down to that one line.
Here's the render code: http://pastebin.com/xw15cqcu
Here's the 'Get': http://pastebin.com/SncrV2zH
-
Do you test performances in release mode (not in debug)?
What graphics card do you have? Are your drivers up to date?
-
Damn, sorry for taking so long to reply. Real life has not been forgiving recently.
I'm on an Acer Aspire 1810TZ (netbook). As far as graphics go, it's got the integrated Mobile Intel 4 Chipset, with 1GB video memory.
-
Damn, sorry for taking so long to reply. Real life has not been forgiving recently.
I'm on an Acer Aspire 1810TZ (netbook). As far as graphics go, it's got the integrated Mobile Intel 4 Chipset, with 1GB video memory.
An integrated chipset on a netbook with 1GB vram?
I know I haven't been shopping for laptops in a while, but are you sure about that?
Last I remember Intel integrated chips had crappy driver support for games, but maybe this is new.
-
How about just post a copy of the complete code and/or binaries so others can test it, and we can determine if its your hardware or your code?
-
An integrated chipset on a netbook with 1GB vram?
That's what I think it says - I might be misreading dxdiag.
How about just post a copy of the complete code and/or binaries so others can test it, and we can determine if its your hardware or your code?
I put it into Release to build it, and the damn thing shot up to about 40 FPS.
Still, if it's worth anything here's the binary AND the source code.
http://rapidshare.com/files/377548276/Test.zip.html
-
An integrated chipset on a netbook with 1GB vram?
Unless I'm mistaken, integrated graphics cards usually use the standard "cpu" ram rather than dedicated video ram.