gosu 1.5.0 → 2.0.0.pre6

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.
Files changed (241) hide show
  1. checksums.yaml +4 -4
  2. data/dependencies/SDL/include/SDL.h +233 -0
  3. data/dependencies/SDL/include/SDL_assert.h +320 -0
  4. data/dependencies/SDL/include/SDL_atomic.h +414 -0
  5. data/dependencies/SDL/include/SDL_audio.h +1500 -0
  6. data/dependencies/SDL/include/{SDL3/SDL_bits.h → SDL_bits.h} +27 -47
  7. data/dependencies/SDL/include/{SDL3/SDL_blendmode.h → SDL_blendmode.h} +55 -59
  8. data/dependencies/SDL/include/SDL_clipboard.h +141 -0
  9. data/dependencies/SDL/include/SDL_config.h +331 -0
  10. data/dependencies/SDL/include/SDL_cpuinfo.h +594 -0
  11. data/dependencies/SDL/include/{SDL3/SDL_egl.h → SDL_egl.h} +8 -11
  12. data/dependencies/SDL/include/SDL_endian.h +348 -0
  13. data/dependencies/SDL/include/SDL_error.h +163 -0
  14. data/dependencies/SDL/include/SDL_events.h +1166 -0
  15. data/dependencies/SDL/include/SDL_filesystem.h +149 -0
  16. data/dependencies/SDL/include/SDL_gamecontroller.h +1074 -0
  17. data/dependencies/SDL/include/SDL_gesture.h +117 -0
  18. data/dependencies/SDL/include/SDL_guid.h +100 -0
  19. data/dependencies/SDL/include/SDL_haptic.h +1341 -0
  20. data/dependencies/SDL/include/SDL_hidapi.h +451 -0
  21. data/dependencies/SDL/include/SDL_hints.h +2613 -0
  22. data/dependencies/SDL/include/SDL_joystick.h +1069 -0
  23. data/dependencies/SDL/include/SDL_keyboard.h +353 -0
  24. data/dependencies/SDL/include/SDL_keycode.h +358 -0
  25. data/dependencies/SDL/include/SDL_loadso.h +115 -0
  26. data/dependencies/SDL/include/{SDL3/SDL_locale.h → SDL_locale.h} +24 -40
  27. data/dependencies/SDL/include/SDL_log.h +404 -0
  28. data/dependencies/SDL/include/SDL_main.h +282 -0
  29. data/dependencies/SDL/include/{SDL3/SDL_messagebox.h → SDL_messagebox.h} +48 -85
  30. data/dependencies/SDL/include/{SDL3/SDL_metal.h → SDL_metal.h} +29 -29
  31. data/dependencies/SDL/include/{SDL3/SDL_misc.h → SDL_misc.h} +12 -13
  32. data/dependencies/SDL/include/SDL_mouse.h +464 -0
  33. data/dependencies/SDL/include/SDL_mutex.h +545 -0
  34. data/dependencies/SDL/include/SDL_name.h +33 -0
  35. data/dependencies/SDL/include/{SDL3/SDL_opengl.h → SDL_opengl.h} +252 -1221
  36. data/dependencies/SDL/include/{SDL3/SDL_opengles.h → SDL_opengles.h} +7 -6
  37. data/dependencies/SDL/include/{SDL3/SDL_opengles2.h → SDL_opengles2.h} +11 -10
  38. data/dependencies/SDL/include/SDL_pixels.h +644 -0
  39. data/dependencies/SDL/include/SDL_platform.h +261 -0
  40. data/dependencies/SDL/include/{SDL3/SDL_power.h → SDL_power.h} +19 -40
  41. data/dependencies/SDL/include/SDL_quit.h +58 -0
  42. data/dependencies/SDL/include/SDL_rect.h +376 -0
  43. data/dependencies/SDL/include/SDL_render.h +1924 -0
  44. data/dependencies/SDL/include/SDL_revision.h +7 -0
  45. data/dependencies/SDL/include/SDL_rwops.h +841 -0
  46. data/dependencies/SDL/include/{SDL3/SDL_scancode.h → SDL_scancode.h} +68 -60
  47. data/dependencies/SDL/include/SDL_sensor.h +322 -0
  48. data/dependencies/SDL/include/SDL_shape.h +155 -0
  49. data/dependencies/SDL/include/SDL_stdinc.h +838 -0
  50. data/dependencies/SDL/include/SDL_surface.h +997 -0
  51. data/dependencies/SDL/include/SDL_system.h +623 -0
  52. data/dependencies/SDL/include/SDL_syswm.h +386 -0
  53. data/dependencies/SDL/include/{SDL3/SDL_test.h → SDL_test.h} +22 -16
  54. data/dependencies/SDL/include/{SDL3/SDL_test_assert.h → SDL_test_assert.h} +34 -27
  55. data/dependencies/SDL/include/{SDL3/SDL_test_common.h → SDL_test_common.h} +52 -109
  56. data/dependencies/SDL/include/{SDL3/SDL_test_compare.h → SDL_test_compare.h} +14 -22
  57. data/dependencies/SDL/include/{SDL3/SDL_test_crc32.h → SDL_test_crc32.h} +30 -27
  58. data/dependencies/SDL/include/{SDL3/SDL_test_font.h → SDL_test_font.h} +49 -50
  59. data/dependencies/SDL/include/{SDL3/SDL_test_fuzzer.h → SDL_test_fuzzer.h} +79 -64
  60. data/dependencies/SDL/include/{SDL3/SDL_test_harness.h → SDL_test_harness.h} +30 -47
  61. data/dependencies/SDL/include/SDL_test_images.h +78 -0
  62. data/dependencies/SDL/include/{SDL3/SDL_platform.h → SDL_test_log.h} +26 -25
  63. data/dependencies/SDL/include/{SDL3/SDL_test_md5.h → SDL_test_md5.h} +28 -21
  64. data/dependencies/SDL/include/{SDL3/SDL_test_memory.h → SDL_test_memory.h} +16 -19
  65. data/dependencies/SDL/include/SDL_test_random.h +115 -0
  66. data/dependencies/SDL/include/SDL_thread.h +464 -0
  67. data/dependencies/SDL/include/SDL_timer.h +222 -0
  68. data/dependencies/SDL/include/SDL_touch.h +150 -0
  69. data/dependencies/SDL/include/{SDL3/SDL_copying.h → SDL_types.h} +9 -2
  70. data/dependencies/SDL/include/SDL_version.h +204 -0
  71. data/dependencies/SDL/include/SDL_video.h +2178 -0
  72. data/dependencies/SDL/include/SDL_vulkan.h +215 -0
  73. data/dependencies/SDL/include/begin_code.h +187 -0
  74. data/dependencies/SDL/include/{SDL3/SDL_close_code.h → close_code.h} +6 -7
  75. data/dependencies/SDL/lib/x64/libSDL2.dll.a +0 -0
  76. data/dependencies/SDL/lib/x86/libSDL2.dll.a +0 -0
  77. data/dependencies/SDL_sound/SDL_sound.c +215 -136
  78. data/dependencies/SDL_sound/SDL_sound.h +725 -0
  79. data/dependencies/SDL_sound/SDL_sound_aiff.c +54 -55
  80. data/dependencies/SDL_sound/SDL_sound_au.c +32 -32
  81. data/dependencies/SDL_sound/SDL_sound_coreaudio.c +41 -24
  82. data/dependencies/SDL_sound/SDL_sound_flac.c +12 -32
  83. data/dependencies/SDL_sound/SDL_sound_internal.h +48 -33
  84. data/dependencies/SDL_sound/SDL_sound_modplug.c +29 -21
  85. data/dependencies/SDL_sound/SDL_sound_mp3.c +13 -35
  86. data/dependencies/SDL_sound/SDL_sound_raw.c +15 -14
  87. data/dependencies/SDL_sound/SDL_sound_shn.c +82 -82
  88. data/dependencies/SDL_sound/SDL_sound_voc.c +30 -30
  89. data/dependencies/SDL_sound/SDL_sound_vorbis.c +25 -34
  90. data/dependencies/SDL_sound/SDL_sound_wav.c +82 -86
  91. data/dependencies/SDL_sound/dr_flac.h +1281 -1845
  92. data/dependencies/SDL_sound/dr_mp3.h +617 -1035
  93. data/dependencies/SDL_sound/libmodplug/fastmix.c +1 -1
  94. data/dependencies/SDL_sound/libmodplug/libmodplug.h +4 -5
  95. data/dependencies/SDL_sound/libmodplug/load_ams.c +3 -6
  96. data/dependencies/SDL_sound/libmodplug/load_dsm.c +1 -2
  97. data/dependencies/SDL_sound/libmodplug/load_mt2.c +2 -2
  98. data/dependencies/SDL_sound/libmodplug/modplug.h +1 -2
  99. data/dependencies/SDL_sound/libmodplug/snd_fx.c +3 -3
  100. data/dependencies/SDL_sound/libmodplug/sndfile.c +0 -3
  101. data/dependencies/SDL_sound/libmodplug/sndmix.c +3 -7
  102. data/dependencies/SDL_sound/stb_vorbis.h +343 -397
  103. data/dependencies/mojoAL/AL/alc.h +2 -2
  104. data/dependencies/mojoAL/mojoal.c +1878 -2113
  105. data/dependencies/stb/stb_image.h +1381 -1192
  106. data/dependencies/stb/stb_image_write.h +129 -329
  107. data/dependencies/stb/stb_truetype.h +60 -304
  108. data/dependencies/utf8proc/utf8proc.c +75 -133
  109. data/dependencies/utf8proc/utf8proc.h +50 -131
  110. data/dependencies/utf8proc/utf8proc_data.h +15658 -16213
  111. data/ext/gosu-ffi/extconf.rb +28 -11
  112. data/ext/gosu-ffi/gosu-ffi.def +0 -3
  113. data/ffi/Gosu.cpp +29 -52
  114. data/ffi/Gosu.h +4 -4
  115. data/ffi/Gosu_Color.cpp +36 -80
  116. data/ffi/Gosu_FFI_internal.h +13 -12
  117. data/ffi/Gosu_Font.cpp +11 -16
  118. data/ffi/Gosu_Font.h +4 -4
  119. data/ffi/Gosu_Image.cpp +36 -69
  120. data/ffi/Gosu_Image.h +5 -16
  121. data/include/Gosu/Bitmap.hpp +1 -1
  122. data/include/Gosu/Color.hpp +4 -5
  123. data/include/Gosu/Graphics.hpp +0 -2
  124. data/include/Gosu/Image.hpp +1 -1
  125. data/include/Gosu/Math.hpp +5 -5
  126. data/include/Gosu/Utility.hpp +1 -27
  127. data/include/Gosu/Version.hpp +2 -2
  128. data/lib/SDL2.dll +0 -0
  129. data/lib/gosu/channel.rb +0 -1
  130. data/lib/gosu/color.rb +13 -36
  131. data/lib/gosu/compat.rb +14 -106
  132. data/lib/gosu/constants.rb +24 -24
  133. data/lib/gosu/ffi.rb +13 -24
  134. data/lib/gosu/font.rb +13 -19
  135. data/lib/gosu/gosu.rb +61 -101
  136. data/lib/gosu/image.rb +34 -72
  137. data/lib/gosu/sample.rb +0 -1
  138. data/lib/gosu/song.rb +0 -1
  139. data/lib/gosu/text_input.rb +1 -15
  140. data/lib/gosu/window.rb +10 -31
  141. data/lib64/SDL2.dll +0 -0
  142. data/rdoc/gosu.rb +0 -2
  143. data/src/Audio.cpp +16 -22
  144. data/src/AudioFileSDLSound.cpp +5 -5
  145. data/src/BinPacker.cpp +4 -5
  146. data/src/Bitmap.cpp +9 -16
  147. data/src/Buffer.cpp +14 -5
  148. data/src/ClipRectStack.hpp +83 -17
  149. data/src/Directories.cpp +1 -1
  150. data/src/DrawOp.hpp +17 -14
  151. data/src/DrawOpQueue.hpp +31 -25
  152. data/src/Font.cpp +1 -1
  153. data/src/GosuGLView.cpp +7 -1
  154. data/src/Graphics.cpp +25 -32
  155. data/src/GraphicsImpl.hpp +24 -0
  156. data/src/Image.cpp +2 -2
  157. data/src/Input.cpp +70 -66
  158. data/src/Macro.cpp +26 -43
  159. data/src/Macro.hpp +16 -22
  160. data/src/Math.cpp +7 -20
  161. data/src/OffScreenTarget.cpp +10 -3
  162. data/src/OpenGLContext.cpp +8 -7
  163. data/src/OpenGLContext.hpp +2 -2
  164. data/src/RenderState.hpp +54 -30
  165. data/src/Resolution.cpp +38 -48
  166. data/src/TexChunk.cpp +2 -2
  167. data/src/TextInput.cpp +9 -9
  168. data/src/Texture.cpp +1 -1
  169. data/src/TiledDrawable.cpp +7 -6
  170. data/src/TrueTypeFontUnix.cpp +9 -12
  171. data/src/Utility.cpp +26 -39
  172. data/src/UtilityWin.cpp +2 -6
  173. data/src/Window.cpp +34 -54
  174. metadata +93 -99
  175. data/dependencies/SDL/include/SDL3/SDL.h +0 -91
  176. data/dependencies/SDL/include/SDL3/SDL_assert.h +0 -710
  177. data/dependencies/SDL/include/SDL3/SDL_asyncio.h +0 -550
  178. data/dependencies/SDL/include/SDL3/SDL_atomic.h +0 -692
  179. data/dependencies/SDL/include/SDL3/SDL_audio.h +0 -2382
  180. data/dependencies/SDL/include/SDL3/SDL_begin_code.h +0 -553
  181. data/dependencies/SDL/include/SDL3/SDL_camera.h +0 -535
  182. data/dependencies/SDL/include/SDL3/SDL_clipboard.h +0 -331
  183. data/dependencies/SDL/include/SDL3/SDL_cpuinfo.h +0 -374
  184. data/dependencies/SDL/include/SDL3/SDL_dialog.h +0 -343
  185. data/dependencies/SDL/include/SDL3/SDL_dlopennote.h +0 -234
  186. data/dependencies/SDL/include/SDL3/SDL_endian.h +0 -645
  187. data/dependencies/SDL/include/SDL3/SDL_error.h +0 -226
  188. data/dependencies/SDL/include/SDL3/SDL_events.h +0 -1651
  189. data/dependencies/SDL/include/SDL3/SDL_filesystem.h +0 -537
  190. data/dependencies/SDL/include/SDL3/SDL_gamepad.h +0 -1657
  191. data/dependencies/SDL/include/SDL3/SDL_gpu.h +0 -4637
  192. data/dependencies/SDL/include/SDL3/SDL_guid.h +0 -106
  193. data/dependencies/SDL/include/SDL3/SDL_haptic.h +0 -1461
  194. data/dependencies/SDL/include/SDL3/SDL_hidapi.h +0 -571
  195. data/dependencies/SDL/include/SDL3/SDL_hints.h +0 -5041
  196. data/dependencies/SDL/include/SDL3/SDL_init.h +0 -508
  197. data/dependencies/SDL/include/SDL3/SDL_intrin.h +0 -410
  198. data/dependencies/SDL/include/SDL3/SDL_iostream.h +0 -1379
  199. data/dependencies/SDL/include/SDL3/SDL_joystick.h +0 -1385
  200. data/dependencies/SDL/include/SDL3/SDL_keyboard.h +0 -615
  201. data/dependencies/SDL/include/SDL3/SDL_keycode.h +0 -348
  202. data/dependencies/SDL/include/SDL3/SDL_loadso.h +0 -145
  203. data/dependencies/SDL/include/SDL3/SDL_log.h +0 -541
  204. data/dependencies/SDL/include/SDL3/SDL_main.h +0 -704
  205. data/dependencies/SDL/include/SDL3/SDL_main_impl.h +0 -149
  206. data/dependencies/SDL/include/SDL3/SDL_mouse.h +0 -813
  207. data/dependencies/SDL/include/SDL3/SDL_mutex.h +0 -1117
  208. data/dependencies/SDL/include/SDL3/SDL_oldnames.h +0 -1339
  209. data/dependencies/SDL/include/SDL3/SDL_pen.h +0 -198
  210. data/dependencies/SDL/include/SDL3/SDL_pixels.h +0 -1441
  211. data/dependencies/SDL/include/SDL3/SDL_platform_defines.h +0 -497
  212. data/dependencies/SDL/include/SDL3/SDL_process.h +0 -441
  213. data/dependencies/SDL/include/SDL3/SDL_properties.h +0 -572
  214. data/dependencies/SDL/include/SDL3/SDL_rect.h +0 -528
  215. data/dependencies/SDL/include/SDL3/SDL_render.h +0 -3034
  216. data/dependencies/SDL/include/SDL3/SDL_revision.h +0 -56
  217. data/dependencies/SDL/include/SDL3/SDL_sensor.h +0 -321
  218. data/dependencies/SDL/include/SDL3/SDL_stdinc.h +0 -6186
  219. data/dependencies/SDL/include/SDL3/SDL_storage.h +0 -686
  220. data/dependencies/SDL/include/SDL3/SDL_surface.h +0 -1769
  221. data/dependencies/SDL/include/SDL3/SDL_system.h +0 -840
  222. data/dependencies/SDL/include/SDL3/SDL_test_log.h +0 -83
  223. data/dependencies/SDL/include/SDL3/SDL_thread.h +0 -602
  224. data/dependencies/SDL/include/SDL3/SDL_time.h +0 -249
  225. data/dependencies/SDL/include/SDL3/SDL_timer.h +0 -454
  226. data/dependencies/SDL/include/SDL3/SDL_touch.h +0 -184
  227. data/dependencies/SDL/include/SDL3/SDL_tray.h +0 -544
  228. data/dependencies/SDL/include/SDL3/SDL_version.h +0 -198
  229. data/dependencies/SDL/include/SDL3/SDL_video.h +0 -3497
  230. data/dependencies/SDL/include/SDL3/SDL_vulkan.h +0 -287
  231. data/dependencies/SDL/lib/x64/libSDL3.dll.a +0 -0
  232. data/dependencies/SDL/lib/x86/libSDL3.dll.a +0 -0
  233. data/dependencies/SDL_sound/SDL3_sound/SDL_sound.h +0 -755
  234. data/lib/SDL3.dll +0 -0
  235. data/lib64/SDL3.dll +0 -0
  236. data/src/ClipRectStack.cpp +0 -38
  237. /data/dependencies/SDL/include/{SDL3/SDL_opengl_glext.h → SDL_opengl_glext.h} +0 -0
  238. /data/dependencies/SDL/include/{SDL3/SDL_opengles2_gl2.h → SDL_opengles2_gl2.h} +0 -0
  239. /data/dependencies/SDL/include/{SDL3/SDL_opengles2_gl2ext.h → SDL_opengles2_gl2ext.h} +0 -0
  240. /data/dependencies/SDL/include/{SDL3/SDL_opengles2_gl2platform.h → SDL_opengles2_gl2platform.h} +0 -0
  241. /data/dependencies/SDL/include/{SDL3/SDL_opengles2_khrplatform.h → SDL_opengles2_khrplatform.h} +0 -0
