opengl-bindings 1.6.10 → 1.6.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog +657 -627
- data/LICENSE.txt +1 -1
- data/README.md +536 -526
- data/lib/glfw.rb +711 -691
- data/lib/glu.rb +366 -366
- data/lib/glut.rb +576 -576
- data/lib/opengl.rb +43 -43
- data/lib/opengl_command.rb +7347 -7347
- data/lib/opengl_common.rb +54 -54
- data/lib/opengl_enum.rb +1818 -1806
- data/lib/opengl_es.rb +31 -31
- data/lib/opengl_es_command.rb +2517 -2517
- data/lib/opengl_es_ext.rb +28 -28
- data/lib/opengl_es_ext_command.rb +8377 -8246
- data/lib/opengl_es_ext_enum.rb +6055 -5985
- data/lib/opengl_ext.rb +34 -34
- data/lib/opengl_ext_command.rb +30480 -30358
- data/lib/opengl_ext_common.rb +52 -52
- data/lib/opengl_ext_enum.rb +14082 -14008
- data/lib/opengl_linux.rb +63 -63
- data/lib/opengl_macosx.rb +68 -68
- data/lib/opengl_platform.rb +43 -43
- data/lib/opengl_windows.rb +71 -71
- data/sample/glfw_build.bat +9 -1
- data/sample/glfw_build.sh +13 -13
- metadata +6 -7
- data/lib/glfw32.rb +0 -594
data/LICENSE.txt
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
Ruby-OpenGL : Yet another OpenGL wrapper for Ruby (and wrapper code generator)
|
2
|
-
Copyright (c) 2013-
|
2
|
+
Copyright (c) 2013-2021 vaiorabbit <http://twitter.com/vaiorabbit>
|
3
3
|
|
4
4
|
This software is provided 'as-is', without any express or implied
|
5
5
|
warranty. In no event will the authors be held liable for any damages
|
data/README.md
CHANGED
@@ -1,526 +1,536 @@
|
|
1
|
-
<!-- -*- mode:markdown; coding:utf-8; -*- -->
|
2
|
-
|
3
|
-
# Yet another OpenGL wrapper for Ruby #
|
4
|
-
|
5
|
-
...and wrapper code generator.
|
6
|
-
|
7
|
-
* Created : 2013-08-28
|
8
|
-
* Last modified :
|
9
|
-
|
10
|
-
[![Gem Version](https://badge.fury.io/rb/opengl-bindings.svg)](https://badge.fury.io/rb/opengl-bindings) [![Gem](https://img.shields.io/gem/dt/opengl-bindings.svg)](opengl-bindings)
|
11
|
-
|
12
|
-
<img src="https://raw.githubusercontent.com/vaiorabbit/ruby-opengl/master/doc/simple_rb.jpg" width="200"> <img src="https://raw.githubusercontent.com/vaiorabbit/ruby-opengl/master/doc/nehe_lesson36_rb.jpg" width="200"> <img src="https://raw.githubusercontent.com/vaiorabbit/ruby-opengl/master/doc/brick_rb.jpg" width="200"> <img src="https://raw.githubusercontent.com/vaiorabbit/ruby-opengl/master/doc/glxs_rb.jpg" width="200">
|
13
|
-
|
14
|
-
|
15
|
-
## Features ##
|
16
|
-
|
17
|
-
* Uses Fiddle (One of the Ruby standard libraries that wraps libffi)
|
18
|
-
* Unlike opengl ( https://rubygems.org/gems/opengl ), you don't need to build C extension library
|
19
|
-
|
20
|
-
* Uses Khronos XML API registry ( https://github.com/KhronosGroup/OpenGL-Registry )
|
21
|
-
* The command/enum wrapper codes are generated via 'gl.xml'
|
22
|
-
* Supports OpenGL - 4.6, OpenGL ES - 3.1 and all OpenGL extensions.
|
23
|
-
|
24
|
-
|
25
|
-
## How to install ##
|
26
|
-
|
27
|
-
Via RubyGems ( https://rubygems.org/gems/opengl-bindings ):
|
28
|
-
|
29
|
-
$ gem install opengl-bindings
|
30
|
-
|
31
|
-
Or grab all library codes (`lib/*.rb') and use them by adding as one of the load paths like:
|
32
|
-
|
33
|
-
$ ruby -I ./lib your_app.rb
|
34
|
-
|
35
|
-
|
36
|
-
## How to use ##
|
37
|
-
|
38
|
-
See sample/simple.rb or sample/simple_glut.rb.
|
39
|
-
|
40
|
-
To get more samples and generator scripts, please visit:
|
41
|
-
https://github.com/vaiorabbit/ruby-opengl
|
42
|
-
|
43
|
-
|
44
|
-
## Contents ##
|
45
|
-
|
46
|
-
* 'opengl.rb' includes these scripts:
|
47
|
-
* 'opengl_command.rb' : OpenGL command wrapper (glDrawRangeElements, etc.). Generated via generator/generate_command.rb.
|
48
|
-
* 'opengl_enum.rb' : OpenGL enum wrapper (GL_TRIANGLE_STRIP, etc.). Generated via generator/generate_enum.rb.
|
49
|
-
* 'opengl_common.rb' : Provides utility functions.
|
50
|
-
* 'opengl_platform.rb' : Provides platform check functions (OpneGL.get_platform).
|
51
|
-
* 'opengl_windows.rb' : Provides functions for Windows platform (wglGetProcAddress, wglGetCurrentContext, wglGetCurrentDC).
|
52
|
-
* 'opengl_macosx.rb' : Provides functions for Mac OS X platform (CGLGetCurrentContext, CGLGetShareGroup).
|
53
|
-
* 'opengl_linux.rb' : Provides functions for Linux (X Window) platform (glXGetCurrentContext, glXGetCurrentDisplay).
|
54
|
-
|
55
|
-
* 'opengl_es.rb' is almost the same with 'opengl.rb', except for including 'opengl_es_command.rb' and 'opengl_es_enum.rb'.
|
56
|
-
|
57
|
-
* 'opengl_ext.rb' includes these scripts:
|
58
|
-
* 'opengl_ext_command.rb' : OpenGL extension command wrapper. Generated via generator/generate_ext_command.rb.
|
59
|
-
* 'opengl_ext_enum.rb' : OpenGL extension enum wrapper Generated via generator/generate_ext_enum.rb.
|
60
|
-
* 'opengl_ext_common.rb' : Provides utility functions.
|
61
|
-
|
62
|
-
* 'opengl_es_ext.rb' is almost the same with 'opengl_ext.rb', except for including 'opengl_es_ext_command.rb' and 'opengl_es_ext_enum.rb'.
|
63
|
-
|
64
|
-
* 'glfw.rb'
|
65
|
-
* My handwritten GLFW wrapper.
|
66
|
-
|
67
|
-
* 'glut.rb'
|
68
|
-
* GLUT wrapper. Supports API Level 4 (GLUT_API_VERSION = 4).
|
69
|
-
|
70
|
-
* 'glu.rb'
|
71
|
-
* My handwritten GLU wrapper.
|
72
|
-
|
73
|
-
* 'generator/gl.xml'
|
74
|
-
* Khronos' official XML API registry for OpenGL.
|
75
|
-
|
76
|
-
* 'generator/Rakefile'
|
77
|
-
* Type 'rake' to generate wrapper codes / fetch gl.xml.
|
78
|
-
* You can get the latest one by 'get_gl_xml.rb'.
|
79
|
-
|
80
|
-
* 'sample/simple.rb', 'sample/simple_glut.rb'
|
81
|
-
* Simple example.
|
82
|
-
* simple.rb : You need to get glfw3.dll (Windows) or libglfw.dylib (Mac OS X). See sample/README.md.
|
83
|
-
* simple_glut.rb : (For Windows uses) You need to get freeglut.dll. See sample/README.md.
|
84
|
-
|
85
|
-
* 'sample/data', 'sample/util'
|
86
|
-
* Data and utilities for sample programs.
|
87
|
-
|
88
|
-
## Prerequisites ##
|
89
|
-
|
90
|
-
* Fiddle
|
91
|
-
* A libffi wrapper
|
92
|
-
* Standard library since Ruby 2.0.0
|
93
|
-
* I recommend you to use Ruby 2.1.2 and later, which fixed Fiddle's memory leak issue (https://bugs.ruby-lang.org/issues/9599).
|
94
|
-
|
95
|
-
### For sample ###
|
96
|
-
|
97
|
-
Use GLFW or GLUT for creating windows and OpenGL rendering contexts.
|
98
|
-
|
99
|
-
* GLFW
|
100
|
-
* http://www.glfw.org/
|
101
|
-
* http://www.glfw.org/download.html
|
102
|
-
|
103
|
-
* freeglut
|
104
|
-
* http://freeglut.sourceforge.net
|
105
|
-
* http://freeglut.sourceforge.net/index.php#download
|
106
|
-
|
107
|
-
|
108
|
-
## Tested Environment ##
|
109
|
-
|
110
|
-
* Ruby
|
111
|
-
* ruby
|
112
|
-
* ruby
|
113
|
-
* ruby 2.
|
114
|
-
* ruby 2.
|
115
|
-
* ruby 2.
|
116
|
-
* ruby 2.
|
117
|
-
* ruby 2.
|
118
|
-
* ruby 2.
|
119
|
-
* ruby 2.
|
120
|
-
* ruby 2.
|
121
|
-
* ruby 2.
|
122
|
-
* ruby 2.
|
123
|
-
* ruby 2.
|
124
|
-
* ruby 2.
|
125
|
-
* ruby 2.
|
126
|
-
* ruby 2.2.
|
127
|
-
* ruby 2.2.
|
128
|
-
* ruby 2.
|
129
|
-
* ruby 2.
|
130
|
-
* ruby 2.
|
131
|
-
* ruby 2.
|
132
|
-
* ruby 2.
|
133
|
-
|
134
|
-
*
|
135
|
-
*
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
*
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
* https://github.com/
|
236
|
-
|
237
|
-
|
238
|
-
* https://github.com/
|
239
|
-
*
|
240
|
-
* https://
|
241
|
-
|
242
|
-
|
243
|
-
* https://github.com/
|
244
|
-
*
|
245
|
-
* https://
|
246
|
-
|
247
|
-
*
|
248
|
-
|
249
|
-
|
250
|
-
* https://
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
* '
|
321
|
-
* '
|
322
|
-
|
323
|
-
* '
|
324
|
-
|
325
|
-
* '
|
326
|
-
* '
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
*
|
332
|
-
*
|
333
|
-
|
334
|
-
* '
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
*
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
*
|
351
|
-
*
|
352
|
-
|
353
|
-
* 'sample/
|
354
|
-
*
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
*
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
* http://
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
*
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
* ruby
|
386
|
-
* ruby
|
387
|
-
* ruby 2.
|
388
|
-
* ruby 2.
|
389
|
-
* ruby 2.
|
390
|
-
* ruby 2.
|
391
|
-
* ruby 2.
|
392
|
-
* ruby 2.
|
393
|
-
* ruby 2.
|
394
|
-
* ruby 2.
|
395
|
-
* ruby 2.
|
396
|
-
* ruby 2.
|
397
|
-
* ruby 2.
|
398
|
-
* ruby 2.
|
399
|
-
* ruby 2.
|
400
|
-
* ruby 2.
|
401
|
-
* ruby 2.
|
402
|
-
|
403
|
-
*
|
404
|
-
*
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
*
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
*
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
*
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
*
|
475
|
-
*
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
*
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
* https://
|
504
|
-
|
505
|
-
*
|
506
|
-
* https://github.com/
|
507
|
-
*
|
508
|
-
* https://github.com/
|
509
|
-
|
510
|
-
*
|
511
|
-
|
512
|
-
|
513
|
-
* https://
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
*
|
522
|
-
|
523
|
-
|
524
|
-
*
|
525
|
-
|
526
|
-
|
1
|
+
<!-- -*- mode:markdown; coding:utf-8; -*- -->
|
2
|
+
|
3
|
+
# Yet another OpenGL wrapper for Ruby #
|
4
|
+
|
5
|
+
...and wrapper code generator.
|
6
|
+
|
7
|
+
* Created : 2013-08-28
|
8
|
+
* Last modified : 2021-04-10
|
9
|
+
|
10
|
+
[![Gem Version](https://badge.fury.io/rb/opengl-bindings.svg)](https://badge.fury.io/rb/opengl-bindings) [![Gem](https://img.shields.io/gem/dt/opengl-bindings.svg)](opengl-bindings)
|
11
|
+
|
12
|
+
<img src="https://raw.githubusercontent.com/vaiorabbit/ruby-opengl/master/doc/simple_rb.jpg" width="200"> <img src="https://raw.githubusercontent.com/vaiorabbit/ruby-opengl/master/doc/nehe_lesson36_rb.jpg" width="200"> <img src="https://raw.githubusercontent.com/vaiorabbit/ruby-opengl/master/doc/brick_rb.jpg" width="200"> <img src="https://raw.githubusercontent.com/vaiorabbit/ruby-opengl/master/doc/glxs_rb.jpg" width="200">
|
13
|
+
|
14
|
+
|
15
|
+
## Features ##
|
16
|
+
|
17
|
+
* Uses Fiddle (One of the Ruby standard libraries that wraps libffi)
|
18
|
+
* Unlike opengl ( https://rubygems.org/gems/opengl ), you don't need to build C extension library
|
19
|
+
|
20
|
+
* Uses Khronos XML API registry ( https://github.com/KhronosGroup/OpenGL-Registry )
|
21
|
+
* The command/enum wrapper codes are generated via 'gl.xml'
|
22
|
+
* Supports OpenGL - 4.6, OpenGL ES - 3.1 and all OpenGL extensions.
|
23
|
+
|
24
|
+
|
25
|
+
## How to install ##
|
26
|
+
|
27
|
+
Via RubyGems ( https://rubygems.org/gems/opengl-bindings ):
|
28
|
+
|
29
|
+
$ gem install opengl-bindings
|
30
|
+
|
31
|
+
Or grab all library codes (`lib/*.rb') and use them by adding as one of the load paths like:
|
32
|
+
|
33
|
+
$ ruby -I ./lib your_app.rb
|
34
|
+
|
35
|
+
|
36
|
+
## How to use ##
|
37
|
+
|
38
|
+
See sample/simple.rb or sample/simple_glut.rb.
|
39
|
+
|
40
|
+
To get more samples and generator scripts, please visit:
|
41
|
+
https://github.com/vaiorabbit/ruby-opengl
|
42
|
+
|
43
|
+
|
44
|
+
## Contents ##
|
45
|
+
|
46
|
+
* 'opengl.rb' includes these scripts:
|
47
|
+
* 'opengl_command.rb' : OpenGL command wrapper (glDrawRangeElements, etc.). Generated via generator/generate_command.rb.
|
48
|
+
* 'opengl_enum.rb' : OpenGL enum wrapper (GL_TRIANGLE_STRIP, etc.). Generated via generator/generate_enum.rb.
|
49
|
+
* 'opengl_common.rb' : Provides utility functions.
|
50
|
+
* 'opengl_platform.rb' : Provides platform check functions (OpneGL.get_platform).
|
51
|
+
* 'opengl_windows.rb' : Provides functions for Windows platform (wglGetProcAddress, wglGetCurrentContext, wglGetCurrentDC).
|
52
|
+
* 'opengl_macosx.rb' : Provides functions for Mac OS X platform (CGLGetCurrentContext, CGLGetShareGroup).
|
53
|
+
* 'opengl_linux.rb' : Provides functions for Linux (X Window) platform (glXGetCurrentContext, glXGetCurrentDisplay).
|
54
|
+
|
55
|
+
* 'opengl_es.rb' is almost the same with 'opengl.rb', except for including 'opengl_es_command.rb' and 'opengl_es_enum.rb'.
|
56
|
+
|
57
|
+
* 'opengl_ext.rb' includes these scripts:
|
58
|
+
* 'opengl_ext_command.rb' : OpenGL extension command wrapper. Generated via generator/generate_ext_command.rb.
|
59
|
+
* 'opengl_ext_enum.rb' : OpenGL extension enum wrapper Generated via generator/generate_ext_enum.rb.
|
60
|
+
* 'opengl_ext_common.rb' : Provides utility functions.
|
61
|
+
|
62
|
+
* 'opengl_es_ext.rb' is almost the same with 'opengl_ext.rb', except for including 'opengl_es_ext_command.rb' and 'opengl_es_ext_enum.rb'.
|
63
|
+
|
64
|
+
* 'glfw.rb'
|
65
|
+
* My handwritten GLFW wrapper.
|
66
|
+
|
67
|
+
* 'glut.rb'
|
68
|
+
* GLUT wrapper. Supports API Level 4 (GLUT_API_VERSION = 4).
|
69
|
+
|
70
|
+
* 'glu.rb'
|
71
|
+
* My handwritten GLU wrapper.
|
72
|
+
|
73
|
+
* 'generator/gl.xml'
|
74
|
+
* Khronos' official XML API registry for OpenGL.
|
75
|
+
|
76
|
+
* 'generator/Rakefile'
|
77
|
+
* Type 'rake' to generate wrapper codes / fetch gl.xml.
|
78
|
+
* You can get the latest one by 'get_gl_xml.rb'.
|
79
|
+
|
80
|
+
* 'sample/simple.rb', 'sample/simple_glut.rb'
|
81
|
+
* Simple example.
|
82
|
+
* simple.rb : You need to get glfw3.dll (Windows) or libglfw.dylib (Mac OS X). See sample/README.md.
|
83
|
+
* simple_glut.rb : (For Windows uses) You need to get freeglut.dll. See sample/README.md.
|
84
|
+
|
85
|
+
* 'sample/data', 'sample/util'
|
86
|
+
* Data and utilities for sample programs.
|
87
|
+
|
88
|
+
## Prerequisites ##
|
89
|
+
|
90
|
+
* Fiddle
|
91
|
+
* A libffi wrapper
|
92
|
+
* Standard library since Ruby 2.0.0
|
93
|
+
* I recommend you to use Ruby 2.1.2 and later, which fixed Fiddle's memory leak issue (https://bugs.ruby-lang.org/issues/9599).
|
94
|
+
|
95
|
+
### For sample ###
|
96
|
+
|
97
|
+
Use GLFW or GLUT for creating windows and OpenGL rendering contexts.
|
98
|
+
|
99
|
+
* GLFW
|
100
|
+
* http://www.glfw.org/
|
101
|
+
* http://www.glfw.org/download.html
|
102
|
+
|
103
|
+
* freeglut
|
104
|
+
* http://freeglut.sourceforge.net
|
105
|
+
* http://freeglut.sourceforge.net/index.php#download
|
106
|
+
|
107
|
+
|
108
|
+
## Tested Environment ##
|
109
|
+
|
110
|
+
* Ruby
|
111
|
+
* ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x64-mingw32]
|
112
|
+
* ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [arm64-darwin20]
|
113
|
+
* ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [arm64-darwin20]
|
114
|
+
* ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x64-mingw32]
|
115
|
+
* ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-darwin19]
|
116
|
+
* ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-darwin18]
|
117
|
+
* ruby 2.6.1p33 (2019-01-30 revision 66950) [x86_64-darwin18]
|
118
|
+
* ruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-darwin18]
|
119
|
+
* ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]
|
120
|
+
* ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-darwin17]
|
121
|
+
* ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin16]
|
122
|
+
* ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-darwin16]
|
123
|
+
* ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]
|
124
|
+
* ruby 2.3.0p0 (2015-12-25 revision 53290) [x64-mingw32]
|
125
|
+
* ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin15]
|
126
|
+
* ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin14]
|
127
|
+
* ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]
|
128
|
+
* ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-darwin14]
|
129
|
+
* ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-darwin14]
|
130
|
+
* ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin14]
|
131
|
+
* ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0]
|
132
|
+
* ruby 2.1.2p95 (2014-05-08 revision 45877) [i386-mingw32]
|
133
|
+
* ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-darwin12.0]
|
134
|
+
* ruby 2.0.0p353 (2013-11-22 revision 43784) [x86_64-darwin13.0.0]
|
135
|
+
* ruby 2.0.0p247 (2013-06-27) [i386-mingw32]
|
136
|
+
|
137
|
+
* Windows 10 Home, 64-bit (Version 1909, OS Build 18363.778)
|
138
|
+
* NVIDIA GeForce RTX 2060 SUPER
|
139
|
+
* OpenGL 4.5
|
140
|
+
|
141
|
+
> ruby report_env.rb
|
142
|
+
Version : 4.5.0 NVIDIA 436.30
|
143
|
+
Vendor : NVIDIA Corporation
|
144
|
+
Renderer : GeForce RTX 2060 SUPER/PCIe/SSE2
|
145
|
+
Shader : 4.50 NVIDIA
|
146
|
+
|
147
|
+
* Windows 10 Home, 64-bit (Version 1511, OS Build 10586.164)
|
148
|
+
* NVIDIA GeForce GTX 960
|
149
|
+
* OpenGL 4.5
|
150
|
+
|
151
|
+
> ruby report_env.rb
|
152
|
+
Version: 4.5.0 NVIDIA 364.72
|
153
|
+
|
154
|
+
* Windows 7 Home Premium, 64-bit (Service Pack 1)
|
155
|
+
* NVIDIA GeForce GTX 560
|
156
|
+
* OpenGL 4.3
|
157
|
+
|
158
|
+
> ruby report_env.rb
|
159
|
+
4.3.0
|
160
|
+
|
161
|
+
* Windows 7 Home Premium, 64-bit (Service Pack 1)
|
162
|
+
* NVIDIA GeForce GTX 560
|
163
|
+
* OpenGL 4.3
|
164
|
+
|
165
|
+
> ruby report_env.rb
|
166
|
+
4.3.0
|
167
|
+
|
168
|
+
* Mac OS X 10.8.4, 64-bit
|
169
|
+
* NVIDIA GeForce 320M on Mac mini (Mid 2010)
|
170
|
+
* OpenGL 2.1
|
171
|
+
|
172
|
+
$ ruby report_env.rb
|
173
|
+
2.1 NVIDIA-8.12.47 310.40.00.05f01
|
174
|
+
|
175
|
+
* Mac OS X 10.10.5, 64-bit
|
176
|
+
* Intel Iris on Mac mini (Late 2014)
|
177
|
+
* OpenGL 4.1
|
178
|
+
|
179
|
+
$ ruby report_env.rb
|
180
|
+
Version: 4.1 INTEL-10.6.33
|
181
|
+
|
182
|
+
* Mac OS X 10.15.3, 64-bit
|
183
|
+
* Intel Iris on Mac mini (Late 2014)
|
184
|
+
* OpenGL 4.1
|
185
|
+
|
186
|
+
$ ruby report_env.rb
|
187
|
+
Version : 4.1 INTEL-14.4.23
|
188
|
+
Vendor : Intel Inc.
|
189
|
+
Renderer : Intel Iris OpenGL Engine
|
190
|
+
Shader : 4.10
|
191
|
+
|
192
|
+
* Arch Linux kernel 4.1.2-2-ARCH, Nvidia Driver, x86_64
|
193
|
+
* NVIDIA GeForce GTS 450
|
194
|
+
* OpenGL 4.5.0
|
195
|
+
|
196
|
+
$ ruby report_env.rb
|
197
|
+
Version: 4.5.0 NVIDIA 352.21
|
198
|
+
|
199
|
+
* Arch Linux kernel 4.1.4-1-ARCH, Nouveau Driver, x86_64
|
200
|
+
* NVIDIA GeForce GTS 450
|
201
|
+
* OpenGL 3.0
|
202
|
+
|
203
|
+
$ ruby report_env.rb
|
204
|
+
Version: 3.0 Mesa 10.6.3
|
205
|
+
|
206
|
+
* You can use any lib/path names by passing as arguments like:
|
207
|
+
* OpenGL.load_lib( 'libGL.so', '/usr/lib' )
|
208
|
+
* GLFW.load_lib( 'libglfw.so', '/usr/lib' )
|
209
|
+
* GLU.load_lib( 'libGLU.so', '/usr/lib' )
|
210
|
+
* GLUT.load_lib( 'libglut.so', '/usr/lib' )
|
211
|
+
|
212
|
+
## Note ##
|
213
|
+
|
214
|
+
* No Ruby-Style handy interfaces are available (like one in the ruby-opengl2 ( http://ruby-opengl.rubyforge.org/ ))
|
215
|
+
* Example:
|
216
|
+
* (Original C API)
|
217
|
+
|
218
|
+
GLuint tex_names_buf[2];
|
219
|
+
glGenTextures( 2, tex_names_buf );
|
220
|
+
GLuint tex_name = tex_names_buf[0];
|
221
|
+
|
222
|
+
* (This library)
|
223
|
+
|
224
|
+
tex_names_buf = ' ' * 8 # String instance that is enough to catch texture names (integer).
|
225
|
+
glGenTextures( 2, tex_names_buf )
|
226
|
+
tex_name = tex_names_buf.unpack('L2')[0]
|
227
|
+
|
228
|
+
* (ruby-opengl2)
|
229
|
+
|
230
|
+
tex_name = glGenTextures( 2 )[0]
|
231
|
+
|
232
|
+
* Projects using opengl-bindings
|
233
|
+
* ruby-gnome2
|
234
|
+
* https://github.com/ruby-gnome2/ruby-gnome2
|
235
|
+
* https://github.com/ruby-gnome2/ruby-gnome2/tree/master/gtk3/sample/misc
|
236
|
+
* gtkglarea1.rb, gtkglarea2.rb
|
237
|
+
* FXRuby - A library for cross-platform graphical user interfaces
|
238
|
+
* https://github.com/larskanis/fxruby/blob/1.6/examples/glviewer.rb
|
239
|
+
* dxsdl2r
|
240
|
+
* https://github.com/mirichi/dxsdl2r
|
241
|
+
* mittsu - A direct port of THREE.js from JavaScript/WebGL to Ruby/OpenGL
|
242
|
+
* https://rubygems.org/gems/mittsu
|
243
|
+
* https://github.com/jellymann/mittsu
|
244
|
+
* opencl-bindings - A Ruby binding for OpenCL 1.2
|
245
|
+
* https://rubygems.org/gems/opencl-bindings
|
246
|
+
* https://github.com/vaiorabbit/ruby-opencl
|
247
|
+
* perfume_dance - A BVH motion parser and playback implementation written in Ruby
|
248
|
+
* https://github.com/vaiorabbit/perfume_dance
|
249
|
+
* open.gl.rb - A port of the https://open.gl/ tutorials to Ruby
|
250
|
+
* https://github.com/mechazoidal/opendotgl_rb
|
251
|
+
|
252
|
+
* Other informative projects
|
253
|
+
* argon | neon
|
254
|
+
* https://github.com/npomf/argon
|
255
|
+
* https://bitbucket.org/npomf/neon/src
|
256
|
+
* "vaiorabbit / ruby-opengl - as the basis for the OpenGL, OpenAL, and GLFW FFI libraries."
|
257
|
+
|
258
|
+
## License ##
|
259
|
+
|
260
|
+
The zlib/libpng License ( http://opensource.org/licenses/Zlib ).
|
261
|
+
|
262
|
+
Copyright (c) 2013-2020 vaiorabbit <http://twitter.com/vaiorabbit>
|
263
|
+
|
264
|
+
This software is provided 'as-is', without any express or implied
|
265
|
+
warranty. In no event will the authors be held liable for any damages
|
266
|
+
arising from the use of this software.
|
267
|
+
|
268
|
+
Permission is granted to anyone to use this software for any purpose,
|
269
|
+
including commercial applications, and to alter it and redistribute it
|
270
|
+
freely, subject to the following restrictions:
|
271
|
+
|
272
|
+
1. The origin of this software must not be misrepresented; you must not
|
273
|
+
claim that you wrote the original software. If you use this software in a
|
274
|
+
product, an acknowledgment in the product documentation would be
|
275
|
+
appreciated but is not required.
|
276
|
+
|
277
|
+
2. Altered source versions must be plainly marked as such, and must not be
|
278
|
+
misrepresented as being the original software.
|
279
|
+
|
280
|
+
3. This notice may not be removed or altered from any source distribution.
|
281
|
+
|
282
|
+
Sample codes/resources under sample/GLExcess are provided under the GNU General
|
283
|
+
Public License version 2. See sample/GLExcess/GPL2.txt .
|
284
|
+
|
285
|
+
Sample codes under sample/OrangeBook are provided under the BSD 3-Clause License.
|
286
|
+
See sample/OrangeBook/3Dlabs-License.txt .
|
287
|
+
|
288
|
+
-------------------------------------------------------------------------------
|
289
|
+
|
290
|
+
# Ruby 用 OpenGL ラッパー (とその自動生成スクリプト) #
|
291
|
+
|
292
|
+
## 特徴 ##
|
293
|
+
|
294
|
+
* 標準ライブラリ Fiddle を使っています ⇒ opengl ( https://rubygems.org/gems/opengl ) のように拡張ライブラリをビルドする必要がありません
|
295
|
+
* 関数とenumのラッパーコードは Khronos の XML API registry ( https://github.com/KhronosGroup/OpenGL-Registry ) の gl.xml から自動生成しています
|
296
|
+
|
297
|
+
|
298
|
+
## インストール ##
|
299
|
+
|
300
|
+
RubyGems経由で ( https://rubygems.org/gems/opengl-bindings ):
|
301
|
+
|
302
|
+
$ gem install opengl-bindings
|
303
|
+
|
304
|
+
もしくは lib 以下の *.rb をコピー → その場所をロードパスに加えて次のように起動:
|
305
|
+
|
306
|
+
$ ruby -I ./lib your_app.rb
|
307
|
+
|
308
|
+
|
309
|
+
## 使い方 ##
|
310
|
+
|
311
|
+
sample/simple.rb または sample/simple_glut.rb を参照してください。
|
312
|
+
|
313
|
+
その他のサンプルと自動生成スクリプトはこちらで開発しています:
|
314
|
+
https://github.com/vaiorabbit/ruby-opengl
|
315
|
+
|
316
|
+
|
317
|
+
## 内容 ##
|
318
|
+
|
319
|
+
* 'opengl.rb' を require することで下記のスクリプトを取り込みます:
|
320
|
+
* 'opengl_command.rb' : OpenGL 関数のラッパーコード (glDrawRangeElements, etc.)。 generator/generate_command.rb で自動生成されたものです。
|
321
|
+
* 'opengl_enum.rb' : OpenGL enum のラッパーコード (GL_TRIANGLE_STRIP, etc.)。 generator/generate_enum.rb で自動生成されたものです。
|
322
|
+
* 'opengl_common.rb' : 共通のユーティリティ関数を提供しています。
|
323
|
+
* 'opengl_platform.rb' : 動作プラットフォームの判別機能を提供しています (OpneGL.get_platform)。
|
324
|
+
* 'opengl_windows.rb' : Windows 用の機能を提供しています (wglGetProcAddress, wglGetCurrentContext, wglGetCurrentDC).
|
325
|
+
* 'opengl_macosx.rb' : Mac OS X 用の機能を提供しています (CGLGetCurrentContext, CGLGetShareGroup).
|
326
|
+
* 'opengl_linux.rb' : Linux (X Window) 用の機能を提供しています (glXGetCurrentContext, glXGetCurrentDisplay).
|
327
|
+
|
328
|
+
* 'opengl_es.rb' は 'opengl_es_command.rb' と 'opengl_es_enum.rb' を取り込む以外は 'opengl.rb' と同じです。
|
329
|
+
|
330
|
+
* 'opengl_ext.rb' を require することで下記のスクリプトを取り込みます:
|
331
|
+
* 'opengl_ext_command.rb' : OpenGL 拡張関数のラッパーコード。 generator/generate_ext_command.rb で自動生成されたものです。
|
332
|
+
* 'opengl_ext_enum.rb' : OpenGL 拡張enumのラッパーコード。 generator/generate_ext_enum.rb で自動生成されたものです。
|
333
|
+
|
334
|
+
* 'opengl_es_ext.rb' は 'opengl_es_ext_command.rb' と 'opengl_es_ext_enum.rb' を取り込む以外は 'opengl_ext.rb' と同じです。
|
335
|
+
|
336
|
+
* 'glfw.rb'
|
337
|
+
* GLFW のラッパーコードです(自動生成ではありません)。
|
338
|
+
|
339
|
+
* 'glut.rb'
|
340
|
+
* GLUT ラッパー。API Level 4 までサポートしています (GLUT_API_VERSION = 4)。
|
341
|
+
|
342
|
+
|
343
|
+
* 'glu.rb'
|
344
|
+
* GLU のラッパーコードです(自動生成ではありません)。
|
345
|
+
|
346
|
+
* 'generator/gl.xml'
|
347
|
+
* Khronos 公式の XML API registry です。
|
348
|
+
|
349
|
+
* 'generator/Rakefile'
|
350
|
+
* 自動生成関連のタスクを自動化するためのものです。'rake' と打てば gl.xml の取得とラッパーコードの生成を実行します。
|
351
|
+
* gl.xml の取得だけなど、単体のタスクなら 'get_gl_xml.rb' などの個別Rubyスクリプトでも実行できます。
|
352
|
+
|
353
|
+
* 'sample/simple.rb', 'sample/simple_glut.rb'
|
354
|
+
* 一番簡単なサンプルです。
|
355
|
+
* simple.rb : 同じ場所に glfw3.dll (Windows) もしくは libglfw.dylib (Mac OS X) を置いてください。詳細は sample/README.md に記載されています。
|
356
|
+
* simple_glut.rb : (Windows の場合) freeglut.dll を置いてください。詳細は sample/README.md に記載されています。
|
357
|
+
|
358
|
+
* 'sample/data', 'sample/util'
|
359
|
+
* サンプルで共有する機能・データの配置場所です。
|
360
|
+
|
361
|
+
|
362
|
+
## 必要なもの ##
|
363
|
+
|
364
|
+
* Fiddle
|
365
|
+
* libffi のラッパーです
|
366
|
+
* Ruby 2.0.0 以降で標準ライブラリになりました
|
367
|
+
* Fiddle のメモリリーク問題 (https://bugs.ruby-lang.org/issues/9599) が修正された Ruby 2.1.2 以降での利用を推奨します
|
368
|
+
|
369
|
+
### サンプル用 ###
|
370
|
+
|
371
|
+
GLFW か GLUT を用意してください。ウィンドウやレンダリングコンテキストの管理に必要です。
|
372
|
+
|
373
|
+
* GLFW
|
374
|
+
* http://www.glfw.org/
|
375
|
+
* http://www.glfw.org/download.html
|
376
|
+
|
377
|
+
* freeglut
|
378
|
+
* http://freeglut.sourceforge.net
|
379
|
+
* http://freeglut.sourceforge.net/index.php#download
|
380
|
+
|
381
|
+
|
382
|
+
## テストした環境 ##
|
383
|
+
|
384
|
+
* Ruby
|
385
|
+
* ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x64-mingw32]
|
386
|
+
* ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [arm64-darwin20]
|
387
|
+
* ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [arm64-darwin20]
|
388
|
+
* ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x64-mingw32]
|
389
|
+
* ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-darwin19]
|
390
|
+
* ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-darwin18]
|
391
|
+
* ruby 2.6.1p33 (2019-01-30 revision 66950) [x86_64-darwin18]
|
392
|
+
* ruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-darwin18]
|
393
|
+
* ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]
|
394
|
+
* ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-darwin17]
|
395
|
+
* ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin16]
|
396
|
+
* ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-darwin16]
|
397
|
+
* ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]
|
398
|
+
* ruby 2.3.0p0 (2015-12-25 revision 53290) [x64-mingw32]
|
399
|
+
* ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin15]
|
400
|
+
* ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin14]
|
401
|
+
* ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]
|
402
|
+
* ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-darwin14]
|
403
|
+
* ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-darwin14]
|
404
|
+
* ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin14]
|
405
|
+
* ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0]
|
406
|
+
* ruby 2.1.2p95 (2014-05-08 revision 45877) [i386-mingw32]
|
407
|
+
* ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-darwin12.0]
|
408
|
+
* ruby 2.0.0p353 (2013-11-22 revision 43784) [x86_64-darwin13.0.0]
|
409
|
+
* ruby 2.0.0p247 (2013-06-27) [i386-mingw32]
|
410
|
+
|
411
|
+
* Windows 10 Home, 64-bit (Version 1909, OS Build 18363.778)
|
412
|
+
* NVIDIA GeForce RTX 2060 SUPER
|
413
|
+
* OpenGL 4.5
|
414
|
+
|
415
|
+
> ruby report_env.rb
|
416
|
+
Version : 4.5.0 NVIDIA 436.30
|
417
|
+
Vendor : NVIDIA Corporation
|
418
|
+
Renderer : GeForce RTX 2060 SUPER/PCIe/SSE2
|
419
|
+
Shader : 4.50 NVIDIA
|
420
|
+
|
421
|
+
* Windows 10 Home, 64-bit (Version 1511, OS Build 10586.164)
|
422
|
+
* NVIDIA GeForce GTX 960
|
423
|
+
* OpenGL 4.5
|
424
|
+
|
425
|
+
> ruby report_env.rb
|
426
|
+
Version: 4.5.0 NVIDIA 364.72
|
427
|
+
|
428
|
+
* Windows 7 Home Premium, 64-bit (Service Pack 1)
|
429
|
+
* NVIDIA GeForce GTX 560
|
430
|
+
* OpenGL 4.3
|
431
|
+
|
432
|
+
> ruby report_env.rb
|
433
|
+
4.3.0
|
434
|
+
|
435
|
+
* Mac OS X 10.8.4, 64-bit
|
436
|
+
* NVIDIA GeForce 320M on Mac mini (Mid 2010)
|
437
|
+
* OpenGL 2.1
|
438
|
+
|
439
|
+
$ ruby report_env.rb
|
440
|
+
2.1 NVIDIA-8.12.47 310.40.00.05f01
|
441
|
+
|
442
|
+
* Mac OS X 10.10.5, 64-bit
|
443
|
+
* Intel Iris on Mac mini (Late 2014)
|
444
|
+
* OpenGL 4.1
|
445
|
+
|
446
|
+
$ ruby report_env.rb
|
447
|
+
Version: 4.1 INTEL-10.6.33
|
448
|
+
|
449
|
+
* Mac OS X 10.15.3, 64-bit
|
450
|
+
* Intel Iris on Mac mini (Late 2014)
|
451
|
+
* OpenGL 4.1
|
452
|
+
|
453
|
+
$ ruby report_env.rb
|
454
|
+
Version : 4.1 INTEL-14.4.23
|
455
|
+
Vendor : Intel Inc.
|
456
|
+
Renderer : Intel Iris OpenGL Engine
|
457
|
+
Shader : 4.10
|
458
|
+
|
459
|
+
* Arch Linux kernel 4.1.2-2-ARCH, Nvidia Driver, x86_64
|
460
|
+
* NVIDIA GeForce GTS 450
|
461
|
+
* OpenGL 4.5.0
|
462
|
+
|
463
|
+
$ ruby report_env.rb
|
464
|
+
Version: 4.5.0 NVIDIA 352.21
|
465
|
+
|
466
|
+
* Arch Linux kernel 4.1.4-1-ARCH, Nouveau Driver, x86_64
|
467
|
+
* NVIDIA GeForce GTS 450
|
468
|
+
* OpenGL 3.0
|
469
|
+
|
470
|
+
$ ruby report_env.rb
|
471
|
+
Version: 3.0 Mesa 10.6.3
|
472
|
+
|
473
|
+
* 引数として渡すことで任意のライブラリ名/パス名を利用できます:
|
474
|
+
* OpenGL.load_lib( 'libGL.so', '/usr/lib' )
|
475
|
+
* GLFW.load_lib( 'libglfw.so', '/usr/lib' )
|
476
|
+
* GLU.load_lib( 'libGLU.so', '/usr/lib' )
|
477
|
+
* GLUT.load_lib( 'libglut.so', '/usr/lib' )
|
478
|
+
|
479
|
+
|
480
|
+
## メモ ##
|
481
|
+
|
482
|
+
* Rubyスタイルの便利なインターフェースはサポートしていません (ruby-opengl2 ( http://ruby-opengl.rubyforge.org/ ) にあったような感じのもの)
|
483
|
+
* 例:
|
484
|
+
* (OpenGLオリジナルの C API)
|
485
|
+
|
486
|
+
GLuint tex_names_buf[2];
|
487
|
+
glGenTextures( 2, tex_names_buf );
|
488
|
+
GLuint tex_name = tex_names_buf[0];
|
489
|
+
|
490
|
+
* (このライブラリの場合)
|
491
|
+
|
492
|
+
tex_names_buf = ' ' * 8 # テクスチャ名(GLuint)を受け取るのに十分なサイズ String インスタンスであればOK
|
493
|
+
glGenTextures( 2, tex_names_buf )
|
494
|
+
tex_name = tex_names_buf.unpack('L2')[0]
|
495
|
+
|
496
|
+
* (ruby-opengl2 の場合)
|
497
|
+
|
498
|
+
tex_name = glGenTextures( 2 )[0] # glGenTextures が配列を返すように修正されています
|
499
|
+
|
500
|
+
* opengl-bindings を使ったプロジェクト
|
501
|
+
* ruby-gnome2
|
502
|
+
* https://github.com/ruby-gnome2/ruby-gnome2
|
503
|
+
* https://github.com/ruby-gnome2/ruby-gnome2/tree/master/gtk3/sample/misc
|
504
|
+
* gtkglarea1.rb, gtkglarea2.rb
|
505
|
+
* FXRuby - A library for cross-platform graphical user interfaces
|
506
|
+
* https://github.com/larskanis/fxruby/blob/1.6/examples/glviewer.rb
|
507
|
+
* dxsdl2r
|
508
|
+
* https://github.com/mirichi/dxsdl2r
|
509
|
+
* mittsu - A direct port of THREE.js from JavaScript/WebGL to Ruby/OpenGL
|
510
|
+
* https://rubygems.org/gems/mittsu
|
511
|
+
* https://github.com/jellymann/mittsu
|
512
|
+
* opencl-bindings - A Ruby binding for OpenCL 1.2
|
513
|
+
* https://rubygems.org/gems/opencl-bindings
|
514
|
+
* https://github.com/vaiorabbit/ruby-opencl
|
515
|
+
* perfume_dance - A BVH motion parser and playback implementation written in Ruby
|
516
|
+
* https://github.com/vaiorabbit/perfume_dance
|
517
|
+
* open.gl.rb - A port of the https://open.gl/ tutorials to Ruby
|
518
|
+
* https://github.com/mechazoidal/opendotgl_rb
|
519
|
+
|
520
|
+
* 参考になりそうなプロジェクト
|
521
|
+
* argon | neon
|
522
|
+
* https://github.com/npomf/argon
|
523
|
+
* https://bitbucket.org/npomf/neon/src
|
524
|
+
* "vaiorabbit / ruby-opengl - as the basis for the OpenGL, OpenAL, and GLFW FFI libraries."
|
525
|
+
|
526
|
+
|
527
|
+
## ライセンス ##
|
528
|
+
|
529
|
+
* zlib/libpng ライセンスです ( http://opensource.org/licenses/Zlib )。
|
530
|
+
|
531
|
+
* sample/GLExcess 以下にあるものについては GNU General Public License version 2 です。
|
532
|
+
sample/GLExcess/GPL2.txt を参照してください。
|
533
|
+
|
534
|
+
* sample/OrangeBook 以下にあるものについては修正BSDライセンスです。
|
535
|
+
sample/OrangeBook/3Dlabs-License.txt を参照してください。
|
536
|
+
|