sdl2-bindings 0.0.1 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ChangeLog +28 -0
- data/LICENSE.txt +1 -1
- data/README.md +5 -2
- data/lib/sdl2.rb +4 -0
- data/lib/sdl2_audio.rb +23 -5
- data/lib/sdl2_blendmode.rb +1 -0
- data/lib/sdl2_cpuinfo.rb +6 -0
- data/lib/sdl2_error.rb +3 -0
- data/lib/sdl2_events.rb +37 -6
- data/lib/sdl2_gamecontroller.rb +67 -1
- data/lib/sdl2_haptic.rb +17 -16
- data/lib/sdl2_hints.rb +108 -2
- data/lib/sdl2_joystick.rb +41 -4
- data/lib/sdl2_keycode.rb +5 -0
- data/lib/sdl2_log.rb +2 -1
- data/lib/sdl2_main.rb +0 -2
- data/lib/sdl2_messagebox.rb +2 -0
- data/lib/sdl2_mixer.rb +15 -2
- data/lib/sdl2_pixels.rb +12 -0
- data/lib/sdl2_render.rb +13 -0
- data/lib/sdl2_stdinc.rb +393 -0
- data/lib/sdl2_surface.rb +4 -1
- data/lib/sdl2_syswm.rb +154 -0
- data/lib/sdl2_timer.rb +1 -1
- data/lib/sdl2_ttf.rb +12 -0
- data/lib/sdl2_version.rb +1 -1
- data/lib/sdl2_video.rb +4 -1
- metadata +8 -6
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 533feab6661f4f13ec028b62c73801f5b8c44d3b204dcfd6acd4986c60297edf
         | 
| 4 | 
            +
              data.tar.gz: 1b0a21d7edb08c3faf2cb9fb6863376fefa15086ccd2dfcaa75ed83a6fc3dc1e
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 52d620b288f5f36afb018356f0788fd833cdaacd17bf20e79625ed1716cffbde8f5502b1e6d2e62b062dfc7546f763abf0b2c59b6c8e93a77b3de3718898bc50
         | 
| 7 | 
            +
              data.tar.gz: 9ebe4273355e338e24deff7b35850a15dcb47c30e1ee11c2b7ca48dbacea21509f946c9b3beda3309560a5bcf3de05c3e4f1964fa6bc41526008ba62767298c5
         | 
    
        data/ChangeLog
    CHANGED
    
    | @@ -1,3 +1,31 @@ | |
| 1 | 
            +
            2021-02-21  vaiorabbit  <http://twitter.com/vaiorabbit>
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            	* Added defines from Audio, Mixer and TTF
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            2020-12-27  vaiorabbit  <http://twitter.com/vaiorabbit>
         | 
| 6 | 
            +
             | 
| 7 | 
            +
            	* Added SDL 2.0.14 features.
         | 
| 8 | 
            +
            	* third_party/sdl2_build_dll.sh: Added to build x64 DLL for Windows
         | 
| 9 | 
            +
            	* test/util.rb: Added
         | 
| 10 | 
            +
             | 
| 11 | 
            +
            2020-12-20  vaiorabbit  <http://twitter.com/vaiorabbit>
         | 
| 12 | 
            +
             | 
| 13 | 
            +
            	* third_party/sdl2_build_dylib.sh: Added to build x86_64|arm64 Universal Binary
         | 
| 14 | 
            +
             | 
| 15 | 
            +
            2020-06-08  vaiorabbit  <http://twitter.com/vaiorabbit>
         | 
| 16 | 
            +
             | 
| 17 | 
            +
            	* lib/sdl2_syswm.rb: Added
         | 
| 18 | 
            +
            	* lib/sdl2_hints.rb: Added hint string symboles
         | 
| 19 | 
            +
             | 
| 20 | 
            +
            2020-03-22  vaiorabbit  <http://twitter.com/vaiorabbit>
         | 
| 21 | 
            +
             | 
| 22 | 
            +
            	* Added SDL 2.0.12 features.
         | 
| 23 | 
            +
            	* Generate callback types correctly.
         | 
| 24 | 
            +
             | 
| 25 | 
            +
            2019-10-27  vaiorabbit  <http://twitter.com/vaiorabbit>
         | 
| 26 | 
            +
             | 
| 27 | 
            +
            	* lib/sdl2_stdinc.rb: Added.
         | 
| 28 | 
            +
             | 
| 1 29 | 
             
            2019-08-31  vaiorabbit  <http://twitter.com/vaiorabbit>
         | 
| 2 30 |  | 
| 3 31 | 
             
            	* Refactoring + Cleanup
         | 
    
        data/LICENSE.txt
    CHANGED
    
    | @@ -1,5 +1,5 @@ | |
| 1 1 | 
             
            sdl2-bindings : Yet another SDL2 wrapper for Ruby
         | 
| 2 | 
            -
            Copyright (c) 2015- | 
| 2 | 
            +
            Copyright (c) 2015-2021 vaiorabbit <http://twitter.com/vaiorabbit>
         | 
