Xbox controllers (360 and One) input without sticks being touched

I know this is at the very beginning of the series but I've tried 3 different controllers (2 Xbox One and 1 360) and they all have the issue of causing the gradient to be moving at all times and at crazy speeds compared to the video.

Same issue with the audio effect. The sound will randomly change or it will work for a bit and then no matter which way I move the stick the tone will randomly change (push stick down and tone goes up but it didnt beforehand). I've basically copy pasted Casey's code and same issue. Anyone else have this problem?

Did you try to compile handmade hero (completely, not just copy some part of it in your code) to see if the issue is also there ?

If the issue is still there, than look in the Windows game controller configuration to see if the stick have some drift (settings, search for controller and there should "Configure USB game controller" (or similar, I don't know the exact name)).

If not, then there is an issue in your code, and you'll need to share the code for us to look at it.


Edited by Simon Anciaux on

I found the issue and it's so silly. I had my watch window so small I couldn't see I had accidentally had stickY be an unsigned int which was causing it to wrap back around to the max value when I pushed the stick down. I fixed the crazy acceleration by working in the dead zone and just setting the stick to 0 if it was between positive/negative dead zone.