SFML community forums

Help => Graphics => Topic started by: Skomakar'n on December 05, 2010, 10:27:27 pm

Title: Windows/SFML bad at handling many images at once?
Post by: Skomakar'n on December 05, 2010, 10:27:27 pm
I have made a little particle system for a game, and it works just fine in Linux and on Mac, but in Windows, the graphics of the particles just flicker by, and might not even show up in screen shots. This also holds true for Wine.

This is what it looks like in Linux:

(http://i375.photobucket.com/albums/oo191/Skomakarn/Program/CPP/OpenGL/SFML/charlesLinux.png)

In OS X:

(http://i375.photobucket.com/albums/oo191/Skomakarn/Program/CPP/OpenGL/SFML/kampaviin3.png)

Then, in Windows, no trail of particles is left. They just flicker from the opening of the bottle, and then disappear entirely. Is this an SFML issue? A Windows issue? Because of all of these images being drawn. Not sure what to do any longer.

Well. It's the same image. The same sprite object, which is just moved using SetPosition, and gets its alpha changed using SetColor, and drawn, once for each particle, in a loop, every frame, like so:

Code: [Select]
for (unsigned int i(0); i < particles.size(); ++ i)
 {
    // Move the image accordingly.
    image.getSFMLSprite()->SetPosition(...);
    image.getSFMLSprite()->SetColor(...);

    // Draw the image.
    image.draw(window);
 }


This loop is within a member function of a class of which the image object is a member variable. The datatype is my own Image class, which contains an sf::Image and an sf::Sprite, and its draw() member function simply draws this internal sf::Sprite into the sf::RenderWindow * that is passed to the function.
Title: Windows/SFML bad at handling many images at once?
Post by: Laurent on December 05, 2010, 10:49:12 pm
It's hard to tell without a complete code. You should try to write a minimal code and see if the bug is reproduced. If not, then you'll have to find what's different in your real code.
Title: Windows/SFML bad at handling many images at once?
Post by: Skomakar'n on December 06, 2010, 12:47:09 am
Figured it out myself. Had nothing to do with anything in SFML, so don't worry. No bugs for you to fix. You can remove this thread, if you wish.

Although... Another thing that I guess could be worth mentioning, is the fact that the native linux build seems to run less smoothly than running the Windows build in Wine on the same machine, in the same Linux OS...
Title: Windows/SFML bad at handling many images at once?
Post by: Groogy on December 06, 2010, 01:02:51 am
Quote from: "Skomakar'n"
Figured it out myself. Had nothing to do with anything in SFML, so don't worry. No bugs for you to fix. You can remove this thread, if you wish.

Although... Another thing that I guess could be worth mentioning, is the fact that the native linux build seems run less smooth than running the Windows build in Wine on the same machine, in the same Linux OS...


I would guess that has to do with drivers. While running it under Wine will make everything software rendered but when running natively it will use the graphics drivers which you might miss.

Donno, just guessing.
Title: Windows/SFML bad at handling many images at once?
Post by: Skomakar'n on December 06, 2010, 04:44:55 pm
Quote from: "Groogy"
Quote from: "Skomakar'n"
Figured it out myself. Had nothing to do with anything in SFML, so don't worry. No bugs for you to fix. You can remove this thread, if you wish.

Although... Another thing that I guess could be worth mentioning, is the fact that the native linux build seems run less smooth than running the Windows build in Wine on the same machine, in the same Linux OS...


I would guess that has to do with drivers. While running it under Wine will make everything software rendered but when running natively it will use the graphics drivers which you might miss.

Donno, just guessing.

Is there any list on the minimum requirements for games that use SFML? I would be interested in offering that information with any SFML games I release anyway.
Title: Windows/SFML bad at handling many images at once?
Post by: Laurent on December 06, 2010, 05:41:17 pm
There is no requirement for running a SFML application, except a compliant OpenGL 1.1 implementation (for the graphics module).

Performance-wise, it's entirely up to what your application does.
Title: Windows/SFML bad at handling many images at once?
Post by: Skomakar'n on December 06, 2010, 06:45:18 pm
Quote from: "Laurent"
There is no requirement for running a SFML application, except a compliant OpenGL 1.1 implementation (for the graphics module).

Performance-wise, it's entirely up to what your application does.

Well, it can't be my drivers. Compiz-Fusion and other graphical things run as smoothly as ever. It also seems to me as though the game runs faster than it should on Linux. That things are moving too fast, even though it's all delta time, and it works fine in Windows, Wine and Mac, and the Linux version is also having a harder time keeping the FPS at 60 (I'm using vertical synchronisation)...
Title: Windows/SFML bad at handling many images at once?
Post by: Laurent on December 06, 2010, 06:55:31 pm
Have you tried disabling Compiz to see if it makes any difference?