I've discovered that Mouse.GetPosition() return mouse position on desktop and not take care of REnderWindow i made... this code:
#include <SFML/Graphics.hpp>
#include <iostream>
int main()
{
sf::RenderWindow App(sf::VideoMode(800,600,32),"SFML AnimTest",sf::Style::Titlebar | sf::Style::Close);
sf::Event _event;
while(App.IsOpen()){
std::cout << sf::Mouse::GetPosition().x << " "<< sf::Mouse::GetPosition().y<<std::endl;
if (App.PollEvent(_event))
{
if (_event.Type == sf::Event::Closed || (_event.Type == sf::Event::KeyPressed && _event.Key.Code == sf::Keyboard::Escape))
App.Close();
}
App.Clear(sf::Color::White);
App.Display();
}
return EXIT_SUCCESS;
}
And here the screens:
http://img220.imageshack.us/img220/4075/76593094.jpghttp://img220.imageshack.us/img220/4075/76593094.jpgThe red arrows point to mouse when i made the print, first on top-left of my desktop, then on bottom-right. As you can see on console my desktop top-left coordinates are 0,0 and not my SFML window. Why? Is it a bug or not?