ruby2d 0.9.3 → 0.9.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. checksums.yaml +4 -4
  2. data/assets/README.md +7 -9
  3. data/assets/Rakefile +85 -0
  4. data/assets/include/SDL2/SDL.h +1 -1
  5. data/assets/include/SDL2/SDL_assert.h +1 -1
  6. data/assets/include/SDL2/SDL_atomic.h +20 -2
  7. data/assets/include/SDL2/SDL_audio.h +47 -14
  8. data/assets/include/SDL2/SDL_bits.h +10 -1
  9. data/assets/include/SDL2/SDL_blendmode.h +7 -7
  10. data/assets/include/SDL2/SDL_clipboard.h +1 -1
  11. data/assets/include/SDL2/SDL_config.h +24 -390
  12. data/assets/include/SDL2/SDL_config_android.h +178 -0
  13. data/assets/include/SDL2/SDL_config_iphoneos.h +201 -0
  14. data/assets/include/SDL2/SDL_config_macosx.h +240 -0
  15. data/assets/include/SDL2/SDL_config_minimal.h +85 -0
  16. data/assets/include/SDL2/SDL_config_os2.h +170 -0
  17. data/assets/include/SDL2/SDL_config_pandora.h +133 -0
  18. data/assets/include/SDL2/SDL_config_psp.h +164 -0
  19. data/assets/include/SDL2/SDL_config_windows.h +257 -0
  20. data/assets/include/SDL2/SDL_config_winrt.h +240 -0
  21. data/assets/include/SDL2/SDL_config_wiz.h +146 -0
  22. data/assets/include/SDL2/SDL_copying.h +20 -0
  23. data/assets/include/SDL2/SDL_cpuinfo.h +90 -8
  24. data/assets/include/SDL2/SDL_egl.h +1 -1
  25. data/assets/include/SDL2/SDL_endian.h +1 -1
  26. data/assets/include/SDL2/SDL_error.h +1 -1
  27. data/assets/include/SDL2/SDL_events.h +4 -1
  28. data/assets/include/SDL2/SDL_filesystem.h +1 -1
  29. data/assets/include/SDL2/SDL_gamecontroller.h +1 -1
  30. data/assets/include/SDL2/SDL_gesture.h +1 -1
  31. data/assets/include/SDL2/SDL_haptic.h +1 -1
  32. data/assets/include/SDL2/SDL_hints.h +145 -14
  33. data/assets/include/SDL2/SDL_image.h +2 -2
  34. data/assets/include/SDL2/SDL_joystick.h +1 -1
  35. data/assets/include/SDL2/SDL_keyboard.h +1 -1
  36. data/assets/include/SDL2/SDL_keycode.h +1 -1
  37. data/assets/include/SDL2/SDL_loadso.h +1 -1
  38. data/assets/include/SDL2/SDL_log.h +1 -1
  39. data/assets/include/SDL2/SDL_main.h +28 -16
  40. data/assets/include/SDL2/SDL_messagebox.h +1 -1
  41. data/assets/include/SDL2/SDL_mouse.h +1 -1
  42. data/assets/include/SDL2/SDL_mutex.h +1 -1
  43. data/assets/include/SDL2/SDL_name.h +1 -1
  44. data/assets/include/SDL2/SDL_opengl.h +1 -1
  45. data/assets/include/SDL2/SDL_opengles.h +1 -1
  46. data/assets/include/SDL2/SDL_opengles2.h +1 -1
  47. data/assets/include/SDL2/SDL_pixels.h +3 -3
  48. data/assets/include/SDL2/SDL_platform.h +1 -1
  49. data/assets/include/SDL2/SDL_power.h +1 -1
  50. data/assets/include/SDL2/SDL_quit.h +1 -1
  51. data/assets/include/SDL2/SDL_rect.h +29 -3
  52. data/assets/include/SDL2/SDL_render.h +168 -1
  53. data/assets/include/SDL2/SDL_revision.h +2 -2
  54. data/assets/include/SDL2/SDL_rwops.h +50 -13
  55. data/assets/include/SDL2/SDL_scancode.h +2 -2
  56. data/assets/include/SDL2/SDL_sensor.h +4 -4
  57. data/assets/include/SDL2/SDL_shape.h +1 -1
  58. data/assets/include/SDL2/SDL_stdinc.h +1 -1
  59. data/assets/include/SDL2/SDL_surface.h +2 -1
  60. data/assets/include/SDL2/SDL_system.h +1 -1
  61. data/assets/include/SDL2/SDL_syswm.h +11 -8
  62. data/assets/include/SDL2/SDL_test.h +1 -1
  63. data/assets/include/SDL2/SDL_test_assert.h +1 -1
  64. data/assets/include/SDL2/SDL_test_common.h +22 -5
  65. data/assets/include/SDL2/SDL_test_compare.h +1 -1
  66. data/assets/include/SDL2/SDL_test_crc32.h +1 -1
  67. data/assets/include/SDL2/SDL_test_font.h +1 -1
  68. data/assets/include/SDL2/SDL_test_fuzzer.h +1 -1
  69. data/assets/include/SDL2/SDL_test_harness.h +1 -1
  70. data/assets/include/SDL2/SDL_test_images.h +1 -1
  71. data/assets/include/SDL2/SDL_test_log.h +1 -1
  72. data/assets/include/SDL2/SDL_test_md5.h +1 -1
  73. data/assets/include/SDL2/SDL_test_memory.h +3 -3
  74. data/assets/include/SDL2/SDL_test_random.h +1 -1
  75. data/assets/include/SDL2/SDL_thread.h +1 -1
  76. data/assets/include/SDL2/SDL_timer.h +1 -1
  77. data/assets/include/SDL2/SDL_touch.h +17 -1
  78. data/assets/include/SDL2/SDL_types.h +1 -1
  79. data/assets/include/SDL2/SDL_version.h +2 -2
  80. data/assets/include/SDL2/SDL_video.h +1 -1
  81. data/assets/include/SDL2/SDL_vulkan.h +3 -3
  82. data/assets/include/SDL2/begin_code.h +4 -1
  83. data/assets/include/SDL2/close_code.h +4 -1
  84. data/assets/include/simple2d.h +22 -0
  85. data/assets/linux/simple2d/Makefile +11 -8
  86. data/assets/linux/simple2d/bin/simple2d.sh +13 -7
  87. data/assets/linux/simple2d/include/simple2d.h +22 -0
  88. data/assets/linux/simple2d/src/gl.c +17 -13
  89. data/assets/linux/simple2d/src/gl3.c +105 -32
  90. data/assets/linux/simple2d/src/sound.c +37 -0
  91. data/assets/linux/simple2d/src/window.c +11 -0
  92. data/assets/macos/lib/libFLAC.a +0 -0
  93. data/assets/macos/lib/libSDL2.a +0 -0
  94. data/assets/macos/lib/libSDL2_image.a +0 -0
  95. data/assets/macos/lib/libSDL2_mixer.a +0 -0
  96. data/assets/macos/lib/libSDL2_ttf.a +0 -0
  97. data/assets/macos/lib/libfreetype.a +0 -0
  98. data/assets/macos/lib/libjpeg.a +0 -0
  99. data/assets/macos/lib/libmpg123.a +0 -0
  100. data/assets/macos/lib/libogg.a +0 -0
  101. data/assets/macos/lib/libpng16.a +0 -0
  102. data/assets/macos/lib/libsimple2d.a +0 -0
  103. data/assets/macos/lib/libtiff.a +0 -0
  104. data/assets/macos/lib/libwebp.a +0 -0
  105. data/assets/mingw/bin/SDL2.dll +0 -0
  106. data/assets/mingw/bin/SDL2_image.dll +0 -0
  107. data/assets/mingw/bin/libpng16-16.dll +0 -0
  108. data/assets/mingw/bin/libtiff-5.dll +0 -0
  109. data/assets/mingw/bin/libwebp-7.dll +0 -0
  110. data/assets/mingw/lib/libSDL2.a +0 -0
  111. data/assets/mingw/lib/libSDL2.dll.a +0 -0
  112. data/assets/mingw/lib/libSDL2_image.a +0 -0
  113. data/assets/mingw/lib/libSDL2_image.dll.a +0 -0
  114. data/assets/mingw/lib/libSDL2_test.a +0 -0
  115. data/assets/mingw/lib/libSDL2main.a +0 -0
  116. data/assets/mingw/lib/libsimple2d.a +0 -0
  117. data/ext/ruby2d/extconf.rb +1 -1
  118. data/lib/ruby2d/version.rb +1 -1
  119. metadata +14 -2
