SFML community forums

Help => Audio => Topic started by: orgos on August 27, 2010, 03:03:27 pm

Title: Rare behavior
Post by: orgos on August 27, 2010, 03:03:27 pm
Hi.

Making some test with SFML 2 we found some rare behavior using soundbuffer.

When we make a soundbuffer declaration the program not return 0 at the end, it return some negative number.

Just making this:

Code: [Select]

int main()
{
    // Create the main rendering window
    sf::RenderWindow App(sf::VideoMode(800, 600, 32), "SFML Graphics");
   
    sf::SoundBuffer mySound;

    // Start game loop
    while (App.IsOpened())
    {

        // Process events
        sf::Event Event;
        while (App.GetEvent(Event))
        {
            // Close window : exit
            if (Event.Type == sf::Event::Closed)
                App.Close();
        }

        // Clear the screen (fill it with black color)
        App.Clear();

        // Display window contents on screen
        App.Display();
    }

    return EXIT_SUCCESS;
}



I test it on Windows XP Sp3 32bits, Windows 7 32bits, using Codeblock and GCC compiler.
Title: Rare behavior
Post by: Laurent on August 27, 2010, 03:26:10 pm
Does it crash? Or does it always ends when you close the window?
Title: Rare behavior
Post by: orgos on August 27, 2010, 03:35:59 pm
It does when I normal close the window.
Title: Rare behavior
Post by: Laurent on August 27, 2010, 03:59:40 pm
So what's the problem? Just ignore the return value :D
Title: Rare behavior
Post by: orgos on August 27, 2010, 04:06:54 pm
We think that can be a problem releasing some thing, so we decide to report it.

So its a normal behavior?
Title: Rare behavior
Post by: Laurent on August 27, 2010, 04:23:25 pm
No it isn't normal. If the return value is not 0, then obviously the application returns before the "return EXIT_SUCCESS" statement, which means that it crashes.

Have you tried running the debugger?