ray 0.0.0.pre1 → 0.0.0.pre2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (110) hide show
  1. data/.gitignore +15 -0
  2. data/.gitmodules +3 -0
  3. data/Rakefile +148 -5
  4. data/VERSION +1 -1
  5. data/ext/event.c +535 -0
  6. data/ext/extconf.rb +7 -1
  7. data/ext/image.c +110 -18
  8. data/ext/joystick.c +145 -0
  9. data/ext/ray.c +288 -35
  10. data/ext/ray.h +54 -2
  11. data/lib/ray/config.rb +84 -0
  12. data/lib/ray/dsl.rb +19 -0
  13. data/lib/ray/dsl/converter.rb +65 -0
  14. data/lib/ray/dsl/event.rb +52 -0
  15. data/lib/ray/dsl/event_raiser.rb +21 -0
  16. data/lib/ray/dsl/event_runner.rb +39 -0
  17. data/lib/ray/dsl/event_translator.rb +38 -0
  18. data/lib/ray/dsl/handler.rb +71 -0
  19. data/lib/ray/dsl/listener.rb +30 -0
  20. data/lib/ray/dsl/matcher.rb +60 -0
  21. data/lib/ray/dsl/type.rb +58 -0
  22. data/lib/ray/game.rb +107 -0
  23. data/lib/ray/helper.rb +17 -0
  24. data/lib/ray/image.rb +11 -0
  25. data/lib/ray/ray.rb +8 -0
  26. data/lib/ray/scene.rb +102 -0
  27. data/psp/SDL_psp_main.c +84 -0
  28. data/psp/bigdecimal/README +60 -0
  29. data/psp/bigdecimal/bigdecimal.c +4697 -0
  30. data/psp/bigdecimal/bigdecimal.h +216 -0
  31. data/psp/bigdecimal/lib/bigdecimal/jacobian.rb +85 -0
  32. data/psp/bigdecimal/lib/bigdecimal/ludcmp.rb +84 -0
  33. data/psp/bigdecimal/lib/bigdecimal/math.rb +235 -0
  34. data/psp/bigdecimal/lib/bigdecimal/newton.rb +77 -0
  35. data/psp/bigdecimal/lib/bigdecimal/util.rb +65 -0
  36. data/psp/digest/bubblebabble/bubblebabble.c +142 -0
  37. data/psp/digest/defs.h +20 -0
  38. data/psp/digest/digest.c +643 -0
  39. data/psp/digest/digest.h +32 -0
  40. data/psp/digest/lib/digest.rb +50 -0
  41. data/psp/digest/lib/md5.rb +27 -0
  42. data/psp/digest/lib/sha1.rb +27 -0
  43. data/psp/digest/md5/md5.c +420 -0
  44. data/psp/digest/md5/md5.h +80 -0
  45. data/psp/digest/md5/md5init.c +40 -0
  46. data/psp/digest/rmd160/rmd160.c +457 -0
  47. data/psp/digest/rmd160/rmd160.h +56 -0
  48. data/psp/digest/rmd160/rmd160init.c +40 -0
  49. data/psp/digest/sha1/sha1.c +269 -0
  50. data/psp/digest/sha1/sha1.h +39 -0
  51. data/psp/digest/sha1/sha1init.c +40 -0
  52. data/psp/digest/sha2/lib/sha2.rb +73 -0
  53. data/psp/digest/sha2/sha2.c +919 -0
  54. data/psp/digest/sha2/sha2.h +109 -0
  55. data/psp/digest/sha2/sha2init.c +52 -0
  56. data/psp/enumerator/enumerator.c +298 -0
  57. data/psp/etc/etc.c +559 -0
  58. data/psp/ext.c +285 -0
  59. data/psp/fcntl/fcntl.c +187 -0
  60. data/psp/lib/rbconfig.rb +178 -0
  61. data/psp/nkf/lib/kconv.rb +367 -0
  62. data/psp/nkf/nkf-utf8/config.h +88 -0
  63. data/psp/nkf/nkf-utf8/nkf.c +6040 -0
  64. data/psp/nkf/nkf-utf8/utf8tbl.c +8500 -0
  65. data/psp/nkf/nkf-utf8/utf8tbl.h +34 -0
  66. data/psp/nkf/nkf.c +654 -0
  67. data/psp/socket/addrinfo.h +173 -0
  68. data/psp/socket/getaddrinfo.c +676 -0
  69. data/psp/socket/getnameinfo.c +270 -0
  70. data/psp/socket/pspsocket.c +71 -0
  71. data/psp/socket/pspsocket.h +28 -0
  72. data/psp/socket/socket.c +4662 -0
  73. data/psp/socket/sockport.h +76 -0
  74. data/psp/stringio/stringio.c +1306 -0
  75. data/psp/strscan/strscan.c +1320 -0
  76. data/psp/syck/bytecode.c +1166 -0
  77. data/psp/syck/emitter.c +1242 -0
  78. data/psp/syck/gram.c +1894 -0
  79. data/psp/syck/gram.h +79 -0
  80. data/psp/syck/handler.c +174 -0
  81. data/psp/syck/implicit.c +2990 -0
  82. data/psp/syck/node.c +408 -0
  83. data/psp/syck/rubyext.c +2367 -0
  84. data/psp/syck/syck.c +504 -0
  85. data/psp/syck/syck.h +456 -0
  86. data/psp/syck/token.c +2725 -0
  87. data/psp/syck/yaml2byte.c +257 -0
  88. data/psp/syck/yamlbyte.h +170 -0
  89. data/psp/thread/thread.c +1175 -0
  90. data/psp/zlib/zlib.c +3547 -0
  91. data/script.rb +10 -0
  92. data/spec/ray/config_spec.rb +90 -0
  93. data/spec/ray/conversion_spec.rb +43 -0
  94. data/spec/ray/event_spec.rb +191 -0
  95. data/spec/ray/image_spec.rb +43 -1
  96. data/spec/ray/joystick_spec.rb +17 -0
  97. data/spec/ray/matcher_spec.rb +73 -0
  98. data/spec/ray/ray_spec.rb +72 -1
  99. data/spec/ray/type_spec.rb +17 -0
  100. data/spec/res/aqua.bmp +0 -0
  101. data/spec/res/aqua.png +0 -0
  102. data/spec/res/not_a_jpeg.jpeg +0 -0
  103. data/spec_runner.rb +4 -0
  104. metadata +101 -9
  105. data/ext/Makefile +0 -189
  106. data/ext/ray +0 -0
  107. data/ext/ray.bundle +0 -0
  108. data/ext/ray_ext.bundle +0 -0
  109. data/ext/ray_ext.so +0 -0
  110. data/ext/test.rb +0 -21
data/.gitignore CHANGED
@@ -5,3 +5,18 @@ pkg/
5
5
  *.gems
6
6
  *.o
7
7
  *.gemspec
8
+ *.elf
9
+ *.tar.gz
10
+ *.tar.bz2
11
+ *.prx
12
+ *.PBP
13
+ *.log
14
+ ext/Makefile
15
+ *.so
16
+ *.SFO
17
+ *.bundle
18
+ Makefile
19
+ ext/ray
20
+ /ext/mkmf.log
21
+ ruby-1.8.*/
22
+ ruby_stdlib/
data/.gitmodules ADDED
@@ -0,0 +1,3 @@
1
+ [submodule "rspec"]
2
+ path = rspec
3
+ url = git://github.com/dchelimsky/rspec.git
data/Rakefile CHANGED
@@ -2,8 +2,22 @@
2
2
  begin
