rays 0.1.28 → 0.1.30

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/.doc/ext/rays/bitmap.cpp +1 -1
  3. data/.doc/ext/rays/bounds.cpp +1 -1
  4. data/.doc/ext/rays/camera.cpp +1 -1
  5. data/.doc/ext/rays/color.cpp +1 -1
  6. data/.doc/ext/rays/color_space.cpp +1 -1
  7. data/.doc/ext/rays/exception.cpp +45 -0
  8. data/.doc/ext/rays/font.cpp +1 -1
  9. data/.doc/ext/rays/image.cpp +1 -1
  10. data/.doc/ext/rays/matrix.cpp +1 -1
  11. data/.doc/ext/rays/native.cpp +35 -33
  12. data/.doc/ext/rays/noise.cpp +1 -1
  13. data/.doc/ext/rays/painter.cpp +1 -1
  14. data/.doc/ext/rays/point.cpp +1 -1
  15. data/.doc/ext/rays/polygon.cpp +1 -1
  16. data/.doc/ext/rays/polygon_line.cpp +1 -1
  17. data/.doc/ext/rays/polyline.cpp +1 -1
  18. data/.doc/ext/rays/shader.cpp +101 -7
  19. data/VERSION +1 -1
  20. data/ext/rays/bitmap.cpp +1 -1
  21. data/ext/rays/bounds.cpp +1 -1
  22. data/ext/rays/camera.cpp +1 -1
  23. data/ext/rays/color.cpp +1 -1
  24. data/ext/rays/color_space.cpp +1 -1
  25. data/ext/rays/defs.h +1 -0
  26. data/ext/rays/exception.cpp +45 -0
  27. data/ext/rays/extconf.rb +1 -1
  28. data/ext/rays/font.cpp +1 -1
  29. data/ext/rays/image.cpp +1 -1
  30. data/ext/rays/matrix.cpp +1 -1
  31. data/ext/rays/native.cpp +35 -33
  32. data/ext/rays/noise.cpp +1 -1
  33. data/ext/rays/painter.cpp +1 -1
  34. data/ext/rays/point.cpp +1 -1
  35. data/ext/rays/polygon.cpp +1 -1
  36. data/ext/rays/polygon_line.cpp +1 -1
  37. data/ext/rays/polyline.cpp +1 -1
  38. data/ext/rays/shader.cpp +102 -6
  39. data/include/rays/exception.h +11 -0
  40. data/include/rays/ruby/bitmap.h +0 -1
  41. data/include/rays/ruby/bounds.h +0 -2
  42. data/include/rays/ruby/camera.h +0 -1
  43. data/include/rays/ruby/color.h +0 -2
  44. data/include/rays/ruby/color_space.h +0 -1
  45. data/include/rays/ruby/defs.h +30 -0
  46. data/include/rays/ruby/exception.h +28 -0
  47. data/include/rays/ruby/font.h +0 -1
  48. data/include/rays/ruby/image.h +0 -1
  49. data/include/rays/ruby/matrix.h +0 -1
  50. data/include/rays/ruby/painter.h +0 -1
  51. data/include/rays/ruby/point.h +0 -2
  52. data/include/rays/ruby/polygon.h +0 -1
  53. data/include/rays/ruby/polyline.h +0 -1
  54. data/include/rays/ruby/rays.h +0 -1
  55. data/include/rays/ruby/shader.h +0 -1
  56. data/include/rays/ruby.h +2 -0
  57. data/include/rays/shader.h +48 -1
  58. data/lib/rays/painter.rb +6 -5
  59. data/lib/rays/point.rb +1 -0
  60. data/lib/rays/shader.rb +18 -5
  61. data/rays.gemspec +3 -3
  62. data/src/exception.cpp +13 -0
  63. data/src/image.cpp +6 -4
  64. data/src/opengl.cpp +20 -7
  65. data/src/opengl.h +5 -3
  66. data/src/osx/font.mm +0 -2
  67. data/src/osx/opengl.mm +17 -2
  68. data/src/painter.cpp +181 -148
  69. data/src/shader.cpp +333 -53
  70. data/src/shader.h +53 -14
  71. data/src/shader_program.cpp +53 -27
  72. data/src/shader_program.h +8 -1
  73. data/src/shader_source.cpp +2 -2
  74. data/src/texture.cpp +80 -63
  75. data/test/helper.rb +1 -1
  76. data/test/test_point.rb +6 -5
  77. data/test/test_rays.rb +2 -2
  78. data/test/test_shader.rb +151 -14
  79. metadata +12 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 38052c848aef75871de813ae9cc59a956672b1c6b8db25b55916f041ae0df976
