You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Documentation.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -108,7 +108,6 @@ typedef struct {
108
108
After setting up the structure, we proceed with SDL initialization by calling `initSDL()` and we set up a function to be called when the program ends, with `atexit()`.
109
109
Once the initialization is done, we start the actual main loop, where we call doInput() and check if the vibration is enabled to play the rumble support.
110
110
`SDL_Delay(16)` makes the program wait for 16 milliseconds. We do that to limit the loop to around 62 frames per second and also prevent the application from running at full tilt and consuming far too much CPU time.
111
-
</details>
112
111
113
112
#### Vibration
114
113
<pre>
@@ -123,6 +122,7 @@ The joystick vibration is enabled when we pressing 2 specific buttons at the sam
123
122
To do this we use the `app.rumble` array: each element corresponds to a joystick (the index is the same for the different arrays) and it's initially set to 0;
124
123
when button 0 or 3 is pressed, we increment the element corresponding to the joystick that sent the event by 1, and we decrement it when the button is released;
125
124
when `app.rumble` value is 2, since a button cannot be pressed multiple times without releasing it, we know both 0 and 3 are pressed and we can enable the vibration.
0 commit comments