@@ -46,6 +46,43 @@ void S2D_PlaySound(S2D_Sound *snd) {
46
46
  }
47
47
 
48
48
 
49
+ /*
50
+ * Get the sound's volume
51
+ */
52
+ int S2D_GetSoundVolume(S2D_Sound *snd) {
53
+ if (!snd) return -1;
54
+ return ceil(Mix_VolumeChunk(snd->data, -1) * (100.0 / MIX_MAX_VOLUME));
55
+ }
56
+
57
+
58
+ /*
59
+ * Set the sound's volume a given percentage
60
+ */
61
+ void S2D_SetSoundVolume(S2D_Sound *snd, int volume) {
62
+ if (!snd) return;
63
+ // Set volume to be a percentage of the maximum mix volume
64
+ Mix_VolumeChunk(snd->data, (volume / 100.0) * MIX_MAX_VOLUME);
65
+ }
66
+
67
+
68
+ /*
69
+ * Get the sound mixer volume
70
+ */
71
+ int S2D_GetSoundMixVolume() {
72
+ return ceil(Mix_Volume(-1, -1) * (100.0 / MIX_MAX_VOLUME));
73
+ }
74
+
75
+
76
+ /*
77
+ * Set the sound mixer volume a given percentage
78
+ */
79
+ void S2D_SetSoundMixVolume(int volume) {
80
+ // This sets the volume value across all channels
81
+ // Set volume to be a percentage of the maximum mix volume
82
+ Mix_Volume(-1, (volume / 100.0) * MIX_MAX_VOLUME);
83
+ }
84
+
85
+
49
86
  /*
50
87
  * Free the sound
51
88
  */