4
- data.tar.gz: d1f462fce0b73364a015fa1826eef17c3d1a4ac0b4378590f20438d87ce8e1cf
3
+ metadata.gz: 88387a7d63567dd0f87d5c28708d1c666b7bd41df31ae34d676a9fcfeb4b19b5
4
+ data.tar.gz: 6a05891d8c4aee2b2ffbdc11fd9d6acc9dee8678f7e98180d399f6a64b04383b
5
5
  SHA512:
6
- metadata.gz: 9e01828d4ac2ad4749a9d050d3890669be7e35dd057cc92b0dae23f645954b44bf7f3775d193ef36d9590d10879175a7937b28ceddf0bf9fd29a84723f0cfdbe
7
- data.tar.gz: da8b670d9e704d4cc48070d5d252ec504e433f00222160a5c42ccf7a036eabc1a31580b6318da59672bc8576b0dddf84fce635ce9194f4a462eebfc8d4e03451
6
+ metadata.gz: 14ec81d1d115983f66e39432af1f98d29efe759bf891412fb67e85b09801c89fa6702e4970fd56fcb29cc1d2dfacbeb7d5edc8fb43aaa17accf964bca2b4df30
7
+ data.tar.gz: 4d07ba7e7280e7aba01eed8b483978e750a6bfc5201a345e062977cf379c10f12ca1d75b38ef00677bc0bd0798245050cc14c5f0aa33e70fd93dcca5aa58d920
@@ -94,7 +94,7 @@ VALUE get_at(VALUE self, VALUE x, VALUE y)
94
94
  static Class cBitmap;
95
95
 
96
96
  void
