+void VID_BuildJoyState(vid_joystate_t *joystate)
+{
+ VID_Shared_BuildJoyState_Begin(joystate);
+ VID_Shared_BuildJoyState_Finish(joystate);
+}
+
+void VID_EnableJoystick(qboolean enable)
+{
+ int index = joy_enable.integer > 0 ? joy_index.integer : -1;
+ qboolean success = false;
+ int sharedcount = 0;
+ sharedcount = VID_Shared_SetJoystick(index);
+ if (index >= 0 && index < sharedcount)
+ success = true;
+
+ // update cvar containing count of XInput joysticks
+ if (joy_detected.integer != sharedcount)
+ Cvar_SetValueQuick(&joy_detected, sharedcount);
+
+ Cvar_SetValueQuick(&joy_active, success ? 1 : 0);
+}
+