data/lib/gosu/gosu.rb CHANGED
@@ -1,49 +1,38 @@
1
1
  module Gosu
2
- # All methods are declared as module_function so that they can be called
3
- # without the `Gosu.` prefix after `include Gosu` (a common pattern).
4
-
5
- module_function def fps
2
+ def self.fps
6
3
  GosuFFI.check_last_error(GosuFFI.Gosu_fps())
7
4
  end
8
5
 
9
- module_function def flush
6
+ def self.flush
10
7
  GosuFFI.Gosu_flush()
11
8
  GosuFFI.check_last_error
12
- GosuFFI.check_last_gl_error
13
9
  end
14
10
 
15
- module_function def milliseconds
11
+ def self.milliseconds
16
12
  GosuFFI.check_last_error(GosuFFI.Gosu_milliseconds())
17
13
  end
18
14
 
19
- module_function def default_font_name
15
+ def self.default_font_name
20
16
  GosuFFI.check_last_error(GosuFFI.Gosu_default_font_name())
21
17
  end
22
18
 
23
- module_function def user_languages
19
+ def self.user_languages
24
20
  languages = []
25
21
  callback = proc { |data, string| languages << string if string }
26
22
  GosuFFI.Gosu_user_languages(callback, nil)
27
23
  GosuFFI.check_last_error(languages)
