rays 0.2.1 → 0.3

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 +99 -32
  3. data/.doc/ext/rays/bounds.cpp +2 -2
  4. data/.doc/ext/rays/camera.cpp +1 -1
  5. data/.doc/ext/rays/color.cpp +2 -2
  6. data/.doc/ext/rays/color_space.cpp +3 -3
  7. data/.doc/ext/rays/font.cpp +4 -3
  8. data/.doc/ext/rays/image.cpp +1 -1
  9. data/.doc/ext/rays/matrix.cpp +4 -4
  10. data/.doc/ext/rays/painter.cpp +1 -1
  11. data/.doc/ext/rays/point.cpp +2 -2
  12. data/.doc/ext/rays/polygon.cpp +3 -3
  13. data/.doc/ext/rays/polyline.cpp +3 -3
  14. data/.doc/ext/rays/rays.cpp +10 -10
  15. data/.doc/ext/rays/shader.cpp +2 -2
  16. data/.github/workflows/release-gem.yml +1 -1
  17. data/.github/workflows/test.yml +3 -0
  18. data/ChangeLog.md +5 -0
  19. data/Rakefile +17 -2
  20. data/VERSION +1 -1
  21. data/ext/rays/bitmap.cpp +99 -32
  22. data/ext/rays/bounds.cpp +2 -2
  23. data/ext/rays/camera.cpp +1 -1
  24. data/ext/rays/color.cpp +2 -2
  25. data/ext/rays/color_space.cpp +3 -3
  26. data/ext/rays/defs.h +2 -0
  27. data/ext/rays/extconf.rb +4 -2
  28. data/ext/rays/font.cpp +4 -3
  29. data/ext/rays/image.cpp +1 -1
  30. data/ext/rays/matrix.cpp +4 -4
  31. data/ext/rays/painter.cpp +1 -1
  32. data/ext/rays/point.cpp +2 -2
  33. data/ext/rays/polygon.cpp +3 -3
  34. data/ext/rays/polyline.cpp +3 -3
  35. data/ext/rays/rays.cpp +10 -10
  36. data/ext/rays/shader.cpp +2 -2
  37. data/include/rays/defs.h +7 -0
  38. data/include/rays/ruby/bitmap.h +2 -2
  39. data/include/rays/ruby/bounds.h +2 -2
  40. data/include/rays/ruby/camera.h +2 -2
  41. data/include/rays/ruby/color.h +2 -2
  42. data/include/rays/ruby/color_space.h +2 -2
  43. data/include/rays/ruby/exception.h +3 -3
  44. data/include/rays/ruby/font.h +2 -2
  45. data/include/rays/ruby/image.h +2 -2
  46. data/include/rays/ruby/matrix.h +2 -2
  47. data/include/rays/ruby/painter.h +2 -2
  48. data/include/rays/ruby/point.h +2 -2
  49. data/include/rays/ruby/polygon.h +2 -2
  50. data/include/rays/ruby/polyline.h +2 -2
  51. data/include/rays/ruby/rays.h +6 -6
  52. data/include/rays/ruby/shader.h +2 -2
  53. data/lib/rays/bitmap.rb +7 -0
  54. data/lib/rays/extension.rb +4 -0
  55. data/rays.gemspec +2 -2
  56. data/src/coord.h +2 -2
  57. data/src/font.cpp +1 -0
  58. data/src/ios/bitmap.mm +23 -30
  59. data/src/ios/font.mm +4 -1
  60. data/src/ios/rays.mm +2 -2
  61. data/src/matrix.h +1 -1
  62. data/src/opengl.h +1 -2
  63. data/src/osx/bitmap.mm +23 -30
  64. data/src/osx/font.mm +4 -1
  65. data/src/osx/rays.mm +2 -2
  66. data/src/painter.cpp +1 -0
  67. data/src/shader.cpp +3 -0
  68. data/src/win32/bitmap.cpp +167 -65
  69. data/src/win32/camera.cpp +119 -0
  70. data/src/win32/font.cpp +179 -40
  71. data/src/win32/gdi.h +1 -1
  72. data/src/win32/opengl.cpp +127 -0
  73. data/src/win32/rays.cpp +16 -9
  74. data/test/helper.rb +2 -0
  75. data/test/test_bitmap.rb +3 -1
  76. data/test/test_image.rb +8 -14
  77. data/test/test_painter.rb +4 -4
  78. metadata +7 -6
  79. data/src/win32/font.h +0 -24