| 3 3 |  | 
| 4 4 | 
             
            This software is provided 'as-is', without any express or implied
         | 
| 5 5 | 
             
            warranty. In no event will the authors be held liable for any damages
         | 
    
        data/README.md
    CHANGED
    
    | @@ -5,7 +5,7 @@ | |
| 5 5 | 
             
            [Notice] Experimental project.
         | 
| 6 6 |  | 
| 7 7 | 
             
            *   Created : 2015-09-19
         | 
| 8 | 
            -
            *   Last modified :  | 
| 8 | 
            +
            *   Last modified : 2021-02-21
         | 
| 9 9 |  | 
| 10 10 | 
             
            ## Features ##
         | 
| 11 11 |  | 
| @@ -29,13 +29,16 @@ | |
| 29 29 | 
             
                *   sdl2_mixer : 2.0.1
         | 
| 30 30 | 
             
                *   sdl2_ttf : 2.0.13
         | 
| 31 31 | 
             
            *   [2019-08-31] SDL 2.0.10 (Installed via Homebrew)
         | 
| 32 | 
            +
            *   [2020-03-22] SDL 2.0.12 (Installed via Homebrew)
         | 
| 33 | 
            +
            *   [2020-12-27] SDL 2.0.14 (Installed via Homebrew)
         | 
| 34 | 
            +
                *   macOS Big Sur (11.0.1), ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [arm64-darwin20]
         | 
| 32 35 |  | 
| 33 36 | 
             
            ## License ##
         | 