28
24
  end
29
25
 
30
- module_function def gl(z = nil, &block)
31
- raise LocalJumpError, "no block given (yield)" unless block
26
+ def self.gl(z = nil, &block)
27
+ raise "Block not given!" unless block
32
28
 
33
29
  if z
34
- # When given a Z position, Gosu.gl will not call its block immediately, but enqueue it.
35
- # Ruby exceptions cannot propagate through the C++ code that calls it then, so remember
36
- # the first exception (and skip the remaining blocks) until Gosu::Window re-raises it.
37
- wrapped_block = proc do
38
- block.call unless $gosu_gl_exception
39
- rescue Exception => e
40
- $gosu_gl_exception = e
41
- end
30
+ # When given a Z position, Gosu.gl will not call its block immediately, but enqueue it for later execution.
42
31
  # To prevent the block from getting GC'd, store it in a global variable which is cleared after Window.draw.
43
32
  $gosu_gl_blocks ||= []
44
- $gosu_gl_blocks << wrapped_block
33
+ $gosu_gl_blocks << block
45
34
 
46
- GosuFFI.Gosu_gl_z(z, wrapped_block)
35
+ GosuFFI.Gosu_gl_z(z, block)
47
36
  else
48
37
  GosuFFI.Gosu_gl(block)
49
38
  end
