Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Drop in FPS after using draw() on two or more sprites  (Read 1090 times)

0 Members and 2 Guests are viewing this topic.

Racktash

  • Newbie
  • *
  • Posts: 2
    • View Profile
Drop in FPS after using draw() on two or more sprites
« on: December 23, 2012, 09:56:50 pm »
Hello,

First of all, I'm finding SFML to be an excellent API -- but I seem to be having FPS / performance issues.

FPS is fine (60) when drawing one sprite -- adding another sprite reduces it to about 50, another sprite reduces it again and so on and so on.

The relevant code:-

Declaration of Texture and Sprite:

static Texture platformTexture;
static Sprite platformSprite;

Drawing:-

window->draw(platformSprite);

I'm using SFML 2 and am on 64-bit Windows 8.

Thanks in advance!



Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Drop in FPS after using draw() on two or more sprites
« Reply #1 on: December 23, 2012, 10:04:26 pm »
Please show us a minimal and complete code.

Why are your objects static? That's usually a mistake.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Racktash

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Drop in FPS after using draw() on two or more sprites
« Reply #2 on: December 23, 2012, 11:10:33 pm »
Figured it out, and I feel like a bit of an idiot.

Update my GFX drivers (hadn't updated since changing OS) and that fixed it -- running perfectly with 60FPS. Regarding the 'static' declaration -- it was just a temporary set up to handle textures and sprites across multiple methods.

Thanks for the response.