3
3
  require 'yard'
4
4
 
5
+ class MatcherHandler < YARD::Handlers::Ruby::Base
6
+ handles method_call(:describe_matcher)
7
+
8
+ def process
9
+ src = statement.parameters.children.first.source[1..-1]
10
+ MethodObject.new(Proxy.new(nil, "Ray::Matchers"), src) do |o|
11
+ o.source = statement.source
12
+ o.docstring = statement.comments
13
+ o.visibility = :private
14
+ end
15
+ end
16
+ end
17
+
5
18
  YARD::Rake::YardocTask.new do |t|
6
- t.files = ['lib/**/*.rb', 'ext/**/*.c']
19
+ t.files = ['lib/**/*.rb', 'ext/**/*.c', 'psp/*.c']
20
+ t.options |= ["--private"]
7
21
  end
8
22
  rescue LoadError
9
23
  $stderr.puts("YARD is not installed. Please install it " +
@@ -40,8 +54,137 @@ task :spec do
40
54
  load "spec_runner.rb"
41
55
  end
42
56
 
43
- desc "Build C extension"
44
- task :ext do
45
- cd "ext/"
46
- sh "ruby extconf.rb && make clean && make"
57
+ namespace :ext do
58
+ desc "Rebuilds the C extension"
59
+ task :rebuild do
60
+ cd "ext/"
61
+ sh "ruby extconf.rb && make clean && make"
62
+ end
63
+
64
+ desc "Builds the C extension"
65
+ task :build do
66
+ cd "ext/"
67
+ sh "ruby extconf.rb && make"
68
+ end
47
69
  end
70
+
71
+ desc "Builds the C extension"
72
+ task :ext => ["ext:build"]
73
+
74
+ begin
75
+ require 'rake/psp_task'
76
+
77
+ libs = %w(socket/socket.c socket/getnameinfo.c socket/getaddrinfo.c
78
+ socket/pspsocket.c
79
+ bigdecimal/bigdecimal.c
80
+ digest/sha2/sha2init.c digest/sha2/sha2.c
81
+ digest/rmd160/rmd160.c digest/rmd160/rmd160init.c
82
+ digest/bubblebabble/bubblebabble.c
83
+ digest/sha1/sha1.c digest/sha1/sha1init.c
84
+ digest/md5/md5.c digest/md5/md5init.c
85
+ digest/digest.c
86
+ enumerator/enumerator.c
87
+ fcntl/fcntl.c
88
+ stringio/stringio.c
89
+ strscan/strscan.c
90
+ thread/thread.c
91
+ zlib/zlib.c
92
+ nkf/nkf.c
93
+ etc/etc.c
94
+ syck/bytecode.c syck/gram.c syck/implicit.c syck/rubyext.c
95
+ syck/token.c syck/emitter.c syck/handler.c syck/node.c syck/syck.c
96
+ syck/yaml2byte.c).map { |i| "psp/#{i}" }
97
+
98
+ static_libs = ["-lSDL_image", "-lSDL", "-lGL", "-lpspvfpu",
99
+ "-lpspgu", "-lpspaudio", "-lpsprtc", "-lpsphprm", "-lpspwlan",
100
+ "-lruby", "-lpng", "-ljpeg", "-lz","-lm", "-lc"]
101
+
102
+ flags = ["-Wall", "-Wno-unused-parameter", "-D_PSP_ -DHAVE_STRUCT_TIMESPEC",
103
+ "-DHAVE_SDL_IMAGE", "-G0"]
104
+
105
+ begin
106
+ PSPTask.new do |t|
107
+ t.objdir = "./obj/"
108
+ t.srcs = Dir['ext/*.c', 'psp/*.c'] | libs
109
+ t.libs = static_libs | t.libs
110
+ t.cflags |= flags
111
+ t.incdir << "-I./ext" << "-I./psp"
112
+ t.target = "ray_release"
113
+
114
+ t.build_prx = true
115
+ t.build_eboot = true
116
+ end
117
+
118
+ PSPTask.new(:debug) do |t|
119
+ t.objdir = "./obj_dbg/"
120
+ t.srcs = Dir['ext/*.c', 'psp/*.c'] | libs
121
+ t.libs = static_libs | t.libs
122
+ t.cflags |= (flags | ["-O0", "-g"])
123
+ t.incdir << "-I./ext" << "-I./psp"
124
+ t.target = "ray"
125
+
126
+ t.build_prx = true
127
+ end
128
+ rescue
129
+ $stderr.puts "could not create PSP tasks"
130
+ end
131
+ rescue LoadError
132
+ $stderr.puts("psp_task is not installed. Please install it " +
133
+ "with the following command: gem intall psp_task")
134
+ end
135
+
136
+ require 'net/ftp'
137
+
138
+ file "ruby-1.8.7-p248.tar.bz2" do
139
+ ftp = Net::FTP.new
140
+ ftp.connect("ftp.ruby-lang.org", 21)
141
+ ftp.login("anonymous", "")
142
+ puts "Downloading ruby-1.8.7-p248.tar.bz2..."
143
+ ftp.getbinaryfile("pub/ruby/1.8/ruby-1.8.7-p248.tar.bz2",
144
+ "ruby-1.8.7-p248.tar.bz2")
145
+ ftp.close
146
+ end
147
+
148
+ directory "ruby_stdlib"
149
+ file "ruby_stdlib" => ["ruby-1.8.7-p248.tar.bz2"] do
150
+ sh "tar xvf ruby-1.8.7-p248.tar.bz2"
151
+ cp_r "ruby-1.8.7-p248/lib", "ruby_stdlib"
152
+
153
+ cp_r "psp/bigdecimal/lib/bigdecimal", "ruby_stdlib/lib"
154
+
155
+ mkdir_p "ruby_stdlib/lib/digest" unless File.exist? "ruby_stdlib/lib/digest"
156
+ cp "psp/digest/lib/digest.rb", "ruby_stdlib/lib"
157
+ cp "psp/digest/lib/sha1.rb", "ruby_stdlib/lib/digest"
158
+ cp "psp/digest/lib/md5.rb", "ruby_stdlib/lib/digest"
159
+
160
+ cp "psp/nkf/lib/kconv.rb", "ruby_stdlib/lib"
161
+ end
162
+
163
+ ruby_libs = ["socket.rb", "bigdecimal.rb", "digest/bubblebabble.rb",
164
+ "fcntl.rb", "stringio.rb", "strscan.rb", "thread.rb",
165
+ "zlib.rb", "nkf.rb", "etc.rb", "syck.rb", "enumerator.rb"]
166
+
167
+ ruby_libs.each do |filename|
168
+ ext_name = case filename
169
+ when /(\w+)\.rb/
170
+ $1
171
+ when /\w+\/(\w+)\.rb/
172
+ $1
173
+ else
174
+ filename
175
+ end
176
+
177
+ dir = File.dirname("ruby_stdlib/lib/#{filename}")
178
+
179
+ directory dir
180
+ file "ruby_stdlib/lib/#{filename}" => ["ruby_stdlib", dir] do
181
+ open("ruby_stdlib/lib/#{filename}", 'w') do |file|
182
+ file.puts "Ray.init_internal(\"#{ext_name}\")"
183
+ end
184
+ end
185
+ end
186
+
187
+ ruby_libs.map! { |i| "ruby_stdlib/lib/#{i}" }
188
+
189
+ desc "Builds dependencies for running the specs on a PSP"
190
+ task :psp_spec => (['debug:prx'] | ruby_libs)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.0.pre1
1
+ 0.0.0.pre2
data/ext/event.c ADDED
@@ -0,0 +1,535 @@
1
+ #include "ray.h"
2
+
3
+ VALUE ray_cEvent = Qnil;
4
+
5
+ SDL_Event *ray_rb2event(VALUE obj) {
6
+ if (!RAY_IS_A(obj, ray_cEvent)) {
7
+ rb_raise(rb_eTypeError, "Can't convert %s into Ray::Event",
8
+ RAY_OBJ_CLASSNAME(obj));
9
+ }
10
+
11
+ SDL_Event *ptr;
12
+ Data_Get_Struct(obj, SDL_Event, ptr);
13
+
14
+ return ptr;
15
+ }
16
+
17
+ void ray_free_event(SDL_Event *ptr) {
18
+ free(ptr);
19
+ }
20
+
21
+ VALUE ray_alloc_event(VALUE self) {
22
+ SDL_Event *ptr = malloc(sizeof(SDL_Event));
23
+ VALUE ret = Data_Wrap_Struct(self, 0L, ray_free_event, ptr);
24
+
25
+ return ret;
26
+ }
27
+
28
+ /*
29
+ Creates the event according to what's happening now.
30
+ */
31
+ VALUE ray_init_event(VALUE self) {
32
+ SDL_Event *event = ray_rb2event(self);
33
+ SDL_PollEvent(event);
34
+
35
+ return Qnil;
36
+ }
37
+
38
+ /*
39
+ Waits for an event and returns it.
40
+ @return [Ray::Event] The event that has just happened.
41
+ */
42
+ VALUE ray_wait_event(VALUE self) {
43
+ SDL_Event *event = malloc(sizeof(SDL_Event));
44
+ SDL_WaitEvent(event);
45
+
46
+ return Data_Wrap_Struct(self, 0, ray_free_event, event);
47
+ }
48
+
49
+ /*
50
+ Updates the object according to what's happening now.
51
+ */
52
+ VALUE ray_event_poll(VALUE self) {
53
+ SDL_PollEvent(ray_rb2event(self));
54
+ return self;
55
+ }
56
+
57
+ /*
58
+ Waits for an event and updates this object.
59
+ */
60
+ VALUE ray_event_wait(VALUE self) {
61
+ SDL_WaitEvent(ray_rb2event(self));
62
+ return self;
63
+ }
64
+
65
+ /*
66
+ Returns the type of the event. See the TYPE_* constants.
67
+ */
68
+ VALUE ray_event_type(VALUE self) {
69
+ return INT2FIX(ray_rb2event(self)->type);
70
+ }
71
+
72
+ /*
73
+ @return [true, false, nil] true if the key is pressed.
74
+ */
75
+ VALUE ray_event_key_pressed(VALUE self) {
76
+ SDL_Event *ev = ray_rb2event(self);
77
+ if (ev->type != SDL_KEYUP && ev->type != SDL_KEYDOWN)
78
+ return Qnil;
79
+
80
+ return ev->key.state == SDL_PRESSED ? Qtrue : Qfalse;
81
+ }
82
+
83
+ /*
84
+ @return [Integer, nil] An integer representing the key, if any.
85
+ */
86
+ VALUE ray_event_key(VALUE self) {
87
+ SDL_Event *ev = ray_rb2event(self);
88
+ if (ev->type != SDL_KEYUP && ev->type != SDL_KEYDOWN)
89
+ return Qnil;
90
+
91
+ return INT2FIX(ev->key.keysym.sym);
92
+ }
93
+
94
+ /*
95
+ @return [Integer, nil] OR'd combination of the mod keys
96
+ (control, alt, shift, ...) pressed
97
+ at the same time.
98
+ */
99
+ VALUE ray_event_mod_keys(VALUE self) {
100
+ SDL_Event *ev = ray_rb2event(self);
101
+ if (ev->type != SDL_KEYUP && ev->type != SDL_KEYDOWN)
102
+ return Qnil;
103
+
104
+ return INT2FIX(ev->key.keysym.mod);
105
+ }
106
+
107
+ /*
108
+ @return [Integer, nil] A mask of the focus states, for active event.
109
+ */
110
+ VALUE ray_event_focus_state(VALUE self) {
111
+ SDL_Event *ev = ray_rb2event(self);
112
+ if (ev->type != SDL_ACTIVEEVENT)
113
+ return Qnil;
114
+ return INT2FIX(ev->active.state);
115
+ }
116
+
117
+ /*
118
+ @return [true, false, nil] True if this event means we gained
119
+ a state.
120
+ */
121
+ VALUE ray_event_is_gain(VALUE self) {
122
+ SDL_Event *ev = ray_rb2event(self);
123
+ if (ev->type != SDL_ACTIVEEVENT)
124
+ return Qnil;
125
+
126
+ return ev->active.gain ? Qtrue : Qfalse;
127
+ }
128
+
129
+ /*
130
+ @return [Integer, nil] The position of the mouse
131
+ */
132
+ VALUE ray_event_mouse_x(VALUE self) {
133
+ SDL_Event *ev = ray_rb2event(self);
134
+ if (ev->type == SDL_MOUSEBUTTONUP || ev->type == SDL_MOUSEBUTTONDOWN)
135
+ return INT2FIX(ev->button.x);
136
+ else if (ev->type == SDL_MOUSEMOTION)
137
+ return INT2FIX(ev->motion.x);
138
+
139
+ return Qnil;
140
+ }
141
+ /*
142
+ @return [Integer, nil] The position of the mouse
143
+ */
144
+ VALUE ray_event_mouse_y(VALUE self) {
145
+ SDL_Event *ev = ray_rb2event(self);
146
+ if (ev->type == SDL_MOUSEBUTTONUP || ev->type == SDL_MOUSEBUTTONDOWN)
147
+ return INT2FIX(ev->button.y);
148
+ else if (ev->type == SDL_MOUSEMOTION)
149
+ return INT2FIX(ev->motion.y);
150
+
151
+ return Qnil;
152
+ }
153
+
154
+ /*
155
+ @return [Integer, nil] the button that has been pressed
156
+ */
157
+ VALUE ray_event_mouse_button(VALUE self) {
158
+ SDL_Event *ev = ray_rb2event(self);
159
+ if (ev->type != SDL_MOUSEBUTTONUP && ev->type != SDL_MOUSEBUTTONDOWN)
160
+ return Qnil;
161
+
162
+ return INT2FIX(ev->button.button);
163
+ }
164
+
165
+ /* @return [Integer, nil] The joystick device index */
166
+ VALUE ray_event_joystick_id(VALUE self) {
167
+ SDL_Event *ev = ray_rb2event(self);
168
+ if (ev->type == SDL_JOYAXISMOTION)
169
+ return INT2FIX(ev->jaxis.which);
170
+ else if (ev->type == SDL_JOYBUTTONDOWN || ev->type == SDL_JOYBUTTONUP)
171
+ return INT2FIX(ev->jbutton.which);
172
+
173
+ return Qnil;
174
+ }
175
+
176
+ /* @return [Integer, nil] The joystick axis index */
177
+ VALUE ray_event_axis_id(VALUE self) {
178
+ SDL_Event *ev = ray_rb2event(self);
179
+ if (ev->type == SDL_JOYAXISMOTION)
180
+ return INT2FIX(ev->jaxis.axis);
181
+
182
+ return Qnil;
183
+ }
184
+
185
+ /* @return [Integer, nil] The axis value, from -32768 upto 32767 */
186
+ VALUE ray_event_axis_value(VALUE self) {
187
+ SDL_Event *ev = ray_rb2event(self);
188
+ if (ev->type == SDL_JOYAXISMOTION)
189
+ return INT2FIX(ev->jaxis.value);
190
+
191
+ return Qnil;
192
+ }
193
+
194
+ /* @return [Integer, nil] The button which was pressed or released */
195
+ VALUE ray_event_joystick_button(VALUE self) {
196
+ SDL_Event *ev = ray_rb2event(self);
197
+ if (ev->type == SDL_JOYBUTTONDOWN || ev->type == SDL_JOYBUTTONUP)
198
+ return INT2FIX(ev->jbutton.button);
199
+
200
+ return Qnil;
201
+ }
202
+
203
+ void Init_ray_event() {
204
+ ray_cEvent = rb_define_class_under(ray_mRay, "Event", rb_cObject);
205
+ rb_define_alloc_func(ray_cEvent, ray_alloc_event);
206
+ rb_define_method(ray_cEvent, "initialize", ray_init_event, 0);
207
+
208
+ rb_define_module_function(ray_cEvent, "wait", ray_wait_event, 0);
209
+
210
+ rb_define_method(ray_cEvent, "poll!", ray_event_poll, 0);
211
+ rb_define_method(ray_cEvent, "wait!", ray_event_wait, 0);
212
+
213
+ rb_define_method(ray_cEvent, "type", ray_event_type, 0);
214
+
215
+ rb_define_method(ray_cEvent, "key_pressed?", ray_event_key_pressed, 0);
216
+ rb_define_method(ray_cEvent, "key", ray_event_key, 0);
217
+ rb_define_method(ray_cEvent, "mod_keys", ray_event_mod_keys, 0);
218
+
219
+ rb_define_method(ray_cEvent, "focus_state", ray_event_focus_state, 0);
220
+ rb_define_method(ray_cEvent, "is_gain?", ray_event_is_gain, 0);
221
+
222
+ rb_define_method(ray_cEvent, "mouse_x", ray_event_mouse_x, 0);
223
+ rb_define_method(ray_cEvent, "mouse_y", ray_event_mouse_y, 0);
224
+ rb_define_method(ray_cEvent, "mouse_button", ray_event_mouse_button, 0);
225
+
226
+ rb_define_method(ray_cEvent, "joystick_id", ray_event_joystick_id, 0);
227
+ rb_define_method(ray_cEvent, "axis_id", ray_event_axis_id, 0);
228
+ rb_define_method(ray_cEvent, "axis_value", ray_event_axis_value, 0);
229
+ rb_define_method(ray_cEvent, "joystick_button", ray_event_joystick_button, 0);
230
+
231
+ rb_define_const(ray_cEvent, "TYPE_NOEVENT", INT2FIX(SDL_NOEVENT));
232
+ rb_define_const(ray_cEvent, "TYPE_ACTIVEEVENT", INT2FIX(SDL_ACTIVEEVENT));
233
+ rb_define_const(ray_cEvent, "TYPE_KEYDOWN", INT2FIX(SDL_KEYDOWN));
234
+ rb_define_const(ray_cEvent, "TYPE_KEYUP", INT2FIX(SDL_KEYUP));
235
+ rb_define_const(ray_cEvent, "TYPE_MOUSEMOTION", INT2FIX(SDL_MOUSEMOTION));
236
+ rb_define_const(ray_cEvent, "TYPE_MOUSEBUTTONDOWN",
237
+ INT2FIX(SDL_MOUSEBUTTONDOWN));
238
+ rb_define_const(ray_cEvent, "TYPE_MOUSEBUTTONUP",
239
+ INT2FIX(SDL_MOUSEBUTTONUP));
240
+ rb_define_const(ray_cEvent, "TYPE_JOYAXISMOTION",
241
+ INT2FIX(SDL_JOYAXISMOTION));
242
+ rb_define_const(ray_cEvent, "TYPE_JOYBALLMOTION",
243
+ INT2FIX(SDL_JOYBALLMOTION));
244
+ rb_define_const(ray_cEvent, "TYPE_JOYHATMOTION",
245
+ INT2FIX(SDL_JOYHATMOTION));
246
+ rb_define_const(ray_cEvent, "TYPE_JOYBUTTONDOWN",
247
+ INT2FIX(SDL_JOYBUTTONDOWN));
248
+ rb_define_const(ray_cEvent, "TYPE_JOYBUTTONUP", INT2FIX(SDL_JOYBUTTONUP));
249
+ rb_define_const(ray_cEvent, "TYPE_QUIT", INT2FIX(SDL_QUIT));
250
+ rb_define_const(ray_cEvent, "TYPE_SYSWMEVENT", INT2FIX(SDL_SYSWMEVENT));
251
+ rb_define_const(ray_cEvent, "TYPE_VIDEORESIZE", INT2FIX(SDL_VIDEORESIZE));
252
+ rb_define_const(ray_cEvent, "TYPE_VIDEOEXPOSE", INT2FIX(SDL_VIDEOEXPOSE));
253
+
254
+ rb_define_const(ray_cEvent, "KEY_UNKNOWN", INT2FIX(SDLK_UNKNOWN));
255
+ rb_define_const(ray_cEvent, "KEY_FIRST", INT2FIX(SDLK_FIRST));
256
+ rb_define_const(ray_cEvent, "KEY_BACKSPACE", INT2FIX(SDLK_BACKSPACE));
257
+ rb_define_const(ray_cEvent, "KEY_TAB", INT2FIX(SDLK_TAB));
258
+ rb_define_const(ray_cEvent, "KEY_CLEAR", INT2FIX(SDLK_CLEAR));
259
+ rb_define_const(ray_cEvent, "KEY_RETURN", INT2FIX(SDLK_RETURN));
260
+ rb_define_const(ray_cEvent, "KEY_PAUSE", INT2FIX(SDLK_PAUSE));
261
+ rb_define_const(ray_cEvent, "KEY_ESCAPE", INT2FIX(SDLK_ESCAPE));
262
+ rb_define_const(ray_cEvent, "KEY_SPACE", INT2FIX(SDLK_SPACE));
263
+ rb_define_const(ray_cEvent, "KEY_EXCLAIM", INT2FIX(SDLK_EXCLAIM));
264
+ rb_define_const(ray_cEvent, "KEY_QUOTEDBL", INT2FIX(SDLK_QUOTEDBL));
265
+ rb_define_const(ray_cEvent, "KEY_HASH", INT2FIX(SDLK_HASH));
266
+ rb_define_const(ray_cEvent, "KEY_DOLLAR", INT2FIX(SDLK_DOLLAR));
267
+ rb_define_const(ray_cEvent, "KEY_AMPERSAND", INT2FIX(SDLK_AMPERSAND));
268
+ rb_define_const(ray_cEvent, "KEY_QUOTE", INT2FIX(SDLK_QUOTE));
269
+ rb_define_const(ray_cEvent, "KEY_LEFTPAREN", INT2FIX(SDLK_LEFTPAREN));
270
+ rb_define_const(ray_cEvent, "KEY_RIGHTPAREN", INT2FIX(SDLK_RIGHTPAREN));
271
+ rb_define_const(ray_cEvent, "KEY_ASTERISK", INT2FIX(SDLK_ASTERISK));
272
+ rb_define_const(ray_cEvent, "KEY_PLUS", INT2FIX(SDLK_PLUS));
273
+ rb_define_const(ray_cEvent, "KEY_COMMA", INT2FIX(SDLK_COMMA));
274
+ rb_define_const(ray_cEvent, "KEY_MINUS", INT2FIX(SDLK_MINUS));
275
+ rb_define_const(ray_cEvent, "KEY_PERIOD", INT2FIX(SDLK_PERIOD));
276
+ rb_define_const(ray_cEvent, "KEY_SLASH", INT2FIX(SDLK_SLASH));
277
+ rb_define_const(ray_cEvent, "KEY_0", INT2FIX(SDLK_0));
278
+ rb_define_const(ray_cEvent, "KEY_1", INT2FIX(SDLK_1));
279
+ rb_define_const(ray_cEvent, "KEY_2", INT2FIX(SDLK_2));
280
+ rb_define_const(ray_cEvent, "KEY_3", INT2FIX(SDLK_3));
281
+ rb_define_const(ray_cEvent, "KEY_4", INT2FIX(SDLK_4));
282
+ rb_define_const(ray_cEvent, "KEY_5", INT2FIX(SDLK_5));
283
+ rb_define_const(ray_cEvent, "KEY_6", INT2FIX(SDLK_6));
284
+ rb_define_const(ray_cEvent, "KEY_7", INT2FIX(SDLK_7));
285
+ rb_define_const(ray_cEvent, "KEY_8", INT2FIX(SDLK_8));
286
+ rb_define_const(ray_cEvent, "KEY_9", INT2FIX(SDLK_9));
287
+ rb_define_const(ray_cEvent, "KEY_COLON", INT2FIX(SDLK_COLON));
288
+ rb_define_const(ray_cEvent, "KEY_SEMICOLON", INT2FIX(SDLK_SEMICOLON));
289
+ rb_define_const(ray_cEvent, "KEY_LESS", INT2FIX(SDLK_LESS));
290
+ rb_define_const(ray_cEvent, "KEY_EQUALS", INT2FIX(SDLK_EQUALS));
291
+ rb_define_const(ray_cEvent, "KEY_GREATER", INT2FIX(SDLK_GREATER));
292
+ rb_define_const(ray_cEvent, "KEY_QUESTION", INT2FIX(SDLK_QUESTION));
293
+ rb_define_const(ray_cEvent, "KEY_AT", INT2FIX(SDLK_AT));
294
+ rb_define_const(ray_cEvent, "KEY_LEFTBRACKET", INT2FIX(SDLK_LEFTBRACKET));
295
+ rb_define_const(ray_cEvent, "KEY_BACKSLASH", INT2FIX(SDLK_BACKSLASH));
296
+ rb_define_const(ray_cEvent, "KEY_RIGHTBRACKET", INT2FIX(SDLK_RIGHTBRACKET));
297
+ rb_define_const(ray_cEvent, "KEY_CARET", INT2FIX(SDLK_CARET));
298
+ rb_define_const(ray_cEvent, "KEY_UNDERSCORE", INT2FIX(SDLK_UNDERSCORE));
299
+ rb_define_const(ray_cEvent, "KEY_BACKQUOTE", INT2FIX(SDLK_BACKQUOTE));
300
+ rb_define_const(ray_cEvent, "KEY_a", INT2FIX(SDLK_a));
301
+ rb_define_const(ray_cEvent, "KEY_b", INT2FIX(SDLK_b));
302
+ rb_define_const(ray_cEvent, "KEY_c", INT2FIX(SDLK_c));
303
+ rb_define_const(ray_cEvent, "KEY_d", INT2FIX(SDLK_d));
304
+ rb_define_const(ray_cEvent, "KEY_e", INT2FIX(SDLK_e));
305
+ rb_define_const(ray_cEvent, "KEY_f", INT2FIX(SDLK_f));
306
+ rb_define_const(ray_cEvent, "KEY_g", INT2FIX(SDLK_g));
307
+ rb_define_const(ray_cEvent, "KEY_h", INT2FIX(SDLK_h));
308
+ rb_define_const(ray_cEvent, "KEY_i", INT2FIX(SDLK_i));
309
+ rb_define_const(ray_cEvent, "KEY_j", INT2FIX(SDLK_j));
310
+ rb_define_const(ray_cEvent, "KEY_k", INT2FIX(SDLK_k));
311
+ rb_define_const(ray_cEvent, "KEY_l", INT2FIX(SDLK_l));
312
+ rb_define_const(ray_cEvent, "KEY_m", INT2FIX(SDLK_m));
313
+ rb_define_const(ray_cEvent, "KEY_n", INT2FIX(SDLK_n));
314
+ rb_define_const(ray_cEvent, "KEY_o", INT2FIX(SDLK_o));
315
+ rb_define_const(ray_cEvent, "KEY_p", INT2FIX(SDLK_p));
316
+ rb_define_const(ray_cEvent, "KEY_q", INT2FIX(SDLK_q));
317
+ rb_define_const(ray_cEvent, "KEY_r", INT2FIX(SDLK_r));
318
+ rb_define_const(ray_cEvent, "KEY_s", INT2FIX(SDLK_s));
319
+ rb_define_const(ray_cEvent, "KEY_t", INT2FIX(SDLK_t));
320
+ rb_define_const(ray_cEvent, "KEY_u", INT2FIX(SDLK_u));
321
+ rb_define_const(ray_cEvent, "KEY_v", INT2FIX(SDLK_v));
322
+ rb_define_const(ray_cEvent, "KEY_w", INT2FIX(SDLK_w));
323
+ rb_define_const(ray_cEvent, "KEY_x", INT2FIX(SDLK_x));
324
+ rb_define_const(ray_cEvent, "KEY_y", INT2FIX(SDLK_y));
325
+ rb_define_const(ray_cEvent, "KEY_z", INT2FIX(SDLK_z));
326
+ rb_define_const(ray_cEvent, "KEY_DELETE", INT2FIX(SDLK_DELETE));
327
+ rb_define_const(ray_cEvent, "KEY_WORLD_0", INT2FIX(SDLK_WORLD_0));
328
+ rb_define_const(ray_cEvent, "KEY_WORLD_1", INT2FIX(SDLK_WORLD_1));
329
+ rb_define_const(ray_cEvent, "KEY_WORLD_2", INT2FIX(SDLK_WORLD_2));
330
+ rb_define_const(ray_cEvent, "KEY_WORLD_3", INT2FIX(SDLK_WORLD_3));
331
+ rb_define_const(ray_cEvent, "KEY_WORLD_4", INT2FIX(SDLK_WORLD_4));
332
+ rb_define_const(ray_cEvent, "KEY_WORLD_5", INT2FIX(SDLK_WORLD_5));
333
+ rb_define_const(ray_cEvent, "KEY_WORLD_6", INT2FIX(SDLK_WORLD_6));
334
+ rb_define_const(ray_cEvent, "KEY_WORLD_7", INT2FIX(SDLK_WORLD_7));
335
+ rb_define_const(ray_cEvent, "KEY_WORLD_8", INT2FIX(SDLK_WORLD_8));
336
+ rb_define_const(ray_cEvent, "KEY_WORLD_9", INT2FIX(SDLK_WORLD_9));
337
+ rb_define_const(ray_cEvent, "KEY_WORLD_10", INT2FIX(SDLK_WORLD_10));
338
+ rb_define_const(ray_cEvent, "KEY_WORLD_11", INT2FIX(SDLK_WORLD_11));
339
+ rb_define_const(ray_cEvent, "KEY_WORLD_12", INT2FIX(SDLK_WORLD_12));
340
+ rb_define_const(ray_cEvent, "KEY_WORLD_13", INT2FIX(SDLK_WORLD_13));
341
+ rb_define_const(ray_cEvent, "KEY_WORLD_14", INT2FIX(SDLK_WORLD_14));
342
+ rb_define_const(ray_cEvent, "KEY_WORLD_15", INT2FIX(SDLK_WORLD_15));
343
+ rb_define_const(ray_cEvent, "KEY_WORLD_16", INT2FIX(SDLK_WORLD_16));
344
+ rb_define_const(ray_cEvent, "KEY_WORLD_17", INT2FIX(SDLK_WORLD_17));
345
+ rb_define_const(ray_cEvent, "KEY_WORLD_18", INT2FIX(SDLK_WORLD_18));
346
+ rb_define_const(ray_cEvent, "KEY_WORLD_19", INT2FIX(SDLK_WORLD_19));
347
+ rb_define_const(ray_cEvent, "KEY_WORLD_20", INT2FIX(SDLK_WORLD_20));
348
+ rb_define_const(ray_cEvent, "KEY_WORLD_21", INT2FIX(SDLK_WORLD_21));
349
+ rb_define_const(ray_cEvent, "KEY_WORLD_22", INT2FIX(SDLK_WORLD_22));
350
+ rb_define_const(ray_cEvent, "KEY_WORLD_23", INT2FIX(SDLK_WORLD_23));
351
+ rb_define_const(ray_cEvent, "KEY_WORLD_24", INT2FIX(SDLK_WORLD_24));
352
+ rb_define_const(ray_cEvent, "KEY_WORLD_25", INT2FIX(SDLK_WORLD_25));
353
+ rb_define_const(ray_cEvent, "KEY_WORLD_26", INT2FIX(SDLK_WORLD_26));
354
+ rb_define_const(ray_cEvent, "KEY_WORLD_27", INT2FIX(SDLK_WORLD_27));
355
+ rb_define_const(ray_cEvent, "KEY_WORLD_28", INT2FIX(SDLK_WORLD_28));
356
+ rb_define_const(ray_cEvent, "KEY_WORLD_29", INT2FIX(SDLK_WORLD_29));
357
+ rb_define_const(ray_cEvent, "KEY_WORLD_30", INT2FIX(SDLK_WORLD_30));
358
+ rb_define_const(ray_cEvent, "KEY_WORLD_31", INT2FIX(SDLK_WORLD_31));
359
+ rb_define_const(ray_cEvent, "KEY_WORLD_32", INT2FIX(SDLK_WORLD_32));
360
+ rb_define_const(ray_cEvent, "KEY_WORLD_33", INT2FIX(SDLK_WORLD_33));
361
+ rb_define_const(ray_cEvent, "KEY_WORLD_34", INT2FIX(SDLK_WORLD_34));
362
+ rb_define_const(ray_cEvent, "KEY_WORLD_35", INT2FIX(SDLK_WORLD_35));
363
+ rb_define_const(ray_cEvent, "KEY_WORLD_36", INT2FIX(SDLK_WORLD_36));
364
+ rb_define_const(ray_cEvent, "KEY_WORLD_37", INT2FIX(SDLK_WORLD_37));
365
+ rb_define_const(ray_cEvent, "KEY_WORLD_38", INT2FIX(SDLK_WORLD_38));
366
+ rb_define_const(ray_cEvent, "KEY_WORLD_39", INT2FIX(SDLK_WORLD_39));
367
+ rb_define_const(ray_cEvent, "KEY_WORLD_40", INT2FIX(SDLK_WORLD_40));
368
+ rb_define_const(ray_cEvent, "KEY_WORLD_41", INT2FIX(SDLK_WORLD_41));
369
+ rb_define_const(ray_cEvent, "KEY_WORLD_42", INT2FIX(SDLK_WORLD_42));
370
+ rb_define_const(ray_cEvent, "KEY_WORLD_43", INT2FIX(SDLK_WORLD_43));
371
+ rb_define_const(ray_cEvent, "KEY_WORLD_44", INT2FIX(SDLK_WORLD_44));
372
+ rb_define_const(ray_cEvent, "KEY_WORLD_45", INT2FIX(SDLK_WORLD_45));
373
+ rb_define_const(ray_cEvent, "KEY_WORLD_46", INT2FIX(SDLK_WORLD_46));
374
+ rb_define_const(ray_cEvent, "KEY_WORLD_47", INT2FIX(SDLK_WORLD_47));
375
+ rb_define_const(ray_cEvent, "KEY_WORLD_48", INT2FIX(SDLK_WORLD_48));
376
+ rb_define_const(ray_cEvent, "KEY_WORLD_49", INT2FIX(SDLK_WORLD_49));
377
+ rb_define_const(ray_cEvent, "KEY_WORLD_50", INT2FIX(SDLK_WORLD_50));
378
+ rb_define_const(ray_cEvent, "KEY_WORLD_51", INT2FIX(SDLK_WORLD_51));
379
+ rb_define_const(ray_cEvent, "KEY_WORLD_52", INT2FIX(SDLK_WORLD_52));
380
+ rb_define_const(ray_cEvent, "KEY_WORLD_53", INT2FIX(SDLK_WORLD_53));
381
+ rb_define_const(ray_cEvent, "KEY_WORLD_54", INT2FIX(SDLK_WORLD_54));
382
+ rb_define_const(ray_cEvent, "KEY_WORLD_55", INT2FIX(SDLK_WORLD_55));
383
+ rb_define_const(ray_cEvent, "KEY_WORLD_56", INT2FIX(SDLK_WORLD_56));
384
+ rb_define_const(ray_cEvent, "KEY_WORLD_57", INT2FIX(SDLK_WORLD_57));
385
+ rb_define_const(ray_cEvent, "KEY_WORLD_58", INT2FIX(SDLK_WORLD_58));
386
+ rb_define_const(ray_cEvent, "KEY_WORLD_59", INT2FIX(SDLK_WORLD_59));
387
+ rb_define_const(ray_cEvent, "KEY_WORLD_60", INT2FIX(SDLK_WORLD_60));
388
+ rb_define_const(ray_cEvent, "KEY_WORLD_61", INT2FIX(SDLK_WORLD_61));
389
+ rb_define_const(ray_cEvent, "KEY_WORLD_62", INT2FIX(SDLK_WORLD_62));
390
+ rb_define_const(ray_cEvent, "KEY_WORLD_63", INT2FIX(SDLK_WORLD_63));
391
+ rb_define_const(ray_cEvent, "KEY_WORLD_64", INT2FIX(SDLK_WORLD_64));
392
+ rb_define_const(ray_cEvent, "KEY_WORLD_65", INT2FIX(SDLK_WORLD_65));
393
+ rb_define_const(ray_cEvent, "KEY_WORLD_66", INT2FIX(SDLK_WORLD_66));
394
+ rb_define_const(ray_cEvent, "KEY_WORLD_67", INT2FIX(SDLK_WORLD_67));
395
+ rb_define_const(ray_cEvent, "KEY_WORLD_68", INT2FIX(SDLK_WORLD_68));
396
+ rb_define_const(ray_cEvent, "KEY_WORLD_69", INT2FIX(SDLK_WORLD_69));
397
+ rb_define_const(ray_cEvent, "KEY_WORLD_70", INT2FIX(SDLK_WORLD_70));
398
+ rb_define_const(ray_cEvent, "KEY_WORLD_71", INT2FIX(SDLK_WORLD_71));
399
+ rb_define_const(ray_cEvent, "KEY_WORLD_72", INT2FIX(SDLK_WORLD_72));
400
+ rb_define_const(ray_cEvent, "KEY_WORLD_73", INT2FIX(SDLK_WORLD_73));
401
+ rb_define_const(ray_cEvent, "KEY_WORLD_74", INT2FIX(SDLK_WORLD_74));
402
+ rb_define_const(ray_cEvent, "KEY_WORLD_75", INT2FIX(SDLK_WORLD_75));
403
+ rb_define_const(ray_cEvent, "KEY_WORLD_76", INT2FIX(SDLK_WORLD_76));
404
+ rb_define_const(ray_cEvent, "KEY_WORLD_77", INT2FIX(SDLK_WORLD_77));
405
+ rb_define_const(ray_cEvent, "KEY_WORLD_78", INT2FIX(SDLK_WORLD_78));
406
+ rb_define_const(ray_cEvent, "KEY_WORLD_79", INT2FIX(SDLK_WORLD_79));
407
+ rb_define_const(ray_cEvent, "KEY_WORLD_80", INT2FIX(SDLK_WORLD_80));
408
+ rb_define_const(ray_cEvent, "KEY_WORLD_81", INT2FIX(SDLK_WORLD_81));
409
+ rb_define_const(ray_cEvent, "KEY_WORLD_82", INT2FIX(SDLK_WORLD_82));
410
+ rb_define_const(ray_cEvent, "KEY_WORLD_83", INT2FIX(SDLK_WORLD_83));
411
+ rb_define_const(ray_cEvent, "KEY_WORLD_84", INT2FIX(SDLK_WORLD_84));
412
+ rb_define_const(ray_cEvent, "KEY_WORLD_85", INT2FIX(SDLK_WORLD_85));
413
+ rb_define_const(ray_cEvent, "KEY_WORLD_86", INT2FIX(SDLK_WORLD_86));
414
+ rb_define_const(ray_cEvent, "KEY_WORLD_87", INT2FIX(SDLK_WORLD_87));
415
+ rb_define_const(ray_cEvent, "KEY_WORLD_88", INT2FIX(SDLK_WORLD_88));
416
+ rb_define_const(ray_cEvent, "KEY_WORLD_89", INT2FIX(SDLK_WORLD_89));
417
+ rb_define_const(ray_cEvent, "KEY_WORLD_90", INT2FIX(SDLK_WORLD_90));
418
+ rb_define_const(ray_cEvent, "KEY_WORLD_91", INT2FIX(SDLK_WORLD_91));
419
+ rb_define_const(ray_cEvent, "KEY_WORLD_92", INT2FIX(SDLK_WORLD_92));
420
+ rb_define_const(ray_cEvent, "KEY_WORLD_93", INT2FIX(SDLK_WORLD_93));
421
+ rb_define_const(ray_cEvent, "KEY_WORLD_94", INT2FIX(SDLK_WORLD_94));
422
+ rb_define_const(ray_cEvent, "KEY_WORLD_95", INT2FIX(SDLK_WORLD_95));
423
+ rb_define_const(ray_cEvent, "KEY_KP0", INT2FIX(SDLK_KP0));
424
+ rb_define_const(ray_cEvent, "KEY_KP1", INT2FIX(SDLK_KP1));
425
+ rb_define_const(ray_cEvent, "KEY_KP2", INT2FIX(SDLK_KP2));
426
+ rb_define_const(ray_cEvent, "KEY_KP3", INT2FIX(SDLK_KP3));
427
+ rb_define_const(ray_cEvent, "KEY_KP4", INT2FIX(SDLK_KP4));
428
+ rb_define_const(ray_cEvent, "KEY_KP5", INT2FIX(SDLK_KP5));
429
+ rb_define_const(ray_cEvent, "KEY_KP6", INT2FIX(SDLK_KP6));
430
+ rb_define_const(ray_cEvent, "KEY_KP7", INT2FIX(SDLK_KP7));
431
+ rb_define_const(ray_cEvent, "KEY_KP8", INT2FIX(SDLK_KP8));
432
+ rb_define_const(ray_cEvent, "KEY_KP9", INT2FIX(SDLK_KP9));
433
+ rb_define_const(ray_cEvent, "KEY_KP_PERIOD", INT2FIX(SDLK_KP_PERIOD));
434
+ rb_define_const(ray_cEvent, "KEY_KP_DIVIDE", INT2FIX(SDLK_KP_DIVIDE));
435
+ rb_define_const(ray_cEvent, "KEY_KP_MULTIPLY", INT2FIX(SDLK_KP_MULTIPLY));
436
+ rb_define_const(ray_cEvent, "KEY_KP_MINUS", INT2FIX(SDLK_KP_MINUS));
437
+ rb_define_const(ray_cEvent, "KEY_KP_PLUS", INT2FIX(SDLK_KP_PLUS));
438
+ rb_define_const(ray_cEvent, "KEY_KP_ENTER", INT2FIX(SDLK_KP_ENTER));
439
+ rb_define_const(ray_cEvent, "KEY_KP_EQUALS", INT2FIX(SDLK_KP_EQUALS));
440
+ rb_define_const(ray_cEvent, "KEY_UP", INT2FIX(SDLK_UP));
441
+ rb_define_const(ray_cEvent, "KEY_DOWN", INT2FIX(SDLK_DOWN));
442
+ rb_define_const(ray_cEvent, "KEY_RIGHT", INT2FIX(SDLK_RIGHT));
443
+ rb_define_const(ray_cEvent, "KEY_LEFT", INT2FIX(SDLK_LEFT));
444
+ rb_define_const(ray_cEvent, "KEY_INSERT", INT2FIX(SDLK_INSERT));
445
+ rb_define_const(ray_cEvent, "KEY_HOME", INT2FIX(SDLK_HOME));
446
+ rb_define_const(ray_cEvent, "KEY_END", INT2FIX(SDLK_END));
447
+ rb_define_const(ray_cEvent, "KEY_PAGEUP", INT2FIX(SDLK_PAGEUP));
448
+ rb_define_const(ray_cEvent, "KEY_PAGEDOWN", INT2FIX(SDLK_PAGEDOWN));
449
+ rb_define_const(ray_cEvent, "KEY_F1", INT2FIX(SDLK_F1));
450
+ rb_define_const(ray_cEvent, "KEY_F2", INT2FIX(SDLK_F2));
451
+ rb_define_const(ray_cEvent, "KEY_F3", INT2FIX(SDLK_F3));
452
+ rb_define_const(ray_cEvent, "KEY_F4", INT2FIX(SDLK_F4));
453
+ rb_define_const(ray_cEvent, "KEY_F5", INT2FIX(SDLK_F5));
454
+ rb_define_const(ray_cEvent, "KEY_F6", INT2FIX(SDLK_F6));
455
+ rb_define_const(ray_cEvent, "KEY_F7", INT2FIX(SDLK_F7));
456
+ rb_define_const(ray_cEvent, "KEY_F8", INT2FIX(SDLK_F8));
457
+ rb_define_const(ray_cEvent, "KEY_F9", INT2FIX(SDLK_F9));
458
+ rb_define_const(ray_cEvent, "KEY_F10", INT2FIX(SDLK_F10));
459
+ rb_define_const(ray_cEvent, "KEY_F11", INT2FIX(SDLK_F11));
460
+ rb_define_const(ray_cEvent, "KEY_F12", INT2FIX(SDLK_F12));
461
+ rb_define_const(ray_cEvent, "KEY_F13", INT2FIX(SDLK_F13));
462
+ rb_define_const(ray_cEvent, "KEY_F14", INT2FIX(SDLK_F14));
463
+ rb_define_const(ray_cEvent, "KEY_F15", INT2FIX(SDLK_F15));
464
+ rb_define_const(ray_cEvent, "KEY_NUMLOCK", INT2FIX(SDLK_NUMLOCK));
465
+ rb_define_const(ray_cEvent, "KEY_CAPSLOCK", INT2FIX(SDLK_CAPSLOCK));
466
+ rb_define_const(ray_cEvent, "KEY_SCROLLOCK", INT2FIX(SDLK_SCROLLOCK));
467
+ rb_define_const(ray_cEvent, "KEY_RSHIFT", INT2FIX(SDLK_RSHIFT));
468
+ rb_define_const(ray_cEvent, "KEY_LSHIFT", INT2FIX(SDLK_LSHIFT));
469
+ rb_define_const(ray_cEvent, "KEY_RCTRL", INT2FIX(SDLK_RCTRL));
470
+ rb_define_const(ray_cEvent, "KEY_LCTRL", INT2FIX(SDLK_LCTRL));
471
+ rb_define_const(ray_cEvent, "KEY_RALT", INT2FIX(SDLK_RALT));
472
+ rb_define_const(ray_cEvent, "KEY_LALT", INT2FIX(SDLK_LALT));
473
+ rb_define_const(ray_cEvent, "KEY_RMETA", INT2FIX(SDLK_RMETA));
474
+ rb_define_const(ray_cEvent, "KEY_LMETA", INT2FIX(SDLK_LMETA));
475
+ rb_define_const(ray_cEvent, "KEY_LSUPER", INT2FIX(SDLK_LSUPER));
476
+ rb_define_const(ray_cEvent, "KEY_RSUPER", INT2FIX(SDLK_RSUPER));
477
+ rb_define_const(ray_cEvent, "KEY_MODE", INT2FIX(SDLK_MODE));
478
+ rb_define_const(ray_cEvent, "KEY_COMPOSE", INT2FIX(SDLK_COMPOSE));
479
+ rb_define_const(ray_cEvent, "KEY_HELP", INT2FIX(SDLK_HELP));
480
+ rb_define_const(ray_cEvent, "KEY_PRINT", INT2FIX(SDLK_PRINT));
481
+ rb_define_const(ray_cEvent, "KEY_SYSREQ", INT2FIX(SDLK_SYSREQ));
482
+ rb_define_const(ray_cEvent, "KEY_BREAK", INT2FIX(SDLK_BREAK));
483
+ rb_define_const(ray_cEvent, "KEY_MENU", INT2FIX(SDLK_MENU));
484
+ rb_define_const(ray_cEvent, "KEY_POWER", INT2FIX(SDLK_POWER));
485
+ rb_define_const(ray_cEvent, "KEY_EURO", INT2FIX(SDLK_EURO));
486
+ rb_define_const(ray_cEvent, "KEY_UNDO", INT2FIX(SDLK_UNDO));
487
+ rb_define_const(ray_cEvent, "KMOD_NONE", INT2FIX(KMOD_NONE));
488
+ rb_define_const(ray_cEvent, "KMOD_LCTRL", INT2FIX(KMOD_LCTRL));
489
+ rb_define_const(ray_cEvent, "KMOD_RCTRL", INT2FIX(KMOD_RCTRL));
490
+ rb_define_const(ray_cEvent, "KMOD_LALT", INT2FIX(KMOD_LALT));
491
+ rb_define_const(ray_cEvent, "KMOD_RALT", INT2FIX(KMOD_RALT));
492
+ rb_define_const(ray_cEvent, "KMOD_LMETA", INT2FIX(KMOD_LMETA));
493
+ rb_define_const(ray_cEvent, "KMOD_RMETA", INT2FIX(KMOD_RMETA));
494
+ rb_define_const(ray_cEvent, "KMOD_NUM", INT2FIX(KMOD_NUM));
495
+ rb_define_const(ray_cEvent, "KMOD_CAPS", INT2FIX(KMOD_CAPS));
496
+ rb_define_const(ray_cEvent, "KMOD_MODE", INT2FIX(KMOD_MODE));
497
+ rb_define_const(ray_cEvent, "KMOD_RESERVED", INT2FIX(KMOD_RESERVED));
498
+
499
+ rb_define_const(ray_cEvent, "APPMOUSEFOCUS", INT2FIX(SDL_APPMOUSEFOCUS));
500
+ rb_define_const(ray_cEvent, "APPINPUTFOCUS", INT2FIX(SDL_APPINPUTFOCUS));
501
+ rb_define_const(ray_cEvent, "APPACTIVE", INT2FIX(SDL_APPACTIVE));
502
+
503
+ rb_define_const(ray_cEvent, "BUTTON_LEFT", INT2FIX(SDL_BUTTON_LEFT));
504
+ rb_define_const(ray_cEvent, "BUTTON_MIDDLE", INT2FIX(SDL_BUTTON_MIDDLE));
505
+ rb_define_const(ray_cEvent, "BUTTON_RIGHT", INT2FIX(SDL_BUTTON_RIGHT));
506
+ rb_define_const(ray_cEvent, "BUTTON_WHEELUP", INT2FIX(SDL_BUTTON_WHEELUP));
507
+ rb_define_const(ray_cEvent, "BUTTON_WHEELDOWN",
508
+ INT2FIX(SDL_BUTTON_WHEELDOWN));
509
+
510
+ #ifdef PSP
511
+
512
+ /* Buttonss are declared in the following order:
513
+ PSP_CTRL_TRIANGLE, PSP_CTRL_CIRCLE, PSP_CTRL_CROSS, PSP_CTRL_SQUARE,
514
+ PSP_CTRL_LTRIGGER, PSP_CTRL_RTRIGGER,
515
+ PSP_CTRL_DOWN, PSP_CTRL_LEFT, PSP_CTRL_UP, PSP_CTRL_RIGHT,
516
+ PSP_CTRL_SELECT, PSP_CTRL_START, PSP_CTRL_HOME, PSP_CTRL_HOLD
517
+ */
518
+
519
+ rb_define_const(ray_cEvent, "PSP_BUTTON_TRIANGLE", INT2FIX(0));
520
+ rb_define_const(ray_cEvent, "PSP_BUTTON_CIRCLE", INT2FIX(1));
521
+ rb_define_const(ray_cEvent, "PSP_BUTTON_CROSS", INT2FIX(2));
522
+ rb_define_const(ray_cEvent, "PSP_BUTTON_SQUARE", INT2FIX(3));
523
+ rb_define_const(ray_cEvent, "PSP_BUTTON_L", INT2FIX(4));
524
+ rb_define_const(ray_cEvent, "PSP_BUTTON_R", INT2FIX(5));
525
+ rb_define_const(ray_cEvent, "PSP_BUTTON_DOWN", INT2FIX(6));
526
+ rb_define_const(ray_cEvent, "PSP_BUTTON_LEFT", INT2FIX(7));
527
+ rb_define_const(ray_cEvent, "PSP_BUTTON_UP", INT2FIX(8));
528
+ rb_define_const(ray_cEvent, "PSP_BUTTON_RIGHT", INT2FIX(9));
529
+ rb_define_const(ray_cEvent, "PSP_BUTTON_SELECT", INT2FIX(10));
530
+ rb_define_const(ray_cEvent, "PSP_BUTTON_START", INT2FIX(11));
531
+ rb_define_const(ray_cEvent, "PSP_BUTTON_HOME", INT2FIX(12));
532
+ rb_define_const(ray_cEvent, "PSP_BUTTON_HOLD", INT2FIX(13));
533
+
534
+ #endif
535
+ }