Added mouse position getters

This commit is contained in:
Robert 2020-05-19 15:20:25 +02:00
parent 5daae26a12
commit c4c81f35f6
6 changed files with 46 additions and 9 deletions

View file

@ -49,7 +49,10 @@ int main(int argc, char** argv)
}
}
window.Clear(sdlu::Color::FromHSV(std::floor(t), 100, 100));
sdlu::Vector2i mousePos = sdlu::Mouse::GetPosition(window) - sdlu::Vector2i(400, 400);
// TODO: Check HSV color conversion, the SV values seem to be ignored
window.Clear(sdlu::Color::FromHSV(std::atan2(mousePos.y, mousePos.x) / PI * 180 + 180,
100, 100));
window.Display();
t += 0.08;