@@ -51,106 +40,77 @@ module Gosu
51
40
  GosuFFI.check_last_error
52
41
  end
53
42
 
54
- module_function def render(width, height, retro: false, tileable: false, &block)
55
- raise LocalJumpError, "no block given (yield)" unless block
56
-
57
- # Ruby-FFI rescues exceptions in callbacks and re-raises them as soon as the FFI call returns.
58
- # (It only keeps the exception from the last callback, which is fine for blocks that are called
59
- # exactly once, like in Gosu.translate.)
60
- # Here, that would happen before the resulting image could be wrapped and later freed.
61
- # Remember the exception and raise it ourselves instead.
62
- exception = nil
63
- wrapped_block = proc do
64
- block.call
65
- rescue Exception => e
66
- exception = e
67
- end
68
- __image = GosuFFI.Gosu_render(width, height, wrapped_block, GosuFFI.image_flags(retro: retro, tileable: tileable))
43
+ def self.render(width, height, retro: false, tileable: false, &block)
44
+ # TODO: Exception translation from inner block
45
+ __image = GosuFFI.Gosu_render(width, height, block, GosuFFI.image_flags(retro: retro, tileable: tileable))
69
46
  GosuFFI.check_last_error
70
- image = Gosu::Image.new(__image)
71
- raise exception if exception
72
- image
47
+ Gosu::Image.new(__image)
73
48
  end
74
49
 
75
- module_function def record(width, height, &block)
76
- raise LocalJumpError, "no block given (yield)" unless block
77
-
78
- # See Gosu.render.
79
- exception = nil
80
- wrapped_block = proc do
81
- block.call
82
- rescue Exception => e
83
- exception = e
84
- end
85
- __image = GosuFFI.Gosu_record(width, height, wrapped_block)
50
+ def self.record(width, height, &block)
51
+ # TODO: Exception translation from inner block
52
+ __image = GosuFFI.Gosu_record(width, height, block)
86
53
  GosuFFI.check_last_error
87
- image = Gosu::Image.new(__image)
88
- raise exception if exception
89
- image
54
+ Gosu::Image.new(__image)
90
55
  end
91
56
 
92
- module_function def transform(e0, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12, e13, e14, e15, &block)
93
- raise LocalJumpError, "no block given (yield)" unless block
94
-
57
+ def self.transform(e0, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12, e13, e14, e15, &block)
58
+ # TODO: Exception translation from inner block
95
59
  GosuFFI.Gosu_transform(e0, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12, e13, e14, e15, block)
96
60
  GosuFFI.check_last_error
97
61
  end
98
62
 
99
- module_function def translate(x, y, &block)
100
- raise LocalJumpError, "no block given (yield)" unless block
101
-
63
+ def self.translate(x, y, &block)
64
+ # TODO: Exception translation from inner block
102
65
  GosuFFI.Gosu_translate(x, y, block)
103
66
  GosuFFI.check_last_error
104
67
  end
105
68
 
106
- module_function def rotate(angle, around_x = 0, around_y = 0, &block)
107
- raise LocalJumpError, "no block given (yield)" unless block
108
-
69
+ def self.rotate(angle, around_x = 0, around_y = 0, &block)
70
+ # TODO: Exception translation from inner block
109
71
  GosuFFI.Gosu_rotate(angle, around_x, around_y, block)
110
72
  GosuFFI.check_last_error
111
73
  end
112
74
 
