(it works if you comment it out, right?)
Right.
so you should have a look at what happens inside (in the cleanup function of the previous state, or in the init of the next one). My guess is that the state switch invalidates the window instance.
The clean function of the first state is doing nothing. The init of the second one, creates a circle, just to test.
I don´t know why the window is feeling invalidated. I have a
sf::RenderWindow object and I keep it alive inside my state manager. In the state manager .hpp file I´m doing this
#include <SFML/Graphics/RenderWindow.hpp>
...
public:
sf::RenderWindow &obtVentana () { return miVentana; } //getter
...
private:
sf::RenderWindow miVentana;
So each state must use
#include <SFML/Window/Event.hpp>
Is that wrong?
If I add this to the state manager:
#include <SFML/Window.hpp>
I get another beautiful piece of data from the debugger:
#0 004D5426 std::operator==<sf::Event, sf::Event&, sf::Event*>(__x=..., __y=...) (e:/programacion/mingw/bin/../lib/gcc/mingw32/4.7.0/include/c++/bits/stl_deque.h:250)
#1 004C50CD std::deque<sf::Event, std::allocator<sf::Event> >::empty(this=0x2974d67b) (e:/programacion/mingw/bin/../lib/gcc/mingw32/4.7.0/include/c++/bits/stl_deque.h:1210)
#2 004C50E3 std::queue<sf::Event, std::deque<sf::Event, std::allocator<sf::Event> > >::empty(this=0x2974d67b) (e:/programacion/mingw/bin/../lib/gcc/mingw32/4.7.0/include/c++/bits/stl_queue.h:150)
#3 004BA4AD sf::priv::WindowImpl::popEvent(this=0x2974d677, event=..., block=false) (E:\Programacion\SFML2\src\SFML\Window\WindowImpl.cpp:100)
#4 004B977E sf::Window::pollEvent(this=0x74d226e9, event=...) (E:\Programacion\SFML2\src\SFML\Window\Window.cpp:183)
#5 00401909 ige::Intro::manejarEventos(this=0x82d828) (E:\Programacion\Ratalypsis\IGE-ESTADOS\Intro.cpp:108)
#6 00402673 Implacable::manejarEventos(this=0x28fbf8) (E:\Programacion\Ratalypsis\IGE-ESTADOS\Implacable.cpp:42)
#7 00402510 main() (E:\Programacion\Ratalypsis\main.cpp:24)
It seems I have a serious events problem, but I don´t know how to fix it
What can I do? (I don´t have the money to buy a Unreal Engine licence
)