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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 24b39a73c4b06804c2ca9b805812bb17791800a00321df3d6b187a10e6e6f452
4
- data.tar.gz: fbee5279f4d246026a355804a87c4a5907d6f119f24d2a9762acc2ba92beaa5a
3
+ metadata.gz: 421bc40f954a8c16950811a9d5b34b5e3c3b00f620d0bb7f2afaa89e16799e76
4
+ data.tar.gz: 0a8e33f23973aaf478d6a260226e0e5bff6bbc12b99bbbbfb63ce16dd6664af4
5
5
  SHA512:
6
- metadata.gz: 2a0459c6671cd2d2cc5b5746082d15dd56bc03270d57317f950567e11a74b83da445666510a173fe8efb0bfb66f422fbf63e18910f20ecd7f68cc0a68123e472
7
- data.tar.gz: 9c7e4b39e0fb36e31a7b9ba7da1d010b49d4daeb6188ef4848ce3c397bc7e20f526d50354137dfc45758e3dc0d5796c87ffdb9f96814b7ba93a950a079ebe919
6
+ metadata.gz: 2022f5528d5b411f38bc255031c4bb9fbb5344e950e94f3d2e1d02d810af80c1ab640c24241c853e60fe4cde456928863ad1a725d37038568c9adf88fe683a1c
7
+ data.tar.gz: c3f57c68a34597455813d48417ece52d2c5bf4f9d5d5c5f920e907705ee1d54d0b53b2cee16c513d2e872456896fd5d7874aeab473b2a00ce834bc898bc08998
data/extconf.rb CHANGED
@@ -54,5 +54,5 @@ have_const("MIX_INIT_MODPLUG", "SDL_mixer.h")
54
54
  have_const("MIX_INIT_FLUIDSYNTH", "SDL_mixer.h")
55
55
  have_const("MIX_INIT_MID", "SDL_mixer.h")
56
56
 
57
- create_header
57
+
58
58
  create_makefile('sdl2_ext')
@@ -1,6 +1,6 @@
1
1
  module SDL2
2
2
  # Version string of Ruby/SDL2
3
- VERSION = "0.3.2"
3
+ VERSION = "0.3.3"
4
4
  # Version of Ruby/SDL2, [major, minor, patch level]
5
5
  VERSION_NUMBER = VERSION.split(".").map(&:to_i)
6
6
  end
data/mixer.c.m4 CHANGED
@@ -1,6 +1,5 @@
1
1
  /* -*- mode: C -*- */
2
2
  #ifdef HAVE_SDL_MIXER_H
3
- #include "extconf.h"
4
3
  #include "rubysdl2_internal.h"
5
4
  #include <SDL_mixer.h>
6
5
 
@@ -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::INIT_MOD|
6
- SDL2::Mixer::INIT_MP3|SDL2::Mixer::INIT_OGG)
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
 
@@ -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::INIT_MOD|
52
- SDL2::Mixer::INIT_MODPLUG|SDL2::Mixer::INIT_MP3|
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
 
@@ -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::INIT_MOD|
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])
@@ -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::AXIS_LEFTY)
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::BUTTON_Y)
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::AXIS_LEFTX)
46
- p controller.axis(SDL2::GameController::AXIS_LEFTY)
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::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)
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
@@ -26,7 +26,10 @@ loop do
26
26
  case ev
27
27
  when SDL2::Event::Quit
28
28
  exit
29
- when SDL2::Event::TextInput, SDL2::Event::TextEditing
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)})"
@@ -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(0, SDL2::Renderer::ACCELERATED)
5
+ renderer = window.create_renderer(-1, SDL2::Renderer::Flags::ACCELERATED)
6
6
  SDL2::TextInput.stop
7
7
 
8
8
  loop do
@@ -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::STYLE_BOLD
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::HINTING_MONO
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::HINTING_NORMAL
57
+ font.hinting = SDL2::TTF::Hinting::NORMAL
58
58
  font.kerning = false
59
59
  draw_three_types(renderer, font, 540, 50)
60
60
 
@@ -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 [Renderer flag masks](SDL2) OR'd together;
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 {#clip_rect=}
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.2
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-03-21 00:00:00.000000000 Z
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