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

Author Topic: Windows/SFML bad at handling many images at once?  (Read 3738 times)

0 Members and 1 Guest are viewing this topic.

Skomakar'n

  • Newbie
  • *
  • Posts: 25
    • View Profile
Windows/SFML bad at handling many images at once?
« 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:



In OS X:



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.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Windows/SFML bad at handling many images at once?
« Reply #1 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.
Laurent Gomila - SFML developer

Skomakar'n

  • Newbie
  • *
  • Posts: 25
    • View Profile
Windows/SFML bad at handling many images at once?
« Reply #2 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...

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
Windows/SFML bad at handling many images at once?
« Reply #3 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.
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

Skomakar'n

  • Newbie
  • *
  • Posts: 25
    • View Profile
Windows/SFML bad at handling many images at once?
« Reply #4 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.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Windows/SFML bad at handling many images at once?
« Reply #5 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.
Laurent Gomila - SFML developer

Skomakar'n

  • Newbie
  • *
  • Posts: 25
    • View Profile
Windows/SFML bad at handling many images at once?
« Reply #6 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)...

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Windows/SFML bad at handling many images at once?
« Reply #7 on: December 06, 2010, 06:55:31 pm »
Have you tried disabling Compiz to see if it makes any difference?
Laurent Gomila - SFML developer