SFML community forums
Help => General => Topic started by: bladelock on September 26, 2011, 11:42:58 am
-
Okay, i learned how to initialize an Event through this code
while (Running)
{
sf::Event Event;
while (App.GetEvent(Event))
{
// Process event
}
App.Display();
}
I then became zealous and created 2 events
while (Running)
{
sf::Event Event;
sf::Event Second;
while (App.GetEvent(Event))
{
// Process event
}
while(App.GetEvent(Second))
{
//Process other events
}
App.Display();
}
Then when I run my SFML program, it releases this...
"Run-Time Check Failure #3 - The variable 'Second' is being used without being initialized."
I don't get it. How do I initialize my Event named Second?
Cheers.
-
Whats the point? If you got all events left in the first loop, why would a second event loop work at all? it just skips.
-
what mr devil means is, youre doing it wrong
sf::Event Event;
while(Window.PollEvent(Event)){
// First event here
if(Event.Type == sf::Event::Closed){
Window.Close();
}
// Second event here
if(Event.Type == sf::Event::Other){
Something.Other();
}
}
-
Thanks a lot for the additional answer, i meant it when i said i didnt know what his point was , but that should be it :D
-
i think this solves this particular issue, but it seems like i might have to take on a different approach for this issue
http://www.sfml-dev.org/forum/viewtopic.php?p=39133#39133
thanks for the help!