rays 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. checksums.yaml +7 -0
  2. data/.doc/ext/rays/bitmap.cpp +70 -233
  3. data/.doc/ext/rays/bounds.cpp +339 -57
  4. data/.doc/ext/rays/color.cpp +58 -48
  5. data/.doc/ext/rays/color_space.cpp +174 -0
  6. data/.doc/ext/rays/font.cpp +31 -53
  7. data/.doc/ext/rays/image.cpp +64 -67
  8. data/.doc/ext/rays/matrix.cpp +22 -50
  9. data/.doc/ext/rays/native.cpp +9 -2
  10. data/.doc/ext/rays/painter.cpp +276 -259
  11. data/.doc/ext/rays/point.cpp +186 -52
  12. data/.doc/ext/rays/rays.cpp +25 -20
  13. data/.doc/ext/rays/shader.cpp +61 -0
  14. data/.doc/ext/rays/texture.cpp +47 -59
  15. data/{README → README.md} +0 -0
  16. data/Rakefile +6 -5
  17. data/VERSION +1 -1
  18. data/ext/rays/bitmap.cpp +88 -248
  19. data/ext/rays/bounds.cpp +437 -141
  20. data/ext/rays/color.cpp +79 -69
  21. data/ext/rays/color_space.cpp +185 -0
  22. data/ext/rays/extconf.rb +14 -63
  23. data/ext/rays/font.cpp +44 -65
  24. data/ext/rays/image.cpp +82 -81
  25. data/ext/rays/matrix.cpp +32 -60
  26. data/ext/rays/native.cpp +9 -2
  27. data/ext/rays/painter.cpp +345 -321
  28. data/ext/rays/point.cpp +212 -69
  29. data/ext/rays/rays.cpp +29 -23
  30. data/ext/rays/shader.cpp +63 -0
  31. data/ext/rays/texture.cpp +64 -74
  32. data/include/rays/bitmap.h +21 -12
  33. data/include/rays/bounds.h +67 -9
  34. data/include/rays/color.h +23 -7
  35. data/include/rays/{colorspace.h → color_space.h} +6 -3
  36. data/include/rays/exception.h +17 -11
  37. data/include/rays/font.h +4 -3
  38. data/include/rays/image.h +11 -6
  39. data/include/rays/matrix.h +15 -12
  40. data/include/rays/opengl.h +54 -1
  41. data/include/rays/painter.h +98 -108
  42. data/include/rays/point.h +45 -5
  43. data/include/rays/rays.h +2 -2
  44. data/include/rays/ruby/bitmap.h +2 -16
  45. data/include/rays/ruby/bounds.h +4 -16
  46. data/include/rays/ruby/color.h +3 -16
  47. data/include/rays/ruby/color_space.h +27 -0
  48. data/include/rays/ruby/font.h +2 -16
  49. data/include/rays/ruby/image.h +2 -16
  50. data/include/rays/ruby/matrix.h +2 -16
  51. data/include/rays/ruby/painter.h +2 -16
  52. data/include/rays/ruby/point.h +3 -16
  53. data/include/rays/ruby/shader.h +27 -0
  54. data/include/rays/ruby/texture.h +2 -16
  55. data/include/rays/ruby.h +1 -0
  56. data/include/rays/shader.h +48 -0
  57. data/include/rays/texture.h +13 -2
  58. data/include/rays.h +2 -1
  59. data/lib/rays/bitmap.rb +20 -11
  60. data/lib/rays/bounds.rb +29 -68
  61. data/lib/rays/color.rb +39 -0
  62. data/lib/rays/color_space.rb +33 -0
  63. data/lib/rays/font.rb +29 -0
  64. data/lib/rays/image.rb +22 -0
  65. data/lib/rays/module.rb +11 -7
  66. data/lib/rays/painter.rb +103 -40
  67. data/lib/rays/point.rb +19 -36
  68. data/lib/rays/shader.rb +13 -0
  69. data/lib/rays/texture.rb +9 -0
  70. data/lib/rays.rb +4 -0
  71. data/rays.gemspec +3 -4
  72. data/src/bounds.cpp +272 -63
  73. data/src/color.cpp +168 -21
  74. data/src/{colorspace.cpp → color_space.cpp} +38 -1
  75. data/src/exception.cpp +24 -15
  76. data/src/frame_buffer.cpp +275 -0
  77. data/src/frame_buffer.h +79 -0
  78. data/src/image.cpp +80 -36
  79. data/src/ios/bitmap.mm +340 -0
  80. data/src/ios/font.mm +206 -0
  81. data/src/{cocoa → ios}/helper.h +2 -2
  82. data/src/{cocoa → ios}/helper.mm +0 -0
  83. data/src/ios/opengl.mm +21 -0
  84. data/src/ios/program.cpp +122 -0
  85. data/src/{cocoa → ios}/rays.mm +8 -7
  86. data/src/matrix.cpp +10 -22
  87. data/src/opengl.cpp +64 -0
  88. data/src/{cocoa → osx}/bitmap.mm +121 -70
  89. data/src/{cocoa → osx}/font.mm +32 -24
  90. data/src/osx/helper.h +26 -0
  91. data/src/osx/helper.mm +25 -0
  92. data/src/osx/opengl.mm +103 -0
  93. data/src/osx/rays.mm +43 -0
  94. data/src/painter.cpp +596 -422
  95. data/src/point.cpp +154 -11
  96. data/src/program.cpp +513 -0
  97. data/src/program.h +73 -0
  98. data/src/render_buffer.cpp +120 -0
  99. data/src/render_buffer.h +47 -0
  100. data/src/shader.cpp +117 -0
  101. data/src/texture.cpp +104 -134
  102. data/test/helper.rb +10 -3
  103. data/test/test_bitmap.rb +18 -0
  104. data/test/test_bounds.rb +81 -35
  105. data/test/test_color.rb +29 -2
  106. data/test/test_image.rb +63 -0
  107. data/test/test_painter.rb +120 -0
  108. data/test/test_point.rb +30 -9
  109. data/test/test_shader.rb +37 -0
  110. data/test/test_texture.rb +18 -0
  111. metadata +75 -58
  112. data/.gitignore +0 -14
  113. data/ChangeLog +0 -8
