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

Author Topic: Draw taking a lot of CPU time...  (Read 1923 times)

0 Members and 1 Guest are viewing this topic.

slotdev

  • Sr. Member
  • ****
  • Posts: 385
    • View Profile
Draw taking a lot of CPU time...
« on: July 13, 2011, 11:16:38 pm »
Hi

So I have 2 windows running at 1280x1024, I am blitting two full screens with an additional 10 or so smaller rectangles.

I have done some measurements, and at 30fps, of every second, rendering takes up ~450ms (45%) of the time, which sounds like quite a lot to me.

This means I see around 25% to 30% CPU usage - not good on quite a high spec laptop (well, Core i3 2.1Ghz with a 1GB NVIDIA GeForce 310M).

Any ideas what I can do to reduce this?

Thanks

Edit: I originally said 512mb VRAM, I have 1GB infact. I do have a very old driver - updating now - will re-post once it's tested.
SFML 2.1

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Draw taking a lot of CPU time...
« Reply #1 on: July 14, 2011, 12:16:35 am »
Use vertical sync or set the framerate limit. Take a look at the sf::RenderWindow documentation for this purpose.

Hm, but do you really only get 30 FPS? Can you show some minimal and complete code? What about the samples provided in the SFML SDK?
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

 

anything