@@ -9,14 +9,14 @@
9
9
  #include <rays/image.h>
10
10
 
11
11
 
12
- RUCY_DECLARE_VALUE_FROM_TO(Rays::Image)
12
+ RUCY_DECLARE_VALUE_FROM_TO(RAYS_EXPORT, Rays::Image)
13
13
 
14
14
 
15
15
  namespace Rays
16
16
  {
17
17
 
18
18
 
19
- Rucy::Class image_class ();
19
+ RAYS_EXPORT Rucy::Class image_class ();
20
20
  // class Rays::Image
21
21
 
22
22
 
@@ -9,14 +9,14 @@
9
9
  #include <rays/matrix.h>
10
10
 
11
11
 
12
- RUCY_DECLARE_VALUE_OR_ARRAY_FROM_TO(Rays::Matrix)
12
+ RUCY_DECLARE_VALUE_OR_ARRAY_FROM_TO(RAYS_EXPORT, Rays::Matrix)
13
13
 
14
14
 
15
15
  namespace Rays
16
16
  {
17
17
 
18
18
 
19
- Rucy::Class matrix_class ();
19
+ RAYS_EXPORT Rucy::Class matrix_class ();
20
20
  // class Rays::Matrix
21
21
 
22
22
 
@@ -9,14 +9,14 @@
9
9
  #include <rays/painter.h>
10
10
 
11
11
 
12
- RUCY_DECLARE_VALUE_FROM_TO(Rays::Painter)
12
+ RUCY_DECLARE_VALUE_FROM_TO(RAYS_EXPORT, Rays::Painter)
13
13
 
14
14
 
15
15
  namespace Rays
16
16
  {
17
17
 
18
18
 
19
- Rucy::Class painter_class ();
19
+ RAYS_EXPORT Rucy::Class painter_class ();
20
20
  // class Rays::Painter
21
21
 
22
22
 
@@ -9,14 +9,14 @@
9
9
  #include <rays/point.h>
10
10
 
11
11
 
12
- RUCY_DECLARE_VALUE_OR_ARRAY_FROM_TO(Rays::Point)
12
+ RUCY_DECLARE_VALUE_OR_ARRAY_FROM_TO(RAYS_EXPORT, Rays::Point)
13
13
 
14
14
 
15
15
  namespace Rays
16
16
  {
17
17
 
18
18
 
19
- Rucy::Class point_class ();
19
+ RAYS_EXPORT Rucy::Class point_class ();
20
20
  // class Rays::Point
21
21
 
22
22
 
@@ -9,14 +9,14 @@
9
9
  #include <rays/polygon.h>
10
10
 
11
11
 
12
- RUCY_DECLARE_VALUE_OR_ARRAY_FROM_TO(Rays::Polygon)
12
+ RUCY_DECLARE_VALUE_OR_ARRAY_FROM_TO(RAYS_EXPORT, Rays::Polygon)
13
13
 
14
14
 
15
15
  namespace Rays
16
16
  {
17
17
 
18
18
 
19
- Rucy::Class polygon_class ();
19
+ RAYS_EXPORT Rucy::Class polygon_class ();
20
20
  // class Rays::Polygon
21
21
 
22
22
 
@@ -9,14 +9,14 @@
9
9
  #include <rays/polyline.h>
10
10
 
11
11
 
12
- RUCY_DECLARE_VALUE_OR_ARRAY_FROM_TO(Rays::Polyline)
12
+ RUCY_DECLARE_VALUE_OR_ARRAY_FROM_TO(RAYS_EXPORT, Rays::Polyline)
13
13
 
14
14
 
15
15
  namespace Rays
16
16
  {
17
17
 
18
18
 
19
- Rucy::Class polyline_class ();
19
+ RAYS_EXPORT Rucy::Class polyline_class ();
20
20
  // class Rays::Polyline
21
21
 
22
22
 
@@ -9,22 +9,22 @@
9
9
  #include <rays/rays.h>
10
10
 
11
11
 
12
- RUCY_DECLARE_CONVERT_TO(Rays::CapType)
12
+ RUCY_DECLARE_CONVERT_TO(RAYS_EXPORT, Rays::CapType)
13
13
 
14
- RUCY_DECLARE_CONVERT_TO(Rays::JoinType)
14
+ RUCY_DECLARE_CONVERT_TO(RAYS_EXPORT, Rays::JoinType)
15
15
 
16
- RUCY_DECLARE_CONVERT_TO(Rays::BlendMode)
16
+ RUCY_DECLARE_CONVERT_TO(RAYS_EXPORT, Rays::BlendMode)
17
17
 
18
- RUCY_DECLARE_CONVERT_TO(Rays::TexCoordMode)
18
+ RUCY_DECLARE_CONVERT_TO(RAYS_EXPORT, Rays::TexCoordMode)
19
19
 
20
- RUCY_DECLARE_CONVERT_TO(Rays::TexCoordWrap)
20
+ RUCY_DECLARE_CONVERT_TO(RAYS_EXPORT, Rays::TexCoordWrap)
21
21
 
22
22
 
23
23
  namespace Rays
24
24
  {
25
25
 
26
26
 
27
- Rucy::Module rays_module ();
27
+ RAYS_EXPORT Rucy::Module rays_module ();
28
28
  // module Rays
29
29
 
30
30
 
@@ -9,14 +9,14 @@
9
9
  #include <rays/shader.h>
10
10
 
11
11
 
12
- RUCY_DECLARE_VALUE_OR_ARRAY_FROM_TO(Rays::Shader)
12
+ RUCY_DECLARE_VALUE_OR_ARRAY_FROM_TO(RAYS_EXPORT, Rays::Shader)
13
13
 
14
14
 
15
15
  namespace Rays
16
16
  {
17
17
 
18
18
 
19
- Rucy::Class shader_class ();
19
+ RAYS_EXPORT Rucy::Class shader_class ();
20
20
  // class Rays::Shader
21
21
 
22
22
 
data/lib/rays/bitmap.rb CHANGED
@@ -16,6 +16,13 @@ module Rays
16
16
  end
17
17
  end
18
18
 
19
+ def pixels()
20
+ case o = pixels!
21
+ when Array then o
22
+ when String then o.unpack 'L*'
23
+ end
24
+ end
25
+
19
26
  def bounds()
20
27
  Bounds.new 0, 0, width, height
21
28
  end
@@ -25,6 +25,10 @@ module Rays
25
25
  root_dir 'lib'
26
26
  end
27
27
 
28
+ def ext_dir()
29
+ root_dir 'ext'
30
+ end
31
+
28
32
  end# Extension
29
33
 
30
34
 
data/rays.gemspec CHANGED
@@ -25,8 +25,8 @@ Gem::Specification.new do |s|
25
25
  s.platform = Gem::Platform::RUBY
26
26
  s.required_ruby_version = '>= 3.0.0'
27
27
 
28
- s.add_runtime_dependency 'xot', '~> 0.2.1'
29
- s.add_runtime_dependency 'rucy', '~> 0.2.1'
28
+ s.add_runtime_dependency 'xot', '~> 0.3'
29
+ s.add_runtime_dependency 'rucy', '~> 0.3'
30
30
 
31
31
  s.files = `git ls-files`.split $/
32
32
  s.executables = s.files.grep(%r{^bin/}) {|f| File.basename f}
data/src/coord.h CHANGED
@@ -13,9 +13,9 @@ namespace Rays
13
13
  {
14
14
 
15
15
 
16
- typedef glm::tvec3<coord, glm::defaultp> Vec3;
16
+ typedef glm::vec<3, coord, glm::defaultp> Vec3;
17
17
 
18
- typedef glm::tvec4<coord, glm::defaultp> Vec4;
18
+ typedef glm::vec<4, coord, glm::defaultp> Vec4;
19
19
 
20
20
 
21
21
  inline Vec3& to_glm ( Coord3& val) {return *( Vec3*) &val;}
data/src/font.cpp CHANGED
@@ -1,6 +1,7 @@
1
1
  #include "font.h"
2
2
 
3
3
 
4
+ #include <string.h>
4
5
  #include <assert.h>
5
6
 
6
7
 
data/src/ios/bitmap.mm CHANGED
@@ -2,7 +2,6 @@
2
2
  #import "bitmap.h"
3
3
 
4
4
 
5
- #include <assert.h>
6
5
  #import <ImageIO/CGImageDestination.h>
7
6
  #import <MobileCoreServices/UTCoreTypes.h>
8
7
  #include "rays/exception.h"
@@ -61,7 +60,7 @@ namespace Rays
61
60
 
62
61
  ColorSpace color_space;
63
62
 
64
- void* pixels = NULL;
63
+ void* pixels = NULL;
65
64
 
66
65
  CGContextRef context = NULL;
67
66
 
@@ -123,37 +122,40 @@ namespace Rays
123
122
 
124
123
  static void
125
124
  setup_bitmap (
126
- Bitmap* this_,
125
+ Bitmap* bitmap,
127
126
  int w, int h, const ColorSpace& cs,
128
- const void* pixels_ = NULL, bool clear_pixels = true)
127
+ const void* pixels = NULL, bool clear_pixels = true)
129
128
  {
130
- if (!this_ || w <= 0 || h <= 0 || !cs)
129
+ if (w <= 0 || h <= 0 || !cs)
131
130
  argument_error(__FILE__, __LINE__);
132
131
 
133
- this_->self->clear();
132
+ Bitmap::Data* self = bitmap->self.get();
134
133
 
135
- this_->self->width = w;
136
- this_->self->height = h;
137
- this_->self->color_space = cs;
138
- this_->self->modified = true;
134
+ self->clear();
135
+
136
+ self->width = w;
137
+ self->height = h;
138
+ self->color_space = cs;
139
+ self->modified = true;
139
140
 
140
141
  size_t size = w * h * cs.Bpp();
141
- this_->self->pixels = new uchar[size];
142
+ self->pixels = new uchar[size];
142
143
 
143
- if (pixels_)
144
- memcpy(this_->self->pixels, pixels_, size);
144
+ if (pixels)
145
+ memcpy(self->pixels, pixels, size);
145
146
  else if (clear_pixels)
146
- memset(this_->self->pixels, 0, size);
147
+ memset(self->pixels, 0, size);
147
148
  }
148
149
 
149
- static void
150
- setup_bitmap (Bitmap* this_, const Texture& tex)
150
+ Bitmap
151
+ Bitmap_from (const Texture& tex)
151
152
  {
152
- if (!this_ || !tex)
153
+ if (!tex)
153
154
  argument_error(__FILE__, __LINE__);
154
155
 
156
+ Bitmap bmp;
155
157
  setup_bitmap(
156
- this_, tex.width(), tex.height(), tex.color_space(), NULL, false);
158
+ &bmp, tex.width(), tex.height(), tex.color_space(), NULL, false);
157
159
 
158
160
  GLenum format, type;
159
161
  ColorSpace_get_gl_format_and_type(&format, &type, tex.color_space());
@@ -161,18 +163,12 @@ namespace Rays
161
163
  FrameBuffer fb(tex);
162
164
  FrameBufferBinder binder(fb.id());
163
165
 
164
- for (int y = 0; y < this_->height(); ++y)
166
+ for (int y = 0; y < bmp.height(); ++y)
165
167
  {
166
- GLvoid* ptr = (GLvoid*) this_->at<uchar>(0, y);
167
- glReadPixels(0, y, this_->width(), 1, format, type, ptr);
168
+ GLvoid* ptr = (GLvoid*) bmp.at<uchar>(0, y);
169
+ glReadPixels(0, y, bmp.width(), 1, format, type, ptr);
168
170
  }
169
- }
170
171
 
171
- Bitmap
172
- Bitmap_from (const Texture& texture)
173
- {
174
- Bitmap bmp;
175
- setup_bitmap(&bmp, texture);
176
172
  return bmp;
177
173
  }
178
174
 
@@ -207,15 +203,12 @@ namespace Rays
207
203
  if (*str == '\0') return;
208
204
 
209
205
  font.draw_string(bitmap->self->get_context(), bitmap->height(), str, x, y);
210
-
211
206
  Bitmap_set_modified(bitmap);
212
207
  }
213
208
 
214
209
  void
215
210
  Bitmap_set_modified (Bitmap* bitmap, bool modified)
216
211
  {
217
- assert(bitmap);
218
-
219
212
  bitmap->self->modified = modified;
220
213
  }
221
214
 
data/src/ios/font.mm CHANGED
@@ -152,11 +152,14 @@ namespace Rays
152
152
  {
153
153
  CGContextRef context = (CGContextRef) context_;
154
154
 
155
- if (!*this || !context || !str)
155
+ if (!context || !str)
156
156
  argument_error(__FILE__, __LINE__);
157
157
 
158
158
  if (*str == '\0') return;
159
159
 
160
+ if (!*this)
161
+ invalid_state_error(__FILE__, __LINE__);
162
+
160
163
  CTLinePtr line = make_line(self->font, str);
161
164
  if (!line)
162
165
  rays_error(__FILE__, __LINE__, "creating CTLineRef failed.");
data/src/ios/rays.mm CHANGED
@@ -25,7 +25,7 @@ namespace Rays
25
25
  init ()
26
26
  {
27
27
  if (global::pool)
28
- rays_error(__FILE__, __LINE__, "Rays::init(): already initialized.");
28
+ rays_error(__FILE__, __LINE__, "already initialized.");
29
29
 
30
30
  global::pool = [[NSAutoreleasePool alloc] init];
31
31
 
@@ -36,7 +36,7 @@ namespace Rays
36
36
  fin ()
37
37
  {
38
38
  if (!global::pool)
39
- rays_error(__FILE__, __LINE__, "Rays::fin(): not initialized.");
39
+ rays_error(__FILE__, __LINE__, "not initialized.");
40
40
 
41
41
  OpenGL_fin();
42
42
 
data/src/matrix.h CHANGED
@@ -12,7 +12,7 @@ namespace Rays
12
12
  {
13
13
 
14
14
 
15
- typedef glm::tmat4x4<coord> Mat4;
15
+ typedef glm::mat<4, 4, coord> Mat4;
16
16
 
17
17
 
18
18
  inline Mat4& to_glm ( Matrix& val) {return *( Mat4*) &val;}
data/src/opengl.h CHANGED
@@ -11,8 +11,7 @@
11
11
  #include <OpenGLES/ES3/gl.h>
12
12
  #include <OpenGLES/ES3/glext.h>
13
13
  #elif defined(WIN32)
14
- #include <GL/gl.h>
15
- #include <GL/glext.h>
14
+ #include <GL/glew.h>
16
15
  #endif
17
16
 
18
17
  #include "rays/defs.h"
data/src/osx/bitmap.mm CHANGED
@@ -2,7 +2,6 @@
2
2
  #import "bitmap.h"
3
3
 
4
4
 
5
- #include <assert.h>
6
5
  #import <Cocoa/Cocoa.h>
7
6
  #include "rays/exception.h"
8
7
  #include "../color_space.h"
@@ -60,7 +59,7 @@ namespace Rays
60
59
 
61
60
  ColorSpace color_space;
62
61
 
63
- void* pixels = NULL;
62
+ void* pixels = NULL;
64
63
 
65
64
  CGContextRef context = NULL;
66
65
 
@@ -122,37 +121,40 @@ namespace Rays
122
121
 
123
122
  static void
124
123
  setup_bitmap (
125
- Bitmap* this_,
124
+ Bitmap* bitmap,
126
125
  int w, int h, const ColorSpace& cs,
127
- const void* pixels_ = NULL, bool clear_pixels = true)
126
+ const void* pixels = NULL, bool clear_pixels = true)
128
127
  {
129
- if (!this_ || w <= 0 || h <= 0 || !cs)
128
+ if (w <= 0 || h <= 0 || !cs)
130
129
  argument_error(__FILE__, __LINE__);
131
130
 
132
- this_->self->clear();
131
+ Bitmap::Data* self = bitmap->self.get();
133
132
 
134
- this_->self->width = w;
135
- this_->self->height = h;
136
- this_->self->color_space = cs;
137
- this_->self->modified = true;
133
+ self->clear();
134
+
135
+ self->width = w;
136
+ self->height = h;
137
+ self->color_space = cs;
138
+ self->modified = true;
138
139
 
139
140
  size_t size = w * h * cs.Bpp();
140
- this_->self->pixels = new uchar[size];
141
+ self->pixels = new uchar[size];
141
142
 
142
- if (pixels_)
143
- memcpy(this_->self->pixels, pixels_, size);
143
+ if (pixels)
144
+ memcpy(self->pixels, pixels, size);
144
145
  else if (clear_pixels)
145
- memset(this_->self->pixels, 0, size);
146
+ memset(self->pixels, 0, size);
146
147
  }
147
148
 
148
- static void
149
- setup_bitmap (Bitmap* this_, const Texture& tex)
149
+ Bitmap
150
+ Bitmap_from (const Texture& tex)
150
151
  {
151
- if (!this_ || !tex)
152
+ if (!tex)
152
153
  argument_error(__FILE__, __LINE__);
153
154
 
155
+ Bitmap bmp;
154
156
  setup_bitmap(
155
- this_, tex.width(), tex.height(), tex.color_space(), NULL, false);
157
+ &bmp, tex.width(), tex.height(), tex.color_space(), NULL, false);
156
158
 
157
159
  GLenum format, type;
158
160
  ColorSpace_get_gl_format_and_type(&format, &type, tex.color_space());
@@ -160,18 +162,12 @@ namespace Rays
160
162
  FrameBuffer fb(tex);
161
163
  FrameBufferBinder binder(fb.id());
162
164
 
163
- for (int y = 0; y < this_->height(); ++y)
165
+ for (int y = 0; y < bmp.height(); ++y)
164
166
  {
165
- GLvoid* ptr = (GLvoid*) this_->at<uchar>(0, y);
166
- glReadPixels(0, y, this_->width(), 1, format, type, ptr);
167
+ GLvoid* ptr = (GLvoid*) bmp.at<uchar>(0, y);
168
+ glReadPixels(0, y, bmp.width(), 1, format, type, ptr);
167
169
  }
168
- }
169
170
 
170
- Bitmap
171
- Bitmap_from (const Texture& texture)
172
- {
173
- Bitmap bmp;
174
- setup_bitmap(&bmp, texture);
175
171
  return bmp;
176
172
  }
177
173
 
@@ -206,15 +202,12 @@ namespace Rays
206
202
  if (*str == '\0') return;
207
203
 
208
204
  font.draw_string(bitmap->self->get_context(), bitmap->height(), str, x, y);
209
-
210
205
  Bitmap_set_modified(bitmap);
211
206
  }
212
207
 
213
208
  void
214
209
  Bitmap_set_modified (Bitmap* bitmap, bool modified)
215
210
  {
216
- assert(bitmap);
217
-
218
211
  bitmap->self->modified = modified;
219
212
  }
220
213
 
data/src/osx/font.mm CHANGED
@@ -154,11 +154,14 @@ namespace Rays
154
154
  {
155
155
  CGContextRef context = (CGContextRef) context_;
156
156
 
157
- if (!*this || !context || !str)
157
+ if (!context || !str)
158
158
  argument_error(__FILE__, __LINE__);
159
159
 
160
160
  if (*str == '\0') return;
161
161
 
162
+ if (!*this)
163
+ invalid_state_error(__FILE__, __LINE__);
164
+
162
165
  CTLinePtr line = make_line(self->font, str);
163
166
  if (!line)
164
167
  rays_error(__FILE__, __LINE__, "creating CTLineRef failed.");
data/src/osx/rays.mm CHANGED
@@ -25,7 +25,7 @@ namespace Rays
25
25
  init ()
26
26
  {
27
27
  if (global::pool)
28
- rays_error(__FILE__, __LINE__, "Rays::init(): already initialized.");
28
+ rays_error(__FILE__, __LINE__, "already initialized.");
29
29
 
30
30
  global::pool = [[NSAutoreleasePool alloc] init];
31
31
 
@@ -36,7 +36,7 @@ namespace Rays
36
36
  fin ()
37
37
  {
38
38
  if (!global::pool)
39
- rays_error(__FILE__, __LINE__, "Rays::fin(): not initialized.");
39
+ rays_error(__FILE__, __LINE__, "not initialized.");
40
40
 
41
41
  OpenGL_fin();
42
42
 
data/src/painter.cpp CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
 
4
4
  #include <math.h>
5
+ #include <string.h>
5
6
  #include <assert.h>
6
7
  #include <memory>
7
8
  #include <vector>
data/src/shader.cpp CHANGED
@@ -156,6 +156,9 @@ namespace Rays
156
156
  // restore premultiplied rgb values
157
157
  " vec3 rgb__ = col__.a != 0.0 ? col__.rgb / col__.a : col__.rgb;\n"
158
158
  " gl_FragColor = " + V_COLOR + " * vec4(rgb__, col__.a);\n"
159
+ #elif defined(WIN32)
160
+ " float a__ = (col__.r + col__.g + col__.b) / 3.0;\n"
161
+ " gl_FragColor = " + V_COLOR + " * vec4(1.0, 1.0, 1.0, a__);\n"
159
162
  #else
160
163
  " gl_FragColor = " + V_COLOR + " * col__;\n"
161
164
  #endif