@@ -477,13 +477,31 @@ SDL_COMPILE_TIME_ASSERT(SDL_VirtualJoystickDesc_SIZE,
477
477
/**
478
478
* Attach a new virtual joystick.
479
479
*
480
+ * Apps can create virtual joysticks, that exist without hardware directly
481
+ * backing them, and have program-supplied inputs. Once attached, a virtual
482
+ * joystick looks like any other joystick that SDL can access. These can be
483
+ * used to make other things look like joysticks, or provide pre-recorded
484
+ * input, etc.
485
+ *
486
+ * Once attached, the app can send joystick inputs to the new virtual joystick
487
+ * using SDL_SetJoystickVirtualAxis(), etc.
488
+ *
489
+ * When no longer needed, the virtual joystick can be removed by calling
490
+ * SDL_DetachVirtualJoystick().
491
+ *
480
492
* \param desc joystick description, initialized using SDL_INIT_INTERFACE().
481
493
* \returns the joystick instance ID, or 0 on failure; call SDL_GetError() for
482
494
* more information.
483
495
*
484
496
* \since This function is available since SDL 3.2.0.
485
497
*
486
498
* \sa SDL_DetachVirtualJoystick
499
+ * \sa SDL_SetJoystickVirtualAxis
500
+ * \sa SDL_SetJoystickVirtualButton
501
+ * \sa SDL_SetJoystickVirtualBall
502
+ * \sa SDL_SetJoystickVirtualHat
503
+ * \sa SDL_SetJoystickVirtualTouchpad
504
+ * \sa SDL_SetJoystickVirtualSensorData
487
505
*/
488
506
extern SDL_DECLSPEC SDL_JoystickID SDLCALL SDL_AttachVirtualJoystick (const SDL_VirtualJoystickDesc * desc );
489
507
@@ -531,6 +549,12 @@ extern SDL_DECLSPEC bool SDLCALL SDL_IsJoystickVirtual(SDL_JoystickID instance_i
531
549
* information.
532
550
*
533
551
* \since This function is available since SDL 3.2.0.
552
+ *
553
+ * \sa SDL_SetJoystickVirtualButton
554
+ * \sa SDL_SetJoystickVirtualBall
555
+ * \sa SDL_SetJoystickVirtualHat
556
+ * \sa SDL_SetJoystickVirtualTouchpad
557
+ * \sa SDL_SetJoystickVirtualSensorData
534
558
*/
535
559
extern SDL_DECLSPEC bool SDLCALL SDL_SetJoystickVirtualAxis (SDL_Joystick * joystick , int axis , Sint16 value );
536
560
@@ -551,6 +575,12 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SetJoystickVirtualAxis(SDL_Joystick *joysti
551
575
* information.
552
576
*
553
577
* \since This function is available since SDL 3.2.0.
578
+ *
579
+ * \sa SDL_SetJoystickVirtualAxis
580
+ * \sa SDL_SetJoystickVirtualButton
581
+ * \sa SDL_SetJoystickVirtualHat
582
+ * \sa SDL_SetJoystickVirtualTouchpad
583
+ * \sa SDL_SetJoystickVirtualSensorData
554
584
*/
555
585
extern SDL_DECLSPEC bool SDLCALL SDL_SetJoystickVirtualBall (SDL_Joystick * joystick , int ball , Sint16 xrel , Sint16 yrel );
556
586
@@ -570,6 +600,12 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SetJoystickVirtualBall(SDL_Joystick *joysti
570
600
* information.
571
601
*
572
602
* \since This function is available since SDL 3.2.0.
603
+ *
604
+ * \sa SDL_SetJoystickVirtualAxis
605
+ * \sa SDL_SetJoystickVirtualBall
606
+ * \sa SDL_SetJoystickVirtualHat
607
+ * \sa SDL_SetJoystickVirtualTouchpad
608
+ * \sa SDL_SetJoystickVirtualSensorData
573
609
*/
574
610
extern SDL_DECLSPEC bool SDLCALL SDL_SetJoystickVirtualButton (SDL_Joystick * joystick , int button , bool down );
575
611
@@ -589,6 +625,12 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SetJoystickVirtualButton(SDL_Joystick *joys
589
625
* information.
590
626
*
591
627
* \since This function is available since SDL 3.2.0.
628
+ *
629
+ * \sa SDL_SetJoystickVirtualAxis
630
+ * \sa SDL_SetJoystickVirtualButton
631
+ * \sa SDL_SetJoystickVirtualBall
632
+ * \sa SDL_SetJoystickVirtualTouchpad
633
+ * \sa SDL_SetJoystickVirtualSensorData
592
634
*/
593
635
extern SDL_DECLSPEC bool SDLCALL SDL_SetJoystickVirtualHat (SDL_Joystick * joystick , int hat , Uint8 value );
594
636
@@ -615,6 +657,12 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SetJoystickVirtualHat(SDL_Joystick *joystic
615
657
* information.
616
658
*
617
659
* \since This function is available since SDL 3.2.0.
660
+ *
661
+ * \sa SDL_SetJoystickVirtualAxis
662
+ * \sa SDL_SetJoystickVirtualButton
663
+ * \sa SDL_SetJoystickVirtualBall
664
+ * \sa SDL_SetJoystickVirtualHat
665
+ * \sa SDL_SetJoystickVirtualSensorData
618
666
*/
619
667
extern SDL_DECLSPEC bool SDLCALL SDL_SetJoystickVirtualTouchpad (SDL_Joystick * joystick , int touchpad , int finger , bool down , float x , float y , float pressure );
620
668
@@ -637,6 +685,12 @@ extern SDL_DECLSPEC bool SDLCALL SDL_SetJoystickVirtualTouchpad(SDL_Joystick *jo
637
685
* information.
638
686
*
639
687
* \since This function is available since SDL 3.2.0.
688
+ *
689
+ * \sa SDL_SetJoystickVirtualAxis
690
+ * \sa SDL_SetJoystickVirtualButton
691
+ * \sa SDL_SetJoystickVirtualBall
692
+ * \sa SDL_SetJoystickVirtualHat
693
+ * \sa SDL_SetJoystickVirtualTouchpad
640
694
*/
641
695
extern SDL_DECLSPEC bool SDLCALL SDL_SendJoystickVirtualSensorData (SDL_Joystick * joystick , SDL_SensorType type , Uint64 sensor_timestamp , const float * data , int num_values );
642
696
0 commit comments