rubysdl 1.3.1 → 2.0

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 (88) hide show
  1. data/MANIFEST +22 -2
  2. data/NEWS.en +80 -0
  3. data/NEWS.ja +83 -0
  4. data/README.en +2 -1
  5. data/README.ja +2 -2
  6. data/doc-en/Makefile +18 -0
  7. data/doc-en/cdrom.rsd +417 -0
  8. data/doc-en/collision.rsd +174 -0
  9. data/doc-en/event.rsd +1476 -0
  10. data/doc-en/font.rsd +811 -0
  11. data/doc-en/general.rsd +43 -0
  12. data/doc-en/init.rsd +168 -0
  13. data/doc-en/joystick.rsd +401 -0
  14. data/doc-en/mixer.rsd +869 -0
  15. data/doc-en/mpeg.rsd +585 -0
  16. data/doc-en/opengl.rsd +155 -0
  17. data/doc-en/sdlskk.rsd +472 -0
  18. data/doc-en/time.rsd +46 -0
  19. data/doc-en/video.rsd +2806 -0
  20. data/doc-en/wm.rsd +112 -0
  21. data/doc/Makefile +1 -1
  22. data/doc/cdrom.rsd +3 -3
  23. data/doc/event.rsd +178 -179
  24. data/doc/general.rsd +10 -0
  25. data/doc/init.rsd +2 -2
  26. data/doc/joystick.rsd +29 -5
  27. data/doc/mixer.rsd +20 -0
  28. data/doc/rsd.rb +42 -9
  29. data/doc/sdlskk.rsd +7 -7
  30. data/doc/video.rsd +461 -168
  31. data/doc/wm.rsd +2 -2
  32. data/extconf.rb +1 -8
  33. data/lib/rubysdl_aliases.rb +52 -190
  34. data/lib/rubysdl_compatible_ver1.rb +243 -0
  35. data/lib/sdl.rb +58 -92
  36. data/rubysdl.h +59 -68
  37. data/rubysdl_cdrom.c +125 -102
  38. data/{rubysdl_doc.en.rd → rubysdl_doc_old.en.rd} +3 -2
  39. data/rubysdl_event.c +318 -255
  40. data/rubysdl_event_key.c +299 -287
  41. data/rubysdl_image.c +37 -13
  42. data/rubysdl_joystick.c +180 -67
  43. data/rubysdl_kanji.c +61 -75
  44. data/rubysdl_main.c +65 -138
  45. data/rubysdl_mixer.c +339 -214
  46. data/rubysdl_mouse.c +50 -43
  47. data/rubysdl_opengl.c +31 -28
  48. data/rubysdl_pixel.c +17 -28
  49. data/rubysdl_ref.en.html +5658 -0
  50. data/rubysdl_ref.en.rd +6337 -0
  51. data/rubysdl_ref.html +2253 -1964
  52. data/rubysdl_ref.rd +823 -469
  53. data/rubysdl_rwops.c +9 -6
  54. data/rubysdl_sdlskk.c +137 -165
  55. data/rubysdl_sge_video.c +355 -469
  56. data/rubysdl_smpeg.c +189 -190
  57. data/rubysdl_time.c +1 -1
  58. data/rubysdl_ttf.c +147 -215
  59. data/rubysdl_video.c +486 -405
  60. data/rubysdl_wm.c +30 -30
  61. data/sample/aadraw.rb +9 -9
  62. data/sample/alpha.rb +12 -13
  63. data/sample/alphadraw.rb +10 -10
  64. data/sample/bfont.rb +4 -4
  65. data/sample/cdrom.rb +11 -4
  66. data/sample/collision.rb +20 -20
  67. data/sample/cursor.rb +5 -5
  68. data/sample/ellipses.rb +20 -16
  69. data/sample/event2.rb +11 -9
  70. data/sample/font.rb +4 -4
  71. data/sample/fpstimer.rb +3 -3
  72. data/sample/icon.bmp.gz +0 -0
  73. data/sample/icon.png +0 -0
  74. data/sample/joy2.rb +14 -14
  75. data/sample/kanji.rb +7 -7
  76. data/sample/load_from_io.rb +44 -0
  77. data/sample/movesp.rb +13 -12
  78. data/sample/playmod.rb +2 -3
  79. data/sample/plaympeg.rb +8 -8
  80. data/sample/playwave.rb +5 -6
  81. data/sample/sdlskk.rb +11 -11
  82. data/sample/sgetest.rb +14 -12
  83. data/sample/stetris.rb +12 -13
  84. data/sample/testgl.rb +13 -14
  85. data/sample/testsprite.rb +12 -11
  86. data/sample/transformblit.rb +23 -22
  87. metadata +62 -35
  88. data/rubysdl_event2.c +0 -417
