SFML community forums
Help => Audio => Topic started 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:
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.
-
Does it crash? Or does it always ends when you close the window?
-
It does when I normal close the window.
-
So what's the problem? Just ignore the return value :D
-
We think that can be a problem releasing some thing, so we decide to report it.
So its a normal behavior?
-
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?