113
- module_function def scale(x, y = x, around_x = 0, around_y = 0, &block)
114
- raise LocalJumpError, "no block given (yield)" unless block
115
-
75
+ def self.scale(x, y = x, around_x = 0, around_y = 0, &block)
76
+ # TODO: Exception translation from inner block
116
77
  GosuFFI.Gosu_scale(x, y, around_x, around_y, block)
117
78
  GosuFFI.check_last_error
118
79
  end
119
80
 
120
81
  # Note: On JRuby this seems to get "optimized out" for some reason
121
82
  # For now, call jruby with the `--dev` option
122
- module_function def clip_to(x, y, width, height, &block)
123
- raise LocalJumpError, "no block given (yield)" unless block
124
-
83
+ def self.clip_to(x, y, width, height, &block)
84
+ # TODO: Exception translation from inner block
125
85
  GosuFFI.Gosu_clip_to(x, y, width, height, block)
126
86
  GosuFFI.check_last_error
127
87
  end
128
88
 
129
- module_function def button_down?(id)
89
+ def self.button_down?(id)
130
90
  GosuFFI.check_last_error(GosuFFI.Gosu_button_down(id))
131
91
  end
132
92
 
133
- module_function def axis(id)
93
+ def self.axis(id)
134
94
  GosuFFI.check_last_error(GosuFFI.Gosu_axis(id))
135
95
  end
136
96
 
137
- module_function def button_id_to_char(id)
97
+ def self.button_id_to_char(id)
138
98
  GosuFFI.check_last_error(GosuFFI.Gosu_button_id_to_char(id))
139
99
  end
140
100
 
141
- module_function def char_to_button_id(id)
101
+ def self.char_to_button_id(id)
142
102
  GosuFFI.check_last_error(GosuFFI.Gosu_button_char_to_id(id))
143
103
  end
144
104
 
145
- module_function def button_name(id)
105
+ def self.button_name(id)
146
106
  GosuFFI.check_last_error(GosuFFI.Gosu_button_name(id))
147
107
  end
148
108
 
149
- module_function def gamepad_name(id)
109
+ def self.gamepad_name(id)
150
110
  GosuFFI.check_last_error(GosuFFI.Gosu_gamepad_name(id))
151
111
  end
152
112
 
153
- module_function def clipboard
113
+ def self.clipboard
154
114
  GosuFFI.check_last_error(GosuFFI.Gosu_clipboard())
155
115
  end
156
116
 
@@ -159,56 +119,56 @@ module Gosu
159
119
  GosuFFI.check_last_error
160
120
  end
161
121
 
162
- module_function def draw_line(x1, y1, c1, x2, y2, c2, z = 0, mode = :default)
163
- GosuFFI.check_last_error if not
164
- GosuFFI.Gosu_draw_line(x1, y1, GosuFFI.color_to_uint32(c1), x2, y2, GosuFFI.color_to_uint32(c2), z, GosuFFI.blend_mode(mode))
122
+ def self.draw_line(x1, y1, c1, x2, y2, c2, z = 0, mode = :default)
123
+ GosuFFI.Gosu_draw_line(x1, y1, GosuFFI.color_to_uint32(c1), x2, y2, GosuFFI.color_to_uint32(c2), z, GosuFFI.blend_mode(mode))
124
+ GosuFFI.check_last_error
165
125
  end
166
126
 
167
- module_function def draw_triangle(x1, y1, c1, x2, y2, c2, x3, y3, c3, z = 0, mode = :default)
168
- GosuFFI.check_last_error if not
169
- GosuFFI.Gosu_draw_triangle(x1, y1, GosuFFI.color_to_uint32(c1), x2, y2, GosuFFI.color_to_uint32(c2),
170
- x3, y3, GosuFFI.color_to_uint32(c3), z, GosuFFI.blend_mode(mode))
127
+ def self.draw_triangle(x1, y1, c1, x2, y2, c2, x3, y3, c3, z = 0, mode = :default)
128
+ GosuFFI.Gosu_draw_triangle(x1, y1, GosuFFI.color_to_uint32(c1), x2, y2, GosuFFI.color_to_uint32(c2),
129
+ x3, y3, GosuFFI.color_to_uint32(c3), z, GosuFFI.blend_mode(mode))
130
+ GosuFFI.check_last_error
171
131
  end
172
132
 