| 34 37 |  | 
| 35 38 | 
             
            The zlib/libpng License ( http://opensource.org/licenses/Zlib ).
         | 
| 36 39 |  | 
| 37 40 | 
             
                sdl2-bindings : Yet another SDL2 wrapper for Ruby
         | 
| 38 | 
            -
                Copyright (c) 2015- | 
| 41 | 
            +
                Copyright (c) 2015-2021 vaiorabbit <http://twitter.com/vaiorabbit>
         | 
| 39 42 |  | 
| 40 43 | 
             
                This software is provided 'as-is', without any express or implied
         | 
| 41 44 | 
             
                warranty. In no event will the authors be held liable for any damages
         | 
    
        data/lib/sdl2.rb
    CHANGED
    
    | @@ -29,7 +29,9 @@ require_relative 'sdl2_render.rb' | |
| 29 29 | 
             
            require_relative 'sdl2_rwops.rb'
         | 
| 30 30 | 
             
            require_relative 'sdl2_scancode.rb'
         | 
| 31 31 | 
             
            require_relative 'sdl2_shape.rb'
         | 
| 32 | 
            +
            require_relative 'sdl2_stdinc.rb'
         | 
| 32 33 | 
             
            require_relative 'sdl2_surface.rb'
         | 
| 34 | 
            +
            require_relative 'sdl2_syswm.rb'
         | 
| 33 35 | 
             
            require_relative 'sdl2_timer.rb'
         | 
| 34 36 | 
             
            require_relative 'sdl2_touch.rb'
         | 
| 35 37 | 
             
            require_relative 'sdl2_version.rb'
         | 
| @@ -113,6 +115,8 @@ module SDL2 | |
| 113 115 | 
             
                setup_scancode_symbols()
         | 
| 114 116 | 
             
                setup_shape_symbols()
         | 
| 115 117 | 
             
                setup_surface_symbols()
         | 
| 118 | 
            +
                setup_syswm_symbols()
         | 
| 119 | 
            +
                setup_stdinc_symbols()
         | 
| 116 120 | 
             
                setup_timer_symbols()
         | 
| 117 121 | 
             
                setup_touch_symbols()
         | 
| 118 122 | 
             
                setup_version_symbols()
         | 
    
        data/lib/sdl2_audio.rb
    CHANGED
    
    | @@ -10,15 +10,33 @@ module SDL2 | |
| 10 10 | 
             
              extend FFI::Library
         | 
| 11 11 | 
             
              # Define/Macro
         | 
| 12 12 |  | 
| 13 | 
            -
              SDL_AUDIO_MASK_BITSIZE =  | 
| 14 | 
            -
              SDL_AUDIO_MASK_DATATYPE = ( | 
| 15 | 
            -
              SDL_AUDIO_MASK_ENDIAN = ( | 
| 16 | 
            -
              SDL_AUDIO_MASK_SIGNED = ( | 
| 13 | 
            +
              SDL_AUDIO_MASK_BITSIZE = 0xFF
         | 
| 14 | 
            +
              SDL_AUDIO_MASK_DATATYPE = (1 << 8)
         | 
| 15 | 
            +
              SDL_AUDIO_MASK_ENDIAN = (1 << 12)
         | 
| 16 | 
            +
              SDL_AUDIO_MASK_SIGNED = (1 << 15)
         | 
| 17 | 
            +
              AUDIO_U8 = 0x0008
         | 
| 18 | 
            +
              AUDIO_S8 = 0x8008
         | 
| 19 | 
            +
              AUDIO_U16LSB = 0x0010
         | 
| 20 | 
            +
              AUDIO_S16LSB = 0x8010
         | 
| 21 | 
            +
              AUDIO_U16MSB = 0x1010
         | 
| 22 | 
            +
              AUDIO_S16MSB = 0x9010
         | 
| 23 | 
            +
              AUDIO_U16 = AUDIO_U16LSB
         | 
| 24 | 
            +
              AUDIO_S16 = AUDIO_S16LSB
         | 
| 25 | 
            +
              AUDIO_S32LSB = 0x8020
         | 
| 26 | 
            +
              AUDIO_S32MSB = 0x9020
         | 
| 27 | 
            +
              AUDIO_S32 = AUDIO_S32LSB
         | 
| 28 | 
            +
              AUDIO_F32LSB = 0x8120
         | 
| 29 | 
            +
              AUDIO_F32MSB = 0x9120
         | 
| 30 | 
            +
              AUDIO_F32 = AUDIO_F32LSB
         | 
| 31 | 
            +
              AUDIO_U16SYS = AUDIO_U16LSB
         | 
| 32 | 
            +
              AUDIO_S16SYS = AUDIO_S16LSB
         | 
| 33 | 
            +
              AUDIO_S32SYS = AUDIO_S32LSB
         | 
| 34 | 
            +
              AUDIO_F32SYS = AUDIO_F32LSB
         | 
| 17 35 | 
             
              SDL_AUDIO_ALLOW_FREQUENCY_CHANGE = 0x00000001
         | 
| 18 36 | 
             
              SDL_AUDIO_ALLOW_FORMAT_CHANGE = 0x00000002
         | 
| 19 37 | 
             
              SDL_AUDIO_ALLOW_CHANNELS_CHANGE = 0x00000004
         | 
| 20 38 | 
             
              SDL_AUDIO_ALLOW_SAMPLES_CHANGE = 0x00000008
         | 
| 21 | 
            -
              SDL_AUDIO_ALLOW_ANY_CHANGE = ( | 
| 39 | 
            +
              SDL_AUDIO_ALLOW_ANY_CHANGE = (SDL_AUDIO_ALLOW_FREQUENCY_CHANGE | SDL_AUDIO_ALLOW_FORMAT_CHANGE | SDL_AUDIO_ALLOW_CHANNELS_CHANGE | SDL_AUDIO_ALLOW_SAMPLES_CHANGE)
         | 
| 22 40 | 
             
              SDL_AUDIOCVT_MAX_FILTERS = 9
         | 
| 23 41 | 
             
              SDL_MIX_MAXVOLUME = 128
         | 
| 24 42 |  | 
    
        data/lib/sdl2_blendmode.rb
    CHANGED
    
    
    
        data/lib/sdl2_cpuinfo.rb
    CHANGED
    
    | @@ -39,10 +39,12 @@ module SDL2 | |
| 39 39 | 
             
                  :SDL_HasAVX,
         | 
| 40 40 | 
             
                  :SDL_HasAVX2,
         | 
| 41 41 | 
             
                  :SDL_HasAVX512F,
         | 
| 42 | 
            +
                  :SDL_HasARMSIMD,
         | 
| 42 43 | 
             
                  :SDL_HasNEON,
         | 
| 43 44 | 
             
                  :SDL_GetSystemRAM,
         | 
| 44 45 | 
             
                  :SDL_SIMDGetAlignment,
         | 
| 45 46 | 
             
                  :SDL_SIMDAlloc,
         | 
| 47 | 
            +
                  :SDL_SIMDRealloc,
         | 
| 46 48 | 
             
                  :SDL_SIMDFree,
         | 
| 47 49 | 
             
                ]
         | 
| 48 50 | 
             
                args = {
         | 
| @@ -60,10 +62,12 @@ module SDL2 | |
| 60 62 | 
             
                  :SDL_HasAVX => [],
         | 
| 61 63 | 
             
                  :SDL_HasAVX2 => [],
         | 
| 62 64 | 
             
                  :SDL_HasAVX512F => [],
         | 
| 65 | 
            +
                  :SDL_HasARMSIMD => [],
         | 
| 63 66 | 
             
                  :SDL_HasNEON => [],
         | 
| 64 67 | 
             
                  :SDL_GetSystemRAM => [],
         | 
| 65 68 | 
             
                  :SDL_SIMDGetAlignment => [],
         | 
| 66 69 | 
             
                  :SDL_SIMDAlloc => [:ulong],
         | 
| 70 | 
            +
                  :SDL_SIMDRealloc => [:pointer, :ulong],
         | 
| 67 71 | 
             
                  :SDL_SIMDFree => [:pointer],
         | 
| 68 72 | 
             
                }
         | 
| 69 73 | 
             
                retvals = {
         | 
| @@ -81,10 +85,12 @@ module SDL2 | |
| 81 85 | 
             
                  :SDL_HasAVX => :int,
         | 
| 82 86 | 
             
                  :SDL_HasAVX2 => :int,
         | 
| 83 87 | 
             
                  :SDL_HasAVX512F => :int,
         | 
| 88 | 
            +
                  :SDL_HasARMSIMD => :int,
         | 
| 84 89 | 
             
                  :SDL_HasNEON => :int,
         | 
| 85 90 | 
             
                  :SDL_GetSystemRAM => :int,
         | 
| 86 91 | 
             
                  :SDL_SIMDGetAlignment => :size_t,
         | 
| 87 92 | 
             
                  :SDL_SIMDAlloc => :pointer,
         | 
| 93 | 
            +
                  :SDL_SIMDRealloc => :pointer,
         | 
| 88 94 | 
             
                  :SDL_SIMDFree => :void,
         | 
| 89 95 | 
             
                }
         | 
| 90 96 | 
             
                symbols.each do |sym|
         | 
    
        data/lib/sdl2_error.rb
    CHANGED
    
    | @@ -33,18 +33,21 @@ module SDL2 | |
| 33 33 | 
             
                symbols = [
         | 
| 34 34 | 
             
                  :SDL_SetError,
         | 
| 35 35 | 
             
                  :SDL_GetError,
         | 
| 36 | 
            +
                  :SDL_GetErrorMsg,
         | 
| 36 37 | 
             
                  :SDL_ClearError,
         | 
| 37 38 | 
             
                  :SDL_Error,
         | 
| 38 39 | 
             
                ]
         | 
| 39 40 | 
             
                args = {
         | 
| 40 41 | 
             
                  :SDL_SetError => [:pointer],
         | 
| 41 42 | 
             
                  :SDL_GetError => [],
         | 
| 43 | 
            +
                  :SDL_GetErrorMsg => [:pointer, :int],
         | 
| 42 44 | 
             
                  :SDL_ClearError => [],
         | 
| 43 45 | 
             
                  :SDL_Error => [:int],
         | 
| 44 46 | 
             
                }
         | 
| 45 47 | 
             
                retvals = {
         | 
| 46 48 | 
             
                  :SDL_SetError => :int,
         | 
| 47 49 | 
             
                  :SDL_GetError => :pointer,
         | 
| 50 | 
            +
                  :SDL_GetErrorMsg => :pointer,
         | 
| 48 51 | 
             
                  :SDL_ClearError => :void,
         | 
| 49 52 | 
             
                  :SDL_Error => :int,
         | 
| 50 53 | 
             
                }
         | 
    
        data/lib/sdl2_events.rb
    CHANGED
    
    | @@ -13,8 +13,8 @@ module SDL2 | |
| 13 13 |  | 
| 14 14 | 
             
              SDL_RELEASED = 0
         | 
| 15 15 | 
             
              SDL_PRESSED = 1
         | 
| 16 | 
            -
              SDL_TEXTEDITINGEVENT_TEXT_SIZE =  | 
| 17 | 
            -
              SDL_TEXTINPUTEVENT_TEXT_SIZE =  | 
| 16 | 
            +
              SDL_TEXTEDITINGEVENT_TEXT_SIZE = 32
         | 
| 17 | 
            +
              SDL_TEXTINPUTEVENT_TEXT_SIZE = 32
         | 
| 18 18 | 
             
              SDL_QUERY = -1
         | 
| 19 19 | 
             
              SDL_IGNORE = 0
         | 
| 20 20 | 
             
              SDL_DISABLE = 0
         | 
| @@ -30,6 +30,7 @@ module SDL2 | |
| 30 30 | 
             
              SDL_APP_DIDENTERBACKGROUND = 260
         | 
| 31 31 | 
             
              SDL_APP_WILLENTERFOREGROUND = 261
         | 
| 32 32 | 
             
              SDL_APP_DIDENTERFOREGROUND = 262
         | 
| 33 | 
            +
              SDL_LOCALECHANGED = 263
         | 
| 33 34 | 
             
              SDL_DISPLAYEVENT = 336
         | 
| 34 35 | 
             
              SDL_WINDOWEVENT = 512
         | 
| 35 36 | 
             
              SDL_SYSWMEVENT = 513
         | 
| @@ -55,6 +56,10 @@ module SDL2 | |
| 55 56 | 
             
              SDL_CONTROLLERDEVICEADDED = 1619
         | 
| 56 57 | 
             
              SDL_CONTROLLERDEVICEREMOVED = 1620
         | 
| 57 58 | 
             
              SDL_CONTROLLERDEVICEREMAPPED = 1621
         | 
| 59 | 
            +
              SDL_CONTROLLERTOUCHPADDOWN = 1622
         | 
| 60 | 
            +
              SDL_CONTROLLERTOUCHPADMOTION = 1623
         | 
| 61 | 
            +
              SDL_CONTROLLERTOUCHPADUP = 1624
         | 
| 62 | 
            +
              SDL_CONTROLLERSENSORUPDATE = 1625
         | 
| 58 63 | 
             
              SDL_FINGERDOWN = 1792
         | 
| 59 64 | 
             
              SDL_FINGERUP = 1793
         | 
| 60 65 | 
             
              SDL_FINGERMOTION = 1794
         | 
| @@ -288,6 +293,29 @@ module SDL2 | |
| 288 293 | 
             
                )
         | 
| 289 294 | 
             
              end
         | 
| 290 295 |  | 
| 296 | 
            +
              class SDL_ControllerTouchpadEvent < FFI::Struct
         | 
| 297 | 
            +
                layout(
         | 
| 298 | 
            +
                  :type, :uint,
         | 
| 299 | 
            +
                  :timestamp, :uint,
         | 
| 300 | 
            +
                  :which, :int,
         | 
| 301 | 
            +
                  :touchpad, :int,
         | 
| 302 | 
            +
                  :finger, :int,
         | 
| 303 | 
            +
                  :x, :float,
         | 
| 304 | 
            +
                  :y, :float,
         | 
| 305 | 
            +
                  :pressure, :float,
         | 
| 306 | 
            +
                )
         | 
| 307 | 
            +
              end
         | 
| 308 | 
            +
             | 
| 309 | 
            +
              class SDL_ControllerSensorEvent < FFI::Struct
         | 
| 310 | 
            +
                layout(
         | 
| 311 | 
            +
                  :type, :uint,
         | 
| 312 | 
            +
                  :timestamp, :uint,
         | 
| 313 | 
            +
                  :which, :int,
         | 
| 314 | 
            +
                  :sensor, :int,
         | 
| 315 | 
            +
                  :data, [:float, 3],
         | 
| 316 | 
            +
                )
         | 
| 317 | 
            +
              end
         | 
| 318 | 
            +
             | 
| 291 319 | 
             
              class SDL_AudioDeviceEvent < FFI::Struct
         | 
| 292 320 | 
             
                layout(
         | 
| 293 321 | 
             
                  :type, :uint,
         | 
| @@ -311,6 +339,7 @@ module SDL2 | |
| 311 339 | 
             
                  :dx, :float,
         | 
| 312 340 | 
             
                  :dy, :float,
         | 
| 313 341 | 
             
                  :pressure, :float,
         | 
| 342 | 
            +
                  :windowID, :uint,
         | 
| 314 343 | 
             
                )
         | 
| 315 344 | 
             
              end
         | 
| 316 345 |  | 
| @@ -412,6 +441,8 @@ module SDL2 | |
| 412 441 | 
             
                  :caxis, SDL_ControllerAxisEvent,
         | 
| 413 442 | 
             
                  :cbutton, SDL_ControllerButtonEvent,
         | 
| 414 443 | 
             
                  :cdevice, SDL_ControllerDeviceEvent,
         | 
| 444 | 
            +
                  :ctouchpad, SDL_ControllerTouchpadEvent,
         | 
| 445 | 
            +
                  :csensor, SDL_ControllerSensorEvent,
         | 
| 415 446 | 
             
                  :adevice, SDL_AudioDeviceEvent,
         | 
| 416 447 | 
             
                  :sensor, SDL_SensorEvent,
         | 
| 417 448 | 
             
                  :quit, SDL_QuitEvent,
         | 
| @@ -459,11 +490,11 @@ module SDL2 | |
| 459 490 | 
             
                  :SDL_WaitEvent => [:pointer],
         | 
| 460 491 | 
             
                  :SDL_WaitEventTimeout => [:pointer, :int],
         | 
| 461 492 | 
             
                  :SDL_PushEvent => [:pointer],
         | 
| 462 | 
            -
                  :SDL_SetEventFilter => [: | 
| 493 | 
            +
                  :SDL_SetEventFilter => [:SDL_EventFilter, :pointer],
         | 
| 463 494 | 
             
                  :SDL_GetEventFilter => [:pointer, :pointer],
         | 
| 464 | 
            -
                  :SDL_AddEventWatch => [: | 
| 465 | 
            -
                  :SDL_DelEventWatch => [: | 
| 466 | 
            -
                  :SDL_FilterEvents => [: | 
| 495 | 
            +
                  :SDL_AddEventWatch => [:SDL_EventFilter, :pointer],
         | 
| 496 | 
            +
                  :SDL_DelEventWatch => [:SDL_EventFilter, :pointer],
         | 
| 497 | 
            +
                  :SDL_FilterEvents => [:SDL_EventFilter, :pointer],
         | 
| 467 498 | 
             
                  :SDL_EventState => [:uint, :int],
         | 
| 468 499 | 
             
                  :SDL_RegisterEvents => [:int],
         | 
| 469 500 | 
             
                }
         | 
    
        data/lib/sdl2_gamecontroller.rb
    CHANGED
    
    | @@ -14,6 +14,14 @@ module SDL2 | |
| 14 14 |  | 
| 15 15 | 
             
              # Enum
         | 
| 16 16 |  | 
| 17 | 
            +
              SDL_CONTROLLER_TYPE_UNKNOWN = 0
         | 
| 18 | 
            +
              SDL_CONTROLLER_TYPE_XBOX360 = 1
         | 
| 19 | 
            +
              SDL_CONTROLLER_TYPE_XBOXONE = 2
         | 
| 20 | 
            +
              SDL_CONTROLLER_TYPE_PS3 = 3
         | 
| 21 | 
            +
              SDL_CONTROLLER_TYPE_PS4 = 4
         | 
| 22 | 
            +
              SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_PRO = 5
         | 
| 23 | 
            +
              SDL_CONTROLLER_TYPE_VIRTUAL = 6
         | 
| 24 | 
            +
              SDL_CONTROLLER_TYPE_PS5 = 7
         | 
| 17 25 | 
             
              SDL_CONTROLLER_BINDTYPE_NONE = 0
         | 
| 18 26 | 
             
              SDL_CONTROLLER_BINDTYPE_BUTTON = 1
         | 
| 19 27 | 
             
              SDL_CONTROLLER_BINDTYPE_AXIS = 2
         | 
| @@ -42,7 +50,13 @@ module SDL2 | |
| 42 50 | 
             
              SDL_CONTROLLER_BUTTON_DPAD_DOWN = 12
         | 
| 43 51 | 
             
              SDL_CONTROLLER_BUTTON_DPAD_LEFT = 13
         | 
| 44 52 | 
             
              SDL_CONTROLLER_BUTTON_DPAD_RIGHT = 14
         | 
| 45 | 
            -
               | 
| 53 | 
            +
              SDL_CONTROLLER_BUTTON_MISC1 = 15
         | 
| 54 | 
            +
              SDL_CONTROLLER_BUTTON_PADDLE1 = 16
         | 
| 55 | 
            +
              SDL_CONTROLLER_BUTTON_PADDLE2 = 17
         | 
| 56 | 
            +
              SDL_CONTROLLER_BUTTON_PADDLE3 = 18
         | 
| 57 | 
            +
              SDL_CONTROLLER_BUTTON_PADDLE4 = 19
         | 
| 58 | 
            +
              SDL_CONTROLLER_BUTTON_TOUCHPAD = 20
         | 
| 59 | 
            +
              SDL_CONTROLLER_BUTTON_MAX = 21
         | 
| 46 60 |  | 
| 47 61 | 
             
              # Typedef
         | 
| 48 62 |  | 
| @@ -69,6 +83,7 @@ module SDL2 | |
| 69 83 | 
             
                )
         | 
| 70 84 | 
             
              end
         | 
| 71 85 |  | 
| 86 | 
            +
              typedef :int, :SDL_GameControllerType
         | 
| 72 87 | 
             
              typedef :int, :SDL_GameControllerBindType
         | 
| 73 88 | 
             
              typedef :int, :SDL_GameControllerAxis
         | 
| 74 89 | 
             
              typedef :int, :SDL_GameControllerButton
         | 
| @@ -88,14 +103,19 @@ module SDL2 | |
| 88 103 | 
             
                  :SDL_GameControllerMapping,
         | 
| 89 104 | 
             
                  :SDL_IsGameController,
         | 
| 90 105 | 
             
                  :SDL_GameControllerNameForIndex,
         | 
| 106 | 
            +
                  :SDL_GameControllerTypeForIndex,
         | 
| 91 107 | 
             
                  :SDL_GameControllerMappingForDeviceIndex,
         | 
| 92 108 | 
             
                  :SDL_GameControllerOpen,
         | 
| 93 109 | 
             
                  :SDL_GameControllerFromInstanceID,
         | 
| 110 | 
            +
                  :SDL_GameControllerFromPlayerIndex,
         | 
| 94 111 | 
             
                  :SDL_GameControllerName,
         | 
| 112 | 
            +
                  :SDL_GameControllerGetType,
         | 
| 95 113 | 
             
                  :SDL_GameControllerGetPlayerIndex,
         | 
| 114 | 
            +
                  :SDL_GameControllerSetPlayerIndex,
         | 
| 96 115 | 
             
                  :SDL_GameControllerGetVendor,
         | 
| 97 116 | 
             
                  :SDL_GameControllerGetProduct,
         | 
| 98 117 | 
             
                  :SDL_GameControllerGetProductVersion,
         | 
| 118 | 
            +
                  :SDL_GameControllerGetSerial,
         | 
| 99 119 | 
             
                  :SDL_GameControllerGetAttached,
         | 
| 100 120 | 
             
                  :SDL_GameControllerGetJoystick,
         | 
| 101 121 | 
             
                  :SDL_GameControllerEventState,
         | 
| @@ -103,12 +123,24 @@ module SDL2 | |
| 103 123 | 
             
                  :SDL_GameControllerGetAxisFromString,
         | 
| 104 124 | 
             
                  :SDL_GameControllerGetStringForAxis,
         | 
| 105 125 | 
             
                  :SDL_GameControllerGetBindForAxis,
         | 
| 126 | 
            +
                  :SDL_GameControllerHasAxis,
         | 
| 106 127 | 
             
                  :SDL_GameControllerGetAxis,
         | 
| 107 128 | 
             
                  :SDL_GameControllerGetButtonFromString,
         | 
| 108 129 | 
             
                  :SDL_GameControllerGetStringForButton,
         | 
| 109 130 | 
             
                  :SDL_GameControllerGetBindForButton,
         | 
| 131 | 
            +
                  :SDL_GameControllerHasButton,
         | 
| 110 132 | 
             
                  :SDL_GameControllerGetButton,
         | 
| 133 | 
            +
                  :SDL_GameControllerGetNumTouchpads,
         | 
| 134 | 
            +
                  :SDL_GameControllerGetNumTouchpadFingers,
         | 
| 135 | 
            +
                  :SDL_GameControllerGetTouchpadFinger,
         | 
| 136 | 
            +
                  :SDL_GameControllerHasSensor,
         | 
| 137 | 
            +
                  :SDL_GameControllerSetSensorEnabled,
         | 
| 138 | 
            +
                  :SDL_GameControllerIsSensorEnabled,
         | 
| 139 | 
            +
                  :SDL_GameControllerGetSensorData,
         | 
| 111 140 | 
             
                  :SDL_GameControllerRumble,
         | 
| 141 | 
            +
                  :SDL_GameControllerRumbleTriggers,
         | 
| 142 | 
            +
                  :SDL_GameControllerHasLED,
         | 
| 143 | 
            +
                  :SDL_GameControllerSetLED,
         | 
| 112 144 | 
             
                  :SDL_GameControllerClose,
         | 
| 113 145 | 
             
                ]
         | 
| 114 146 | 
             
                args = {
         | 
| @@ -120,14 +152,19 @@ module SDL2 | |
| 120 152 | 
             
                  :SDL_GameControllerMapping => [:pointer],
         | 
| 121 153 | 
             
                  :SDL_IsGameController => [:int],
         | 
| 122 154 | 
             
                  :SDL_GameControllerNameForIndex => [:int],
         | 
| 155 | 
            +
                  :SDL_GameControllerTypeForIndex => [:int],
         | 
| 123 156 | 
             
                  :SDL_GameControllerMappingForDeviceIndex => [:int],
         | 
| 124 157 | 
             
                  :SDL_GameControllerOpen => [:int],
         | 
| 125 158 | 
             
                  :SDL_GameControllerFromInstanceID => [:int],
         | 
| 159 | 
            +
                  :SDL_GameControllerFromPlayerIndex => [:int],
         | 
| 126 160 | 
             
                  :SDL_GameControllerName => [:pointer],
         | 
| 161 | 
            +
                  :SDL_GameControllerGetType => [:pointer],
         | 
| 127 162 | 
             
                  :SDL_GameControllerGetPlayerIndex => [:pointer],
         | 
| 163 | 
            +
                  :SDL_GameControllerSetPlayerIndex => [:pointer, :int],
         | 
| 128 164 | 
             
                  :SDL_GameControllerGetVendor => [:pointer],
         | 
| 129 165 | 
             
                  :SDL_GameControllerGetProduct => [:pointer],
         | 
| 130 166 | 
             
                  :SDL_GameControllerGetProductVersion => [:pointer],
         | 
| 167 | 
            +
                  :SDL_GameControllerGetSerial => [:pointer],
         | 
| 131 168 | 
             
                  :SDL_GameControllerGetAttached => [:pointer],
         | 
| 132 169 | 
             
                  :SDL_GameControllerGetJoystick => [:pointer],
         | 
| 133 170 | 
             
                  :SDL_GameControllerEventState => [:int],
         | 
| @@ -135,12 +172,24 @@ module SDL2 | |
| 135 172 | 
             
                  :SDL_GameControllerGetAxisFromString => [:pointer],
         | 
| 136 173 | 
             
                  :SDL_GameControllerGetStringForAxis => [:int],
         | 
| 137 174 | 
             
                  :SDL_GameControllerGetBindForAxis => [:pointer, :int],
         | 
| 175 | 
            +
                  :SDL_GameControllerHasAxis => [:pointer, :int],
         | 
| 138 176 | 
             
                  :SDL_GameControllerGetAxis => [:pointer, :int],
         | 
| 139 177 | 
             
                  :SDL_GameControllerGetButtonFromString => [:pointer],
         | 
| 140 178 | 
             
                  :SDL_GameControllerGetStringForButton => [:int],
         | 
| 141 179 | 
             
                  :SDL_GameControllerGetBindForButton => [:pointer, :int],
         | 
| 180 | 
            +
                  :SDL_GameControllerHasButton => [:pointer, :int],
         | 
| 142 181 | 
             
                  :SDL_GameControllerGetButton => [:pointer, :int],
         | 
| 182 | 
            +
                  :SDL_GameControllerGetNumTouchpads => [:pointer],
         | 
| 183 | 
            +
                  :SDL_GameControllerGetNumTouchpadFingers => [:pointer, :int],
         | 
| 184 | 
            +
                  :SDL_GameControllerGetTouchpadFinger => [:pointer, :int, :int, :pointer, :pointer, :pointer, :pointer],
         | 
| 185 | 
            +
                  :SDL_GameControllerHasSensor => [:pointer, :int],
         | 
| 186 | 
            +
                  :SDL_GameControllerSetSensorEnabled => [:pointer, :int, :int],
         | 
| 187 | 
            +
                  :SDL_GameControllerIsSensorEnabled => [:pointer, :int],
         | 
| 188 | 
            +
                  :SDL_GameControllerGetSensorData => [:pointer, :int, :pointer, :int],
         | 
| 143 189 | 
             
                  :SDL_GameControllerRumble => [:pointer, :ushort, :ushort, :uint],
         | 
| 190 | 
            +
                  :SDL_GameControllerRumbleTriggers => [:pointer, :ushort, :ushort, :uint],
         | 
| 191 | 
            +
                  :SDL_GameControllerHasLED => [:pointer],
         | 
| 192 | 
            +
                  :SDL_GameControllerSetLED => [:pointer, :uchar, :uchar, :uchar],
         | 
| 144 193 | 
             
                  :SDL_GameControllerClose => [:pointer],
         | 
| 145 194 | 
             
                }
         | 
| 146 195 | 
             
                retvals = {
         | 
| @@ -152,14 +201,19 @@ module SDL2 | |
| 152 201 | 
             
                  :SDL_GameControllerMapping => :pointer,
         | 
| 153 202 | 
             
                  :SDL_IsGameController => :int,
         | 
| 154 203 | 
             
                  :SDL_GameControllerNameForIndex => :pointer,
         | 
| 204 | 
            +
                  :SDL_GameControllerTypeForIndex => :int,
         | 
| 155 205 | 
             
                  :SDL_GameControllerMappingForDeviceIndex => :pointer,
         | 
| 156 206 | 
             
                  :SDL_GameControllerOpen => :pointer,
         | 
| 157 207 | 
             
                  :SDL_GameControllerFromInstanceID => :pointer,
         | 
| 208 | 
            +
                  :SDL_GameControllerFromPlayerIndex => :pointer,
         | 
| 158 209 | 
             
                  :SDL_GameControllerName => :pointer,
         | 
| 210 | 
            +
                  :SDL_GameControllerGetType => :int,
         | 
| 159 211 | 
             
                  :SDL_GameControllerGetPlayerIndex => :int,
         | 
| 212 | 
            +
                  :SDL_GameControllerSetPlayerIndex => :void,
         | 
| 160 213 | 
             
                  :SDL_GameControllerGetVendor => :ushort,
         | 
| 161 214 | 
             
                  :SDL_GameControllerGetProduct => :ushort,
         | 
| 162 215 | 
             
                  :SDL_GameControllerGetProductVersion => :ushort,
         | 
| 216 | 
            +
                  :SDL_GameControllerGetSerial => :pointer,
         | 
| 163 217 | 
             
                  :SDL_GameControllerGetAttached => :int,
         | 
| 164 218 | 
             
                  :SDL_GameControllerGetJoystick => :pointer,
         | 
| 165 219 | 
             
                  :SDL_GameControllerEventState => :int,
         | 
| @@ -167,12 +221,24 @@ module SDL2 | |
| 167 221 | 
             
                  :SDL_GameControllerGetAxisFromString => :int,
         | 
| 168 222 | 
             
                  :SDL_GameControllerGetStringForAxis => :pointer,
         | 
| 169 223 | 
             
                  :SDL_GameControllerGetBindForAxis => SDL_GameControllerButtonBind,
         | 
| 224 | 
            +
                  :SDL_GameControllerHasAxis => :int,
         | 
| 170 225 | 
             
                  :SDL_GameControllerGetAxis => :short,
         | 
| 171 226 | 
             
                  :SDL_GameControllerGetButtonFromString => :int,
         | 
| 172 227 | 
             
                  :SDL_GameControllerGetStringForButton => :pointer,
         | 
| 173 228 | 
             
                  :SDL_GameControllerGetBindForButton => SDL_GameControllerButtonBind,
         | 
| 229 | 
            +
                  :SDL_GameControllerHasButton => :int,
         | 
| 174 230 | 
             
                  :SDL_GameControllerGetButton => :uchar,
         | 
| 231 | 
            +
                  :SDL_GameControllerGetNumTouchpads => :int,
         | 
| 232 | 
            +
                  :SDL_GameControllerGetNumTouchpadFingers => :int,
         | 
| 233 | 
            +
                  :SDL_GameControllerGetTouchpadFinger => :int,
         | 
| 234 | 
            +
                  :SDL_GameControllerHasSensor => :int,
         | 
| 235 | 
            +
                  :SDL_GameControllerSetSensorEnabled => :int,
         | 
| 236 | 
            +
                  :SDL_GameControllerIsSensorEnabled => :int,
         | 
| 237 | 
            +
                  :SDL_GameControllerGetSensorData => :int,
         | 
| 175 238 | 
             
                  :SDL_GameControllerRumble => :int,
         | 
| 239 | 
            +
                  :SDL_GameControllerRumbleTriggers => :int,
         | 
| 240 | 
            +
                  :SDL_GameControllerHasLED => :int,
         | 
| 241 | 
            +
                  :SDL_GameControllerSetLED => :int,
         | 
| 176 242 | 
             
                  :SDL_GameControllerClose => :void,
         | 
| 177 243 | 
             
                }
         | 
| 178 244 | 
             
                symbols.each do |sym|
         |