Hello.
I am using TGUI v0.6.5 compiled as shared lib on windows 7 - MinGW.
My IDE is QtCreator and i' m using Qt in conjunction with SFML & TGUI.
I have 3 classes, 1 is pure virtual "GameState", 2 is the "GameWindow" with the sf::RenderWindow and the sf::Event and 3 is a state( the login screen in this situation ) called "LoginScreen" which is inheriting from "GameState".
I create a GameState pointer(currentState) and assign a new LoginScreen object on it.
Then in the GameWindow main loop i call currentState->HandleEvents, HandleLogic etc.
In my LoginScreen class i have 2 variables passed by reference, the sf::RenderWindow
and the sf::Event
so all the events on the main window are passed to the LoginScreen. The program crashes when there is a new event on the window at the myGUI->handleEvent(*LoginEvent);
This is my LoginScreen::HandleEvent():
void LoginScreen::HandleEvents()
{
while( LoginWindow->pollEvent(*LoginEvent) )
{
if (LoginEvent->type == sf::Event::Closed)
LoginWindow->close();
myGUI->handleEvent(*LoginEvent); <- This is where the crash occurs, tried with commenting out as well
//QApplication::processEvents();
}
}
I started the debugger but the only thing i get is (??) at function names and one file;
libstdc++6.dll
Like the error is coming from this..
Also, before i implemented the state machine and had only 1 class
as MainWindow the myGUI->handleEvent(*LoginEvent) was working just fine.
Any ideas?