C++ Joystick

Hello, im kinda new to C++, im making a game and want to use a controller for it, i made also bullets and used a formula for it (so i can shoot 360 degrees around my player (Code down blow)). My question is: how can i use my joystick (Axis) to also shoot 360 degrees around me?

CODE 360 DEGREES WITH MOUSE:

MousePosWindow = sf::Vector2f(sf::Mouse::getPosition(window));
aimDir = MousePosWindow - PlayerCenter;
aimDirNorm = aimDir / sqrt(pow(aimDir.x, 2) + pow(aimDir.y, 2));

if (sf::Mouse::isButtonPressed(sf::Mouse::Left))
{
bullet.SetTex(Bu);
bullet.currVelocity = aimDirNorm * bullet.maxSpeed;
bulletVec.push_back(bullet);
}
Topic archived. No new replies allowed.