sdl2-bindings 0.0.8 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/ChangeLog +124 -92
  3. data/LICENSE.txt +1 -1
  4. data/README.md +77 -53
  5. data/lib/sdl2.rb +131 -172
  6. data/lib/sdl2_audio.rb +261 -222
  7. data/lib/sdl2_blendmode.rb +72 -69
  8. data/lib/sdl2_clipboard.rb +56 -51
  9. data/lib/sdl2_cpuinfo.rb +129 -106
  10. data/lib/sdl2_error.rb +71 -64
  11. data/lib/sdl2_events.rb +564 -533
  12. data/lib/sdl2_filesystem.rb +52 -48
  13. data/lib/sdl2_framerate.rb +74 -67
  14. data/lib/sdl2_gamecontroller.rb +329 -274
  15. data/lib/sdl2_gesture.rb +61 -55
  16. data/lib/sdl2_gfxPrimitives.rb +283 -222
  17. data/lib/sdl2_haptic.rb +301 -269
  18. data/lib/sdl2_hidapi.rb +139 -118
  19. data/lib/sdl2_hints.rb +221 -197
  20. data/lib/sdl2_image.rb +232 -185
  21. data/lib/sdl2_imageFilter.rb +164 -132
  22. data/lib/sdl2_joystick.rb +294 -239
  23. data/lib/sdl2_keyboard.rb +125 -99
  24. data/lib/sdl2_keycode.rb +307 -305
  25. data/lib/sdl2_log.rb +131 -115
  26. data/lib/sdl2_main.rb +74 -67
  27. data/lib/sdl2_messagebox.rb +102 -98
  28. data/lib/sdl2_misc.rb +48 -45
  29. data/lib/sdl2_mixer.rb +392 -317
  30. data/lib/sdl2_mouse.rb +136 -117
  31. data/lib/sdl2_pixels.rb +240 -224
  32. data/lib/sdl2_platform.rb +48 -45
  33. data/lib/sdl2_power.rb +54 -51
  34. data/lib/sdl2_rect.rb +145 -102
  35. data/lib/sdl2_render.rb +408 -322
  36. data/lib/sdl2_rotozoom.rb +76 -66
  37. data/lib/sdl2_rwops.rb +238 -208
  38. data/lib/sdl2_scancode.rb +289 -287
  39. data/lib/sdl2_sensor.rb +115 -97
  40. data/lib/sdl2_shape.rb +83 -77
  41. data/lib/sdl2_sound.rb +154 -0
  42. data/lib/sdl2_stdinc.rb +556 -439
  43. data/lib/sdl2_surface.rb +229 -188
  44. data/lib/sdl2_syswm.rb +160 -156
  45. data/lib/sdl2_timer.rb +74 -65
  46. data/lib/sdl2_touch.rb +86 -75
  47. data/lib/sdl2_ttf.rb +358 -202
  48. data/lib/sdl2_version.rb +67 -62
  49. data/lib/sdl2_video.rb +540 -446
  50. data/lib/sdl2_vulkan.rb +72 -64
  51. metadata +19 -4
data/lib/sdl2_version.rb CHANGED
@@ -1,62 +1,67 @@
1
- # Ruby-SDL2 : Yet another SDL2 wrapper for Ruby
2
- #
3
- # * https://github.com/vaiorabbit/sdl2-bindings
4
- #
5
- # [NOTICE] This is an automatically generated file.
6
-
7
- require 'ffi'
8
-
9
- module SDL2
10
- extend FFI::Library
11
- # Define/Macro
12
-
13
- SDL_MAJOR_VERSION = 2
14
- SDL_MINOR_VERSION = 0
15
- SDL_PATCHLEVEL = 18
16
-
17
- # Enum
18
-
19
-
20
- # Typedef
21
-
22
-
23
- # Struct
24
-
25
- class SDL_version < FFI::Struct
26
- layout(
27
- :major, :uchar,
28
- :minor, :uchar,
29
- :patch, :uchar,
30
- )
31
- end
32
-
33
-
34
- # Function
35
-
36
- def self.setup_version_symbols()
37
- symbols = [
38
- :SDL_GetVersion,
39
- :SDL_GetRevision,
40
- :SDL_GetRevisionNumber,
41
- ]
42
- args = {
43
- :SDL_GetVersion => [:pointer],
44
- :SDL_GetRevision => [],
45
- :SDL_GetRevisionNumber => [],
46
- }
47
- retvals = {
48
- :SDL_GetVersion => :void,
49
- :SDL_GetRevision => :pointer,
50
- :SDL_GetRevisionNumber => :int,
51
- }
52
- symbols.each do |sym|
53
- begin
54
- attach_function sym, args[sym], retvals[sym]
55
- rescue FFI::NotFoundError => error
56
- $stderr.puts("[Warning] Failed to import #{sym} (#{error}).")
57
- end
58
- end
59
- end
60
-
61
- end
62
-
1
+ # Ruby-SDL2 : Yet another SDL2 wrapper for Ruby
2
+ #
3
+ # * https://github.com/vaiorabbit/sdl2-bindings
4
+ #
5
+ # [NOTICE] This is an automatically generated file.
6
+
7
+ require 'ffi'
8
+
9
+ module SDL
10
+ extend FFI::Library
11
+ # Define/Macro
12
+
13
+ MAJOR_VERSION = 2
14
+ MINOR_VERSION = 0
15
+ PATCHLEVEL = 20
16
+
17
+ # Enum
18
+
19
+
20
+ # Typedef
21
+
22
+
23
+ # Struct
24
+
25
+ class Version < FFI::Struct
26
+ layout(
27
+ :major, :uchar,
28
+ :minor, :uchar,
29
+ :patch, :uchar,
30
+ )
31
+ end
32
+
33
+
34
+ # Function
35
+
36
+ def self.setup_version_symbols(output_error = false)
37
+ symbols = [
38
+ :SDL_GetVersion,
39
+ :SDL_GetRevision,
40
+ :SDL_GetRevisionNumber,
41
+ ]
42
+ apis = {
43
+ :SDL_GetVersion => :GetVersion,
44
+ :SDL_GetRevision => :GetRevision,
45
+ :SDL_GetRevisionNumber => :GetRevisionNumber,
46
+ }
47
+ args = {
48
+ :SDL_GetVersion => [:pointer],
49
+ :SDL_GetRevision => [],
50
+ :SDL_GetRevisionNumber => [],
51
+ }
52
+ retvals = {
53
+ :SDL_GetVersion => :void,
54
+ :SDL_GetRevision => :pointer,
55
+ :SDL_GetRevisionNumber => :int,
56
+ }
57
+ symbols.each do |sym|
58
+ begin
59
+ attach_function apis[sym], sym, args[sym], retvals[sym]
60
+ rescue FFI::NotFoundError => error
61
+ $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
62
+ end
63
+ end
64
+ end
65
+
66
+ end
67
+