comparison include/SDL_haptic.h @ 2523:366d84fdf8d1 gsoc2008_force_feedback

Haptic subsystem handles haptic axes now. Support for SDL_HAPTIC_SPHERICAL on linux. More error checking. Improved documentation. Added missing SDLCALLs to SDL_haptic.h.
author Edgar Simo <bobbens@gmail.com>
date Thu, 17 Jul 2008 11:47:48 +0000
parents af9df9662807
children 1fb3fba13a2c
comparison
equal deleted inserted replaced
2522:0877146be013 2523:366d84fdf8d1
290 * \brief Structure that represents a haptic direction. 290 * \brief Structure that represents a haptic direction.
291 * 291 *
292 * Directions can be specified by: 292 * Directions can be specified by:
293 * - SDL_HAPTIC_POLAR : Specified by polar coordinates. 293 * - SDL_HAPTIC_POLAR : Specified by polar coordinates.
294 * - SDL_HAPTIC_CARTESIAN : Specified by cartesian coordinates. 294 * - SDL_HAPTIC_CARTESIAN : Specified by cartesian coordinates.
295 * - SDL_HAPTIC_SHPERICAL : Specified by spherical coordinates.
295 * 296 *
296 * Cardinal directions of the haptic device are relative to the positioning 297 * Cardinal directions of the haptic device are relative to the positioning
297 * of the device. North is considered to be away from the user. 298 * of the device. North is considered to be away from the user.
298 * 299 *
299 * The following diagram represents the cardinal directions: 300 * The following diagram represents the cardinal directions:
300 * \code 301 * \code
301 * .--. 302 * .--.
302 * |__| .-------. 303 * |__| .-------.
303 * |=.| |.-----.| 304 * |=.| |.-----.|
304 * |--| || || 305 * |--| || ||
305 * | | |'-----'| 306 * | | |'-----'|
306 * |__|~')_____(' 307 * |__|~')_____('
307 * [ COMPUTER ] 308 * [ COMPUTER ]
308 * 309 *
309 * 310 *
310 * North (-1) 311 * North (0,-1)
311 * ^ 312 * ^
312 * | 313 * |
313 * | 314 * |
314 * (1) West <----[ HAPTIC ]----> East (-1) 315 * (1,0) West <----[ HAPTIC ]----> East (-1,0)
315 * | 316 * |
316 * | 317 * |
317 * v 318 * v
318 * South (1) 319 * South (0,1)
319 * 320 *
320 * 321 *
321 * [ USER ] 322 * [ USER ]
322 * \|||/ 323 * \|||/
323 * (o o) 324 * (o o)
324 * ---ooO-(_)-Ooo--- 325 * ---ooO-(_)-Ooo---
325 * \endcode 326 * \endcode
326 * 327 *
327 * If type is SDL_HAPTIC_POLAR, direction is encoded by hundredths of a 328 * If type is SDL_HAPTIC_POLAR, direction is encoded by hundredths of a
328 * degree starting north and turning clockwise. SDL_HAPTIC_POLAR only uses 329 * degree starting north and turning clockwise. SDL_HAPTIC_POLAR only uses
329 * the first dir parameter. The cardinal directions would be: 330 * the first dir parameter. The cardinal directions would be:
330 * - North: 0 (0 degrees) 331 * - North: 0 (0 degrees)
331 * - East: 9000 (90 degrees) 332 * - East: 9000 (90 degrees)
332 * - South: 18000 (180 degrees) 333 * - South: 18000 (180 degrees)
333 * - West: 27000 (270 degrees) 334 * - West: 27000 (270 degrees)
334 * 335 *
335 * If type is SDL_HAPTIC_CARTESIAN, direction is encoded by two positions 336 * If type is SDL_HAPTIC_CARTESIAN, direction is encoded by three positions
336 * (X axis and Y axis). SDL_HAPTIC_CARTESIAN uses the first two dir 337 * (X axis, Y axis and Z axis (with 3 axes)). SDL_HAPTIC_CARTESIAN uses
337 * parameters. The cardinal directions would be: 338 * the first three dir parameters. The cardinal directions would be:
338 * - North: 0,-1 339 * - North: 0,-1, 0
339 * - East: -1, 0 340 * - East: -1, 0, 0
340 * - South: 0, 1 341 * - South: 0, 1, 0
341 * - West: 1, 0 342 * - West: 1, 0, 0
342 * 343 * The Z axis represents the height of the effect if supported, otherwise
343 * If type is SDL_HAPTIC_SPHERICAL, direction is encoded by three rotations. 344 * it's unused. In cartesian encoding (1,2) would be the same as (2,4), you
344 * All three dir parameters are used. The dir parameters are as follows 345 * can use any multiple you want, only the direction matters.
346 *
347 * If type is SDL_HAPTIC_SPHERICAL, direction is encoded by two rotations.
348 * The first two dir parameters are used. The dir parameters are as follows
345 * (all values are in hundredths of degrees): 349 * (all values are in hundredths of degrees):
346 * 1) Degrees from (1, 0) rotated towards (0, 1). 350 * 1) Degrees from (1, 0) rotated towards (0, 1).
347 * 2) Degrees towards (0, 0, 1) (device needs at least 3 axes). 351 * 2) Degrees towards (0, 0, 1) (device needs at least 3 axes).
348 * 3) Degrees tworads (0, 0, 0, 1) (device needs at least 4 axes). 352 *
349 * 353 *
350 * 354 * Example of force coming from the south with all encodings (force coming
351 * Example: 355 * from the south means the user will have to pull the stick to counteract):
352 * \code 356 * \code
353 * SDL_HapticDirection direction; 357 * SDL_HapticDirection direction;
354 * 358 *
359 * // Cartesian directions
360 * direction.type = SDL_HAPTIC_CARTESIAN; // Using cartesian direction encoding.
361 * direction.dir[0] = 0; // X position
362 * direction.dir[1] = 1; // Y position
363 * // Assuming the device has 2 axes, we don't need to specify third parameter.
364 *
365 * // Polar directions
355 * direction.type = SDL_HAPTIC_POLAR; // We'll be using polar direction encoding. 366 * direction.type = SDL_HAPTIC_POLAR; // We'll be using polar direction encoding.
356 * direction.dir = 18000; // Force comes from the south meaning the user will 367 * direction.dir[0] = 18000; // Polar only uses first parameter
357 * // have to pull the stick to counteract. 368 *
369 * // Spherical coordinates
370 * direction.type = SDL_HAPTIC_SPHERICAL; // Spherical encoding
371 * direction.dir[0] = 9000; // Since we only have two axes we don't need more parameters.
358 * \endcode 372 * \endcode
359 * 373 *
360 * \sa SDL_HAPTIC_POLAR 374 * \sa SDL_HAPTIC_POLAR
361 * \sa SDL_HAPTIC_CARTESIAN 375 * \sa SDL_HAPTIC_CARTESIAN
362 * \sa SDL_HAPTIC_SHPERICAL 376 * \sa SDL_HAPTIC_SHPERICAL
363 * \sa SDL_HapticEffect 377 * \sa SDL_HapticEffect
378 * \sa SDL_HapticNumAxes
364 */ 379 */
365 typedef struct SDL_HapticDirection { 380 typedef struct SDL_HapticDirection {
366 Uint8 type; /**< The type of encoding. */ 381 Uint8 type; /**< The type of encoding. */
367 Uint16 dir[3]; /**< The encoded direction. */ 382 Uint16 dir[3]; /**< The encoded direction. */
368 } SDL_HapticDirection; 383 } SDL_HapticDirection;
508 */ 523 */
509 typedef struct SDL_HapticCondition { 524 typedef struct SDL_HapticCondition {
510 /* Header */ 525 /* Header */
511 Uint16 type; /**< SDL_HAPTIC_SPRING, SDL_HAPTIC_DAMPER, 526 Uint16 type; /**< SDL_HAPTIC_SPRING, SDL_HAPTIC_DAMPER,
512 SDL_HAPTIC_INERTIA or SDL_HAPTIC_FRICTION */ 527 SDL_HAPTIC_INERTIA or SDL_HAPTIC_FRICTION */
528 SDL_HapticDirection direction; /**< Direction of the effect - Not used ATM. */
513 529
514 /* Replay */ 530 /* Replay */
515 Uint32 length; /**< Duration of the effect. */ 531 Uint32 length; /**< Duration of the effect. */
516 Uint16 delay; /**< Delay before starting the effect. */ 532 Uint16 delay; /**< Delay before starting the effect. */
517 533
677 * \sa SDL_HapticOpenFromJoystick 693 * \sa SDL_HapticOpenFromJoystick
678 * \sa SDL_HapticClose 694 * \sa SDL_HapticClose
679 * \sa SDL_HapticSetGain 695 * \sa SDL_HapticSetGain
680 * \sa SDL_HapticSetAutocenter 696 * \sa SDL_HapticSetAutocenter
681 */ 697 */
682 extern DECLSPEC SDL_Haptic * SDL_HapticOpen(int device_index); 698 extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpen(int device_index);
683 699
684 /** 700 /**
685 * \fn int SDL_HapticOpened(int device_index) 701 * \fn int SDL_HapticOpened(int device_index)
686 * 702 *
687 * \brief Checks if the haptic device at index has been opened. 703 * \brief Checks if the haptic device at index has been opened.
690 * \return 1 if it has been opened or 0 if it hasn't. 706 * \return 1 if it has been opened or 0 if it hasn't.
691 * 707 *
692 * \sa SDL_HapticOpen 708 * \sa SDL_HapticOpen
693 * \sa SDL_HapticIndex 709 * \sa SDL_HapticIndex
694 */ 710 */
695 extern DECLSPEC int SDL_HapticOpened(int device_index); 711 extern DECLSPEC int SDLCALL SDL_HapticOpened(int device_index);
696 712
697 /** 713 /**
698 * \fn int SDL_HapticIndex(SDL_Haptic * haptic) 714 * \fn int SDL_HapticIndex(SDL_Haptic * haptic)
699 * 715 *
700 * \brief Gets the index of a haptic device. 716 * \brief Gets the index of a haptic device.
703 * \return The index of the haptic device or -1 on error. 719 * \return The index of the haptic device or -1 on error.
704 * 720 *
705 * \sa SDL_HapticOpen 721 * \sa SDL_HapticOpen
706 * \sa SDL_HapticOpened 722 * \sa SDL_HapticOpened
707 */ 723 */
708 extern DECLSPEC int SDL_HapticIndex(SDL_Haptic * haptic); 724 extern DECLSPEC int SDLCALL SDL_HapticIndex(SDL_Haptic * haptic);
709 725
710 /** 726 /**
711 * \fn int SDL_MouseIsHaptic(void) 727 * \fn int SDL_MouseIsHaptic(void)
712 * 728 *
713 * \brief Gets whether or not the current mouse has haptic capabilities. 729 * \brief Gets whether or not the current mouse has haptic capabilities.
714 * 730 *
715 * \return SDL_TRUE if the mouse is haptic, SDL_FALSE if it isn't. 731 * \return SDL_TRUE if the mouse is haptic, SDL_FALSE if it isn't.
716 * 732 *
717 * \sa SDL_HapticOpenFromMouse 733 * \sa SDL_HapticOpenFromMouse
718 */ 734 */
719 extern DECLSPEC int SDL_MouseIsHaptic(void); 735 extern DECLSPEC int SDLCALL SDL_MouseIsHaptic(void);
720 736
721 /** 737 /**
722 * \fn SDL_Haptic * SDL_HapticOpenFromMouse(void) 738 * \fn SDL_Haptic * SDL_HapticOpenFromMouse(void)
723 * 739 *
724 * \brief Tries to open a haptic device from the current mouse. 740 * \brief Tries to open a haptic device from the current mouse.
726 * \return The haptic device identifier or NULL on error. 742 * \return The haptic device identifier or NULL on error.
727 * 743 *
728 * \sa SDL_MouseIsHaptic 744 * \sa SDL_MouseIsHaptic
729 * \sa SDL_HapticOpen 745 * \sa SDL_HapticOpen
730 */ 746 */
731 extern DECLSPEC SDL_Haptic * SDL_HapticOpenFromMouse(void); 747 extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpenFromMouse(void);
732 748
733 /** 749 /**
734 * \fn int SDL_JoystickIsHaptic(SDL_Joystick * joystick) 750 * \fn int SDL_JoystickIsHaptic(SDL_Joystick * joystick)
735 * 751 *
736 * \brief Checks to see if a joystick has haptic features. 752 * \brief Checks to see if a joystick has haptic features.
739 * \return SDL_TRUE if the joystick is haptic, SDL_FALSE if it isn't 755 * \return SDL_TRUE if the joystick is haptic, SDL_FALSE if it isn't
740 * or -1 if an error ocurred. 756 * or -1 if an error ocurred.
741 * 757 *
742 * \sa SDL_HapticOpenFromJoystick 758 * \sa SDL_HapticOpenFromJoystick
743 */ 759 */
744 extern DECLSPEC int SDL_JoystickIsHaptic(SDL_Joystick * joystick); 760 extern DECLSPEC int SDLCALL SDL_JoystickIsHaptic(SDL_Joystick * joystick);
745 761
746 /** 762 /**
747 * \fn SDL_Haptic * SDL_HapticOpenFromJoystick(SDL_Joystick * joystick) 763 * \fn SDL_Haptic * SDL_HapticOpenFromJoystick(SDL_Joystick * joystick)
748 * 764 *
749 * \brief Opens a Haptic device for usage from a Joystick device. Still has 765 * \brief Opens a Haptic device for usage from a Joystick device. Still has
753 * \return A valid haptic device identifier on success or NULL on error. 769 * \return A valid haptic device identifier on success or NULL on error.
754 * 770 *
755 * \sa SDL_HapticOpen 771 * \sa SDL_HapticOpen
756 * \sa SDL_HapticClose 772 * \sa SDL_HapticClose
757 */ 773 */
758 extern DECLSPEC SDL_Haptic * SDL_HapticOpenFromJoystick(SDL_Joystick * joystick); 774 extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpenFromJoystick(SDL_Joystick * joystick);
759 775
760 /** 776 /**
761 * \fn void SDL_HapticClose(SDL_Haptic * haptic) 777 * \fn void SDL_HapticClose(SDL_Haptic * haptic)
762 * 778 *
763 * \brief Closes a Haptic device previously opened with SDL_HapticOpen. 779 * \brief Closes a Haptic device previously opened with SDL_HapticOpen.
764 * 780 *
765 * \param haptic Haptic device to close. 781 * \param haptic Haptic device to close.
766 */ 782 */
767 extern DECLSPEC void SDL_HapticClose(SDL_Haptic * haptic); 783 extern DECLSPEC void SDLCALL SDL_HapticClose(SDL_Haptic * haptic);
768 784
769 /** 785 /**
770 * \fn int SDL_HapticNumEffects(SDL_Haptic * haptic) 786 * \fn int SDL_HapticNumEffects(SDL_Haptic * haptic)
771 * 787 *
772 * \brief Returns the number of effects a haptic device can store. 788 * \brief Returns the number of effects a haptic device can store.
776 * -1 on error. 792 * -1 on error.
777 * 793 *
778 * \sa SDL_HapticNumEffectsPlaying 794 * \sa SDL_HapticNumEffectsPlaying
779 * \sa SDL_HapticQuery 795 * \sa SDL_HapticQuery
780 */ 796 */
781 extern DECLSPEC int SDL_HapticNumEffects(SDL_Haptic * haptic); 797 extern DECLSPEC int SDLCALL SDL_HapticNumEffects(SDL_Haptic * haptic);
782 798
783 /** 799 /**
784 * \fn int SDL_HapticNumEffectsPlaying(SDL_Haptic * haptic) 800 * \fn int SDL_HapticNumEffectsPlaying(SDL_Haptic * haptic)
785 * 801 *
786 * \brief Returns the number of effects a haptic device can play at the same time. 802 * \brief Returns the number of effects a haptic device can play at the same time.
790 * or -1 on error. 806 * or -1 on error.
791 * 807 *
792 * \sa SDL_HapticNumEffects 808 * \sa SDL_HapticNumEffects
793 * \sa SDL_HapticQuery 809 * \sa SDL_HapticQuery
794 */ 810 */
795 extern DECLSPEC int SDL_HapticNumEffectsPlaying(SDL_Haptic * haptic); 811 extern DECLSPEC int SDLCALL SDL_HapticNumEffectsPlaying(SDL_Haptic * haptic);
796 812
797 /** 813 /**
798 * \fn unsigned int SDL_HapticQuery(SDL_Haptic * haptic) 814 * \fn unsigned int SDL_HapticQuery(SDL_Haptic * haptic)
799 * 815 *
800 * \brief Gets the haptic devices supported features in bitwise matter. 816 * \brief Gets the haptic devices supported features in bitwise matter.
811 * \return Haptic features in bitwise manner (OR'd). 827 * \return Haptic features in bitwise manner (OR'd).
812 * 828 *
813 * \sa SDL_HapticNumEffects 829 * \sa SDL_HapticNumEffects
814 * \sa SDL_HapticEffectSupported 830 * \sa SDL_HapticEffectSupported
815 */ 831 */
816 extern DECLSPEC unsigned int SDL_HapticQuery(SDL_Haptic * haptic); 832 extern DECLSPEC unsigned int SDLCALL SDL_HapticQuery(SDL_Haptic * haptic);
833
834
835 /**
836 * \fn int SDL_HapticNumAxes(SDL_Haptic * haptic)
837 *
838 * \brief Gets the number of haptic axes the device has.
839 *
840 * \sa SDL_HapticDirection
841 */
842 extern DECLSPEC int SDLCALL SDL_HapticNumAxes(SDL_Haptic * haptic);
817 843
818 /** 844 /**
819 * \fn int SDL_HapticEffectSupported(SDL_Haptic * haptic, SDL_HapticEffect * effect) 845 * \fn int SDL_HapticEffectSupported(SDL_Haptic * haptic, SDL_HapticEffect * effect)
820 * 846 *
821 * \brief Checks to see if effect is supported by haptic. 847 * \brief Checks to see if effect is supported by haptic.
826 * -1 on error. 852 * -1 on error.
827 * 853 *
828 * \sa SDL_HapticQuery 854 * \sa SDL_HapticQuery
829 * \sa SDL_HapticNewEffect 855 * \sa SDL_HapticNewEffect
830 */ 856 */
831 extern DECLSPEC int SDL_HapticEffectSupported(SDL_Haptic * haptic, SDL_HapticEffect * effect); 857 extern DECLSPEC int SDLCALL SDL_HapticEffectSupported(SDL_Haptic * haptic, SDL_HapticEffect * effect);
832 858
833 /** 859 /**
834 * \fn int SDL_HapticNewEffect(SDL_Haptic * haptic, SDL_HapticEffect * effect) 860 * \fn int SDL_HapticNewEffect(SDL_Haptic * haptic, SDL_HapticEffect * effect)
835 * 861 *
836 * \brief Creates a new haptic effect on the device. 862 * \brief Creates a new haptic effect on the device.
841 * 867 *
842 * \sa SDL_HapticUpdateEffect 868 * \sa SDL_HapticUpdateEffect
843 * \sa SDL_HapticRunEffect 869 * \sa SDL_HapticRunEffect
844 * \sa SDL_HapticDestroyEffect 870 * \sa SDL_HapticDestroyEffect
845 */ 871 */
846 extern DECLSPEC int SDL_HapticNewEffect(SDL_Haptic * haptic, SDL_HapticEffect * effect); 872 extern DECLSPEC int SDLCALL SDL_HapticNewEffect(SDL_Haptic * haptic, SDL_HapticEffect * effect);
847 873
848 /** 874 /**
849 * \fn int SDL_HapticUpdateEffect(SDL_Haptic * haptic, int effect, SDL_HapticEffect * data) 875 * \fn int SDL_HapticUpdateEffect(SDL_Haptic * haptic, int effect, SDL_HapticEffect * data)
850 * 876 *
851 * \brief Updates an effect. Can be used dynamically, although behaviour when 877 * \brief Updates an effect. Can be used dynamically, although behaviour when
860 * 886 *
861 * \sa SDL_HapticNewEffect 887 * \sa SDL_HapticNewEffect
862 * \sa SDL_HapticRunEffect 888 * \sa SDL_HapticRunEffect
863 * \sa SDL_HapticDestroyEffect 889 * \sa SDL_HapticDestroyEffect
864 */ 890 */
865 extern DECLSPEC int SDL_HapticUpdateEffect(SDL_Haptic * haptic, int effect, SDL_HapticEffect * data); 891 extern DECLSPEC int SDLCALL SDL_HapticUpdateEffect(SDL_Haptic * haptic, int effect, SDL_HapticEffect * data);
866 892
867 /** 893 /**
868 * \fn int SDL_HapticRunEffect(SDL_Haptic * haptic, int effect, int iterations) 894 * \fn int SDL_HapticRunEffect(SDL_Haptic * haptic, int effect, int iterations)
869 * 895 *
870 * \brief Runs the haptic effect on it's assosciated haptic device. 896 * \brief Runs the haptic effect on it's assosciated haptic device.
877 * 903 *
878 * \sa SDL_HapticStopEffect 904 * \sa SDL_HapticStopEffect
879 * \sa SDL_HapticDestroyEffect 905 * \sa SDL_HapticDestroyEffect
880 * \sa SDL_HapticGetEffectStatus 906 * \sa SDL_HapticGetEffectStatus
881 */ 907 */
882 extern DECLSPEC int SDL_HapticRunEffect(SDL_Haptic * haptic, int effect, Uint32 iterations); 908 extern DECLSPEC int SDLCALL SDL_HapticRunEffect(SDL_Haptic * haptic, int effect, Uint32 iterations);
883 909
884 /** 910 /**
885 * \fn int SDL_HapticStopEffect(SDL_Haptic * haptic, int effect) 911 * \fn int SDL_HapticStopEffect(SDL_Haptic * haptic, int effect)
886 * 912 *
887 * \brief Stops the haptic effect on it's assosciated haptic device. 913 * \brief Stops the haptic effect on it's assosciated haptic device.
891 * \return 0 on success or -1 on error. 917 * \return 0 on success or -1 on error.
892 * 918 *
893 * \sa SDL_HapticRunEffect 919 * \sa SDL_HapticRunEffect
894 * \sa SDL_HapticDestroyEffect 920 * \sa SDL_HapticDestroyEffect
895 */ 921 */
896 extern DECLSPEC int SDL_HapticStopEffect(SDL_Haptic * haptic, int effect); 922 extern DECLSPEC int SDLCALL SDL_HapticStopEffect(SDL_Haptic * haptic, int effect);
897 923
898 /** 924 /**
899 * \fn void SDL_HapticDestroyEffect(SDL_Haptic * haptic, int effect) 925 * \fn void SDL_HapticDestroyEffect(SDL_Haptic * haptic, int effect)
900 * 926 *
901 * \brief Destroys a haptic effect on the device. This will stop the effect 927 * \brief Destroys a haptic effect on the device. This will stop the effect
905 * \param haptic Device to destroy the effect on. 931 * \param haptic Device to destroy the effect on.
906 * \param effect Identifier of the effect to destroy. 932 * \param effect Identifier of the effect to destroy.
907 * 933 *
908 * \sa SDL_HapticNewEffect 934 * \sa SDL_HapticNewEffect
909 */ 935 */
910 extern DECLSPEC void SDL_HapticDestroyEffect(SDL_Haptic * haptic, int effect); 936 extern DECLSPEC void SDLCALL SDL_HapticDestroyEffect(SDL_Haptic * haptic, int effect);
911 937
912 /** 938 /**
913 * \fn int SDL_HapticGetEffectStatus(SDL_Haptic *haptic, int effect) 939 * \fn int SDL_HapticGetEffectStatus(SDL_Haptic *haptic, int effect)
914 * 940 *
915 * \brief Gets the status of the current effect on the haptic device. 941 * \brief Gets the status of the current effect on the haptic device.
922 * or -1 on error. 948 * or -1 on error.
923 * 949 *
924 * \sa SDL_HapticRunEffect 950 * \sa SDL_HapticRunEffect
925 * \sa SDL_HapticStopEffect 951 * \sa SDL_HapticStopEffect
926 */ 952 */
927 extern DECLSPEC int SDL_HapticGetEffectStatus(SDL_Haptic *haptic, int effect); 953 extern DECLSPEC int SDLCALL SDL_HapticGetEffectStatus(SDL_Haptic *haptic, int effect);
928 954
929 /** 955 /**
930 * \fn int SDL_HapticSetGain(SDL_Haptic * haptic, int gain) 956 * \fn int SDL_HapticSetGain(SDL_Haptic * haptic, int gain)
931 * 957 *
932 * \brief Sets the global gain of the device. Gain should be between 0 and 100. 958 * \brief Sets the global gain of the device. Gain should be between 0 and 100.
942 * \param gain Value to set the gain to, should be between 0 and 100. 968 * \param gain Value to set the gain to, should be between 0 and 100.
943 * \return 0 on success or -1 on error. 969 * \return 0 on success or -1 on error.
944 * 970 *
945 * \sa SDL_HapticQuery 971 * \sa SDL_HapticQuery
946 */ 972 */
947 extern DECLSPEC int SDL_HapticSetGain(SDL_Haptic * haptic, int gain); 973 extern DECLSPEC int SDLCALL SDL_HapticSetGain(SDL_Haptic * haptic, int gain);
948 974
949 /** 975 /**
950 * \fn int SDL_HapticSetAutocenter(SDL_Haptic * haptic, int autocenter) 976 * \fn int SDL_HapticSetAutocenter(SDL_Haptic * haptic, int autocenter)
951 * 977 *
952 * \brief Sets the global autocenter of the device. Autocenter should be between 978 * \brief Sets the global autocenter of the device. Autocenter should be between
958 * \param autocenter Value to set autocenter to, 0 disables autocentering. 984 * \param autocenter Value to set autocenter to, 0 disables autocentering.
959 * \return 0 on success or -1 on error. 985 * \return 0 on success or -1 on error.
960 * 986 *
961 * \sa SDL_HapticQuery 987 * \sa SDL_HapticQuery
962 */ 988 */
963 extern DECLSPEC int SDL_HapticSetAutocenter(SDL_Haptic * haptic, int autocenter); 989 extern DECLSPEC int SDLCALL SDL_HapticSetAutocenter(SDL_Haptic * haptic, int autocenter);
964 990
965 991
966 /* Ends C function definitions when using C++ */ 992 /* Ends C function definitions when using C++ */
967 #ifdef __cplusplus 993 #ifdef __cplusplus
968 /* *INDENT-OFF* */ 994 /* *INDENT-OFF* */