97
- Init_bitmap ()
97
+ Init_rays_bitmap ()
98
98
  {
99
99
  Module mRays = rb_define_module("Rays");
100
100
 
@@ -522,7 +522,7 @@ VALUE invalid(VALUE self)
522
522
  static Class cBounds;
523
523
 
524
524
  void
525
- Init_bounds ()
525
+ Init_rays_bounds ()
526
526
  {
527
527
  Module mRays = rb_define_module("Rays");
528
528
 
@@ -134,7 +134,7 @@ VALUE device_names(VALUE self)
134
134
  static Class cCamera;
135
135
 
136
136
  void
137
- Init_camera ()
137
+ Init_rays_camera ()
138
138
  {
139
139
  Module mRays = rb_define_module("Rays");
140
140
 
@@ -182,7 +182,7 @@ VALUE set_palette_color(VALUE self)
182
182
  static Class cColor;
183
183
 
184
184
  void
185
- Init_color ()
185
+ Init_rays_color ()
186
186
  {
187
187
  Module mRays = rb_define_module("Rays");
188
188
 
@@ -177,7 +177,7 @@ VALUE to_s(VALUE self)
177
177
  static Class cColorSpace;
178
178
 
179
179
  void
180
- Init_color_space ()
180
+ Init_rays_color_space ()
181
181
  {
182
182
  Module mRays = rb_define_module("Rays");
183
183
 
@@ -0,0 +1,45 @@
1
+ #include "rays/ruby/exception.h"
2
+
3
+
4
+ #include "defs.h"
5
+
6
+
7
+ static Class cRaysError;
8
+ static Class cOpenGLError;
9
+ static Class cShaderError;
10
+
11
+ void
12
+ Init_rays_exception ()
13
+ {
14
+ Module mRays = rb_define_module("Rays");
15
+
16
+ cRaysError = rb_define_class_under(mRays, "RaysError", rb_eRuntimeError);
17
+ cOpenGLError = rb_define_class_under(mRays, "OpenGLError", cRaysError);
18
+ cShaderError = rb_define_class_under(mRays, "ShaderError", cOpenGLError);
19
+ }
20
+
21
+
22
+ namespace Rays
23
+ {
24
+
25
+
26
+ Class
27
+ rays_error_class ()
28
+ {
29
+ return cRaysError;
30
+ }
31
+
32
+ Class
33
+ opengl_error_class ()
34
+ {
35
+ return cOpenGLError;
36
+ }
37
+
38
+ Class
39
+ shader_error_class ()
40
+ {
41
+ return cShaderError;
42
+ }
43
+
44
+
45
+ }// Rays
@@ -86,7 +86,7 @@ VALUE leading(VALUE self)
86
86
  static Class cFont;
87
87
 
88
88
  void
89
- Init_font ()
89
+ Init_rays_font ()
90
90
  {
91
91
  Module mRays = rb_define_module("Rays");
92
92
 
@@ -123,7 +123,7 @@ VALUE load(VALUE self)
123
123
  static Class cImage;
124
124
 
125
125
  void
126
- Init_image ()
126
+ Init_rays_image ()
127
127
  {
128
128
  Module mRays = rb_define_module("Rays");
129
129
 
@@ -193,7 +193,7 @@ VALUE s_rotate(VALUE self)
193
193
  static Class cMatrix;
194
194
 
195
195
  void
196
- Init_matrix ()
196
+ Init_rays_matrix ()
197
197
  {
198
198
  Module mRays = rb_define_module("Rays");
199
199
 
@@ -2,24 +2,25 @@
2
2
 
3
3
 
4
4
  void Init_rays ();
5
+ void Init_rays_exception ();
5
6
 
6
- void Init_point ();
7
- void Init_bounds ();
8
- void Init_color ();
9
- void Init_color_space ();
10
- void Init_matrix ();
7
+ void Init_rays_point ();
8
+ void Init_rays_bounds ();
9
+ void Init_rays_color ();
10
+ void Init_rays_color_space ();
11
+ void Init_rays_matrix ();
11
12
 
12
- void Init_painter ();
13
- void Init_polyline ();
14
- void Init_polygon_line ();
15
- void Init_polygon ();
16
- void Init_bitmap ();
17
- void Init_image ();
18
- void Init_font ();
19
- void Init_shader ();
20
- void Init_camera ();
13
+ void Init_rays_painter ();
14
+ void Init_rays_polyline ();
15
+ void Init_rays_polygon_line ();
16
+ void Init_rays_polygon ();
17
+ void Init_rays_bitmap ();
18
+ void Init_rays_image ();
19
+ void Init_rays_font ();
20
+ void Init_rays_shader ();
21
+ void Init_rays_camera ();
21
22
 
22
- void Init_noise ();
23
+ void Init_rays_noise ();
23
24
 
24
25
 
25
26
  extern "C" void
@@ -34,24 +35,25 @@ extern "C" void
34
35
  Rucy::init();
35
36
 
36
37
  Init_rays();
37
-
38
- Init_point();
39
- Init_bounds();
40
- Init_color();
41
- Init_color_space();
42
- Init_matrix();
43
-
44
- Init_painter();
45
- Init_polyline();
46
- Init_polygon_line();
47
- Init_polygon();
48
- Init_bitmap();
49
- Init_image();
50
- Init_font();
51
- Init_shader();
52
- Init_camera();
53
-
54
- Init_noise();
38
+ Init_rays_exception();
39
+
40
+ Init_rays_point();
41
+ Init_rays_bounds();
42
+ Init_rays_color();
43
+ Init_rays_color_space();
44
+ Init_rays_matrix();
45
+
46
+ Init_rays_painter();
47
+ Init_rays_polyline();
48
+ Init_rays_polygon_line();
49
+ Init_rays_polygon();
50
+ Init_rays_bitmap();
51
+ Init_rays_image();
52
+ Init_rays_font();
53
+ Init_rays_shader();
54
+ Init_rays_camera();
55
+
56
+ Init_rays_noise();
55
57
 
56
58
  RUCY_CATCH
57
59
  }
@@ -45,7 +45,7 @@ VALUE simplex(VALUE self)
45
45
 
46
46
 
47
47
  void
48
- Init_noise ()
48
+ Init_rays_noise ()
49
49
  {
50
50
  Module mRays = rb_define_module("Rays");
51
51
  rb_define_singleton_method(mRays, "perlin", RUBY_METHOD_FUNC(perlin), -1);
@@ -602,7 +602,7 @@ VALUE pop_matrix(VALUE self)
602
602
  static Class cPainter;
603
603
 
604
604
  void
605
- Init_painter ()
605
+ Init_rays_painter ()
606
606
  {
607
607
  Module mRays = rb_define_module("Rays");
608
608
 
@@ -247,7 +247,7 @@ VALUE cross(VALUE self, VALUE p1, VALUE p2)
247
247
  static Class cPoint;
248
248
 
249
249
  void
250
- Init_point ()
250
+ Init_rays_point ()
251
251
  {
252
252
  Module mRays = rb_define_module("Rays");
253
253
 
@@ -233,7 +233,7 @@ VALUE create_bezier(VALUE self, VALUE args, VALUE loop)
233
233
  static Class cPolygon;
234
234
 
235
235
  void
236
- Init_polygon ()
236
+ Init_rays_polygon ()
237
237
  {
238
238
  Module mRays = rb_define_module("Rays");
239
239
 
@@ -39,7 +39,7 @@ VALUE hole(VALUE self)
39
39
  static Class cPolygonLine;
40
40
 
41
41
  void
42
- Init_polygon_line ()
42
+ Init_rays_polygon_line ()
43
43
  {
44
44
  Module mRays = rb_define_module("Rays");
45
45
  Class cPolygon = rb_define_class_under(mRays, "Polygon", rb_cObject);
@@ -105,7 +105,7 @@ VALUE each(VALUE self)
105
105
  static Class cPolyline;
106
106
 
107
107
  void
108
- Init_polyline ()
108
+ Init_rays_polyline ()
109
109
  {
110
110
  Module mRays = rb_define_module("Rays");
111
111
 
@@ -1,6 +1,7 @@
1
1
  #include "rays/ruby/shader.h"
2
2
 
3
3
 
4
+ #include "rays/ruby/image.h"
4
5
  #include "defs.h"
5
6
 
6
7
 
@@ -17,12 +18,83 @@ VALUE alloc(VALUE klass)
17
18
  return new_type<Rays::Shader>(klass);
18
19
  }
19
20
 
21
+ static const char*
22
+ to_name (const Value& names, size_t index)
23
+ {
24
+ if (!names || !names.is_array() || index >= names.size())
25
+ return NULL;
26
+
27
+ const auto& name = names[index];
28
+ if (!name) return NULL;
29
+
30
+ return name.c_str();
31
+ }
32
+
33
+ static Rays::ShaderEnv::NameList
34
+ to_name_list (const Value& names, size_t index)
35
+ {
36
+ if (!names || !names.is_array() || index >= names.size())
37
+ return {};
38
+
39
+ const auto& name_or_array = names[index];
40
+ if (name_or_array.is_array())
41
+ {
42
+ Rays::ShaderEnv::NameList list;
43
+ for (size_t i = 0; i < name_or_array.size(); ++i)
44
+ list.emplace_back(name_or_array[i].c_str());
45
+ return list;
46
+ }
47
+ else if (name_or_array.is_s() || name_or_array.is_sym())
48
+ return {Xot::String(name_or_array.c_str())};
49
+ else
50
+ return {};
51
+ }
52
+
53
+ static std::shared_ptr<Rays::ShaderEnv>
54
+ make_env (const Value& names, const Value& ignore_no_uniform_location_error)
55
+ {
56
+ bool has_names = names && names.is_array() && !names.empty();
57
+ if (!has_names && !ignore_no_uniform_location_error)
58
+ return NULL;
59
+
60
+ uint flags = 0;
61
+ if (ignore_no_uniform_location_error)
62
+ flags |= Rays::ShaderEnv::IGNORE_NO_UNIFORM_LOCATION_ERROR;
63
+
64
+ return std::make_shared<Rays::ShaderEnv>(
65
+ to_name_list(names, 0),
66
+ to_name_list(names, 1),
67
+ to_name_list(names, 2),
68
+ to_name( names, 3),
69
+ to_name( names, 4),
70
+ to_name( names, 5),
71
+ to_name_list(names, 6),
72
+ to_name_list(names, 7),
73
+ to_name_list(names, 8),
74
+ to_name_list(names, 9),
75
+ to_name_list(names, 10),
76
+ to_name_list(names, 11),
77
+ flags);
78
+ }
79
+
20
80
  static
21
- VALUE setup(VALUE self, VALUE source)
81
+ VALUE setup(VALUE self, VALUE
82
+ fragment_shader_source, VALUE vertex_shader_source, VALUE
83
+ builtin_variable_names, VALUE ignore_no_uniform_location_error)
22
84
  {
23
85
  RUCY_CHECK_OBJ(Rays::Shader, self);
24
86
 
25
- *THIS = to<Rays::Shader>(source);
87
+ if (fragment_shader_source.is_nil())
88
+ argument_error(__FILE__, __LINE__);
89
+
90
+ const char* fs = fragment_shader_source.c_str();
91
+ const char* vs = vertex_shader_source ? vertex_shader_source.c_str() : NULL;
92
+
93
+ auto env = make_env(builtin_variable_names, ignore_no_uniform_location_error);
94
+ if (env)
95
+ *THIS = Rays::Shader(fs, vs, *env);
96
+ else
97
+ *THIS = Rays::Shader(fs, vs);
26
98
  }
27
99
 
28
100
  static
@@ -31,9 +103,6 @@ VALUE set_uniform(VALUE self)
31
103
  CHECK;
32
104
  check_arg_count(__FILE__, __LINE__, "Painter#set_uniform", argc, 2, 3, 4, 5);
33
105
 
34
- #define Ai(n) (argv[n].as_i())
35
- #define Af(n) ((float) argv[n].as_f())
36
-
37
106
  const char* name = argv[0].c_str();
38
107
  if (argv[1].is_array())
39
108
  {
@@ -46,6 +115,9 @@ VALUE set_uniform(VALUE self)
46
115
  argv += 1;
47
116
  }
48
117
 
118
+ #define Ai(n) (argv[n].as_i())
119
+ #define Af(n) ((float) argv[n].as_f())
120
+
49
121
  if (argv[0].is_i())
50
122
  {
51
123
  switch (argc)
@@ -66,6 +138,8 @@ VALUE set_uniform(VALUE self)
66
138
  case 4: THIS->set_uniform(name, Af(0), Af(1), Af(2), Af(3)); break;
67
139
  }
68
140
  }
141
+ else if (argv[0].is_kind_of(Rays::image_class()))
142
+ THIS->set_uniform(name, to<Rays::Image&>(argv[0]));
69
143
  else
70
144
  argument_error(__FILE__, __LINE__);
71
145
 
@@ -75,18 +149,38 @@ VALUE set_uniform(VALUE self)
75
149
  return self;
76
150
  }
77
151
 
152
+ static
153
+ VALUE get_vertex_shader_source(VALUE self)
154
+ {
155
+ CHECK;
156
+
157
+ const char* source = THIS->vertex_shader_source();
158
+ return source ? value(source) : nil();
159
+ }
160
+
161
+ static
162
+ VALUE get_fragment_shader_source(VALUE self)
163
+ {
164
+ CHECK;
165
+
166
+ const char* source = THIS->fragment_shader_source();
167
+ return source ? value(source) : nil();
168
+ }
169
+
78
170
 
79
171
  static Class cShader;
80
172
 
81
173
  void
82
- Init_shader ()
174
+ Init_rays_shader ()
83
175
  {
84
176
  Module mRays = rb_define_module("Rays");
85
177
 
86
178
  cShader = rb_define_class_under(mRays, "Shader", rb_cObject);
87
179
  rb_define_alloc_func(cShader, alloc);
88
- rb_define_private_method(cShader, "setup", RUBY_METHOD_FUNC(setup), 1);
180
+ rb_define_private_method(cShader, "setup", RUBY_METHOD_FUNC(setup), 4);
89
181
  rb_define_private_method(cShader, "set_uniform", RUBY_METHOD_FUNC(set_uniform), -1);
182
+ rb_define_method(cShader, "vertex_shader_source", RUBY_METHOD_FUNC(get_vertex_shader_source), 0);
183
+ rb_define_method(cShader, "fragment_shader_source", RUBY_METHOD_FUNC(get_fragment_shader_source), 0);
90
184
  }
91
185
 
92
186
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.28
1
+ 0.1.30
data/ext/rays/bitmap.cpp CHANGED
@@ -102,7 +102,7 @@ RUCY_END
102
102
  static Class cBitmap;
103
103
 
104
104
  void
105
- Init_bitmap ()
105
+ Init_rays_bitmap ()
106
106
  {
107
107
  Module mRays = define_module("Rays");
108
108
 
data/ext/rays/bounds.cpp CHANGED
@@ -569,7 +569,7 @@ RUCY_END
569
569
  static Class cBounds;
570
570
 
571
571
  void
572
- Init_bounds ()
572
+ Init_rays_bounds ()
573
573
  {
574
574
  Module mRays = define_module("Rays");
575
575
 
data/ext/rays/camera.cpp CHANGED
@@ -149,7 +149,7 @@ RUCY_END
149
149
  static Class cCamera;
150
150
 
151
151
  void
152
- Init_camera ()
152
+ Init_rays_camera ()
153
153
  {
154
154
  Module mRays = define_module("Rays");
155
155
 
data/ext/rays/color.cpp CHANGED
@@ -195,7 +195,7 @@ RUCY_END
195
195
  static Class cColor;
196
196
 
197
197
  void
198
- Init_color ()
198
+ Init_rays_color ()
199
199
  {
200
200
  Module mRays = define_module("Rays");
201
201
 
@@ -190,7 +190,7 @@ RUCY_END
190
190
  static Class cColorSpace;
191
191
 
192
192
  void
193
- Init_color_space ()
193
+ Init_rays_color_space ()
194
194
  {
195
195
  Module mRays = define_module("Rays");
196
196
 
data/ext/rays/defs.h CHANGED
@@ -8,6 +8,7 @@
8
8
  #include <rucy.h>
9
9
  #include <rays/defs.h>
10
10
  #include <rays/point.h>
11
+ #include <rays/ruby/defs.h>
11
12
 
12
13
 
13
14
  using namespace Rucy;
@@ -0,0 +1,45 @@
1
+ #include "rays/ruby/exception.h"
2
+
3
+
4
+ #include "defs.h"
5
+
6
+
7
+ static Class cRaysError;
8
+ static Class cOpenGLError;
9
+ static Class cShaderError;
10
+
11
+ void
12
+ Init_rays_exception ()
13
+ {
14
+ Module mRays = define_module("Rays");
15
+
16
+ cRaysError = mRays.define_class("RaysError", rb_eRuntimeError);
17
+ cOpenGLError = mRays.define_class("OpenGLError", cRaysError);
18
+ cShaderError = mRays.define_class("ShaderError", cOpenGLError);
19
+ }
20
+
21
+
22
+ namespace Rays
23
+ {
24
+
25
+
26
+ Class
27
+ rays_error_class ()
28
+ {
29
+ return cRaysError;
30
+ }
31
+
32
+ Class
33
+ opengl_error_class ()
34
+ {
35
+ return cOpenGLError;
36
+ }
37
+
38
+ Class
39
+ shader_error_class ()
40
+ {
41
+ return cShaderError;
42
+ }
43
+
44
+
45
+ }// Rays
data/ext/rays/extconf.rb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
  %w[../xot ../rucy .]
5
- .map {|s| File.expand_path "../../../#{s}/lib", __FILE__}
5
+ .map {|s| File.expand_path "../../#{s}/lib", __dir__}
6
6
  .each {|s| $:.unshift s if !$:.include?(s) && File.directory?(s)}
7
7
 
8
8
  require 'mkmf'
data/ext/rays/font.cpp CHANGED
@@ -95,7 +95,7 @@ RUCY_END
95
95
  static Class cFont;
96
96
 
97
97
  void
98
- Init_font ()
98
+ Init_rays_font ()
99
99
  {
100
100
  Module mRays = define_module("Rays");
101
101
 
data/ext/rays/image.cpp CHANGED
@@ -134,7 +134,7 @@ RUCY_END
134
134
  static Class cImage;
135
135
 
136
136
  void
137
- Init_image ()
137
+ Init_rays_image ()
138
138
  {
139
139
  Module mRays = define_module("Rays");
140
140
 
data/ext/rays/matrix.cpp CHANGED
@@ -209,7 +209,7 @@ RUCY_END
209
209
  static Class cMatrix;
210
210
 
211
211
  void
212
- Init_matrix ()
212
+ Init_rays_matrix ()
213
213
  {
214
214
  Module mRays = define_module("Rays");
215
215
 
data/ext/rays/native.cpp CHANGED
@@ -2,24 +2,25 @@
2
2
 
3
3
 
4
4
  void Init_rays ();
5
+ void Init_rays_exception ();
5
6
 
6
- void Init_point ();
7
- void Init_bounds ();
8
- void Init_color ();
9
- void Init_color_space ();
10
- void Init_matrix ();
7
+ void Init_rays_point ();
8
+ void Init_rays_bounds ();
9
+ void Init_rays_color ();
10
+ void Init_rays_color_space ();
11
+ void Init_rays_matrix ();
11
12
 
12
- void Init_painter ();
13
- void Init_polyline ();
14
- void Init_polygon_line ();
15
- void Init_polygon ();
16
- void Init_bitmap ();
17
- void Init_image ();
18
- void Init_font ();
19
- void Init_shader ();
20
- void Init_camera ();
13
+ void Init_rays_painter ();
14
+ void Init_rays_polyline ();
15
+ void Init_rays_polygon_line ();
16
+ void Init_rays_polygon ();
17
+ void Init_rays_bitmap ();
18
+ void Init_rays_image ();
19
+ void Init_rays_font ();
20
+ void Init_rays_shader ();
21
+ void Init_rays_camera ();
21
22
 
22
- void Init_noise ();
23
+ void Init_rays_noise ();
23
24
 
24
25
 
25
26
  extern "C" void
@@ -34,24 +35,25 @@ extern "C" void
34
35
  Rucy::init();
35
36
 
36
37
  Init_rays();
37
-
38
- Init_point();
39
- Init_bounds();
40
- Init_color();
41
- Init_color_space();
42
- Init_matrix();
43
-
44
- Init_painter();
45
- Init_polyline();
46
- Init_polygon_line();
47
- Init_polygon();
48
- Init_bitmap();
49
- Init_image();
50
- Init_font();
51
- Init_shader();
52
- Init_camera();
53
-
54
- Init_noise();
38
+ Init_rays_exception();
39
+
40
+ Init_rays_point();
41
+ Init_rays_bounds();
42
+ Init_rays_color();
43
+ Init_rays_color_space();
44
+ Init_rays_matrix();
45
+
46
+ Init_rays_painter();
47
+ Init_rays_polyline();
48
+ Init_rays_polygon_line();
49
+ Init_rays_polygon();
50
+ Init_rays_bitmap();
51
+ Init_rays_image();
52
+ Init_rays_font();
53
+ Init_rays_shader();
54
+ Init_rays_camera();
55
+
56
+ Init_rays_noise();
55
57
 
56
58
  RUCY_CATCH
57
59
  }