void NX::Camera::MouseMovement(int x, int y)
{
NX::App* p = NX::App::Get();
//float screenCenterX = static_cast<float>(p->GetWindow()->getSize().x) * .5f;
//float screenCenterY = static_cast<float>(p->GetWindow()->getSize().y) * .5f;
float screenCenterX = static_cast<float>(sf::VideoMode::getDesktopMode().width) * .5f;
float screenCenterY = static_cast<float>(sf::VideoMode::getDesktopMode().height) * .5f;
float xf = static_cast<float>(x);
float yf = static_cast<float>(y);
if(prevX != xf || prevY != yf)
{
float deltaX = xf - screenCenterX;
float deltaY = yf - screenCenterY;
xRot += deltaY;
yRot += deltaX;
MaxCameraRotationX();
//sf::Mouse::setPosition(sf::Vector2i(static_cast<int>(screenCenterX),
// static_cast<int>(screenCenterY)));
sf::Mouse::setPosition(sf::Vector2i(static_cast<int>(screenCenterX),
static_cast<int>(screenCenterY)),
p->GetWindow());
prevX = xf;
prevY = yf;
}
}
This is for a RenderWindow if that matters....
BTW this only happens when the windowed mode screen is not maximized...