173
- module_function def draw_quad(x1, y1, c1, x2, y2, c2,
133
+ def self.draw_quad(x1, y1, c1, x2, y2, c2,
174
134
  x3, y3, c3, x4, y4, c4,
175
135
  z = 0, mode = :default)
176
- GosuFFI.check_last_error if not
177
- GosuFFI.Gosu_draw_quad(x1, y1, GosuFFI.color_to_uint32(c1), x2, y2, GosuFFI.color_to_uint32(c2),
178
- x3, y3, GosuFFI.color_to_uint32(c3), x4, y4, GosuFFI.color_to_uint32(c4),
179
- z, GosuFFI.blend_mode(mode))
136
+ GosuFFI.Gosu_draw_quad(x1, y1, GosuFFI.color_to_uint32(c1), x2, y2, GosuFFI.color_to_uint32(c2),
137
+ x3, y3, GosuFFI.color_to_uint32(c3), x4, y4, GosuFFI.color_to_uint32(c4),
138
+ z, GosuFFI.blend_mode(mode))
139
+ GosuFFI.check_last_error
180
140
  end
181
141
 
182
- module_function def draw_rect(x, y, width, height, c, z = 0, mode = :default)
183
- GosuFFI.check_last_error if not
184
- GosuFFI.Gosu_draw_rect(x, y, width, height, GosuFFI.color_to_uint32(c), z, GosuFFI.blend_mode(mode))
142
+ def self.draw_rect(x, y, width, height, c, z = 0, mode = :default)
143
+ GosuFFI.Gosu_draw_rect(x, y, width, height, GosuFFI.color_to_uint32(c), z, GosuFFI.blend_mode(mode))
144
+ GosuFFI.check_last_error
185
145
  end
186
146
 
187
- module_function def offset_x(angle, distance)
147
+ def self.offset_x(angle, distance)
188
148
  GosuFFI.check_last_error(GosuFFI.Gosu_offset_x(angle, distance))
189
149
  end
190
150
 
191
- module_function def offset_y(angle, distance)
151
+ def self.offset_y(angle, distance)
192
152
  GosuFFI.check_last_error(GosuFFI.Gosu_offset_y(angle, distance))
193
153
  end
194
154
 
195
- module_function def distance(x1, y1, x2, y2)
155
+ def self.distance(x1, y1, x2, y2)
196
156
  GosuFFI.check_last_error(GosuFFI.Gosu_distance(x1, y1, x2, y2))
197
157
  end
198
158
 
199
- module_function def angle(x1, y1, x2, y2)
159
+ def self.angle(x1, y1, x2, y2)
200
160
  GosuFFI.check_last_error(GosuFFI.Gosu_angle(x1, y1, x2, y2))
201
161
  end
202
162
 
203
- module_function def angle_diff(angle1, angle2)
163
+ def self.angle_diff(angle1, angle2)
204
164
  GosuFFI.check_last_error(GosuFFI.Gosu_angle_diff(angle1, angle2))
205
165
  end
206
166
 
207
- module_function def random(min, max)
167
+ def self.random(min, max)
208
168
  GosuFFI.check_last_error(GosuFFI.Gosu_random(min, max))
209
169
  end
210
170
 
211
- module_function def available_width(window = nil)
171
+ def self.available_width(window = nil)
212
172
  if window.nil?
213
173
  GosuFFI.check_last_error(GosuFFI.Gosu_available_width(nil))
214
174
  else
@@ -217,7 +177,7 @@ module Gosu
217
177
  end
218
178
  end
219
179
 
220
- module_function def available_height(window = nil)
180
+ def self.available_height(window = nil)
221
181
  if window.nil?
222
182
  GosuFFI.check_last_error(GosuFFI.Gosu_available_height(nil))
223
183
  else
@@ -226,7 +186,7 @@ module Gosu
226
186
  end
227
187
  end
228
188
 
229
- module_function def screen_width(window = nil)
189
+ def self.screen_width(window = nil)
230
190
  if window.nil?
231
191
  GosuFFI.check_last_error(GosuFFI.Gosu_screen_width(nil))
232
192
  else
@@ -235,7 +195,7 @@ module Gosu
235
195
  end
236
196
  end
237
197
 
238
- module_function def screen_height(window = nil)
198
+ def self.screen_height(window = nil)
239
199
  if window.nil?
240
200
  GosuFFI.check_last_error(GosuFFI.Gosu_screen_height(nil))
241
201
  else
@@ -244,7 +204,7 @@ module Gosu
244
204
  end
245
205
  end
246
206
 
247
- module_function def enable_undocumented_retrofication
207
+ def self.enable_undocumented_retrofication
248
208
  # TODO: Move implementation from C++ to Ruby.
249
209
  end
250
210
  end
data/lib/gosu/image.rb CHANGED
@@ -1,13 +1,14 @@
1
1
  module Gosu
2
2
  class Image
3
+ BlobHelper = Struct.new(:columns, :rows, :to_blob)
4
+
3
5
  def self.from_blob(width, height, rgba = "\0\0\0\0" * (width * height), retro: false, tileable: false)
4
- @struct ||= Struct.new(:columns, :rows, :to_blob)
5
- self.new(@struct.new(width, height, rgba), retro: retro, tileable: tileable)
6
+ self.new(BlobHelper.new(width, height, rgba), retro: retro, tileable: tileable)
6
7
  end
7
8
 
8
- def self.from_text(text, line_height, font: Gosu.default_font_name, width: -1, spacing: 0, align: :left,
9
+ def self.from_text(markup, line_height, font: Gosu.default_font_name, width: -1, spacing: 0, align: :left,
9
10
  bold: false, italic: false, underline: false, retro: false)
10
- __image = GosuFFI.Gosu_Image_create_from_text(text.to_s, font, line_height, width, spacing,
11
+ __image = GosuFFI.Gosu_Image_create_from_text(markup, font, line_height, width, spacing,
11
12
  GosuFFI.font_alignment_flags(align),
12
13
  GosuFFI.font_flags(bold, italic, underline),
13
14
  GosuFFI.image_flags(retro: retro))
@@ -17,7 +18,7 @@ module Gosu
17
18
 
18
19
  def self.from_markup(markup, line_height, font: Gosu.default_font_name, width: -1, spacing: 0, align: :left,
19
20
  bold: false, italic: false, underline: false, retro: false)
20
- __image = GosuFFI.Gosu_Image_create_from_markup(markup.to_s, font, line_height, width, spacing,
21
+ __image = GosuFFI.Gosu_Image_create_from_markup(markup, font, line_height, width, spacing,
21
22
  GosuFFI.font_alignment_flags(align),
22
23
  GosuFFI.font_flags(bold, italic, underline),
23
24
  GosuFFI.image_flags(retro: retro))
@@ -47,42 +48,28 @@ module Gosu
47
48
  return images
48
49
  end
49
50
 
50
- def initialize(object, retro: false, tileable: false, rect: nil)
51
- if rect and rect.size != 4
52
- raise ArgumentError, "Expected 4-element array as rect"
53
- end
54
-
55
- flags = GosuFFI.image_flags(retro: retro, tileable: tileable)
56
-
51
+ def initialize(object, retro: false, tileable: false)
57
52
  if object.is_a? String
58
- if rect
59
- __image = GosuFFI.Gosu_Image_create_from_rect(object, *rect, flags)
60
- else
61
- __image = GosuFFI.Gosu_Image_create(object, flags)
62
- end
53
+ __image = GosuFFI.Gosu_Image_create(object, GosuFFI.image_flags(retro: retro, tileable: tileable))
63
54
  GosuFFI.check_last_error
64
55
  elsif object.is_a?(FFI::Pointer)
65
56
  __image = object
66
- elsif object.respond_to?(:to_blob) and
67
- object.respond_to?(:columns) and
57
+ elsif object.respond_to?(:to_blob) &&
58
+ object.respond_to?(:columns) &&
68
59
  object.respond_to?(:rows)
69
-
70
- blob = object.to_blob { self.format = "RGBA"; self.depth = 8 }
71
-
72
- # This creates a copy of the Ruby string data, which shouldn't be necessary with CRuby.
73
- ptr = FFI::MemoryPointer.from_string(blob)
74
- rect ||= [0, 0, object.columns, object.rows]
75
- # Do not consider the terminating null byte part of the ptr length.
76
- __image = GosuFFI.Gosu_Image_create_from_blob(ptr, ptr.size - 1, object.columns, object.rows, *rect, flags)
77
- ptr.free
60
+ blob_bytes = object.to_blob { self.format = "RGBA"; self.depth = 8 }.bytes
61
+ FFI::MemoryPointer.new(:uchar, blob_bytes.size) do |blob|
62
+ blob.write_array_of_type(:uchar, :put_uchar, blob_bytes)
63
+ __image = GosuFFI.Gosu_Image_create_from_blob(blob, blob_bytes.size, object.columns, object.rows, GosuFFI.image_flags(retro: retro, tileable: tileable))
64
+ GosuFFI.check_last_error
65
+ end
78
66
 
79
- GosuFFI.check_last_error
67
+ raise "Failed to load image from blob" if __image.null?
80
68
  else
81
- raise ArgumentError, "Expected String or RMagick::Image (or a type compatible with it)"
69
+ raise ArgumentError
82
70
  end
83
71
 
84
72
  @managed_pointer = FFI::AutoPointer.new(__image, GosuFFI.method(:Gosu_Image_destroy))
85
- self
86
73
  end
87
74
 
88
75
  def __pointer
@@ -90,51 +77,28 @@ module Gosu
90
77
  end
91
78
 
92
79
  def width
93
- # We can cache this, image sizes cannot change in Gosu.
94
- @width ||= GosuFFI.check_last_error(GosuFFI.Gosu_Image_width(__pointer))
80
+ GosuFFI.check_last_error(GosuFFI.Gosu_Image_width(__pointer))
95
81
  end
96
82
 
97
83
  def height
98
- # We can cache this, image sizes cannot change in Gosu.
99
- @height ||= GosuFFI.check_last_error(GosuFFI.Gosu_Image_height(__pointer))
84
+ GosuFFI.check_last_error(GosuFFI.Gosu_Image_height(__pointer))
100
85
  end
101
86
 
102
- # Together with to_blob, these make Gosu::Image compatible with RMagick::Image, so that an image
103
- # can be passed wherever an RMagick image is accepted, e.g. Gosu::Image.new(image).
104
- alias columns width
105
- alias rows height
106
-
107
- def draw(x, y, z = 0, scale_x = 1, scale_y = 1, color = Gosu::Color::WHITE, flags = :default)
108
- if scale_x == 1 and scale_y == 1 and color.equal?(Gosu::Color::WHITE) and flags == :default
109
- # Use a fast-path method when most arguments have their default value.
110
- GosuFFI.check_last_error if not
111
- GosuFFI.Gosu_Image_draw_quick(__pointer, x, y, z)
112
- else
113
- GosuFFI.check_last_error if not
114
- GosuFFI.Gosu_Image_draw(__pointer, x, y, z, scale_x, scale_y,
115
- GosuFFI.color_to_uint32(color), GosuFFI.blend_mode(flags))
116
- end
87
+ def draw(x, y, z, scale_x = 1, scale_y = 1, color = Gosu::Color::WHITE, flags = :default)
88
+ GosuFFI.Gosu_Image_draw(__pointer, x, y, z, scale_x, scale_y, GosuFFI.color_to_uint32(color), GosuFFI.blend_mode(flags))
89
+ GosuFFI.check_last_error
117
90
  end
118
91
 
119
- def draw_rot(x, y, z = 0, angle = 0, center_x = 0.5, center_y = 0.5, scale_x = 1, scale_y = 1, color = Gosu::Color::WHITE, flags = :default)
120
- if center_x == 0.5 and center_y == 0.5 and scale_x == 1 and scale_y == 1 and
121
- color.equal?(Gosu::Color::WHITE) and flags == :default
122
- # Use a fast-path method when most arguments have their default value.
123
- GosuFFI.check_last_error if not
124
- GosuFFI.Gosu_Image_draw_rot_quick(__pointer, x, y, z, angle)
125
- else
126
- GosuFFI.check_last_error if not
127
- GosuFFI.Gosu_Image_draw_rot(__pointer, x, y, z, angle, center_x, center_y, scale_x, scale_y,
128
- GosuFFI.color_to_uint32(color), GosuFFI.blend_mode(flags))
129
- end
92
+ def draw_rot(x, y, z, angle = 0, center_x = 0.5, center_y = 0.5, scale_x = 1, scale_y = 1, color = Gosu::Color::WHITE, flags = :default)
93
+ GosuFFI.Gosu_Image_draw_rot(__pointer, x, y, z, angle, center_x, center_y, scale_x, scale_y, GosuFFI.color_to_uint32(color), GosuFFI.blend_mode(flags))
94
+ GosuFFI.check_last_error
130
95
  end
131
96
 
132
97
  def draw_as_quad(x1, y1, color1, x2, y2, color2, x3, y3, color3, x4, y4, color4, z = 0, mode = :default)
133
- GosuFFI.check_last_error if not
134
- GosuFFI.Gosu_Image_draw_as_quad(__pointer,
135
- x1, y1, GosuFFI.color_to_uint32(color1), x2, y2, GosuFFI.color_to_uint32(color2),
136
- x3, y3, GosuFFI.color_to_uint32(color3), x4, y4, GosuFFI.color_to_uint32(color4),
137
- z, GosuFFI.blend_mode(mode))
98
+ GosuFFI.Gosu_Image_draw_as_quad(x1, y1, GosuFFI.color_to_uint32(color1), x2, y2, GosuFFI.color_to_uint32(color2),
99
+ x3, y3, GosuFFI.color_to_uint32(color3), x4, y4, GosuFFI.color_to_uint32(color4),
100
+ z, GosuFFI.blend_mode(mode))
101
+ GosuFFI.check_last_error
138
102
  end
139
103
 
140
104
  def save(filename)
@@ -148,19 +112,17 @@ module Gosu
148
112
  end
149
113
 
150
114
  def subimage(left, top, width, height)
151
- __subimage = GosuFFI.Gosu_Image_create_from_subimage(__pointer, left, top, width, height)
115
+ __pointer = GosuFFI.Gosu_Image_create_from_subimage(__pointer, left, top, width, height)
152
116
  GosuFFI.check_last_error
153
- Gosu::Image.new(__subimage)
117
+ Gosu::Image.new(__pointer)
154
118
  end
155
119
 
156
120
  def insert(image, x, y)
157
121
  image_ = nil
158
122
  if image.is_a?(Gosu::Image)
159
123
  image_ = image.__pointer
160
- elsif image.respond_to?(:to_str)
161
- image_ = Gosu::Image.new(image.to_str).__pointer
162
- elsif image.respond_to?(:to_blob) and
163
- image.respond_to?(:rows) and
124
+ elsif image.respond_to?(:to_blob) &&
125
+ image.respond_to?(:rows) &&
164
126
  image.respond_to?(:columns)
165
127
  image_ = Gosu::Image.new(image).__pointer
166
128
  else
data/lib/gosu/sample.rb CHANGED
@@ -3,7 +3,6 @@ module Gosu
3
3
  def initialize(filename)
4
4
  __sample = GosuFFI.check_last_error(GosuFFI.Gosu_Sample_create(filename))
5
5
  @memory_pointer = FFI::AutoPointer.new(__sample, GosuFFI.method(:Gosu_Sample_destroy))
6
- self
7
6
  end
8
7
 
9
8
  def __pointer
data/lib/gosu/song.rb CHANGED
@@ -14,7 +14,6 @@ module Gosu
14
14
  __song = GosuFFI.Gosu_Song_create(filename)
15
15
  GosuFFI.check_last_error
16
16
  @memory_pointer = FFI::AutoPointer.new(__song, GosuFFI.method(:Gosu_Song_destroy))
17
- self
18
17
  end
19
18
 
20
19
  def __pointer
@@ -8,8 +8,6 @@ module Gosu
8
8
  @__filter_proc = proc { |data, text| protected_filter(text) }
9
9
  GosuFFI.Gosu_TextInput_set_filter(__pointer, @__filter_proc, nil)
10
10
  GosuFFI.check_last_error
11
-
12
- self
13
11
  end
14
12
 
15
13
  def __pointer
@@ -64,20 +62,8 @@ module Gosu
64
62
 
65
63
  # Ensures that filter_result is set on C side before filter callback returns
66
64
  private def protected_filter(text)
67
- string = begin
68
- filter(text)
69
- rescue Exception => e
70
- # We cannot use Ruby exceptions (internally: longjmp) in C++ callbacks.
71
- # Reject the input and remember the exception. Window will re-raise it.
72
- @__exception = e
73
- ""
74
- end
65
+ string = filter(text)
75
66
  GosuFFI.Gosu_TextInput_set_filter_result(__pointer, string)
76
67
  end
77
-
78
- # Raises and forgets the last exception from #filter, if any.
79
- def __raise_filter_exception
80
- raise remove_instance_variable(:@__exception) if defined?(@__exception)
81
- end
82
68
  end
83
69
  end
data/lib/gosu/window.rb CHANGED
@@ -5,24 +5,15 @@ module Gosu
5
5
  define_method "protected_#{callback}" do |*args|
6
6
  begin
7
7
  # If there has been an exception, don't do anything as to not make matters worse.
8
- if defined?(@__exception)
9
- false
10
- else
11
- # Treat exceptions from TextInput#filter and Gosu.gl(z) like exceptions from the callbacks themselves.
12
- @text_input&.__raise_filter_exception
13
- GosuFFI.check_last_gl_error
14
-
15
- # Let the GC clean up deferred Gosu.gl(z) blocks before the next draw.
16
- $gosu_gl_blocks = nil if callback == "draw"
17
- result = send(callback, *args)
18
- # Conveniently turn the return value into a boolean result (for needs_cursor? etc).
19
- callback.end_with?("?") ? !!result : result
20
- end
8
+ # Conveniently turn the return value into a boolean result (for needs_cursor? etc).
9
+ defined?(@__exception) ? false : send(callback, *args)
21
10
  rescue Exception => e
22
11
  # Exit the message loop naturally, then re-throw during the next tick.
23
12
  @__exception = e
24
13
  close!
25
14
  false
15
+ ensure
16
+ $gosu_gl_blocks = nil if callback == "draw"
26
17
  end
27
18
  end
28
19
  end
@@ -61,8 +52,6 @@ module Gosu
61
52
  GosuFFI.send(:"Gosu_Window_set_#{callback_safename}", __pointer, instance_variable_get(:"@__#{callback_safename}_proc"), nil)
62
53
  GosuFFI.check_last_error
63
54
  end
64
-
65
- self
66
55
  end
67
56
 
68
57
  # Returns FFI pointer of C side Gosu::Window
@@ -98,7 +87,7 @@ module Gosu
98
87
  end
99
88
 
100
89
  def needs_cursor?
101
- true
90
+ false
102
91
  end
103
92
 
104
93
  def capture_cursor?
@@ -212,31 +201,21 @@ module Gosu
212
201
  end
213
202
 
214
203
  def show
215
- GosuFFI.check_last_error GosuFFI.Gosu_Window_show(__pointer)
204
+ GosuFFI.Gosu_Window_show(__pointer)
216
205
 
217
- raise_pending_exception
206
+ raise @__exception if defined?(@__exception)
207
+
208
+ GosuFFI.check_last_error
218
209
  end
219
210
 
220
211
  def tick
221
212
  value = GosuFFI.check_last_error(GosuFFI.Gosu_Window_tick(__pointer))
222
213
 
223
- raise_pending_exception
214
+ raise @__exception if defined?(@__exception)
224
215
 
225
216
  value
226
217
  end
227
218
 
228
- private def raise_pending_exception
229
- raise remove_instance_variable(:@__exception) if defined?(@__exception)
230
-
231
- # Blocks passed to Gosu.gl(z) are called after Window#draw, so they may have failed after the last callback.
232
- begin
233
- GosuFFI.check_last_gl_error
234
- rescue Exception
235
- close!
236
- raise
237
- end
238
- end
239
-
240
219
  def close!
241
220
  GosuFFI.Gosu_Window_close_immediately(__pointer)
242
221
  GosuFFI.check_last_error
data/lib64/SDL2.dll ADDED
Binary file
data/rdoc/gosu.rb CHANGED
@@ -1192,8 +1192,6 @@ module Gosu
1192
1192
  #
1193
1193
  # @note Because the returned object is not backed by a bitmap texture, there are restrictions on how it can be used. For example, you can not use any color other than {Gosu::Color#WHITE} when drawing the image.
1194
1194
  #
1195
- # @note {draw_line}, {clip_to} and {gl} cannot currently be used inside the block.
1196
- #
1197
1195
  # @note The width and height of the returned image will be the values you passed to {record}, regardless of the area you draw on.
1198
1196
  # It is important to pass accurate values if you plan on calling {Gosu::Image#draw_as_quad} or {Gosu::Image#draw_rot} on the result later.
1199
1197
  #