ruby-sdl2 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/extconf.rb +1 -1
- data/lib/sdl2/version.rb +1 -1
- data/mixer.c.m4 +0 -1
- data/sample/chunk_destroy.rb +2 -2
- data/sample/music_player.rb +2 -3
- data/sample/playwave.rb +2 -2
- data/sample/test_controller.rb +8 -8
- data/sample/test_keyboard.rb +4 -1
- data/sample/test_mouse.rb +1 -1
- data/sample/test_ttf.rb +3 -3
- data/sample/testsprite.rb +1 -1
- data/video.c.m4 +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 421bc40f954a8c16950811a9d5b34b5e3c3b00f620d0bb7f2afaa89e16799e76
|
4
|
+
data.tar.gz: 0a8e33f23973aaf478d6a260226e0e5bff6bbc12b99bbbbfb63ce16dd6664af4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2022f5528d5b411f38bc255031c4bb9fbb5344e950e94f3d2e1d02d810af80c1ab640c24241c853e60fe4cde456928863ad1a725d37038568c9adf88fe683a1c
|
7
|
+
data.tar.gz: c3f57c68a34597455813d48417ece52d2c5bf4f9d5d5c5f920e907705ee1d54d0b53b2cee16c513d2e872456896fd5d7874aeab473b2a00ce834bc898bc08998
|
data/extconf.rb
CHANGED
data/lib/sdl2/version.rb
CHANGED
data/mixer.c.m4
CHANGED
data/sample/chunk_destroy.rb
CHANGED
@@ -2,8 +2,8 @@ require 'sdl2'
|
|
2
2
|
|
3
3
|
SDL2::init(SDL2::INIT_AUDIO)
|
4
4
|
|
5
|
-
SDL2::Mixer.init(SDL2::Mixer::INIT_FLAC|SDL2::Mixer::
|
6
|
-
|
5
|
+
SDL2::Mixer.init(SDL2::Mixer::INIT_FLAC|SDL2::Mixer::INIT_MP3|SDL2::Mixer::INIT_OGG)
|
6
|
+
|
7
7
|
|
8
8
|
SDL2::Mixer.open(22050, SDL2::Mixer::DEFAULT_FORMAT, 2, 512)
|
9
9
|
|
data/sample/music_player.rb
CHANGED
@@ -48,9 +48,8 @@ class MusicPlayer
|
|
48
48
|
file = argv.shift
|
49
49
|
|
50
50
|
SDL2.init(SDL2::INIT_EVERYTHING)
|
51
|
-
SDL2::Mixer.init(SDL2::Mixer::INIT_FLAC|SDL2::Mixer::
|
52
|
-
SDL2::Mixer::
|
53
|
-
SDL2::Mixer::INIT_OGG)
|
51
|
+
SDL2::Mixer.init(SDL2::Mixer::INIT_FLAC|SDL2::Mixer::INIT_MODPLUG|
|
52
|
+
SDL2::Mixer::INIT_MP3|SDL2::Mixer::INIT_OGG)
|
54
53
|
SDL2::Mixer.open(44100, SDL2::Mixer::DEFAULT_FORMAT, 2, 512)
|
55
54
|
SDL2::TTF.init
|
56
55
|
|
data/sample/playwave.rb
CHANGED
@@ -3,9 +3,9 @@ require 'sdl2'
|
|
3
3
|
|
4
4
|
SDL2::init(SDL2::INIT_AUDIO)
|
5
5
|
|
6
|
-
SDL2::Mixer.init(SDL2::Mixer::INIT_FLAC|SDL2::Mixer::
|
7
|
-
SDL2::Mixer::INIT_MP3|SDL2::Mixer::INIT_OGG)
|
6
|
+
SDL2::Mixer.init(SDL2::Mixer::INIT_FLAC|SDL2::Mixer::INIT_MP3|SDL2::Mixer::INIT_OGG)
|
8
7
|
SDL2::Mixer.open(22050, SDL2::Mixer::DEFAULT_FORMAT, 2, 512)
|
8
|
+
|
9
9
|
p SDL2::Mixer::Chunk.decoders
|
10
10
|
p SDL2::Mixer::Music.decoders
|
11
11
|
wave = SDL2::Mixer::Chunk.load(ARGV[0])
|
data/sample/test_controller.rb
CHANGED
@@ -3,10 +3,10 @@ require 'sdl2'
|
|
3
3
|
SDL2.init(SDL2::INIT_EVERYTHING)
|
4
4
|
|
5
5
|
|
6
|
-
p SDL2::GameController.axis_name_of(SDL2::GameController::
|
6
|
+
p SDL2::GameController.axis_name_of(SDL2::GameController::Axis::LEFTY)
|
7
7
|
p SDL2::GameController.axis_name_of(129) rescue p $!
|
8
8
|
p SDL2::GameController.axis_from_name("rightx")
|
9
|
-
p SDL2::GameController.button_name_of(SDL2::GameController::
|
9
|
+
p SDL2::GameController.button_name_of(SDL2::GameController::Button::Y)
|
10
10
|
p SDL2::GameController.button_from_name("x")
|
11
11
|
p SDL2::GameController.button_from_name("rightx") rescue p $!
|
12
12
|
|
@@ -42,14 +42,14 @@ loop do
|
|
42
42
|
exit if event.sym == SDL2::Key::ESCAPE
|
43
43
|
when SDL2::Event::ControllerAxisMotion
|
44
44
|
p event
|
45
|
-
p controller.axis(SDL2::GameController::
|
46
|
-
p controller.axis(SDL2::GameController::
|
45
|
+
p controller.axis(SDL2::GameController::Axis::LEFTX)
|
46
|
+
p controller.axis(SDL2::GameController::Axis::LEFTY)
|
47
47
|
when SDL2::Event::ControllerButton
|
48
48
|
p event
|
49
|
-
p controller.button_pressed?(SDL2::GameController::
|
50
|
-
p controller.button_pressed?(SDL2::GameController::
|
51
|
-
p controller.button_pressed?(SDL2::GameController::
|
52
|
-
p controller.button_pressed?(SDL2::GameController::
|
49
|
+
p controller.button_pressed?(SDL2::GameController::Button::A)
|
50
|
+
p controller.button_pressed?(SDL2::GameController::Button::B)
|
51
|
+
p controller.button_pressed?(SDL2::GameController::Button::X)
|
52
|
+
p controller.button_pressed?(SDL2::GameController::Button::Y)
|
53
53
|
when SDL2::Event::ControllerDevice
|
54
54
|
p event
|
55
55
|
end
|
data/sample/test_keyboard.rb
CHANGED
@@ -26,7 +26,10 @@ loop do
|
|
26
26
|
case ev
|
27
27
|
when SDL2::Event::Quit
|
28
28
|
exit
|
29
|
-
when SDL2::Event::TextInput
|
29
|
+
when SDL2::Event::TextInput
|
30
|
+
p ev
|
31
|
+
p ev.text
|
32
|
+
when SDL2::Event::TextEditing
|
30
33
|
p ev
|
31
34
|
when SDL2::Event::KeyDown
|
32
35
|
puts "scancode: #{ev.scancode}(#{SDL2::Key::Scan.name_of(ev.scancode)})"
|
data/sample/test_mouse.rb
CHANGED
@@ -2,7 +2,7 @@ require 'sdl2'
|
|
2
2
|
|
3
3
|
SDL2.init(SDL2::INIT_EVERYTHING)
|
4
4
|
window = SDL2::Window.create("testsprite",0, 0, 640, 480, 0)
|
5
|
-
renderer = window.create_renderer(
|
5
|
+
renderer = window.create_renderer(-1, SDL2::Renderer::Flags::ACCELERATED)
|
6
6
|
SDL2::TextInput.stop
|
7
7
|
|
8
8
|
loop do
|
data/sample/test_ttf.rb
CHANGED
@@ -46,15 +46,15 @@ font.outline = 1
|
|
46
46
|
draw_three_types(renderer, font, 150, 50)
|
47
47
|
|
48
48
|
font.outline = 0
|
49
|
-
font.style = SDL2::TTF::
|
49
|
+
font.style = SDL2::TTF::Style::BOLD
|
50
50
|
draw_three_types(renderer, font, 280, 50)
|
51
51
|
|
52
52
|
font.style = 0
|
53
|
-
font.hinting = SDL2::TTF::
|
53
|
+
font.hinting = SDL2::TTF::Hinting::MONO
|
54
54
|
draw_three_types(renderer, font, 410, 50)
|
55
55
|
|
56
56
|
font.style = 0
|
57
|
-
font.hinting = SDL2::TTF::
|
57
|
+
font.hinting = SDL2::TTF::Hinting::NORMAL
|
58
58
|
font.kerning = false
|
59
59
|
draw_three_types(renderer, font, 540, 50)
|
60
60
|
|
data/sample/testsprite.rb
CHANGED
@@ -218,7 +218,7 @@ class App
|
|
218
218
|
opts.on("--cycle-alpha"){ @cycle.cycle_alpha = true }
|
219
219
|
|
220
220
|
opts.on("--vsync", "Present is syncronized with the refresh rate") {
|
221
|
-
@renderer_flags |= SDL2::Renderer::PRESENTVSYNC
|
221
|
+
@renderer_flags |= SDL2::Renderer::Flags::PRESENTVSYNC
|
222
222
|
}
|
223
223
|
|
224
224
|
opts.on("--use-color-key (yes|no)", TrueClass){|bool| @use_color_key = bool }
|
data/video.c.m4
CHANGED
@@ -436,7 +436,7 @@ static VALUE Window_destroy(VALUE self)
|
|
436
436
|
*
|
437
437
|
* @param [Integer] index the index of the rendering driver to initialize,
|
438
438
|
* or -1 to initialize the first one supporting the requested flags
|
439
|
-
* @param [Integer] flags 0, or one or more
|
439
|
+
* @param [Integer] flags 0, or one or more {Flags} OR'd together
|
440
440
|
*
|
441
441
|
* @return [SDL2::Renderer] the created renderer (rendering context)
|
442
442
|
*/
|
@@ -1497,7 +1497,7 @@ static VALUE Renderer_set_draw_blend_mode(VALUE self, VALUE mode)
|
|
1497
1497
|
* Get the clip rectangle for the current target.
|
1498
1498
|
*
|
1499
1499
|
* @return [SDL2::Rect] the current clip rectangle
|
1500
|
-
* @see
|
1500
|
+
* @see #clip_rect=
|
1501
1501
|
*/
|
1502
1502
|
static VALUE Renderer_clip_rect(VALUE self)
|
1503
1503
|
{
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-sdl2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ippei Obayashi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-04-01 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |2
|
14
14
|
Ruby/SDL2 is an extension library to use SDL 2.x
|