data/src/ios/bitmap.mm ADDED
@@ -0,0 +1,340 @@
1
+ // -*- objc -*-
2
+ #import "rays/bitmap.h"
3
+
4
+
5
+ #include <assert.h>
6
+ #include <boost/scoped_array.hpp>
7
+ #import <ImageIO/ImageIO.h>
8
+ #import <MobileCoreServices/UTCoreTypes.h>
9
+ #include "rays/exception.h"
10
+ #include "rays/texture.h"
11
+ #include "../frame_buffer.h"
12
+ #include "helper.h"
13
+
14
+
15
+ namespace Rays
16
+ {
17
+
18
+
19
+ static CGBitmapInfo
20
+ make_bitmapinfo (const ColorSpace& cs)
21
+ {
22
+ // Q: What color spaces does CGBitmapContextCreate support?
23
+ // http://developer.apple.com/library/mac/#qa/qa1037/_index.html
24
+
25
+ CGBitmapInfo info = 0;
26
+
27
+ if (cs.is_alpha_first())
28
+ {
29
+ info |= cs.is_premult()
30
+ ? kCGImageAlphaPremultipliedFirst
31
+ : kCGImageAlphaFirst;
32
+ }
33
+ else if (cs.is_alpha_last())
34
+ {
35
+ info |= cs.is_premult()
36
+ ? kCGImageAlphaPremultipliedLast
37
+ : kCGImageAlphaLast;
38
+ }
39
+ else if (cs.is_skip_first())
40
+ info |= kCGImageAlphaNoneSkipFirst;
41
+ else if (cs.is_skip_last())
42
+ info |= kCGImageAlphaNoneSkipLast;
43
+ else
44
+ info |= kCGImageAlphaNone;
45
+
46
+ if (cs.is_rgb()) info |= kCGBitmapByteOrder32Big;
47
+ else if (cs.is_bgr()) info |= kCGBitmapByteOrder32Little;
48
+ else return false;
49
+
50
+ if (cs.is_float()) info |= kCGBitmapFloatComponents;
51
+
52
+ return info;
53
+ }
54
+
55
+
56
+ struct Bitmap::Data
57
+ {
58
+
59
+ int width, height;
60
+
61
+ ColorSpace color_space;
62
+
63
+ void* pixels;
64
+
65
+ CGContextRef context;
66
+
67
+ bool dirty;
68
+
69
+ Data ()
70
+ : pixels(NULL), context(NULL)
71
+ {
72
+ clear();
73
+ }
74
+
75
+ ~Data ()
76
+ {
77
+ clear();
78
+ }
79
+
80
+ CGContextRef get_context ()
81
+ {
82
+ if (context) return context;
83
+
84
+ int bpc = color_space.bpc();
85
+ int pitch = width * color_space.Bpp();
86
+ if (bpc <= 0 || pitch <= 0) return NULL;
87
+
88
+ CGColorSpaceRef cgcs = NULL;
89
+ if (color_space.is_gray())
90
+ cgcs = CGColorSpaceCreateDeviceGray();
91
+ else if (color_space.is_rgb() || color_space.is_bgr())
92
+ cgcs = CGColorSpaceCreateDeviceRGB();
93
+ else
94
+ return NULL;
95
+
96
+ context = CGBitmapContextCreate(
97
+ pixels, width, height, bpc, pitch, cgcs, make_bitmapinfo(color_space));
98
+ CGColorSpaceRelease(cgcs);
99
+ return context;
100
+ }
101
+
102
+ CGImageRef get_image ()
103
+ {
104
+ CGContextRef c = get_context();
105
+ if (!c) return NULL;
106
+ return CGBitmapContextCreateImage(c);
107
+ }
108
+
109
+ void clear ()
110
+ {
111
+ if (context) CGContextRelease(context);
112
+ if (pixels) delete [] (uchar*) pixels;
113
+
114
+ width = height = 0;
115
+ color_space = COLORSPACE_UNKNOWN;
116
+ pixels = NULL;
117
+ context = NULL;
118
+ dirty = false;
119
+ }
120
+
121
+ };// Bitmap::Data
122
+
123
+
124
+ static void
125
+ setup_bitmap (
126
+ Bitmap* this_,
127
+ int w, int h, const ColorSpace& cs,
128
+ const void* pixels_ = NULL, bool clear_pixels = true)
129
+ {
130
+ if (!this_ || w <= 0 || h <= 0 || !cs)
131
+ argument_error(__FILE__, __LINE__);
132
+
133
+ this_->self->clear();
134
+
135
+ this_->self->width = w;
136
+ this_->self->height = h;
137
+ this_->self->color_space = cs;
138
+ this_->self->dirty = true;
139
+
140
+ size_t size = w * h * cs.Bpp();
141
+ this_->self->pixels = new uchar[size];
142
+
143
+ if (pixels_)
144
+ memcpy(this_->self->pixels, pixels_, size);
145
+ else if (clear_pixels)
146
+ memset(this_->self->pixels, 0, size);
147
+ }
148
+
149
+ static void
150
+ setup_bitmap (Bitmap* this_, const Texture& tex)
151
+ {
152
+ if (!this_ || !tex)
153
+ argument_error(__FILE__, __LINE__);
154
+
155
+ setup_bitmap(this_, tex.width(), tex.height(), tex.color_space(), NULL, false);
156
+
157
+ GLenum format, type;
158
+ tex.color_space().get_gl_enums(&format, &type, tex.alpha_only());
159
+
160
+ FrameBuffer fb(tex);
161
+ FrameBufferBinder binder(fb.id());
162
+
163
+ for (int y = 0; y < this_->height(); ++y)
164
+ glReadPixels(0, y, this_->width(), 1, format, type, (GLvoid*) this_->at<uchar>(0, y));
165
+ }
166
+
167
+
168
+ Bitmap::Bitmap ()
169
+ {
170
+ }
171
+
172
+ Bitmap::Bitmap (
173
+ int width, int height, const ColorSpace& color_space, const void* pixels)
174
+ {
175
+ setup_bitmap(this, width, height, color_space, pixels);
176
+ }
177
+
178
+ Bitmap::Bitmap (const Texture& texture)
179
+ {
180
+ setup_bitmap(this, texture);
181
+ }
182
+
183
+ Bitmap::~Bitmap ()
184
+ {
185
+ }
186
+
187
+ Bitmap
188
+ Bitmap::copy () const
189
+ {
190
+ return Bitmap(width(), height(), color_space(), pixels());
191
+ }
192
+
193
+ int
194
+ Bitmap::width () const
195
+ {
196
+ if (!*this) return 0;
197
+ return self->width;
198
+ }
199
+
200
+ int
201
+ Bitmap::height () const
202
+ {
203
+ if (!*this) return 0;
204
+ return self->height;
205
+ }
206
+
207
+ const ColorSpace&
208
+ Bitmap::color_space () const
209
+ {
210
+ if (!*this)
211
+ {
212
+ static const ColorSpace UNKNOWN = COLORSPACE_UNKNOWN;
213
+ return UNKNOWN;
214
+ }
215
+ return self->color_space;
216
+ }
217
+
218
+ int
219
+ Bitmap::pitch () const
220
+ {
221
+ return width() * self->color_space.Bpp();
222
+ }
223
+
224
+ size_t
225
+ Bitmap::size () const
226
+ {
227
+ return pitch() * height();
228
+ }
229
+
230
+ void*
231
+ Bitmap::pixels ()
232
+ {
233
+ if (!*this) return NULL;
234
+ return self->pixels;
235
+ }
236
+
237
+ const void*
238
+ Bitmap::pixels () const
239
+ {
240
+ return const_cast<This*>(this)->pixels();
241
+ }
242
+
243
+ bool
244
+ Bitmap::dirty () const
245
+ {
246
+ return self->dirty;
247
+ }
248
+
249
+ void
250
+ Bitmap::set_dirty (bool b)
251
+ {
252
+ self->dirty = b;
253
+ }
254
+
255
+ Bitmap::operator bool () const
256
+ {
257
+ return
258
+ self->width > 0 && self->height > 0 && self->color_space && self->pixels;
259
+ }
260
+
261
+ bool
262
+ Bitmap::operator ! () const
263
+ {
264
+ return !operator bool();
265
+ }
266
+
267
+
268
+ Bitmap
269
+ load_bitmap (const char* path_)
270
+ {
271
+ if (!path_ || path_[0] == '\0')
272
+ argument_error(__FILE__, __LINE__);
273
+
274
+ NSString* path = [NSString stringWithUTF8String: path_];
275
+ UIImage* uiimage = [UIImage imageWithContentsOfFile: path];
276
+ if (!uiimage)
277
+ rays_error(__FILE__, __LINE__, "[UIImage imageWithContentsOfFile:] failed.");
278
+
279
+ CGImageRef image = [uiimage CGImage];
280
+ if (!image)
281
+ rays_error(__FILE__, __LINE__, "[imagerep CGImage] failed.");
282
+
283
+ size_t width = CGImageGetWidth(image);
284
+ size_t height = CGImageGetHeight(image);
285
+
286
+ Bitmap bmp((int) width, (int) height, RGBA);
287
+ if (!bmp)
288
+ rays_error(__FILE__, __LINE__, "invalid bitmap.");
289
+
290
+ CGContextRef context = bmp.self->get_context();
291
+ if (!context)
292
+ rays_error(__FILE__, __LINE__, "creating CGContext failed.");
293
+
294
+ CGContextDrawImage(context, CGRectMake(0, 0, width, height), image);
295
+ return bmp;
296
+ }
297
+
298
+ void
299
+ save_bitmap (const Bitmap& bmp, const char* path_)
300
+ {
301
+ boost::shared_ptr<CGImage> img(
302
+ bmp.self->get_image(), CGImageRelease);
303
+ if (!img)
304
+ rays_error(__FILE__, __LINE__, "getting CGImage failed.");
305
+
306
+ NSString* path = [NSString stringWithUTF8String: path_];
307
+ NSURL* url = [NSURL fileURLWithPath: path];
308
+ if (!url)
309
+ rays_error(__FILE__, __LINE__, "creating NSURL failed.");
310
+
311
+ boost::shared_ptr<CGImageDestination> dest(
312
+ CGImageDestinationCreateWithURL((CFURLRef) url, kUTTypePNG, 1, NULL),
313
+ safe_cfrelease);
314
+ if (!dest)
315
+ rays_error(__FILE__, __LINE__, "CGImageDestinationCreateWithURL() failed.");
316
+
317
+ CGImageDestinationAddImage(dest.get(), img.get(), NULL);
318
+ if (!CGImageDestinationFinalize(dest.get()))
319
+ rays_error(__FILE__, __LINE__, "CGImageDestinationFinalize() failed.");
320
+ }
321
+
322
+
323
+ void draw_string (
324
+ CGContextRef, coord, const char*, coord, coord, const Font&);
325
+
326
+ void
327
+ draw_string (
328
+ Bitmap* bmp, const char* str, coord x, coord y, const Font& font)
329
+ {
330
+ if (!bmp || !*bmp || !str || !font)
331
+ argument_error(__FILE__, __LINE__);
332
+
333
+ if (*str == '\0') return;
334
+
335
+ draw_string(bmp->self->get_context(), bmp->height(), str, x, y, font);
336
+ bmp->set_dirty();
337
+ }
338
+
339
+
340
+ }// Rays
data/src/ios/font.mm ADDED
@@ -0,0 +1,206 @@
1
+ // -*- objc -*-
2
+ #include "rays/font.h"
3
+
4
+
5
+ #import <CoreText/CoreText.h>
6
+ #include "rays/exception.h"
7
+ #include "helper.h"
8
+
9
+
10
+ namespace Rays
11
+ {
12
+
13
+
14
+ struct Font::Data
15
+ {
16
+
17
+ CTFontRef font;
18
+
19
+ Data ()
20
+ : font(NULL)
21
+ {
22
+ }
23
+
24
+ ~Data ()
25
+ {
26
+ if (font)
27
+ {
28
+ CFRelease(font);
29
+ font = NULL;
30
+ }
31
+ }
32
+
33
+ };// Font::Data
34
+
35
+
36
+ static CTLineRef
37
+ make_line (CTFontRef font, const char* str)
38
+ {
39
+ if (!font || !str || *str == '\0')
40
+ return NULL;
41
+
42
+ CFStringRef keys[] = {
43
+ kCTFontAttributeName,
44
+ kCTForegroundColorFromContextAttributeName
45
+ };
46
+ CFTypeRef values[] = {
47
+ font,
48
+ kCFBooleanTrue
49
+ };
50
+ size_t nkeys = sizeof(keys) / sizeof(keys[0]);
51
+
52
+ CFDictionaryRef attr = CFDictionaryCreate(
53
+ NULL, (const void**) &keys, (const void**) &values, nkeys,
54
+ &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
55
+
56
+ CFAttributedStringRef attrstr = CFAttributedStringCreate(
57
+ NULL, cfstring(str).get(), attr);
58
+ CFRelease(attr);
59
+
60
+ CTLineRef line = CTLineCreateWithAttributedString(attrstr);
61
+ CFRelease(attrstr);
62
+
63
+ return line;
64
+ }
65
+
66
+
67
+ Font::Font ()
68
+ {
69
+ }
70
+
71
+ Font::Font (const char* name, coord size)
72
+ {
73
+ self->font = name
74
+ ? CTFontCreateWithName(cfstring(name).get(), size, NULL)
75
+ : CTFontCreateUIFontForLanguage(kCTFontSystemFontType, size, NULL);
76
+ }
77
+
78
+ Font::~Font ()
79
+ {
80
+ }
81
+
82
+ Font
83
+ Font::copy () const
84
+ {
85
+ return Font(name(), size());
86
+ }
87
+
88
+ String
89
+ Font::name () const
90
+ {
91
+ if (!*this) return "";
92
+
93
+ CFStringRef str = CTFontCopyFullName(self->font);
94
+
95
+ enum {BUFSIZE = 2048};
96
+ char buf[BUFSIZE + 1];
97
+ if (!CFStringGetCString(str, buf, BUFSIZE, kCFStringEncodingUTF8))
98
+ buf[0] = '\0';
99
+
100
+ CFRelease(str);
101
+ return buf;
102
+ }
103
+
104
+ coord
105
+ Font::size () const
106
+ {
107
+ if (!*this) return 0;
108
+ return CTFontGetSize(self->font);
109
+ }
110
+
111
+ coord
112
+ Font::get_width (const char* str) const
113
+ {
114
+ if (!str)
115
+ argument_error(__FILE__, __LINE__);
116
+
117
+ if (!*this)
118
+ invalid_state_error(__FILE__, __LINE__);
119
+
120
+ if (*str == '\0') return 0;
121
+
122
+ CTLineRef line = make_line(self->font, str);
123
+ if (!line)
124
+ rays_error(__FILE__, __LINE__, "creating CTLineRef failed.");
125
+
126
+ coord w = CTLineGetTypographicBounds(line, NULL, NULL, NULL);
127
+ CFRelease(line);
128
+
129
+ return w;
130
+ }
131
+
132
+ coord
133
+ Font::get_height (coord* ascent, coord* descent, coord* leading) const
134
+ {
135
+ if (!*this)
136
+ invalid_state_error(__FILE__, __LINE__);
137
+
138
+ CGFloat asc = CTFontGetAscent(self->font);
139
+ CGFloat desc = CTFontGetDescent(self->font);
140
+ CGFloat lead = CTFontGetLeading(self->font);
141
+
142
+ if (ascent) *ascent = asc;
143
+ if (descent) *descent = desc;
144
+ if (leading) *leading = lead;
145
+
146
+ return asc + desc + lead;
147
+ }
148
+
149
+ Font::operator bool () const
150
+ {
151
+ return !!self->font;
152
+ }
153
+
154
+ bool
155
+ Font::operator ! () const
156
+ {
157
+ return !operator bool();
158
+ }
159
+
160
+
161
+ const Font&
162
+ default_font ()
163
+ {
164
+ static const Font FONT(NULL);
165
+ return FONT;
166
+ }
167
+
168
+
169
+ void
170
+ draw_string (
171
+ CGContextRef context, coord context_height,
172
+ const char* str, coord x, coord y, const Font& font)
173
+ {
174
+ if (!context || !str || !font)
175
+ argument_error(__FILE__, __LINE__);
176
+
177
+ if (*str == '\0') return;
178
+
179
+ CTLineRef line = make_line(font.self->font, str);
180
+ if (!line)
181
+ rays_error(__FILE__, __LINE__, "creating CTLineRef failed.");
182
+
183
+ coord width = 0, height = 0, ascent = 0;
184
+ width = font.get_width(str);
185
+ height = font.get_height(&ascent);
186
+
187
+ height = ceil(height);
188
+ ascent = floor(ascent);
189
+
190
+ CGRect rect = CGRectMake(x, context_height - height - y, width, height);
191
+ CGContextClearRect(context, rect);
192
+ //CGContextSetRGBFillColor(context, 0, 0, 0, 1);
193
+ //CGContextFillRect(context, rect);
194
+ CGContextSetRGBFillColor(context, 1, 1, 1, 1);
195
+
196
+ CGContextSaveGState(context);
197
+ CGContextSetTextMatrix(context, CGAffineTransformIdentity);
198
+ CGContextSetTextPosition(context, x, context_height - ascent - y);
199
+ CTLineDraw(line, context);
200
+ CGContextRestoreGState(context);
201
+
202
+ CFRelease(line);
203
+ }
204
+
205
+
206
+ }// Rays
@@ -1,7 +1,7 @@
1
1
  // -*- c++ -*-
2
2
  #pragma once
3
- #ifndef __RAYS_COCOA_HELPER_H__
4
- #define __RAYS_COCOA_HELPER_H__
3
+ #ifndef __RAYS_OSX_HELPER_H__
4
+ #define __RAYS_OSX_HELPER_H__
5
5
 
6
6
 
7
7
  #include <boost/shared_ptr.hpp>
File without changes
data/src/ios/opengl.mm ADDED
@@ -0,0 +1,21 @@
1
+ // -*- objc -*-
2
+ #include "rays/opengl.h"
3
+
4
+
5
+ #include <vector>
6
+ #import <OpenGLES/EAGL.h>
7
+
8
+
9
+ namespace Rays
10
+ {
11
+
12
+
13
+ void
14
+ init_offscreen_context ()
15
+ {
16
+ EAGLContext* c = [[EAGLContext alloc] initWithAPI: kEAGLRenderingAPIOpenGLES1];
17
+ [EAGLContext setCurrentContext: c];
18
+ }
19
+
20
+
21
+ }// Rays
@@ -0,0 +1,122 @@
1
+ #include "program.h"
2
+
3
+
4
+ #include "rays/exception.h"
5
+
6
+
7
+ namespace Rays
8
+ {
9
+
10
+
11
+ struct Program::Data {};
12
+
13
+
14
+ Program::Program ()
15
+ {
16
+ }
17
+
18
+ Program::~Program ()
19
+ {
20
+ }
21
+
22
+ void
23
+ Program::attach (const Shader& shader)
24
+ {
25
+ not_implemented_error(__FILE__, __LINE__);
26
+ }
27
+
28
+ void
29
+ Program::detach (const Shader& shader)
30
+ {
31
+ not_implemented_error(__FILE__, __LINE__);
32
+ }
33
+
34
+ void
35
+ Program::set_uniform (const char* name, int arg1)
36
+ {
37
+ not_implemented_error(__FILE__, __LINE__);
38
+ }
39
+
40
+ void
41
+ Program::set_uniform (const char* name, int arg1, int arg2)
42
+ {
43
+ not_implemented_error(__FILE__, __LINE__);
44
+ }
45
+
46
+ void
47
+ Program::set_uniform (const char* name, int arg1, int arg2, int arg3)
48
+ {
49
+ not_implemented_error(__FILE__, __LINE__);
50
+ }
51
+
52
+ void
53
+ Program::set_uniform (const char* name, int arg1, int arg2, int arg3, int arg4)
54
+ {
55
+ not_implemented_error(__FILE__, __LINE__);
56
+ }
57
+
58
+ void
59
+ Program::set_uniform (const char* name, const int* args, size_t size)
60
+ {
61
+ not_implemented_error(__FILE__, __LINE__);
62
+ }
63
+
64
+ void
65
+ Program::set_uniform (const char* name, float arg1)
66
+ {
67
+ not_implemented_error(__FILE__, __LINE__);
68
+ }
69
+
70
+ void
71
+ Program::set_uniform (const char* name, float arg1, float arg2)
72
+ {
73
+ not_implemented_error(__FILE__, __LINE__);
74
+ }
75
+
76
+ void
77
+ Program::set_uniform (const char* name, float arg1, float arg2, float arg3)
78
+ {
79
+ not_implemented_error(__FILE__, __LINE__);
80
+ }
81
+
82
+ void
83
+ Program::set_uniform (const char* name, float arg1, float arg2, float arg3, float arg4)
84
+ {
85
+ not_implemented_error(__FILE__, __LINE__);
86
+ }
87
+
88
+ void
89
+ Program::set_uniform (const char* name, const float* args, size_t size)
90
+ {
91
+ not_implemented_error(__FILE__, __LINE__);
92
+ }
93
+
94
+ void
95
+ Program::push ()
96
+ {
97
+ }
98
+
99
+ void
100
+ Program::pop ()
101
+ {
102
+ }
103
+
104
+ GLuint
105
+ Program::id () const
106
+ {
107
+ return 0;
108
+ }
109
+
110
+ Program::operator bool () const
111
+ {
112
+ return false;
113
+ }
114
+
115
+ bool
116
+ Program::operator ! () const
117
+ {
118
+ return !operator bool();
119
+ }
120
+
121
+
122
+ }// Rays