data/doc-en/mpeg.rsd ADDED
@@ -0,0 +1,585 @@
1
+ = MPEG playback
2
+ * ((<MPEG playback Outline>))
3
+ * ((<SDL::MPEG>))
4
+ * ((<SDL::MPEG::Info>))
5
+ * ((<MPEG playback methods>))
6
+ TOC
7
+
8
+ == MPEG playback Outline
9
+ Ruby/SDL enables you to play MPEG movie
10
+ with ((<SMPEG|URL:http://www.icculus.org/smpeg>)).
11
+
12
+ Before calling MPEG methods, @[init] should be called
13
+ with SDL::INIT_AUDIO|SDL::INIT_VIDEO and
14
+ @[Mixer.open] should be called.
15
+
16
+ MPEG playback system runs in sub thread(native thread).
17
+ Therefore you cannot read and write movie @[Surface]
18
+ while playing. In addition you cannot use @[Mixer]
19
+ routines while playing if @[audio is enabled|MPEG#enable_audio].
20
+ Ruby/SDL doesn't control such an invalid access.
21
+
22
+ == SDL::MPEG
23
+ This class represents MPEG stream and playing state.
24
+
25
+ METHODS(MPEG)
26
+
27
+ == SDL::MPEG::Info
28
+ This class represents @[MPEG] information.
29
+ You can get instance by @[MPEG#info].
30
+
31
+ METHODS(MPEG::Info)
32
+
33
+ == MPEG playback methods
34
+ %%%
35
+ NAME new
36
+ MOD MPEG
37
+ TYPE .
38
+ DEP SMPEG
39
+ PURPOSE Load MPEG file.
40
+ RVAL SDL::MPEG
41
+
42
+ PROTO
43
+ new(filename)
44
+ load(filename)
45
+
46
+ DESC
47
+ Loads a $[filename] and returns
48
+ new @[MPEG] object.
49
+
50
+ EXCEPTION *
51
+
52
+ SEEALSO
53
+ MPEG#info
54
+ MPEG#play
55
+
56
+ %%
57
+ NAME info
58
+ MOD MPEG
59
+ TYPE #
60
+ DEP SMPEG
61
+ PURPOSE Get information about MPEG object
62
+ RVAL SDL::MPEG::Info
63
+
64
+ PROTO
65
+ info
66
+
67
+ DESC
68
+ Gets information about $[self] as @[MPEG::Info] object.
69
+
70
+ SEEALSO
71
+ MPEG::Info
72
+
73
+ %%
74
+ NAME enable_audio
75
+ MOD MPEG
76
+ TYPE #
77
+ DEP SMPEG
78
+ PURPOSE Enable/Dislable audio
79
+
80
+ PROTO
81
+ enable_audio(enable)
82
+ enableAudio(enable)
83
+
84
+ DESC
85
+ Enables or disables audio.
86
+ If $[enable] is true, audio data is played, but if $[enable]
87
+ is false, audio data is not played.
88
+
89
+ NOTES
90
+ Audio enable/disable setting is reflected after
91
+ playing starts.
92
+
93
+ SEEALSO
94
+ MPEG#enable_video
95
+ MPEG#info
96
+
97
+ %%
98
+ NAME enable_video
99
+ MOD MPEG
100
+ TYPE #
101
+ DEP SMPEG
102
+ PURPOSE Enable/Disable video
103
+
104
+ PROTO
105
+ enable_video(enable)
106
+ enableVideo(enable)
107
+
108
+ DESC
109
+ Enables or disables audio.
110
+ If $[enable] is true, movie data is played, but if $[enable]
111
+ is false, movie data is not played.
112
+
113
+ SEEALSO
114
+ MPEG#enable_audio
115
+ MPEG#info
116
+
117
+ %%
118
+ NAME status
119
+ MOD MPEG
120
+ TYPE #
121
+ DEP SMPEG
122
+ PURPOSE Get current status
123
+ RVAL Integer
124
+
125
+ PROTO
126
+ status
127
+
128
+ DESC
129
+ Returns current status of $[self] as follows:
130
+ * SDL::MEPG::ERROR - system has some errors
131
+ * SDL::MPEG::STOPPED - movie is stopped
132
+ * SDL::MPEG::PLAYING - movie is playing
133
+
134
+ SEEALSO
135
+ MPEG#info
136
+
137
+ %%
138
+ NAME set_volume
139
+ MOD MPEG
140
+ TYPE #
141
+ DEP SMPEG
142
+ PURPOSE Change volume of MPEG stream
143
+
144
+ PROTO
145
+ set_volume(volume)
146
+ setVolume(volume)
147
+
148
+ DESC
149
+ Set volume MPEG stream from 0 to 100.
150
+
151
+ NOTES
152
+ You cannot get current volume.
153
+
154
+ SEEALSO
155
+ MPEG#enable_audio
156
+
157
+ %%
158
+ NAME set_display
159
+ MOD MPEG
160
+ TYPE #
161
+ DEP SMPEG
162
+ PURPOSE Set display surface
163
+
164
+ PROTO
165
+ set_display(surface)
166
+ setDisplay(surface)
167
+
168
+ DESC
169
+ Sets the @[surface|Surface] that the playing movie displays on.
170
+ Normally, the surface object returned by @[set_video_mode]
171
+ is used as $[surface].
172
+
173
+ NOTES
174
+ MPEG playback system call @[Screen#update_rect] from
175
+ a (native) sub thread.
176
+
177
+ SEEALSO
178
+ Surface
179
+ MPEG#play
180
+
181
+ %%
182
+ NAME set_loop
183
+ MOD MPEG
184
+ TYPE #
185
+ DEP SMPEG
186
+ PURPOSE Set/Clear looping play
187
+
188
+ PROTO
189
+ set_loop(repeat)
190
+ setLoop(repeat)
191
+
192
+ DESC
193
+ Set or clear looping play on $[self].
194
+
195
+ SEEALSO
196
+ MPEG#play
197
+
198
+ %%
199
+ NAME scale_xy
200
+ MOD MPEG
201
+ TYPE #
202
+ DEP SMPEG
203
+ PURPOSE Scale pixel display
204
+
205
+ PROTO
206
+ scale_xy(width, height)
207
+ scaleXY(width, height)
208
+
209
+ DESC
210
+ Set scale pixel display on $[self].
211
+ The Unit of $[width] and $[height] is pixel.
212
+
213
+ SEEALSO
214
+ MPEG#scale
215
+ MPEG#set_display_region
216
+
217
+ %%
218
+ NAME scale
219
+ MOD MPEG
220
+ TYPE #
221
+ DEP SMPEG
222
+ PURPOSE Scale pixel display
223
+
224
+ PROTO
225
+ scale(scale)
226
+
227
+ DESC
228
+ Set scale display on $[self].
229
+
230
+ SEEALSO
231
+ MPEG#scale_xy
232
+
233
+ %%
234
+ NAME move
235
+ MOD MPEG
236
+ TYPE #
237
+ DEP SMPEG
238
+ PURPOSE Move the video display area
239
+
240
+ PROTO
241
+ move(x, y)
242
+
243
+ DESC
244
+ Moves the video display to ($[x], $[y])
245
+ within the destination surface set by @[MPEG#set_display].
246
+
247
+ SEEALSO
248
+ MPEG#set_display
249
+ MPEG#set_display_region
250
+
251
+ %%
252
+ NAME set_display_region
253
+ MOD MPEG
254
+ TYPE #
255
+ DEP SMPEG
256
+ PURPOSE Set the video display region
257
+
258
+ PROTO
259
+ set_display_region(x, y, w, h)
260
+
261
+ DESC
262
+ Set the region of the video to be shown at
263
+ the rectangle of $[x], $[y], $[w], $[h]
264
+
265
+ SEEALSO
266
+ MPEG#move
267
+ MPEG#scale_xy
268
+
269
+ %%
270
+ NAME play
271
+ MOD MPEG
272
+ TYPE #
273
+ DEP SMPEG
274
+ PURPOSE Play an MPEG object
275
+
276
+ PROTO
277
+ play
278
+
279
+ DESC
280
+ Plays an MPEG object.
281
+
282
+
283
+ NOTES
284
+ You don't have to access surface set by @[MPEG#set_display].
285
+ x
286
+ SEEALSO
287
+ MPEG#pause
288
+ MPEG#stop
289
+ MPEG#rewind
290
+ MPEG#seek
291
+ MPEG#skip
292
+ MPEG#render_frame
293
+
294
+ %%
295
+ NAME stop
296
+ MOD MPEG
297
+ TYPE #
298
+ DEP SMPEG
299
+ PURPOSE Stop playback of an MPEG object
300
+
301
+ PROTO
302
+ stop
303
+
304
+ DESC
305
+ Stop play back of $[self].
306
+
307
+ SEEALSO
308
+ MPEG#play
309
+
310
+ %%
311
+ NAME pause
312
+ MOD MPEG
313
+ TYPE #
314
+ DEP SMPEG
315
+ PURPOSE Pause/Resume playback of an MPEG object
316
+
317
+ PROTO
318
+ pause
319
+
320
+ DESC
321
+ Pauses/Resumes playback of $[self].
322
+ Pauses playback if $[self] is playing, and
323
+ Resume playback if paused.
324
+
325
+ %%
326
+ NAME rewind
327
+ MOD MPEG
328
+ TYPE #
329
+ DEP SMPEG
330
+ PURPOSE Rewind the play position
331
+
332
+ PROTO
333
+ rewind
334
+
335
+ DESC
336
+ Rewinds the play position of $[self]
337
+ to the beginning of the MPEG.
338
+
339
+
340
+ %%
341
+ NAME seek
342
+ MOD MPEG
343
+ TYPE #
344
+ DEP SMPEG
345
+ PURPOSE Seek in the MPEG stream.
346
+
347
+ PROTO
348
+ seek(bytes)
349
+
350
+ DESC
351
+ Seeks $[bytes] ((*bytes*)) the play position of $[self].
352
+
353
+ SEEALSO
354
+ MPEG#play
355
+ MPEG#skip
356
+
357
+ %%
358
+ NAME skip
359
+ MOD MPEG
360
+ TYPE #
361
+ DEP SMPEG
362
+ PURPOSE Skip seconds in the MPEG stream
363
+
364
+ PROTO
365
+ skip(seconds)
366
+
367
+ DESC
368
+ Skips $[seconds] seconds in $[self] MPEG stream.
369
+ $[seconds] can be Float or Integer.
370
+
371
+ SEEALSO
372
+ MPEG#play
373
+ MPEG#seek
374
+
375
+ %%
376
+ NAME render_frame
377
+ MOD MPEG
378
+ TYPE #
379
+ DEP SMPEG
380
+ PURPOSE Render a particular frame in the MPEG video.
381
+
382
+ PROTO
383
+ render_frame(framenum)
384
+
385
+ DESC
386
+ Render the $[framenum]-th frame in the surface set by
387
+ @[MEPG#set_display].
388
+
389
+ SEEALSO
390
+ MPEG#render_final
391
+ MPEG#play
392
+
393
+ %%
394
+ NAME render_final
395
+ MOD MPEG
396
+ TYPE #
397
+ DEP SMPEG
398
+ PURPOSE Render the last frame of an MPEG video
399
+
400
+ PROTO
401
+ render_final(dst, x, y)
402
+
403
+ DESC
404
+ Render the last frame of $[self] video
405
+ at ($[x], $[y]) in the $[dst] @[surface|Surface].
406
+
407
+ %%
408
+ NAME set_filer
409
+ MOD MPEG
410
+ TYPE #
411
+ DEP SMPEG
412
+ PURPOSE Set video filter
413
+
414
+ PROTO
415
+ set_filer(filter)
416
+
417
+ DESC
418
+ Selects video filter from one of following:
419
+ * SDL::MPEG::NULL_FILTER no filter
420
+ * SDL::MPEG::BILIEAR_FILTER bilinear filter
421
+ * SDL::MPEG::DEBLOCKING_FILTER deblocking filter
422
+
423
+ %%
424
+ NAME has_audio
425
+ MOD MPEG::Info
426
+ TYPE #
427
+ DEP SMPEG
428
+ PURPOSE Get whether an MPEG stream has audio data
429
+ RVAL true/false
430
+
431
+ PROTO
432
+ has_audio
433
+
434
+ DESC
435
+ Returns true if $[self] MPEG stream has audio data,
436
+ otherwise returns false.
437
+
438
+ %%
439
+ NAME has_video
440
+ MOD MPEG::Info
441
+ TYPE #
442
+ DEP SMPEG
443
+ PURPOSE Get whether an MPEG stream has video data
444
+ RVAL true/false
445
+
446
+ PROTO
447
+ has_video
448
+
449
+ DESC
450
+ Returns true if $[self] MPEG stream has video data,
451
+ otherwise returns false.
452
+
453
+ %%
454
+ NAME width
455
+ MOD MPEG::Info
456
+ TYPE #
457
+ DEP SMPEG
458
+ PURPOSE Get width of video
459
+
460
+ PROTO
461
+ width
462
+
463
+ DESC
464
+ Returns the width of video as pixels.
465
+
466
+
467
+ %%
468
+ NAME height
469
+ MOD MPEG::Info
470
+ TYPE #
471
+ DEP SMPEG
472
+ PURPOSE Get height of video
473
+
474
+ PROTO
475
+ height
476
+
477
+ DESC
478
+ Returns the width of video as pixels.
479
+
480
+ %%
481
+ NAME current_frame
482
+ MOD MPEG::Info
483
+ TYPE #
484
+ DEP SMPEG
485
+ PURPOSE
486
+
487
+ PROTO
488
+ current_frame
489
+
490
+ DESC
491
+ not documented yet
492
+
493
+ %%
494
+ NAME current_fps
495
+ MOD MPEG::Info
496
+ TYPE #
497
+ DEP SMPEG
498
+ PURPOSE
499
+
500
+ PROTO
501
+ current_fps
502
+
503
+ DESC
504
+ not documented yet
505
+
506
+ %%
507
+ NAME audio_string
508
+ MOD MPEG::Info
509
+ TYPE #
510
+ DEP SMPEG
511
+ PURPOSE
512
+
513
+ PROTO
514
+ audio_string
515
+
516
+ DESC
517
+ not documented yet
518
+
519
+ %%
520
+ NAME audio_current_frame
521
+ MOD MPEG::Info
522
+ TYPE #
523
+ DEP SMPEG
524
+ PURPOSE
525
+
526
+ PROTO
527
+ audio_current_frame
528
+
529
+ DESC
530
+ not documented yet
531
+
532
+ %%
533
+ NAME current_offset
534
+ MOD MPEG::Info
535
+ TYPE #
536
+ DEP SMPEG
537
+ PURPOSE
538
+
539
+ PROTO
540
+ current_offset
541
+
542
+ DESC
543
+ not documented yet
544
+
545
+ %%
546
+ NAME total_size
547
+ MOD MPEG::Info
548
+ TYPE #
549
+ DEP SMPEG
550
+ PURPOSE
551
+
552
+ PROTO
553
+ total_size
554
+
555
+ DESC
556
+ not documented yet
557
+
558
+ %%
559
+ NAME current_time
560
+ MOD MPEG::Info
561
+ TYPE #
562
+ DEP SMPEG
563
+ PURPOSE
564
+
565
+ PROTO
566
+ current_time
567
+
568
+ DESC
569
+ not documented yet
570
+
571
+ %%
572
+ NAME total_time
573
+ MOD MPEG
574
+ TYPE #
575
+ DEP SMPEG
576
+ PURPOSE
577
+
578
+ PROTO
579
+ total_time
580
+
581
+ DESC
582
+ not documented yet
583
+
584
+
585
+