SFML community forums
Help => General => Topic started by: mihaineken on July 28, 2013, 08:23:18 pm
-
why the programas whrited in SFML consume lots of resources?
for example even a symple window consumes 40% RAM (I have 4GB).
-
What do you do in your code ?
I just launched a window and code that contains about 50 shapes and it took 0.2-0.3% of 6Gio RAM. (Linux @Ubunu)
-
Well, sf::Texture is a pretty heavy class, but I doubt it would consume that much RAM unless you were attempting to create and draw thousands of them.
-
Well, sf::Texture is a pretty heavy class, but I doubt it would consume that much RAM unless you were attempting to create and draw thousands of them.
Actually, sf::Texture is not heavy not the RAM at all, since textures are stored in VRAM.
-
I'm so sorry
I was totaly wrong.
I was thinking at somethig else when I was whriting the post.
It's not ram that is consuming, is CPU even with the smallest code that open a window.
-
I'm using windows and whrite the code in code::blocks using sfml 2.
-
If you don't do anything, a CPU core will execute the loop at its full capacity.
To reduce CPU load, you have three possibilities, of which I recommend the third:
- sf::RenderWindow::setFramerateLimit()
- sf::sleep() -- manual approach for the framerate limit
- sf::RenderWindow::setVerticalSyncEnabled()
By the way, you can edit your post if you have something to add.
-
yes... I look so silly, like... almost all the time...
thank you very much, you are such a nice people...