Hello, I'm writing Application which uses SFML as input system. I use it with Ogre3d engine. The part of creating sfml-window:
size_t mWindowHandle;
ogreWindow->getCustomAttribute("WINDOW", &mWindowHandle);
boost::shared_ptr<sf::Window> = mInputWindow = boost::shared_ptr<sf::Window>( new sf::Window(mWindowHandle) );
And in global update cycle:
sf::Event localEvent;
while(mInputWindow->GetEvent(localEvent))
{
using namespace Engine::Events;
sf::Event::EventType type = localEvent.Type;
if (type == sf::Event::MouseButtonPressed) { cout << "Mouse bbutton pressed!"; }
else if (type == sf::Event::MouseButtonReleased) { cout << "Mouse button released!"; }
}
The text never writes to the console. All another events work (I tested key events). Also I could work with input handle mInputWindow->GetInput(). Using it I can show the cursor position, show/hide it, etc. All this stuff works.
I tried to do something like (in global cycle too):
if (mInputWindow->GetInput().IsMouseButtonDown(sf::Mouse::Left))
{
cout << "Left mouse button is pressed!";
}
Thid doesn't work too.
What could it be?