@@ -91,6 +91,12 @@ int S2D_Show(S2D_Window *window) {
91
91
 
92
92
  S2D_GL_Init(window);
93
93
 
94
+ // SDL 2.0.10 and macOS 10.15 fix ////////////////////////////////////////////
95
+
96
+ #if MACOS
97
+ SDL_SetWindowSize(window->sdl, window->width, window->height);
98
+ #endif
99
+
94
100
  // Set Main Loop Data ////////////////////////////////////////////////////////
95
101
 
96
102
  const Uint8 *key_state;
@@ -313,6 +319,11 @@ int S2D_Show(S2D_Window *window) {
313
319
  if (window->render) window->render();
314
320
 
315
321
  // Draw Frame //////////////////////////////////////////////////////////////
322
+
323
+ // Render and flush all OpenGL buffers
324
+ S2D_GL_FlushBuffers();
325
+
326
+ // Swap buffers to display drawn contents in the window
316
327
  SDL_GL_SwapWindow(window->sdl);
317
328
  }
318
329
 
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -1,7 +1,7 @@
1
1
  require 'mkmf'
2
2
  require_relative '../../lib/ruby2d/cli/colorize'
3
3
 
4
- S2D_VERSION = '1.1.0' # Simple 2D minimum version required
4
+ S2D_VERSION = '1.2.0' # Simple 2D minimum version required
5
5
  $errors = [] # Holds errors
6
6
 
7
7
  # Set the OS platform
@@ -1,5 +1,5 @@
1
1
  # Ruby2D::VERSION
2
2
 
3
3
  module Ruby2D
4
- VERSION = '0.9.3'
4
+ VERSION = '0.9.4'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby2d
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.3
4
+ version: 0.9.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Black
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-10 00:00:00.000000000 Z
11
+ date: 2020-02-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -33,6 +33,7 @@ extensions:
33
33
  extra_rdoc_files: []
34
34
  files:
35
35
  - assets/README.md
36
+ - assets/Rakefile
36
37
  - assets/app.icns
37
38
  - assets/include/SDL2/SDL.h
38
39
  - assets/include/SDL2/SDL_assert.h
@@ -42,6 +43,17 @@ files:
42
43
  - assets/include/SDL2/SDL_blendmode.h
43
44
  - assets/include/SDL2/SDL_clipboard.h
44
45
  - assets/include/SDL2/SDL_config.h
46
+ - assets/include/SDL2/SDL_config_android.h
47
+ - assets/include/SDL2/SDL_config_iphoneos.h
48
+ - assets/include/SDL2/SDL_config_macosx.h
49
+ - assets/include/SDL2/SDL_config_minimal.h
50
+ - assets/include/SDL2/SDL_config_os2.h
51
+ - assets/include/SDL2/SDL_config_pandora.h
52
+ - assets/include/SDL2/SDL_config_psp.h
53
+ - assets/include/SDL2/SDL_config_windows.h
54
+ - assets/include/SDL2/SDL_config_winrt.h
55
+ - assets/include/SDL2/SDL_config_wiz.h
56
+ - assets/include/SDL2/SDL_copying.h
45
57
  - assets/include/SDL2/SDL_cpuinfo.h
46
58
  - assets/include/SDL2/SDL_egl.h
47
59
  - assets/include/SDL2/SDL_endian.h