gosu 1.3.0 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/dependencies/SDL/include/SDL.h +108 -14
- data/dependencies/SDL/include/SDL_assert.h +81 -50
- data/dependencies/SDL/include/SDL_atomic.h +135 -35
- data/dependencies/SDL/include/SDL_audio.h +960 -355
- data/dependencies/SDL/include/SDL_bits.h +11 -6
- data/dependencies/SDL/include/SDL_blendmode.h +91 -14
- data/dependencies/SDL/include/SDL_clipboard.h +30 -7
- data/dependencies/SDL/include/SDL_config.h +277 -27
- data/dependencies/SDL/include/SDL_config_android.h +13 -38
- data/dependencies/SDL/include/SDL_config_iphoneos.h +21 -62
- data/dependencies/SDL/include/SDL_config_macosx.h +23 -92
- data/dependencies/SDL/include/SDL_config_minimal.h +1 -4
- data/dependencies/SDL/include/SDL_config_pandora.h +15 -22
- data/dependencies/SDL/include/SDL_config_psp.h +16 -37
- data/dependencies/SDL/include/SDL_config_windows.h +28 -91
- data/dependencies/SDL/include/SDL_config_winrt.h +33 -61
- data/dependencies/SDL/include/SDL_config_wiz.h +28 -56
- data/dependencies/SDL/include/SDL_copying.h +1 -1
- data/dependencies/SDL/include/SDL_cpuinfo.h +331 -71
- data/dependencies/SDL/include/SDL_egl.h +906 -280
- data/dependencies/SDL/include/SDL_endian.h +101 -47
- data/dependencies/SDL/include/SDL_error.h +70 -19
- data/dependencies/SDL/include/SDL_events.h +387 -79
- data/dependencies/SDL/include/SDL_filesystem.h +73 -64
- data/dependencies/SDL/include/SDL_gamecontroller.h +585 -125
- data/dependencies/SDL/include/SDL_gesture.h +36 -6
- data/dependencies/SDL/include/SDL_haptic.h +304 -210
- data/dependencies/SDL/include/SDL_hidapi.h +451 -0
- data/dependencies/SDL/include/SDL_hints.h +1286 -897
- data/dependencies/SDL/include/SDL_joystick.h +577 -130
- data/dependencies/SDL/include/SDL_keyboard.h +162 -63
- data/dependencies/SDL/include/SDL_keycode.h +7 -5
- data/dependencies/SDL/include/SDL_loadso.h +42 -8
- data/dependencies/SDL/include/SDL_locale.h +34 -32
- data/dependencies/SDL/include/SDL_log.h +212 -19
- data/dependencies/SDL/include/SDL_main.h +72 -17
- data/dependencies/SDL/include/SDL_messagebox.h +70 -23
- data/dependencies/SDL/include/SDL_metal.h +27 -32
- data/dependencies/SDL/include/SDL_misc.h +19 -15
- data/dependencies/SDL/include/SDL_mouse.h +262 -110
- data/dependencies/SDL/include/SDL_mutex.h +286 -66
- data/dependencies/SDL/include/SDL_name.h +1 -1
- data/dependencies/SDL/include/SDL_opengl.h +1 -1
- data/dependencies/SDL/include/SDL_opengles.h +1 -1
- data/dependencies/SDL/include/SDL_opengles2.h +2 -2
- data/dependencies/SDL/include/SDL_pixels.h +199 -34
- data/dependencies/SDL/include/SDL_platform.h +39 -2
- data/dependencies/SDL/include/SDL_power.h +23 -10
- data/dependencies/SDL/include/SDL_quit.h +1 -1
- data/dependencies/SDL/include/SDL_rect.h +78 -28
- data/dependencies/SDL/include/SDL_render.h +1204 -472
- data/dependencies/SDL/include/SDL_revision.h +2 -2
- data/dependencies/SDL/include/SDL_rwops.h +605 -33
- data/dependencies/SDL/include/SDL_scancode.h +1 -1
- data/dependencies/SDL/include/SDL_sensor.h +76 -42
- data/dependencies/SDL/include/SDL_shape.h +38 -27
- data/dependencies/SDL/include/SDL_stdinc.h +96 -24
- data/dependencies/SDL/include/SDL_surface.h +571 -139
- data/dependencies/SDL/include/SDL_system.h +339 -101
- data/dependencies/SDL/include/SDL_syswm.h +50 -20
- data/dependencies/SDL/include/SDL_test.h +1 -1
- data/dependencies/SDL/include/SDL_test_assert.h +2 -2
- data/dependencies/SDL/include/SDL_test_common.h +23 -6
- data/dependencies/SDL/include/SDL_test_compare.h +1 -1
- data/dependencies/SDL/include/SDL_test_crc32.h +1 -1
- data/dependencies/SDL/include/SDL_test_font.h +3 -3
- data/dependencies/SDL/include/SDL_test_fuzzer.h +28 -26
- data/dependencies/SDL/include/SDL_test_harness.h +6 -6
- data/dependencies/SDL/include/SDL_test_images.h +1 -1
- data/dependencies/SDL/include/SDL_test_log.h +1 -1
- data/dependencies/SDL/include/SDL_test_md5.h +1 -1
- data/dependencies/SDL/include/SDL_test_memory.h +1 -1
- data/dependencies/SDL/include/SDL_test_random.h +2 -2
- data/dependencies/SDL/include/SDL_thread.h +226 -128
- data/dependencies/SDL/include/SDL_timer.h +129 -22
- data/dependencies/SDL/include/SDL_touch.h +48 -8
- data/dependencies/SDL/include/SDL_types.h +1 -1
- data/dependencies/SDL/include/SDL_version.h +72 -46
- data/dependencies/SDL/include/SDL_video.h +1266 -460
- data/dependencies/SDL/include/SDL_vulkan.h +100 -161
- data/dependencies/SDL/include/begin_code.h +22 -1
- data/dependencies/SDL/include/close_code.h +1 -1
- data/dependencies/SDL/lib/x64/libSDL2.dll.a +0 -0
- data/dependencies/SDL/lib/x86/libSDL2.dll.a +0 -0
- data/dependencies/SDL_sound/SDL_sound.c +83 -7
- data/dependencies/SDL_sound/SDL_sound.h +4 -4
- data/dependencies/SDL_sound/SDL_sound_aiff.c +9 -12
- data/dependencies/SDL_sound/SDL_sound_au.c +7 -7
- data/dependencies/SDL_sound/SDL_sound_coreaudio.c +3 -3
- data/dependencies/SDL_sound/SDL_sound_flac.c +1 -1
- data/dependencies/SDL_sound/SDL_sound_internal.h +17 -10
- data/dependencies/SDL_sound/SDL_sound_modplug.c +25 -27
- data/dependencies/SDL_sound/SDL_sound_mp3.c +5 -17
- data/dependencies/SDL_sound/SDL_sound_raw.c +11 -11
- data/dependencies/SDL_sound/SDL_sound_shn.c +8 -7
- data/dependencies/SDL_sound/SDL_sound_voc.c +6 -4
- data/dependencies/SDL_sound/SDL_sound_vorbis.c +6 -11
- data/dependencies/SDL_sound/SDL_sound_wav.c +35 -29
- data/dependencies/SDL_sound/dr_flac.h +618 -220
- data/dependencies/SDL_sound/dr_mp3.h +263 -94
- data/dependencies/SDL_sound/libmodplug/fastmix.c +58 -64
- data/dependencies/SDL_sound/libmodplug/libmodplug.h +25 -103
- data/dependencies/SDL_sound/libmodplug/load_669.c +14 -17
- data/dependencies/SDL_sound/libmodplug/load_amf.c +11 -7
- data/dependencies/SDL_sound/libmodplug/load_ams.c +65 -22
- data/dependencies/SDL_sound/libmodplug/load_dbm.c +8 -4
- data/dependencies/SDL_sound/libmodplug/load_dmf.c +55 -25
- data/dependencies/SDL_sound/libmodplug/load_far.c +9 -13
- data/dependencies/SDL_sound/libmodplug/load_gdm.c +448 -0
- data/dependencies/SDL_sound/libmodplug/load_it.c +45 -49
- data/dependencies/SDL_sound/libmodplug/load_mdl.c +80 -53
- data/dependencies/SDL_sound/libmodplug/load_med.c +20 -12
- data/dependencies/SDL_sound/libmodplug/load_mod.c +40 -15
- data/dependencies/SDL_sound/libmodplug/load_mt2.c +29 -17
- data/dependencies/SDL_sound/libmodplug/load_okt.c +12 -8
- data/dependencies/SDL_sound/libmodplug/load_psm.c +101 -78
- data/dependencies/SDL_sound/libmodplug/load_ptm.c +18 -17
- data/dependencies/SDL_sound/libmodplug/load_s3m.c +9 -7
- data/dependencies/SDL_sound/libmodplug/load_stm.c +3 -2
- data/dependencies/SDL_sound/libmodplug/load_ult.c +2 -2
- data/dependencies/SDL_sound/libmodplug/load_umx.c +315 -35
- data/dependencies/SDL_sound/libmodplug/load_xm.c +25 -21
- data/dependencies/SDL_sound/libmodplug/mmcmp.c +295 -149
- data/dependencies/SDL_sound/libmodplug/modplug.c +7 -123
- data/dependencies/SDL_sound/libmodplug/modplug.h +32 -29
- data/dependencies/SDL_sound/libmodplug/snd_dsp.c +0 -1
- data/dependencies/SDL_sound/libmodplug/snd_flt.c +2 -2
- data/dependencies/SDL_sound/libmodplug/snd_fx.c +24 -18
- data/dependencies/SDL_sound/libmodplug/sndfile.c +55 -156
- data/dependencies/SDL_sound/libmodplug/sndmix.c +7 -12
- data/dependencies/SDL_sound/libmodplug/tables.h +10 -15
- data/dependencies/SDL_sound/stb_vorbis.h +508 -325
- data/dependencies/{al_soft → mojoAL}/AL/al.h +38 -30
- data/dependencies/{al_soft → mojoAL}/AL/alc.h +27 -56
- data/dependencies/mojoAL/mojoal.c +4594 -0
- data/ext/gosu/extconf.rb +29 -30
- data/include/Gosu/Audio.hpp +70 -85
- data/include/Gosu/Color.hpp +19 -11
- data/include/Gosu/Font.hpp +40 -44
- data/include/Gosu/Graphics.hpp +58 -71
- data/include/Gosu/GraphicsBase.hpp +26 -33
- data/include/Gosu/Image.hpp +56 -62
- data/include/Gosu/ImageData.hpp +23 -27
- data/include/Gosu/Inspection.hpp +1 -4
- data/include/Gosu/TextInput.hpp +34 -40
- data/include/Gosu/Version.hpp +1 -1
- data/include/Gosu/Window.hpp +71 -70
- data/lib/SDL2.dll +0 -0
- data/lib/gosu/compat.rb +24 -37
- data/lib/gosu.rb +2 -2
- data/lib64/SDL2.dll +0 -0
- data/src/Audio.cpp +86 -86
- data/src/AudioFile.hpp +6 -6
- data/src/AudioFileAudioToolbox.cpp +1 -1
- data/src/AudioFileSDLSound.cpp +1 -1
- data/src/AudioImpl.hpp +5 -5
- data/src/BitmapIO.cpp +0 -20
- data/src/BlockAllocator.cpp +2 -1
- data/src/Channel.cpp +22 -20
- data/src/Color.cpp +12 -9
- data/src/EmptyImageData.hpp +15 -17
- data/src/FileUnix.cpp +1 -1
- data/src/FileWin.cpp +1 -1
- data/src/Font.cpp +48 -53
- data/src/Graphics.cpp +135 -143
- data/src/Image.cpp +41 -42
- data/src/Input.cpp +1 -1
- data/src/InputUIKit.cpp +1 -1
- data/src/LargeImageData.cpp +108 -101
- data/src/LargeImageData.hpp +17 -15
- data/src/Log.hpp +6 -6
- data/src/Macro.cpp +35 -37
- data/src/Macro.hpp +11 -11
- data/src/Math.cpp +8 -1
- data/src/Resolution.cpp +12 -7
- data/src/RubyGosu.cxx +5 -5
- data/src/TexChunk.cpp +50 -41
- data/src/TexChunk.hpp +22 -22
- data/src/Text.cpp +37 -37
- data/src/TextBuilder.cpp +60 -57
- data/src/TextBuilder.hpp +20 -20
- data/src/TextInput.cpp +127 -135
- data/src/TrueTypeFont.cpp +107 -107
- data/src/TrueTypeFont.hpp +39 -38
- data/src/TrueTypeFontApple.cpp +19 -22
- data/src/TrueTypeFontUnix.cpp +21 -26
- data/src/TrueTypeFontWin.cpp +30 -30
- data/src/Window.cpp +95 -86
- data/src/WindowUIKit.cpp +46 -49
- metadata +7 -17
- data/dependencies/SDL/include/SDL_config_os2.h +0 -188
- data/dependencies/SDL_sound/libmodplug/load_abc.c +0 -4725
- data/dependencies/SDL_sound/libmodplug/load_mid.c +0 -1405
- data/dependencies/SDL_sound/libmodplug/load_pat.c +0 -1143
- data/dependencies/SDL_sound/libmodplug/load_pat.h +0 -25
- data/dependencies/al_soft/AL/alext.h +0 -585
- data/dependencies/al_soft/AL/efx-creative.h +0 -3
- data/dependencies/al_soft/AL/efx-presets.h +0 -402
- data/dependencies/al_soft/AL/efx.h +0 -762
- data/dependencies/al_soft/x64/libOpenAL32.dll.a +0 -0
- data/dependencies/al_soft/x86/libOpenAL32.dll.a +0 -0
- data/lib/OpenAL32.dll +0 -0
- data/lib64/OpenAL32.dll +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
Simple DirectMedia Layer
|
3
|
-
Copyright (C) 1997-
|
3
|
+
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
4
4
|
|
5
5
|
This software is provided 'as-is', without any express or implied
|
6
6
|
warranty. In no event will the authors be held liable for any damages
|
@@ -76,7 +76,7 @@
|
|
76
76
|
* }
|
77
77
|
*
|
78
78
|
* // Create the effect
|
79
|
-
*
|
79
|
+
* SDL_memset( &effect, 0, sizeof(SDL_HapticEffect) ); // 0 is safe default
|
80
80
|
* effect.type = SDL_HAPTIC_SINE;
|
81
81
|
* effect.periodic.direction.type = SDL_HAPTIC_POLAR; // Polar coordinates
|
82
82
|
* effect.periodic.direction.dir[0] = 18000; // Force comes from south
|
@@ -820,419 +820,513 @@ typedef union SDL_HapticEffect
|
|
820
820
|
|
821
821
|
|
822
822
|
/* Function prototypes */
|
823
|
+
|
823
824
|
/**
|
824
|
-
*
|
825
|
+
* Count the number of haptic devices attached to the system.
|
826
|
+
*
|
827
|
+
* \returns the number of haptic devices detected on the system or a negative
|
828
|
+
* error code on failure; call SDL_GetError() for more information.
|
825
829
|
*
|
826
|
-
*
|
830
|
+
* \since This function is available since SDL 2.0.0.
|
831
|
+
*
|
832
|
+
* \sa SDL_HapticName
|
827
833
|
*/
|
828
834
|
extern DECLSPEC int SDLCALL SDL_NumHaptics(void);
|
829
835
|
|
830
836
|
/**
|
831
|
-
*
|
837
|
+
* Get the implementation dependent name of a haptic device.
|
838
|
+
*
|
839
|
+
* This can be called before any joysticks are opened. If no name can be
|
840
|
+
* found, this function returns NULL.
|
832
841
|
*
|
833
|
-
*
|
834
|
-
*
|
842
|
+
* \param device_index index of the device to query.
|
843
|
+
* \returns the name of the device or NULL on failure; call SDL_GetError() for
|
844
|
+
* more information.
|
835
845
|
*
|
836
|
-
*
|
837
|
-
* \return Name of the device or NULL on error.
|
846
|
+
* \since This function is available since SDL 2.0.0.
|
838
847
|
*
|
839
|
-
*
|
848
|
+
* \sa SDL_NumHaptics
|
840
849
|
*/
|
841
850
|
extern DECLSPEC const char *SDLCALL SDL_HapticName(int device_index);
|
842
851
|
|
843
852
|
/**
|
844
|
-
*
|
853
|
+
* Open a haptic device for use.
|
845
854
|
*
|
846
|
-
*
|
847
|
-
*
|
855
|
+
* The index passed as an argument refers to the N'th haptic device on this
|
856
|
+
* system.
|
848
857
|
*
|
849
|
-
*
|
850
|
-
*
|
851
|
-
*
|
858
|
+
* When opening a haptic device, its gain will be set to maximum and
|
859
|
+
* autocenter will be disabled. To modify these values use SDL_HapticSetGain()
|
860
|
+
* and SDL_HapticSetAutocenter().
|
852
861
|
*
|
853
|
-
*
|
854
|
-
*
|
862
|
+
* \param device_index index of the device to open
|
863
|
+
* \returns the device identifier or NULL on failure; call SDL_GetError() for
|
864
|
+
* more information.
|
855
865
|
*
|
856
|
-
*
|
857
|
-
*
|
858
|
-
*
|
859
|
-
*
|
860
|
-
*
|
861
|
-
*
|
862
|
-
*
|
863
|
-
*
|
866
|
+
* \since This function is available since SDL 2.0.0.
|
867
|
+
*
|
868
|
+
* \sa SDL_HapticClose
|
869
|
+
* \sa SDL_HapticIndex
|
870
|
+
* \sa SDL_HapticOpenFromJoystick
|
871
|
+
* \sa SDL_HapticOpenFromMouse
|
872
|
+
* \sa SDL_HapticPause
|
873
|
+
* \sa SDL_HapticSetAutocenter
|
874
|
+
* \sa SDL_HapticSetGain
|
875
|
+
* \sa SDL_HapticStopAll
|
864
876
|
*/
|
865
877
|
extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpen(int device_index);
|
866
878
|
|
867
879
|
/**
|
868
|
-
*
|
880
|
+
* Check if the haptic device at the designated index has been opened.
|
869
881
|
*
|
870
|
-
*
|
871
|
-
*
|
882
|
+
* \param device_index the index of the device to query
|
883
|
+
* \returns 1 if it has been opened, 0 if it hasn't or on failure; call
|
884
|
+
* SDL_GetError() for more information.
|
872
885
|
*
|
873
|
-
*
|
874
|
-
*
|
886
|
+
* \since This function is available since SDL 2.0.0.
|
887
|
+
*
|
888
|
+
* \sa SDL_HapticIndex
|
889
|
+
* \sa SDL_HapticOpen
|
875
890
|
*/
|
876
891
|
extern DECLSPEC int SDLCALL SDL_HapticOpened(int device_index);
|
877
892
|
|
878
893
|
/**
|
879
|
-
*
|
894
|
+
* Get the index of a haptic device.
|
880
895
|
*
|
881
|
-
*
|
882
|
-
*
|
896
|
+
* \param haptic the SDL_Haptic device to query
|
897
|
+
* \returns the index of the specified haptic device or a negative error code
|
898
|
+
* on failure; call SDL_GetError() for more information.
|
883
899
|
*
|
884
|
-
*
|
885
|
-
*
|
900
|
+
* \since This function is available since SDL 2.0.0.
|
901
|
+
*
|
902
|
+
* \sa SDL_HapticOpen
|
903
|
+
* \sa SDL_HapticOpened
|
886
904
|
*/
|
887
905
|
extern DECLSPEC int SDLCALL SDL_HapticIndex(SDL_Haptic * haptic);
|
888
906
|
|
889
907
|
/**
|
890
|
-
*
|
908
|
+
* Query whether or not the current mouse has haptic capabilities.
|
891
909
|
*
|
892
|
-
*
|
910
|
+
* \returns SDL_TRUE if the mouse is haptic or SDL_FALSE if it isn't.
|
893
911
|
*
|
894
|
-
*
|
912
|
+
* \since This function is available since SDL 2.0.0.
|
913
|
+
*
|
914
|
+
* \sa SDL_HapticOpenFromMouse
|
895
915
|
*/
|
896
916
|
extern DECLSPEC int SDLCALL SDL_MouseIsHaptic(void);
|
897
917
|
|
898
918
|
/**
|
899
|
-
*
|
919
|
+
* Try to open a haptic device from the current mouse.
|
900
920
|
*
|
901
|
-
*
|
921
|
+
* \returns the haptic device identifier or NULL on failure; call
|
922
|
+
* SDL_GetError() for more information.
|
902
923
|
*
|
903
|
-
*
|
904
|
-
*
|
924
|
+
* \since This function is available since SDL 2.0.0.
|
925
|
+
*
|
926
|
+
* \sa SDL_HapticOpen
|
927
|
+
* \sa SDL_MouseIsHaptic
|
905
928
|
*/
|
906
929
|
extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpenFromMouse(void);
|
907
930
|
|
908
931
|
/**
|
909
|
-
*
|
932
|
+
* Query if a joystick has haptic features.
|
910
933
|
*
|
911
|
-
*
|
912
|
-
*
|
913
|
-
*
|
934
|
+
* \param joystick the SDL_Joystick to test for haptic capabilities
|
935
|
+
* \returns SDL_TRUE if the joystick is haptic, SDL_FALSE if it isn't, or a
|
936
|
+
* negative error code on failure; call SDL_GetError() for more
|
937
|
+
* information.
|
914
938
|
*
|
915
|
-
*
|
939
|
+
* \since This function is available since SDL 2.0.0.
|
940
|
+
*
|
941
|
+
* \sa SDL_HapticOpenFromJoystick
|
916
942
|
*/
|
917
943
|
extern DECLSPEC int SDLCALL SDL_JoystickIsHaptic(SDL_Joystick * joystick);
|
918
944
|
|
919
945
|
/**
|
920
|
-
*
|
946
|
+
* Open a haptic device for use from a joystick device.
|
921
947
|
*
|
922
|
-
*
|
923
|
-
*
|
948
|
+
* You must still close the haptic device separately. It will not be closed
|
949
|
+
* with the joystick.
|
924
950
|
*
|
925
|
-
*
|
926
|
-
*
|
927
|
-
*
|
928
|
-
*
|
951
|
+
* When opened from a joystick you should first close the haptic device before
|
952
|
+
* closing the joystick device. If not, on some implementations the haptic
|
953
|
+
* device will also get unallocated and you'll be unable to use force feedback
|
954
|
+
* on that device.
|
929
955
|
*
|
930
|
-
*
|
931
|
-
*
|
956
|
+
* \param joystick the SDL_Joystick to create a haptic device from
|
957
|
+
* \returns a valid haptic device identifier on success or NULL on failure;
|
958
|
+
* call SDL_GetError() for more information.
|
932
959
|
*
|
933
|
-
*
|
934
|
-
*
|
960
|
+
* \since This function is available since SDL 2.0.0.
|
961
|
+
*
|
962
|
+
* \sa SDL_HapticClose
|
963
|
+
* \sa SDL_HapticOpen
|
964
|
+
* \sa SDL_JoystickIsHaptic
|
935
965
|
*/
|
936
966
|
extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpenFromJoystick(SDL_Joystick *
|
937
967
|
joystick);
|
938
968
|
|
939
969
|
/**
|
940
|
-
*
|
970
|
+
* Close a haptic device previously opened with SDL_HapticOpen().
|
971
|
+
*
|
972
|
+
* \param haptic the SDL_Haptic device to close
|
941
973
|
*
|
942
|
-
*
|
974
|
+
* \since This function is available since SDL 2.0.0.
|
975
|
+
*
|
976
|
+
* \sa SDL_HapticOpen
|
943
977
|
*/
|
944
978
|
extern DECLSPEC void SDLCALL SDL_HapticClose(SDL_Haptic * haptic);
|
945
979
|
|
946
980
|
/**
|
947
|
-
*
|
981
|
+
* Get the number of effects a haptic device can store.
|
982
|
+
*
|
983
|
+
* On some platforms this isn't fully supported, and therefore is an
|
984
|
+
* approximation. Always check to see if your created effect was actually
|
985
|
+
* created and do not rely solely on SDL_HapticNumEffects().
|
948
986
|
*
|
949
|
-
*
|
950
|
-
*
|
951
|
-
*
|
987
|
+
* \param haptic the SDL_Haptic device to query
|
988
|
+
* \returns the number of effects the haptic device can store or a negative
|
989
|
+
* error code on failure; call SDL_GetError() for more information.
|
952
990
|
*
|
953
|
-
*
|
954
|
-
* \return The number of effects the haptic device can store or
|
955
|
-
* -1 on error.
|
991
|
+
* \since This function is available since SDL 2.0.0.
|
956
992
|
*
|
957
|
-
*
|
958
|
-
*
|
993
|
+
* \sa SDL_HapticNumEffectsPlaying
|
994
|
+
* \sa SDL_HapticQuery
|
959
995
|
*/
|
960
996
|
extern DECLSPEC int SDLCALL SDL_HapticNumEffects(SDL_Haptic * haptic);
|
961
997
|
|
962
998
|
/**
|
963
|
-
*
|
964
|
-
* time.
|
999
|
+
* Get the number of effects a haptic device can play at the same time.
|
965
1000
|
*
|
966
|
-
*
|
967
|
-
* Added here for the sake of completeness.
|
1001
|
+
* This is not supported on all platforms, but will always return a value.
|
968
1002
|
*
|
969
|
-
*
|
970
|
-
*
|
971
|
-
* or
|
1003
|
+
* \param haptic the SDL_Haptic device to query maximum playing effects
|
1004
|
+
* \returns the number of effects the haptic device can play at the same time
|
1005
|
+
* or a negative error code on failure; call SDL_GetError() for more
|
1006
|
+
* information.
|
972
1007
|
*
|
973
|
-
*
|
974
|
-
*
|
1008
|
+
* \since This function is available since SDL 2.0.0.
|
1009
|
+
*
|
1010
|
+
* \sa SDL_HapticNumEffects
|
1011
|
+
* \sa SDL_HapticQuery
|
975
1012
|
*/
|
976
1013
|
extern DECLSPEC int SDLCALL SDL_HapticNumEffectsPlaying(SDL_Haptic * haptic);
|
977
1014
|
|
978
1015
|
/**
|
979
|
-
*
|
1016
|
+
* Get the haptic device's supported features in bitwise manner.
|
980
1017
|
*
|
981
|
-
*
|
982
|
-
*
|
983
|
-
*
|
984
|
-
* printf("We have constant haptic effect!\n");
|
985
|
-
* }
|
986
|
-
* \endcode
|
1018
|
+
* \param haptic the SDL_Haptic device to query
|
1019
|
+
* \returns a list of supported haptic features in bitwise manner (OR'd), or 0
|
1020
|
+
* on failure; call SDL_GetError() for more information.
|
987
1021
|
*
|
988
|
-
*
|
989
|
-
* \return Haptic features in bitwise manner (OR'd).
|
1022
|
+
* \since This function is available since SDL 2.0.0.
|
990
1023
|
*
|
991
|
-
*
|
992
|
-
*
|
1024
|
+
* \sa SDL_HapticEffectSupported
|
1025
|
+
* \sa SDL_HapticNumEffects
|
993
1026
|
*/
|
994
1027
|
extern DECLSPEC unsigned int SDLCALL SDL_HapticQuery(SDL_Haptic * haptic);
|
995
1028
|
|
996
1029
|
|
997
1030
|
/**
|
998
|
-
*
|
1031
|
+
* Get the number of haptic axes the device has.
|
999
1032
|
*
|
1000
|
-
*
|
1033
|
+
* The number of haptic axes might be useful if working with the
|
1034
|
+
* SDL_HapticDirection effect.
|
1035
|
+
*
|
1036
|
+
* \param haptic the SDL_Haptic device to query
|
1037
|
+
* \returns the number of axes on success or a negative error code on failure;
|
1038
|
+
* call SDL_GetError() for more information.
|
1039
|
+
*
|
1040
|
+
* \since This function is available since SDL 2.0.0.
|
1001
1041
|
*/
|
1002
1042
|
extern DECLSPEC int SDLCALL SDL_HapticNumAxes(SDL_Haptic * haptic);
|
1003
1043
|
|
1004
1044
|
/**
|
1005
|
-
*
|
1045
|
+
* Check to see if an effect is supported by a haptic device.
|
1046
|
+
*
|
1047
|
+
* \param haptic the SDL_Haptic device to query
|
1048
|
+
* \param effect the desired effect to query
|
1049
|
+
* \returns SDL_TRUE if effect is supported, SDL_FALSE if it isn't, or a
|
1050
|
+
* negative error code on failure; call SDL_GetError() for more
|
1051
|
+
* information.
|
1006
1052
|
*
|
1007
|
-
*
|
1008
|
-
* \param effect Effect to check to see if it is supported.
|
1009
|
-
* \return SDL_TRUE if effect is supported, SDL_FALSE if it isn't or -1 on error.
|
1053
|
+
* \since This function is available since SDL 2.0.0.
|
1010
1054
|
*
|
1011
|
-
*
|
1012
|
-
*
|
1055
|
+
* \sa SDL_HapticNewEffect
|
1056
|
+
* \sa SDL_HapticQuery
|
1013
1057
|
*/
|
1014
1058
|
extern DECLSPEC int SDLCALL SDL_HapticEffectSupported(SDL_Haptic * haptic,
|
1015
1059
|
SDL_HapticEffect *
|
1016
1060
|
effect);
|
1017
1061
|
|
1018
1062
|
/**
|
1019
|
-
*
|
1063
|
+
* Create a new haptic effect on a specified device.
|
1020
1064
|
*
|
1021
|
-
*
|
1022
|
-
*
|
1023
|
-
*
|
1065
|
+
* \param haptic an SDL_Haptic device to create the effect on
|
1066
|
+
* \param effect an SDL_HapticEffect structure containing the properties of
|
1067
|
+
* the effect to create
|
1068
|
+
* \returns the ID of the effect on success or a negative error code on
|
1069
|
+
* failure; call SDL_GetError() for more information.
|
1024
1070
|
*
|
1025
|
-
*
|
1026
|
-
*
|
1027
|
-
*
|
1071
|
+
* \since This function is available since SDL 2.0.0.
|
1072
|
+
*
|
1073
|
+
* \sa SDL_HapticDestroyEffect
|
1074
|
+
* \sa SDL_HapticRunEffect
|
1075
|
+
* \sa SDL_HapticUpdateEffect
|
1028
1076
|
*/
|
1029
1077
|
extern DECLSPEC int SDLCALL SDL_HapticNewEffect(SDL_Haptic * haptic,
|
1030
1078
|
SDL_HapticEffect * effect);
|
1031
1079
|
|
1032
1080
|
/**
|
1033
|
-
*
|
1081
|
+
* Update the properties of an effect.
|
1082
|
+
*
|
1083
|
+
* Can be used dynamically, although behavior when dynamically changing
|
1084
|
+
* direction may be strange. Specifically the effect may re-upload itself and
|
1085
|
+
* start playing from the start. You also cannot change the type either when
|
1086
|
+
* running SDL_HapticUpdateEffect().
|
1034
1087
|
*
|
1035
|
-
*
|
1036
|
-
*
|
1037
|
-
*
|
1038
|
-
*
|
1088
|
+
* \param haptic the SDL_Haptic device that has the effect
|
1089
|
+
* \param effect the identifier of the effect to update
|
1090
|
+
* \param data an SDL_HapticEffect structure containing the new effect
|
1091
|
+
* properties to use
|
1092
|
+
* \returns 0 on success or a negative error code on failure; call
|
1093
|
+
* SDL_GetError() for more information.
|
1039
1094
|
*
|
1040
|
-
*
|
1041
|
-
* \param effect Identifier of the effect to update.
|
1042
|
-
* \param data New effect properties to use.
|
1043
|
-
* \return 0 on success or -1 on error.
|
1095
|
+
* \since This function is available since SDL 2.0.0.
|
1044
1096
|
*
|
1045
|
-
*
|
1046
|
-
*
|
1047
|
-
*
|
1097
|
+
* \sa SDL_HapticDestroyEffect
|
1098
|
+
* \sa SDL_HapticNewEffect
|
1099
|
+
* \sa SDL_HapticRunEffect
|
1048
1100
|
*/
|
1049
1101
|
extern DECLSPEC int SDLCALL SDL_HapticUpdateEffect(SDL_Haptic * haptic,
|
1050
1102
|
int effect,
|
1051
1103
|
SDL_HapticEffect * data);
|
1052
1104
|
|
1053
1105
|
/**
|
1054
|
-
*
|
1106
|
+
* Run the haptic effect on its associated haptic device.
|
1055
1107
|
*
|
1056
|
-
*
|
1057
|
-
*
|
1058
|
-
*
|
1059
|
-
*
|
1108
|
+
* To repeat the effect over and over indefinitely, set `iterations` to
|
1109
|
+
* `SDL_HAPTIC_INFINITY`. (Repeats the envelope - attack and fade.) To make
|
1110
|
+
* one instance of the effect last indefinitely (so the effect does not fade),
|
1111
|
+
* set the effect's `length` in its structure/union to `SDL_HAPTIC_INFINITY`
|
1112
|
+
* instead.
|
1060
1113
|
*
|
1061
|
-
*
|
1062
|
-
*
|
1063
|
-
*
|
1064
|
-
*
|
1065
|
-
*
|
1114
|
+
* \param haptic the SDL_Haptic device to run the effect on
|
1115
|
+
* \param effect the ID of the haptic effect to run
|
1116
|
+
* \param iterations the number of iterations to run the effect; use
|
1117
|
+
* `SDL_HAPTIC_INFINITY` to repeat forever
|
1118
|
+
* \returns 0 on success or a negative error code on failure; call
|
1119
|
+
* SDL_GetError() for more information.
|
1066
1120
|
*
|
1067
|
-
*
|
1068
|
-
*
|
1069
|
-
*
|
1121
|
+
* \since This function is available since SDL 2.0.0.
|
1122
|
+
*
|
1123
|
+
* \sa SDL_HapticDestroyEffect
|
1124
|
+
* \sa SDL_HapticGetEffectStatus
|
1125
|
+
* \sa SDL_HapticStopEffect
|
1070
1126
|
*/
|
1071
1127
|
extern DECLSPEC int SDLCALL SDL_HapticRunEffect(SDL_Haptic * haptic,
|
1072
1128
|
int effect,
|
1073
1129
|
Uint32 iterations);
|
1074
1130
|
|
1075
1131
|
/**
|
1076
|
-
*
|
1132
|
+
* Stop the haptic effect on its associated haptic device.
|
1133
|
+
*
|
1134
|
+
* *
|
1077
1135
|
*
|
1078
|
-
*
|
1079
|
-
*
|
1080
|
-
*
|
1136
|
+
* \param haptic the SDL_Haptic device to stop the effect on
|
1137
|
+
* \param effect the ID of the haptic effect to stop
|
1138
|
+
* \returns 0 on success or a negative error code on failure; call
|
1139
|
+
* SDL_GetError() for more information.
|
1081
1140
|
*
|
1082
|
-
*
|
1083
|
-
*
|
1141
|
+
* \since This function is available since SDL 2.0.0.
|
1142
|
+
*
|
1143
|
+
* \sa SDL_HapticDestroyEffect
|
1144
|
+
* \sa SDL_HapticRunEffect
|
1084
1145
|
*/
|
1085
1146
|
extern DECLSPEC int SDLCALL SDL_HapticStopEffect(SDL_Haptic * haptic,
|
1086
1147
|
int effect);
|
1087
1148
|
|
1088
1149
|
/**
|
1089
|
-
*
|
1150
|
+
* Destroy a haptic effect on the device.
|
1151
|
+
*
|
1152
|
+
* This will stop the effect if it's running. Effects are automatically
|
1153
|
+
* destroyed when the device is closed.
|
1090
1154
|
*
|
1091
|
-
*
|
1092
|
-
*
|
1155
|
+
* \param haptic the SDL_Haptic device to destroy the effect on
|
1156
|
+
* \param effect the ID of the haptic effect to destroy
|
1093
1157
|
*
|
1094
|
-
*
|
1095
|
-
* \param effect Identifier of the effect to destroy.
|
1158
|
+
* \since This function is available since SDL 2.0.0.
|
1096
1159
|
*
|
1097
|
-
*
|
1160
|
+
* \sa SDL_HapticNewEffect
|
1098
1161
|
*/
|
1099
1162
|
extern DECLSPEC void SDLCALL SDL_HapticDestroyEffect(SDL_Haptic * haptic,
|
1100
1163
|
int effect);
|
1101
1164
|
|
1102
1165
|
/**
|
1103
|
-
*
|
1166
|
+
* Get the status of the current effect on the specified haptic device.
|
1104
1167
|
*
|
1105
|
-
*
|
1168
|
+
* Device must support the SDL_HAPTIC_STATUS feature.
|
1106
1169
|
*
|
1107
|
-
*
|
1108
|
-
*
|
1109
|
-
*
|
1170
|
+
* \param haptic the SDL_Haptic device to query for the effect status on
|
1171
|
+
* \param effect the ID of the haptic effect to query its status
|
1172
|
+
* \returns 0 if it isn't playing, 1 if it is playing, or a negative error
|
1173
|
+
* code on failure; call SDL_GetError() for more information.
|
1110
1174
|
*
|
1111
|
-
*
|
1112
|
-
*
|
1175
|
+
* \since This function is available since SDL 2.0.0.
|
1176
|
+
*
|
1177
|
+
* \sa SDL_HapticRunEffect
|
1178
|
+
* \sa SDL_HapticStopEffect
|
1113
1179
|
*/
|
1114
1180
|
extern DECLSPEC int SDLCALL SDL_HapticGetEffectStatus(SDL_Haptic * haptic,
|
1115
1181
|
int effect);
|
1116
1182
|
|
1117
1183
|
/**
|
1118
|
-
*
|
1184
|
+
* Set the global gain of the specified haptic device.
|
1119
1185
|
*
|
1120
|
-
*
|
1186
|
+
* Device must support the SDL_HAPTIC_GAIN feature.
|
1121
1187
|
*
|
1122
|
-
*
|
1123
|
-
*
|
1124
|
-
*
|
1125
|
-
*
|
1188
|
+
* The user may specify the maximum gain by setting the environment variable
|
1189
|
+
* `SDL_HAPTIC_GAIN_MAX` which should be between 0 and 100. All calls to
|
1190
|
+
* SDL_HapticSetGain() will scale linearly using `SDL_HAPTIC_GAIN_MAX` as the
|
1191
|
+
* maximum.
|
1126
1192
|
*
|
1127
|
-
*
|
1128
|
-
*
|
1129
|
-
*
|
1193
|
+
* \param haptic the SDL_Haptic device to set the gain on
|
1194
|
+
* \param gain value to set the gain to, should be between 0 and 100 (0 - 100)
|
1195
|
+
* \returns 0 on success or a negative error code on failure; call
|
1196
|
+
* SDL_GetError() for more information.
|
1130
1197
|
*
|
1131
|
-
*
|
1198
|
+
* \since This function is available since SDL 2.0.0.
|
1199
|
+
*
|
1200
|
+
* \sa SDL_HapticQuery
|
1132
1201
|
*/
|
1133
1202
|
extern DECLSPEC int SDLCALL SDL_HapticSetGain(SDL_Haptic * haptic, int gain);
|
1134
1203
|
|
1135
1204
|
/**
|
1136
|
-
*
|
1205
|
+
* Set the global autocenter of the device.
|
1206
|
+
*
|
1207
|
+
* Autocenter should be between 0 and 100. Setting it to 0 will disable
|
1208
|
+
* autocentering.
|
1137
1209
|
*
|
1138
|
-
*
|
1139
|
-
* autocentering.
|
1210
|
+
* Device must support the SDL_HAPTIC_AUTOCENTER feature.
|
1140
1211
|
*
|
1141
|
-
*
|
1212
|
+
* \param haptic the SDL_Haptic device to set autocentering on
|
1213
|
+
* \param autocenter value to set autocenter to (0-100)
|
1214
|
+
* \returns 0 on success or a negative error code on failure; call
|
1215
|
+
* SDL_GetError() for more information.
|
1142
1216
|
*
|
1143
|
-
*
|
1144
|
-
* \param autocenter Value to set autocenter to, 0 disables autocentering.
|
1145
|
-
* \return 0 on success or -1 on error.
|
1217
|
+
* \since This function is available since SDL 2.0.0.
|
1146
1218
|
*
|
1147
|
-
*
|
1219
|
+
* \sa SDL_HapticQuery
|
1148
1220
|
*/
|
1149
1221
|
extern DECLSPEC int SDLCALL SDL_HapticSetAutocenter(SDL_Haptic * haptic,
|
1150
1222
|
int autocenter);
|
1151
1223
|
|
1152
1224
|
/**
|
1153
|
-
*
|
1225
|
+
* Pause a haptic device.
|
1154
1226
|
*
|
1155
|
-
*
|
1156
|
-
*
|
1227
|
+
* Device must support the `SDL_HAPTIC_PAUSE` feature. Call
|
1228
|
+
* SDL_HapticUnpause() to resume playback.
|
1157
1229
|
*
|
1158
|
-
*
|
1159
|
-
*
|
1230
|
+
* Do not modify the effects nor add new ones while the device is paused. That
|
1231
|
+
* can cause all sorts of weird errors.
|
1160
1232
|
*
|
1161
|
-
*
|
1162
|
-
*
|
1233
|
+
* \param haptic the SDL_Haptic device to pause
|
1234
|
+
* \returns 0 on success or a negative error code on failure; call
|
1235
|
+
* SDL_GetError() for more information.
|
1163
1236
|
*
|
1164
|
-
*
|
1237
|
+
* \since This function is available since SDL 2.0.0.
|
1238
|
+
*
|
1239
|
+
* \sa SDL_HapticUnpause
|
1165
1240
|
*/
|
1166
1241
|
extern DECLSPEC int SDLCALL SDL_HapticPause(SDL_Haptic * haptic);
|
1167
1242
|
|
1168
1243
|
/**
|
1169
|
-
*
|
1244
|
+
* Unpause a haptic device.
|
1170
1245
|
*
|
1171
|
-
*
|
1246
|
+
* Call to unpause after SDL_HapticPause().
|
1172
1247
|
*
|
1173
|
-
*
|
1174
|
-
*
|
1248
|
+
* \param haptic the SDL_Haptic device to unpause
|
1249
|
+
* \returns 0 on success or a negative error code on failure; call
|
1250
|
+
* SDL_GetError() for more information.
|
1175
1251
|
*
|
1176
|
-
*
|
1252
|
+
* \since This function is available since SDL 2.0.0.
|
1253
|
+
*
|
1254
|
+
* \sa SDL_HapticPause
|
1177
1255
|
*/
|
1178
1256
|
extern DECLSPEC int SDLCALL SDL_HapticUnpause(SDL_Haptic * haptic);
|
1179
1257
|
|
1180
1258
|
/**
|
1181
|
-
*
|
1259
|
+
* Stop all the currently playing effects on a haptic device.
|
1260
|
+
*
|
1261
|
+
* \param haptic the SDL_Haptic device to stop
|
1262
|
+
* \returns 0 on success or a negative error code on failure; call
|
1263
|
+
* SDL_GetError() for more information.
|
1182
1264
|
*
|
1183
|
-
*
|
1184
|
-
* \return 0 on success or -1 on error.
|
1265
|
+
* \since This function is available since SDL 2.0.0.
|
1185
1266
|
*/
|
1186
1267
|
extern DECLSPEC int SDLCALL SDL_HapticStopAll(SDL_Haptic * haptic);
|
1187
1268
|
|
1188
1269
|
/**
|
1189
|
-
*
|
1270
|
+
* Check whether rumble is supported on a haptic device.
|
1190
1271
|
*
|
1191
|
-
*
|
1192
|
-
*
|
1272
|
+
* \param haptic haptic device to check for rumble support
|
1273
|
+
* \returns SDL_TRUE if effect is supported, SDL_FALSE if it isn't, or a
|
1274
|
+
* negative error code on failure; call SDL_GetError() for more
|
1275
|
+
* information.
|
1193
1276
|
*
|
1194
|
-
*
|
1195
|
-
*
|
1196
|
-
*
|
1277
|
+
* \since This function is available since SDL 2.0.0.
|
1278
|
+
*
|
1279
|
+
* \sa SDL_HapticRumbleInit
|
1280
|
+
* \sa SDL_HapticRumblePlay
|
1281
|
+
* \sa SDL_HapticRumbleStop
|
1197
1282
|
*/
|
1198
1283
|
extern DECLSPEC int SDLCALL SDL_HapticRumbleSupported(SDL_Haptic * haptic);
|
1199
1284
|
|
1200
1285
|
/**
|
1201
|
-
*
|
1286
|
+
* Initialize a haptic device for simple rumble playback.
|
1202
1287
|
*
|
1203
|
-
*
|
1204
|
-
*
|
1288
|
+
* \param haptic the haptic device to initialize for simple rumble playback
|
1289
|
+
* \returns 0 on success or a negative error code on failure; call
|
1290
|
+
* SDL_GetError() for more information.
|
1205
1291
|
*
|
1206
|
-
*
|
1207
|
-
*
|
1208
|
-
*
|
1209
|
-
*
|
1292
|
+
* \since This function is available since SDL 2.0.0.
|
1293
|
+
*
|
1294
|
+
* \sa SDL_HapticOpen
|
1295
|
+
* \sa SDL_HapticRumblePlay
|
1296
|
+
* \sa SDL_HapticRumbleStop
|
1297
|
+
* \sa SDL_HapticRumbleSupported
|
1210
1298
|
*/
|
1211
1299
|
extern DECLSPEC int SDLCALL SDL_HapticRumbleInit(SDL_Haptic * haptic);
|
1212
1300
|
|
1213
1301
|
/**
|
1214
|
-
*
|
1302
|
+
* Run a simple rumble effect on a haptic device.
|
1303
|
+
*
|
1304
|
+
* \param haptic the haptic device to play the rumble effect on
|
1305
|
+
* \param strength strength of the rumble to play as a 0-1 float value
|
1306
|
+
* \param length length of the rumble to play in milliseconds
|
1307
|
+
* \returns 0 on success or a negative error code on failure; call
|
1308
|
+
* SDL_GetError() for more information.
|
1215
1309
|
*
|
1216
|
-
*
|
1217
|
-
* \param strength Strength of the rumble to play as a 0-1 float value.
|
1218
|
-
* \param length Length of the rumble to play in milliseconds.
|
1219
|
-
* \return 0 on success or -1 on error.
|
1310
|
+
* \since This function is available since SDL 2.0.0.
|
1220
1311
|
*
|
1221
|
-
*
|
1222
|
-
*
|
1223
|
-
*
|
1312
|
+
* \sa SDL_HapticRumbleInit
|
1313
|
+
* \sa SDL_HapticRumbleStop
|
1314
|
+
* \sa SDL_HapticRumbleSupported
|
1224
1315
|
*/
|
1225
1316
|
extern DECLSPEC int SDLCALL SDL_HapticRumblePlay(SDL_Haptic * haptic, float strength, Uint32 length );
|
1226
1317
|
|
1227
1318
|
/**
|
1228
|
-
*
|
1319
|
+
* Stop the simple rumble on a haptic device.
|
1320
|
+
*
|
1321
|
+
* \param haptic the haptic device to stop the rumble effect on
|
1322
|
+
* \returns 0 on success or a negative error code on failure; call
|
1323
|
+
* SDL_GetError() for more information.
|
1229
1324
|
*
|
1230
|
-
*
|
1231
|
-
* \return 0 on success or -1 on error.
|
1325
|
+
* \since This function is available since SDL 2.0.0.
|
1232
1326
|
*
|
1233
|
-
*
|
1234
|
-
*
|
1235
|
-
*
|
1327
|
+
* \sa SDL_HapticRumbleInit
|
1328
|
+
* \sa SDL_HapticRumblePlay
|
1329
|
+
* \sa SDL_HapticRumbleSupported
|
1236
1330
|
*/
|
1237
1331
|
extern DECLSPEC int SDLCALL SDL_HapticRumbleStop(SDL_Haptic * haptic);
|
1238
1332
|
|