opengl-bindings 1.6.15 → 1.6.16

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.
data/README.md CHANGED
@@ -1,731 +1,767 @@
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 : 2025-01-01
9
-
10
- ---
11
-
12
- ## Attention : Version 2 is now available ##
13
-
14
- Though I will continue making this [version 1.6 series of opengl-bindings](https://rubygems.org/gems/opengl-bindings) available, please consider migrating to [opengl-bindings2](https://rubygems.org/gems/opengl-bindings2).
15
-
16
- ### Redesigned API
17
-
18
- In version 2, all OpenGL APIs are defined as public methods under `module GL`, so we don't have to `include OpenGL` and scatter OpenGL APIs under other modules any more:
19
-
20
- ```ruby
21
- # opengl-bindings
22
- require 'opengl'
23
- include OpenGL
24
- # ...
25
- glEnable(GL_DEPTH_TEST)
26
- ```
27
-
28
- ```ruby
29
- # opengl-bindings2
30
- require 'opengl'
31
- # ...
32
- GL.Enable(GL::DEPTH_TEST)
33
- ```
34
-
35
- ### Improved efficiency
36
-
37
- All redundant `nil` checks done on every API calls are removed in version 2:
38
-
39
- ```ruby
40
- # opengl-bindings1
41
- module OpenGL
42
- #...
43
- def self.get_command( sym )
44
- if GL_FUNCTIONS_MAP[sym] == nil
45
- bind_command( sym )
46
- end
47
- return GL_FUNCTIONS_MAP[sym]
48
- end
49
-
50
- #...
51
-
52
- def glEnable(_cap_)
53
- f = OpenGL::get_command(:glEnable) # Every API call caused redundant nil check here
54
- f.call(_cap_)
55
- end
56
- ```
57
-
58
- ```ruby
59
- # opengl-bindings2
60
- module GL
61
- #...
62
- def self.Enable(_cap_)
63
- GL_FUNCTIONS_MAP[:glEnable].call(_cap_) # Hashmap is built on initialization so there's no need to do nil check at every API call
64
- end
65
- ```
66
-
67
- ---
68
-
69
- ## Features ##
70
-
71
- * Version 1 [![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)
72
- * Version 2 [![Gem Version](https://badge.fury.io/rb/opengl-bindings2.svg)](https://badge.fury.io/rb/opengl-bindings2) [![Gem](https://img.shields.io/gem/dt/opengl-bindings2.svg)](opengl-bindings2)
73
-
74
- <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">
75
-
76
- * Uses Fiddle (One of the Ruby libraries that wraps libffi)
77
- * Unlike opengl ( https://rubygems.org/gems/opengl ), you don't need to build C extension library
78
-
79
- * Uses Khronos XML API registry ( https://github.com/KhronosGroup/OpenGL-Registry )
80
- * The command/enum wrapper codes are generated via 'gl.xml'
81
- * Supports OpenGL - 4.6, OpenGL ES - 3.1 and all OpenGL extensions.
82
-
83
-
84
- ## How to install ##
85
-
86
- Via RubyGems ( https://rubygems.org/gems/opengl-bindings ):
87
-
88
- $ gem install opengl-bindings
89
-
90
- Or grab all library codes (`lib/*.rb') and use them by adding as one of the load paths like:
91
-
92
- $ ruby -I ./lib your_app.rb
93
-
94
-
95
- ## How to use ##
96
-
97
- See sample/simple.rb or sample/simple_glut.rb.
98
-
99
- To get more samples and generator scripts, please visit:
100
- https://github.com/vaiorabbit/ruby-opengl
101
-
102
-
103
- ## Contents ##
104
-
105
- * 'opengl.rb' includes these scripts:
106
- * 'opengl_command.rb' : OpenGL command wrapper (glDrawRangeElements, etc.). Generated via generator/generate_command.rb.
107
- * 'opengl_enum.rb' : OpenGL enum wrapper (GL_TRIANGLE_STRIP, etc.). Generated via generator/generate_enum.rb.
108
- * 'opengl_common.rb' : Provides utility functions.
109
- * 'opengl_platform.rb' : Provides platform check functions (OpneGL.get_platform).
110
- * 'opengl_windows.rb' : Provides functions for Windows platform (wglGetProcAddress, wglGetCurrentContext, wglGetCurrentDC).
111
- * 'opengl_macosx.rb' : Provides functions for Mac OS X platform (CGLGetCurrentContext, CGLGetShareGroup).
112
- * 'opengl_linux.rb' : Provides functions for Linux (X Window) platform (glXGetCurrentContext, glXGetCurrentDisplay).
113
-
114
- * 'opengl_es.rb' is almost the same with 'opengl.rb', except for including 'opengl_es_command.rb' and 'opengl_es_enum.rb'.
115
-
116
- * 'opengl_ext.rb' includes these scripts:
117
- * 'opengl_ext_command.rb' : OpenGL extension command wrapper. Generated via generator/generate_ext_command.rb.
118
- * 'opengl_ext_enum.rb' : OpenGL extension enum wrapper Generated via generator/generate_ext_enum.rb.
119
- * 'opengl_ext_common.rb' : Provides utility functions.
120
-
121
- * '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'.
122
-
123
- * 'glfw.rb'
124
- * My handwritten GLFW wrapper.
125
-
126
- * 'glut.rb'
127
- * GLUT wrapper. Supports API Level 4 (GLUT_API_VERSION = 4).
128
-
129
- * 'glu.rb'
130
- * My handwritten GLU wrapper.
131
-
132
- * 'generator/gl.xml'
133
- * Khronos' official XML API registry for OpenGL.
134
-
135
- * 'generator/Rakefile'
136
- * Type 'rake' to generate wrapper codes / fetch gl.xml.
137
- * You can get the latest one by 'get_gl_xml.rb'.
138
-
139
- * 'sample/simple.rb', 'sample/simple_glut.rb'
140
- * Simple example.
141
- * simple.rb : You need to get glfw3.dll (Windows) or libglfw.dylib (Mac OS X). See sample/README.md.
142
- * simple_glut.rb : (For Windows uses) You need to get freeglut.dll. See sample/README.md.
143
-
144
- * 'sample/data', 'sample/util'
145
- * Data and utilities for sample programs.
146
-
147
- ## Prerequisites ##
148
-
149
- * Fiddle
150
- * A libffi wrapper
151
- * 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).
152
-
153
- ### For sample ###
154
-
155
- Use GLFW or GLUT for creating windows and OpenGL rendering contexts.
156
-
157
- * GLFW
158
- * http://www.glfw.org/
159
- * http://www.glfw.org/download.html
160
-
161
- * freeglut
162
- * http://freeglut.sourceforge.net
163
- * http://freeglut.sourceforge.net/index.php#download
164
-
165
-
166
- ## Tested Environment ##
167
-
168
- * Ruby
169
- * ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +PRISM [x64-mingw-ucrt]
170
- * ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +PRISM [arm64-darwin24]
171
-
172
- * Windows 11 Pro (Version 24H2, OS Build 26100.2605)
173
-
174
- > ruby report_env.rb
175
- Version : 4.5.0 NVIDIA 560.94
176
- Vendor : NVIDIA Corporation
177
- Renderer : NVIDIA GeForce RTX 4080 Laptop GPU/PCIe/SSE2
178
- Shader : 4.50 NVIDIA
179
-
180
- * macOS 15.2 / Mac mini (M1 2020)
181
-
182
- $ ruby report_env.rb
183
- Version : 4.1 Metal - 89.3
184
- Vendor : Apple
185
- Renderer : Apple M1
186
- Shader : 4.10
187
-
188
- * Arch Linux kernel 4.1.2-2-ARCH, Nvidia Driver, x86_64
189
- * NVIDIA GeForce GTS 450
190
- * OpenGL 4.5.0
191
-
192
- $ ruby report_env.rb
193
- Version: 4.5.0 NVIDIA 352.21
194
-
195
- * Arch Linux kernel 4.1.4-1-ARCH, Nouveau Driver, x86_64
196
- * NVIDIA GeForce GTS 450
197
- * OpenGL 3.0
198
-
199
- $ ruby report_env.rb
200
- Version: 3.0 Mesa 10.6.3
201
-
202
- <details>
203
- <summary>Older versions</summary>
204
-
205
- * Ruby
206
- * ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [arm64-darwin23]
207
- * ruby 3.2.0 (2022-12-25 revision a528908271) [arm64-darwin21]
208
- * ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [arm64-darwin20]
209
- * ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x64-mingw32]
210
- * ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [arm64-darwin20]
211
- * ruby 3.0.1p64 (2021-04-05 revision 0fb782ee38) [arm64-darwin20]
212
- * ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x64-mingw32]
213
- * ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [arm64-darwin20]
214
- * ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [arm64-darwin20]
215
- * ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x64-mingw32]
216
- * ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-darwin19]
217
- * ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-darwin18]
218
- * ruby 2.6.1p33 (2019-01-30 revision 66950) [x86_64-darwin18]
219
- * ruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-darwin18]
220
- * ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]
221
- * ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-darwin17]
222
- * ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin16]
223
- * ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-darwin16]
224
- * ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]
225
- * ruby 2.3.0p0 (2015-12-25 revision 53290) [x64-mingw32]
226
- * ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin15]
227
- * ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin14]
228
- * ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]
229
- * ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-darwin14]
230
- * ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-darwin14]
231
- * ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin14]
232
- * ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0]
233
- * ruby 2.1.2p95 (2014-05-08 revision 45877) [i386-mingw32]
234
- * ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-darwin12.0]
235
- * ruby 2.0.0p353 (2013-11-22 revision 43784) [x86_64-darwin13.0.0]
236
- * ruby 2.0.0p247 (2013-06-27) [i386-mingw32]
237
-
238
- * Windows 10 Home, 64-bit (Version 1909, OS Build 18363.778)
239
- * NVIDIA GeForce RTX 2060 SUPER
240
- * OpenGL 4.5
241
-
242
- > ruby report_env.rb
243
- Version : 4.5.0 NVIDIA 436.30
244
- Vendor : NVIDIA Corporation
245
- Renderer : GeForce RTX 2060 SUPER/PCIe/SSE2
246
- Shader : 4.50 NVIDIA
247
-
248
- * Windows 10 Home, 64-bit (Version 1511, OS Build 10586.164)
249
- * NVIDIA GeForce GTX 960
250
- * OpenGL 4.5
251
-
252
- > ruby report_env.rb
253
- Version: 4.5.0 NVIDIA 364.72
254
-
255
- * Windows 7 Home Premium, 64-bit (Service Pack 1)
256
- * NVIDIA GeForce GTX 560
257
- * OpenGL 4.3
258
-
259
- > ruby report_env.rb
260
- 4.3.0
261
-
262
- * Windows 7 Home Premium, 64-bit (Service Pack 1)
263
- * NVIDIA GeForce GTX 560
264
- * OpenGL 4.3
265
-
266
- > ruby report_env.rb
267
- 4.3.0
268
-
269
- * Mac OS X 10.8.4, 64-bit
270
- * NVIDIA GeForce 320M on Mac mini (Mid 2010)
271
- * OpenGL 2.1
272
-
273
- $ ruby report_env.rb
274
- 2.1 NVIDIA-8.12.47 310.40.00.05f01
275
-
276
- * Mac OS X 10.10.5, 64-bit
277
- * Intel Iris on Mac mini (Late 2014)
278
- * OpenGL 4.1
279
-
280
- $ ruby report_env.rb
281
- Version: 4.1 INTEL-10.6.33
282
-
283
- * Mac OS X 10.15.3, 64-bit
284
- * Intel Iris on Mac mini (Late 2014)
285
- * OpenGL 4.1
286
-
287
- $ ruby report_env.rb
288
- Version : 4.1 INTEL-14.4.23
289
- Vendor : Intel Inc.
290
- Renderer : Intel Iris OpenGL Engine
291
- Shader : 4.10
292
-
293
- * macOS 12.5.1, 64-bit
294
- * Mac mini (M1 2020)
295
- * OpenGL 4.1
296
-
297
- $ ruby report_env.rb
298
- Version : 4.1 Metal - 76.3
299
- Vendor : Apple
300
- Renderer : Apple M1
301
- Shader : 4.10
302
-
303
- </details>
304
-
305
- * You can use any lib/path names by passing as arguments like:
306
- * OpenGL.load_lib( 'libGL.so', '/usr/lib' )
307
- * GLFW.load_lib( 'libglfw.so', '/usr/lib' )
308
- * GLU.load_lib( 'libGLU.so', '/usr/lib' )
309
- * GLUT.load_lib( 'libglut.so', '/usr/lib' )
310
-
311
- ## Note ##
312
-
313
- * No Ruby-Style handy interfaces are available (like one in the ruby-opengl2 ( http://ruby-opengl.rubyforge.org/ ))
314
- * Example:
315
- * (Original C API)
316
-
317
- GLuint tex_names_buf[2];
318
- glGenTextures( 2, tex_names_buf );
319
- GLuint tex_name = tex_names_buf[0];
320
-
321
- * (This library)
322
-
323
- tex_names_buf = ' ' * 8 # String instance that is enough to catch texture names (integer).
324
- glGenTextures( 2, tex_names_buf )
325
- tex_name = tex_names_buf.unpack('L2')[0]
326
-
327
- * (ruby-opengl2)
328
-
329
- tex_name = glGenTextures( 2 )[0]
330
-
331
- * Projects using opengl-bindings
332
- * ruby-gnome2
333
- * https://github.com/ruby-gnome2/ruby-gnome2
334
- * https://github.com/ruby-gnome2/ruby-gnome2/tree/master/gtk3/sample/misc
335
- * gtkglarea1.rb, gtkglarea2.rb
336
- * FXRuby - A library for cross-platform graphical user interfaces
337
- * https://github.com/larskanis/fxruby/blob/1.6/examples/glviewer.rb
338
- * dxsdl2r
339
- * https://github.com/mirichi/dxsdl2r
340
- * mittsu - A direct port of THREE.js from JavaScript/WebGL to Ruby/OpenGL
341
- * https://rubygems.org/gems/mittsu
342
- * https://github.com/danini-the-panini/mittsu
343
- * opencl-bindings - A Ruby binding for OpenCL 1.2
344
- * https://rubygems.org/gems/opencl-bindings
345
- * https://github.com/vaiorabbit/ruby-opencl
346
- * perfume_dance - A BVH motion parser and playback implementation written in Ruby
347
- * https://github.com/vaiorabbit/perfume_dance
348
- * open.gl.rb - A port of the https://open.gl/ tutorials to Ruby
349
- * https://github.com/mechazoidal/opendotgl_rb
350
-
351
- * Other informative projects
352
- * argon | neon
353
- * https://github.com/npomf/argon
354
- * https://bitbucket.org/npomf/neon/src
355
- * "vaiorabbit / ruby-opengl - as the basis for the OpenGL, OpenAL, and GLFW FFI libraries."
356
-
357
- ## License ##
358
-
359
- The zlib/libpng License ( http://opensource.org/licenses/Zlib ).
360
-
361
- Copyright (c) 2013-2025 vaiorabbit <http://twitter.com/vaiorabbit>
362
-
363
- This software is provided 'as-is', without any express or implied
364
- warranty. In no event will the authors be held liable for any damages
365
- arising from the use of this software.
366
-
367
- Permission is granted to anyone to use this software for any purpose,
368
- including commercial applications, and to alter it and redistribute it
369
- freely, subject to the following restrictions:
370
-
371
- 1. The origin of this software must not be misrepresented; you must not
372
- claim that you wrote the original software. If you use this software in a
373
- product, an acknowledgment in the product documentation would be
374
- appreciated but is not required.
375
-
376
- 2. Altered source versions must be plainly marked as such, and must not be
377
- misrepresented as being the original software.
378
-
379
- 3. This notice may not be removed or altered from any source distribution.
380
-
381
- Sample codes/resources under sample/GLExcess are provided under the GNU General
382
- Public License version 2. See sample/GLExcess/GPL2.txt .
383
-
384
- Sample codes under sample/OrangeBook are provided under the BSD 3-Clause License.
385
- See sample/OrangeBook/3Dlabs-License.txt .
386
-
387
- -------------------------------------------------------------------------------
388
-
389
- # Ruby OpenGL ラッパー (とその自動生成スクリプト) #
390
-
391
- ## Version 2 が利用可能です ##
392
-
393
- [Version 1.6 系の opengl-bindings](https://rubygems.org/gems/opengl-bindings) も引き続き利用できるようにしますが、[opengl-bindings2](https://rubygems.org/gems/opengl-bindings2) への移行を検討してください。
394
-
395
- ### API の修正
396
-
397
- Version 2 では OpenGL API `module GL` public メソッドとして定義され、`include OpenGL` を実行する必要がなくなりました。
398
-
399
- ```ruby
400
- # opengl-bindings
401
- require 'opengl'
402
- include OpenGL
403
- # ...
404
- glEnable(GL_DEPTH_TEST)
405
- ```
406
-
407
- ```ruby
408
- # opengl-bindings2
409
- require 'opengl'
410
- # ...
411
- GL.Enable(GL::DEPTH_TEST)
412
- ```
413
-
414
- ### 効率の改善
415
-
416
- API を呼ぶたびに走っていた無駄な `nil` のチェックが Version 2 では削除されています。
417
-
418
- ```ruby
419
- # opengl-bindings1
420
- module OpenGL
421
- #...
422
- def self.get_command( sym )
423
- if GL_FUNCTIONS_MAP[sym] == nil
424
- bind_command( sym )
425
- end
426
- return GL_FUNCTIONS_MAP[sym]
427
- end
428
-
429
- #...
430
-
431
- def glEnable(_cap_)
432
- f = OpenGL::get_command(:glEnable) # Every API call caused redundant nil check here
433
- f.call(_cap_)
434
- end
435
- ```
436
-
437
- ```ruby
438
- # opengl-bindings2
439
- module GL
440
- #...
441
- def self.Enable(_cap_)
442
- GL_FUNCTIONS_MAP[:glEnable].call(_cap_) # Hashmap is built on initialization so there's no need to do nil check at every API call
443
- end
444
- ```
445
-
446
- ---
447
-
448
- ## 特徴 ##
449
-
450
- * 標準ライブラリ Fiddle を使っています opengl ( https://rubygems.org/gems/opengl ) のように拡張ライブラリをビルドする必要がありません
451
- * 関数とenumのラッパーコードは Khronos の XML API registry ( https://github.com/KhronosGroup/OpenGL-Registry ) の gl.xml から自動生成しています
452
-
453
-
454
- ## インストール ##
455
-
456
- RubyGems経由で ( https://rubygems.org/gems/opengl-bindings ):
457
-
458
- $ gem install opengl-bindings
459
-
460
- もしくは lib 以下の *.rb をコピー その場所をロードパスに加えて次のように起動:
461
-
462
- $ ruby -I ./lib your_app.rb
463
-
464
-
465
- ## 使い方 ##
466
-
467
- sample/simple.rb または sample/simple_glut.rb を参照してください。
468
-
469
- その他のサンプルと自動生成スクリプトはこちらで開発しています:
470
- https://github.com/vaiorabbit/ruby-opengl
471
-
472
-
473
- ## 内容 ##
474
-
475
- * 'opengl.rb' を require することで下記のスクリプトを取り込みます:
476
- * 'opengl_command.rb' : OpenGL 関数のラッパーコード (glDrawRangeElements, etc.)。 generator/generate_command.rb で自動生成されたものです。
477
- * 'opengl_enum.rb' : OpenGL enum のラッパーコード (GL_TRIANGLE_STRIP, etc.)。 generator/generate_enum.rb で自動生成されたものです。
478
- * 'opengl_common.rb' : 共通のユーティリティ関数を提供しています。
479
- * 'opengl_platform.rb' : 動作プラットフォームの判別機能を提供しています (OpneGL.get_platform)。
480
- * 'opengl_windows.rb' : Windows 用の機能を提供しています (wglGetProcAddress, wglGetCurrentContext, wglGetCurrentDC).
481
- * 'opengl_macosx.rb' : Mac OS X 用の機能を提供しています (CGLGetCurrentContext, CGLGetShareGroup).
482
- * 'opengl_linux.rb' : Linux (X Window) 用の機能を提供しています (glXGetCurrentContext, glXGetCurrentDisplay).
483
-
484
- * 'opengl_es.rb' は 'opengl_es_command.rb' と 'opengl_es_enum.rb' を取り込む以外は 'opengl.rb' と同じです。
485
-
486
- * 'opengl_ext.rb' を require することで下記のスクリプトを取り込みます:
487
- * 'opengl_ext_command.rb' : OpenGL 拡張関数のラッパーコード。 generator/generate_ext_command.rb で自動生成されたものです。
488
- * 'opengl_ext_enum.rb' : OpenGL 拡張enumのラッパーコード。 generator/generate_ext_enum.rb で自動生成されたものです。
489
-
490
- * 'opengl_es_ext.rb' は 'opengl_es_ext_command.rb' と 'opengl_es_ext_enum.rb' を取り込む以外は 'opengl_ext.rb' と同じです。
491
-
492
- * 'glfw.rb'
493
- * GLFW のラッパーコードです(自動生成ではありません)。
494
-
495
- * 'glut.rb'
496
- * GLUT ラッパー。API Level 4 までサポートしています (GLUT_API_VERSION = 4)。
497
-
498
-
499
- * 'glu.rb'
500
- * GLU のラッパーコードです(自動生成ではありません)
501
-
502
- * 'generator/gl.xml'
503
- * Khronos 公式の XML API registry です。
504
-
505
- * 'generator/Rakefile'
506
- * 自動生成関連のタスクを自動化するためのものです。'rake' と打てば gl.xml の取得とラッパーコードの生成を実行します。
507
- * gl.xml の取得だけなど、単体のタスクなら 'get_gl_xml.rb' などの個別Rubyスクリプトでも実行できます。
508
-
509
- * 'sample/simple.rb', 'sample/simple_glut.rb'
510
- * 一番簡単なサンプルです。
511
- * simple.rb : 同じ場所に glfw3.dll (Windows) もしくは libglfw.dylib (Mac OS X) を置いてください。詳細は sample/README.md に記載されています。
512
- * simple_glut.rb : (Windows の場合) freeglut.dll を置いてください。詳細は sample/README.md に記載されています。
513
-
514
- * 'sample/data', 'sample/util'
515
- * サンプルで共有する機能・データの配置場所です。
516
-
517
-
518
- ## 必要なもの ##
519
-
520
- * Fiddle
521
- * libffi のラッパーです
522
- * Fiddle のメモリリーク問題 (https://bugs.ruby-lang.org/issues/9599) が修正された Ruby 2.1.2 以降での利用を推奨します
523
-
524
- ### サンプル用 ###
525
-
526
- GLFW か GLUT を用意してください。ウィンドウやレンダリングコンテキストの管理に必要です。
527
-
528
- * GLFW
529
- * http://www.glfw.org/
530
- * http://www.glfw.org/download.html
531
-
532
- * freeglut
533
- * http://freeglut.sourceforge.net
534
- * http://freeglut.sourceforge.net/index.php#download
535
-
536
-
537
- ## テストした環境 ##
538
-
539
- * Ruby
540
- * ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +PRISM [x64-mingw-ucrt]
541
- * ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +PRISM [arm64-darwin24]
542
-
543
- * Windows 11 Pro (Version 24H2, OS Build 26100.2605)
544
-
545
- > ruby report_env.rb
546
- Version : 4.5.0 NVIDIA 560.94
547
- Vendor : NVIDIA Corporation
548
- Renderer : NVIDIA GeForce RTX 4080 Laptop GPU/PCIe/SSE2
549
- Shader : 4.50 NVIDIA
550
-
551
- * macOS 15.2 / Mac mini (M1 2020)
552
-
553
- $ ruby report_env.rb
554
- Version : 4.1 Metal - 89.3
555
- Vendor : Apple
556
- Renderer : Apple M1
557
- Shader : 4.10
558
-
559
- * Arch Linux kernel 4.1.2-2-ARCH, Nvidia Driver, x86_64
560
- * NVIDIA GeForce GTS 450
561
- * OpenGL 4.5.0
562
-
563
- $ ruby report_env.rb
564
- Version: 4.5.0 NVIDIA 352.21
565
-
566
- * Arch Linux kernel 4.1.4-1-ARCH, Nouveau Driver, x86_64
567
- * NVIDIA GeForce GTS 450
568
- * OpenGL 3.0
569
-
570
- $ ruby report_env.rb
571
- Version: 3.0 Mesa 10.6.3
572
-
573
- <details>
574
- <summary>以前のバージョン</summary>
575
-
576
- * Ruby
577
- * ruby 3.2.0 (2022-12-25 revision a528908271) [arm64-darwin21]
578
- * ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [arm64-darwin20]
579
- * ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x64-mingw32]
580
- * ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [arm64-darwin20]
581
- * ruby 3.0.1p64 (2021-04-05 revision 0fb782ee38) [arm64-darwin20]
582
- * ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x64-mingw32]
583
- * ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [arm64-darwin20]
584
- * ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [arm64-darwin20]
585
- * ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x64-mingw32]
586
- * ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-darwin19]
587
- * ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-darwin18]
588
- * ruby 2.6.1p33 (2019-01-30 revision 66950) [x86_64-darwin18]
589
- * ruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-darwin18]
590
- * ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]
591
- * ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-darwin17]
592
- * ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin16]
593
- * ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-darwin16]
594
- * ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]
595
- * ruby 2.3.0p0 (2015-12-25 revision 53290) [x64-mingw32]
596
- * ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin15]
597
- * ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin14]
598
- * ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]
599
- * ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-darwin14]
600
- * ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-darwin14]
601
- * ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin14]
602
- * ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0]
603
- * ruby 2.1.2p95 (2014-05-08 revision 45877) [i386-mingw32]
604
- * ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-darwin12.0]
605
- * ruby 2.0.0p353 (2013-11-22 revision 43784) [x86_64-darwin13.0.0]
606
- * ruby 2.0.0p247 (2013-06-27) [i386-mingw32]
607
-
608
- * Windows 10 Home, 64-bit (Version 1909, OS Build 18363.778)
609
- * NVIDIA GeForce RTX 2060 SUPER
610
- * OpenGL 4.5
611
-
612
- > ruby report_env.rb
613
- Version : 4.5.0 NVIDIA 436.30
614
- Vendor : NVIDIA Corporation
615
- Renderer : GeForce RTX 2060 SUPER/PCIe/SSE2
616
- Shader : 4.50 NVIDIA
617
-
618
- * Windows 10 Home, 64-bit (Version 1511, OS Build 10586.164)
619
- * NVIDIA GeForce GTX 960
620
- * OpenGL 4.5
621
-
622
- > ruby report_env.rb
623
- Version: 4.5.0 NVIDIA 364.72
624
-
625
- * Windows 7 Home Premium, 64-bit (Service Pack 1)
626
- * NVIDIA GeForce GTX 560
627
- * OpenGL 4.3
628
-
629
- > ruby report_env.rb
630
- 4.3.0
631
-
632
- * Windows 7 Home Premium, 64-bit (Service Pack 1)
633
- * NVIDIA GeForce GTX 560
634
- * OpenGL 4.3
635
-
636
- > ruby report_env.rb
637
- 4.3.0
638
-
639
- * Mac OS X 10.8.4, 64-bit
640
- * NVIDIA GeForce 320M on Mac mini (Mid 2010)
641
- * OpenGL 2.1
642
-
643
- $ ruby report_env.rb
644
- 2.1 NVIDIA-8.12.47 310.40.00.05f01
645
-
646
- * Mac OS X 10.10.5, 64-bit
647
- * Intel Iris on Mac mini (Late 2014)
648
- * OpenGL 4.1
649
-
650
- $ ruby report_env.rb
651
- Version: 4.1 INTEL-10.6.33
652
-
653
- * Mac OS X 10.15.3, 64-bit
654
- * Intel Iris on Mac mini (Late 2014)
655
- * OpenGL 4.1
656
-
657
- $ ruby report_env.rb
658
- Version : 4.1 INTEL-14.4.23
659
- Vendor : Intel Inc.
660
- Renderer : Intel Iris OpenGL Engine
661
- Shader : 4.10
662
-
663
- * macOS 12.5.1, 64-bit
664
- * Mac mini (M1 2020)
665
- * OpenGL 4.1
666
-
667
- $ ruby report_env.rb
668
- Version : 4.1 Metal - 76.3
669
- Vendor : Apple
670
- Renderer : Apple M1
671
- Shader : 4.10
672
-
673
- </details>
674
-
675
- ## メモ ##
676
-
677
- * Rubyスタイルの便利なインターフェースはサポートしていません (ruby-opengl2 ( http://ruby-opengl.rubyforge.org/ ) にあったような感じのもの)
678
- * 例:
679
- * (OpenGLオリジナルの C API)
680
-
681
- GLuint tex_names_buf[2];
682
- glGenTextures( 2, tex_names_buf );
683
- GLuint tex_name = tex_names_buf[0];
684
-
685
- * (このライブラリの場合)
686
-
687
- tex_names_buf = ' ' * 8 # テクスチャ名(GLuint)を受け取るのに十分なサイズ String インスタンスであればOK
688
- glGenTextures( 2, tex_names_buf )
689
- tex_name = tex_names_buf.unpack('L2')[0]
690
-
691
- * (ruby-opengl2 の場合)
692
-
693
- tex_name = glGenTextures( 2 )[0] # glGenTextures が配列を返すように修正されています
694
-
695
- * opengl-bindings を使ったプロジェクト
696
- * ruby-gnome2
697
- * https://github.com/ruby-gnome2/ruby-gnome2
698
- * https://github.com/ruby-gnome2/ruby-gnome2/tree/master/gtk3/sample/misc
699
- * gtkglarea1.rb, gtkglarea2.rb
700
- * FXRuby - A library for cross-platform graphical user interfaces
701
- * https://github.com/larskanis/fxruby/blob/1.6/examples/glviewer.rb
702
- * dxsdl2r
703
- * https://github.com/mirichi/dxsdl2r
704
- * mittsu - A direct port of THREE.js from JavaScript/WebGL to Ruby/OpenGL
705
- * https://rubygems.org/gems/mittsu
706
- * https://github.com/jellymann/mittsu
707
- * opencl-bindings - A Ruby binding for OpenCL 1.2
708
- * https://rubygems.org/gems/opencl-bindings
709
- * https://github.com/vaiorabbit/ruby-opencl
710
- * perfume_dance - A BVH motion parser and playback implementation written in Ruby
711
- * https://github.com/vaiorabbit/perfume_dance
712
- * open.gl.rb - A port of the https://open.gl/ tutorials to Ruby
713
- * https://github.com/mechazoidal/opendotgl_rb
714
-
715
- * 参考になりそうなプロジェクト
716
- * argon | neon
717
- * https://github.com/npomf/argon
718
- * https://bitbucket.org/npomf/neon/src
719
- * "vaiorabbit / ruby-opengl - as the basis for the OpenGL, OpenAL, and GLFW FFI libraries."
720
-
721
-
722
- ## ライセンス ##
723
-
724
- * zlib/libpng ライセンスです ( http://opensource.org/licenses/Zlib )
725
-
726
- * sample/GLExcess 以下にあるものについては GNU General Public License version 2 です。
727
- sample/GLExcess/GPL2.txt を参照してください。
728
-
729
- * sample/OrangeBook 以下にあるものについては修正BSDライセンスです。
730
- sample/OrangeBook/3Dlabs-License.txt を参照してください。
731
-
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 : 2026-01-10
9
+
10
+ ---
11
+
12
+ ## Attention : Version 2 is now available ##
13
+
14
+ Though I will continue making this [version 1.6 series of opengl-bindings](https://rubygems.org/gems/opengl-bindings) available, please consider migrating to [opengl-bindings2](https://rubygems.org/gems/opengl-bindings2).
15
+
16
+ ### Redesigned API
17
+
18
+ In version 2, all OpenGL APIs are defined as public methods under `module GL`, so we don't have to `include OpenGL` and scatter OpenGL APIs under other modules any more:
19
+
20
+ ```ruby
21
+ # opengl-bindings
22
+ require 'opengl'
23
+ include OpenGL
24
+ # ...
25
+ glEnable(GL_DEPTH_TEST)
26
+ ```
27
+
28
+ ```ruby
29
+ # opengl-bindings2
30
+ require 'opengl'
31
+ # ...
32
+ GL.Enable(GL::DEPTH_TEST)
33
+ ```
34
+
35
+ ### Improved efficiency
36
+
37
+ All redundant `nil` checks done on every API calls are removed in version 2:
38
+
39
+ ```ruby
40
+ # opengl-bindings1
41
+ module OpenGL
42
+ #...
43
+ def self.get_command( sym )
44
+ if GL_FUNCTIONS_MAP[sym] == nil
45
+ bind_command( sym )
46
+ end
47
+ return GL_FUNCTIONS_MAP[sym]
48
+ end
49
+
50
+ #...
51
+
52
+ def glEnable(_cap_)
53
+ f = OpenGL::get_command(:glEnable) # Every API call caused redundant nil check here
54
+ f.call(_cap_)
55
+ end
56
+ ```
57
+
58
+ ```ruby
59
+ # opengl-bindings2
60
+ module GL
61
+ #...
62
+ def self.Enable(_cap_)
63
+ GL_FUNCTIONS_MAP[:glEnable].call(_cap_) # Hashmap is built on initialization so there's no need to do nil check at every API call
64
+ end
65
+ ```
66
+
67
+ ---
68
+
69
+ ## Features ##
70
+
71
+ * Version 1 [![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)
72
+ * Version 2 [![Gem Version](https://badge.fury.io/rb/opengl-bindings2.svg)](https://badge.fury.io/rb/opengl-bindings2) [![Gem](https://img.shields.io/gem/dt/opengl-bindings2.svg)](opengl-bindings2)
73
+
74
+ <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">
75
+
76
+ * Uses Fiddle (One of the Ruby libraries that wraps libffi)
77
+ * Unlike opengl ( https://rubygems.org/gems/opengl ), you don't need to build C extension library
78
+
79
+ * Uses Khronos XML API registry ( https://github.com/KhronosGroup/OpenGL-Registry )
80
+ * The command/enum wrapper codes are generated via 'gl.xml'
81
+ * Supports OpenGL - 4.6, OpenGL ES - 3.1 and all OpenGL extensions.
82
+
83
+
84
+ ## How to install ##
85
+
86
+ Via RubyGems ( https://rubygems.org/gems/opengl-bindings ):
87
+
88
+ $ gem install opengl-bindings
89
+
90
+ Or grab all library codes (`lib/*.rb') and use them by adding as one of the load paths like:
91
+
92
+ $ ruby -I ./lib your_app.rb
93
+
94
+
95
+ ## How to use ##
96
+
97
+ See sample/simple.rb or sample/simple_glut.rb.
98
+
99
+ To get more samples and generator scripts, please visit:
100
+ https://github.com/vaiorabbit/ruby-opengl
101
+
102
+
103
+ ## Contents ##
104
+
105
+ * 'opengl.rb' includes these scripts:
106
+ * 'opengl_command.rb' : OpenGL command wrapper (glDrawRangeElements, etc.). Generated via generator/generate_command.rb.
107
+ * 'opengl_enum.rb' : OpenGL enum wrapper (GL_TRIANGLE_STRIP, etc.). Generated via generator/generate_enum.rb.
108
+ * 'opengl_common.rb' : Provides utility functions.
109
+ * 'opengl_platform.rb' : Provides platform check functions (OpneGL.get_platform).
110
+ * 'opengl_windows.rb' : Provides functions for Windows platform (wglGetProcAddress, wglGetCurrentContext, wglGetCurrentDC).
111
+ * 'opengl_macosx.rb' : Provides functions for Mac OS X platform (CGLGetCurrentContext, CGLGetShareGroup).
112
+ * 'opengl_linux.rb' : Provides functions for Linux (X Window) platform (glXGetCurrentContext, glXGetCurrentDisplay).
113
+
114
+ * 'opengl_es.rb' is almost the same with 'opengl.rb', except for including 'opengl_es_command.rb' and 'opengl_es_enum.rb'.
115
+
116
+ * 'opengl_ext.rb' includes these scripts:
117
+ * 'opengl_ext_command.rb' : OpenGL extension command wrapper. Generated via generator/generate_ext_command.rb.
118
+ * 'opengl_ext_enum.rb' : OpenGL extension enum wrapper Generated via generator/generate_ext_enum.rb.
119
+ * 'opengl_ext_common.rb' : Provides utility functions.
120
+
121
+ * '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'.
122
+
123
+ * 'glfw.rb'
124
+ * My handwritten GLFW wrapper.
125
+
126
+ * 'glut.rb'
127
+ * GLUT wrapper. Supports API Level 4 (GLUT_API_VERSION = 4).
128
+
129
+ * 'glu.rb'
130
+ * My handwritten GLU wrapper.
131
+
132
+ * 'generator/gl.xml'
133
+ * Khronos' official XML API registry for OpenGL.
134
+
135
+ * 'generator/Rakefile'
136
+ * Type 'rake' to generate wrapper codes / fetch gl.xml.
137
+ * You can get the latest one by 'get_gl_xml.rb'.
138
+
139
+ * 'sample/simple.rb', 'sample/simple_glut.rb'
140
+ * Simple example.
141
+ * simple.rb : You need to get glfw3.dll (Windows) or libglfw.dylib (Mac OS X). See sample/README.md.
142
+ * simple_glut.rb : (For Windows uses) You need to get freeglut.dll. See sample/README.md.
143
+
144
+ * 'sample/data', 'sample/util'
145
+ * Data and utilities for sample programs.
146
+
147
+ ## Prerequisites ##
148
+
149
+ * Fiddle
150
+ * A libffi wrapper
151
+ * 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).
152
+
153
+ ### For sample ###
154
+
155
+ Use GLFW or GLUT for creating windows and OpenGL rendering contexts.
156
+
157
+ * GLFW
158
+ * http://www.glfw.org/
159
+ * http://www.glfw.org/download.html
160
+
161
+ * freeglut
162
+ * http://freeglut.sourceforge.net
163
+ * http://freeglut.sourceforge.net/index.php#download
164
+
165
+
166
+ ## Tested Environment ##
167
+
168
+ * Ruby
169
+ * ruby 4.0.0 (2025-12-25 revision 553f1675f3) +PRISM [x64-mingw-ucrt]
170
+ * ruby 4.0.0 (2025-12-25 revision 553f1675f3) +PRISM [arm64-darwin25]
171
+
172
+ * Windows 11 Pro (Version 25H2, OS Build 26200.7462)
173
+
174
+ > ruby report_env.rb
175
+ Version : 4.5.0 NVIDIA 591.44
176
+ Vendor : NVIDIA Corporation
177
+ Renderer : NVIDIA GeForce RTX 4080 Laptop GPU/PCIe/SSE2
178
+ Shader : 4.50 NVIDIA
179
+
180
+ * macOS 26.2 / Mac mini (M1 2020)
181
+
182
+ $ ruby report_env.rb
183
+ Version : 4.1 Metal - 90.5
184
+ Vendor : Apple
185
+ Renderer : Apple M1
186
+ Shader : 4.10
187
+ Shader : 4.10
188
+
189
+ * Arch Linux kernel 4.1.2-2-ARCH, Nvidia Driver, x86_64
190
+ * NVIDIA GeForce GTS 450
191
+ * OpenGL 4.5.0
192
+
193
+ $ ruby report_env.rb
194
+ Version: 4.5.0 NVIDIA 352.21
195
+
196
+ * Arch Linux kernel 4.1.4-1-ARCH, Nouveau Driver, x86_64
197
+ * NVIDIA GeForce GTS 450
198
+ * OpenGL 3.0
199
+
200
+ $ ruby report_env.rb
201
+ Version: 3.0 Mesa 10.6.3
202
+
203
+ <details>
204
+ <summary>Older versions</summary>
205
+
206
+ * Ruby
207
+ * ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +PRISM [x64-mingw-ucrt]
208
+ * ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [arm64-darwin23]
209
+ * ruby 3.2.0 (2022-12-25 revision a528908271) [arm64-darwin21]
210
+ * ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [arm64-darwin20]
211
+ * ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x64-mingw32]
212
+ * ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [arm64-darwin20]
213
+ * ruby 3.0.1p64 (2021-04-05 revision 0fb782ee38) [arm64-darwin20]
214
+ * ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x64-mingw32]
215
+ * ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [arm64-darwin20]
216
+ * ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [arm64-darwin20]
217
+ * ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x64-mingw32]
218
+ * ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-darwin19]
219
+ * ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-darwin18]
220
+ * ruby 2.6.1p33 (2019-01-30 revision 66950) [x86_64-darwin18]
221
+ * ruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-darwin18]
222
+ * ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]
223
+ * ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-darwin17]
224
+ * ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin16]
225
+ * ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-darwin16]
226
+ * ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]
227
+ * ruby 2.3.0p0 (2015-12-25 revision 53290) [x64-mingw32]
228
+ * ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin15]
229
+ * ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin14]
230
+ * ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]
231
+ * ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-darwin14]
232
+ * ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-darwin14]
233
+ * ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin14]
234
+ * ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0]
235
+ * ruby 2.1.2p95 (2014-05-08 revision 45877) [i386-mingw32]
236
+ * ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-darwin12.0]
237
+ * ruby 2.0.0p353 (2013-11-22 revision 43784) [x86_64-darwin13.0.0]
238
+ * ruby 2.0.0p247 (2013-06-27) [i386-mingw32]
239
+
240
+ * Windows 11 Pro (Version 24H2, OS Build 26100.2605)
241
+
242
+ > ruby report_env.rb
243
+ Version : 4.5.0 NVIDIA 560.94
244
+ Vendor : NVIDIA Corporation
245
+ Renderer : NVIDIA GeForce RTX 4080 Laptop GPU/PCIe/SSE2
246
+ Shader : 4.50 NVIDIA
247
+
248
+ * Windows 10 Home, 64-bit (Version 1909, OS Build 18363.778)
249
+ * NVIDIA GeForce RTX 2060 SUPER
250
+ * OpenGL 4.5
251
+
252
+ > ruby report_env.rb
253
+ Version : 4.5.0 NVIDIA 436.30
254
+ Vendor : NVIDIA Corporation
255
+ Renderer : GeForce RTX 2060 SUPER/PCIe/SSE2
256
+ Shader : 4.50 NVIDIA
257
+
258
+ * Windows 10 Home, 64-bit (Version 1511, OS Build 10586.164)
259
+ * NVIDIA GeForce GTX 960
260
+ * OpenGL 4.5
261
+
262
+ > ruby report_env.rb
263
+ Version: 4.5.0 NVIDIA 364.72
264
+
265
+ * Windows 7 Home Premium, 64-bit (Service Pack 1)
266
+ * NVIDIA GeForce GTX 560
267
+ * OpenGL 4.3
268
+
269
+ > ruby report_env.rb
270
+ 4.3.0
271
+
272
+ * Windows 7 Home Premium, 64-bit (Service Pack 1)
273
+ * NVIDIA GeForce GTX 560
274
+ * OpenGL 4.3
275
+
276
+ > ruby report_env.rb
277
+ 4.3.0
278
+
279
+ * Mac OS X 10.8.4, 64-bit
280
+ * NVIDIA GeForce 320M on Mac mini (Mid 2010)
281
+ * OpenGL 2.1
282
+
283
+ $ ruby report_env.rb
284
+ 2.1 NVIDIA-8.12.47 310.40.00.05f01
285
+
286
+ * Mac OS X 10.10.5, 64-bit
287
+ * Intel Iris on Mac mini (Late 2014)
288
+ * OpenGL 4.1
289
+
290
+ $ ruby report_env.rb
291
+ Version: 4.1 INTEL-10.6.33
292
+
293
+ * Mac OS X 10.15.3, 64-bit
294
+ * Intel Iris on Mac mini (Late 2014)
295
+ * OpenGL 4.1
296
+
297
+ $ ruby report_env.rb
298
+ Version : 4.1 INTEL-14.4.23
299
+ Vendor : Intel Inc.
300
+ Renderer : Intel Iris OpenGL Engine
301
+ Shader : 4.10
302
+
303
+ * macOS 12.5.1, 64-bit
304
+ * Mac mini (M1 2020)
305
+ * OpenGL 4.1
306
+
307
+ $ ruby report_env.rb
308
+ Version : 4.1 Metal - 76.3
309
+ Vendor : Apple
310
+ Renderer : Apple M1
311
+ Shader : 4.10
312
+
313
+ * macOS 15.2 / Mac mini (M1 2020)
314
+
315
+ $ ruby report_env.rb
316
+ Version : 4.1 Metal - 89.3
317
+ Vendor : Apple
318
+ Renderer : Apple M1
319
+ Shader : 4.10
320
+
321
+ </details>
322
+
323
+ * You can use any lib/path names by passing as arguments like:
324
+ * OpenGL.load_lib( 'libGL.so', '/usr/lib' )
325
+ * GLFW.load_lib( 'libglfw.so', '/usr/lib' )
326
+ * GLU.load_lib( 'libGLU.so', '/usr/lib' )
327
+ * GLUT.load_lib( 'libglut.so', '/usr/lib' )
328
+
329
+ ## Note ##
330
+
331
+ * No Ruby-Style handy interfaces are available (like one in the ruby-opengl2 ( http://ruby-opengl.rubyforge.org/ ))
332
+ * Example:
333
+ * (Original C API)
334
+
335
+ GLuint tex_names_buf[2];
336
+ glGenTextures( 2, tex_names_buf );
337
+ GLuint tex_name = tex_names_buf[0];
338
+
339
+ * (This library)
340
+
341
+ tex_names_buf = ' ' * 8 # String instance that is enough to catch texture names (integer).
342
+ glGenTextures( 2, tex_names_buf )
343
+ tex_name = tex_names_buf.unpack('L2')[0]
344
+
345
+ * (ruby-opengl2)
346
+
347
+ tex_name = glGenTextures( 2 )[0]
348
+
349
+ * Projects using opengl-bindings
350
+ * ruby-gnome2
351
+ * https://github.com/ruby-gnome2/ruby-gnome2
352
+ * https://github.com/ruby-gnome2/ruby-gnome2/tree/master/gtk3/sample/misc
353
+ * gtkglarea1.rb, gtkglarea2.rb
354
+ * FXRuby - A library for cross-platform graphical user interfaces
355
+ * https://github.com/larskanis/fxruby/blob/1.6/examples/glviewer.rb
356
+ * dxsdl2r
357
+ * https://github.com/mirichi/dxsdl2r
358
+ * mittsu - A direct port of THREE.js from JavaScript/WebGL to Ruby/OpenGL
359
+ * https://rubygems.org/gems/mittsu
360
+ * https://github.com/danini-the-panini/mittsu
361
+ * opencl-bindings - A Ruby binding for OpenCL 1.2
362
+ * https://rubygems.org/gems/opencl-bindings
363
+ * https://github.com/vaiorabbit/ruby-opencl
364
+ * perfume_dance - A BVH motion parser and playback implementation written in Ruby
365
+ * https://github.com/vaiorabbit/perfume_dance
366
+ * open.gl.rb - A port of the https://open.gl/ tutorials to Ruby
367
+ * https://github.com/mechazoidal/opendotgl_rb
368
+
369
+ * Other informative projects
370
+ * argon | neon
371
+ * https://github.com/npomf/argon
372
+ * https://bitbucket.org/npomf/neon/src
373
+ * "vaiorabbit / ruby-opengl - as the basis for the OpenGL, OpenAL, and GLFW FFI libraries."
374
+
375
+ ## License ##
376
+
377
+ The zlib/libpng License ( http://opensource.org/licenses/Zlib ).
378
+
379
+ Copyright (c) 2013-2026 vaiorabbit <http://twitter.com/vaiorabbit>
380
+
381
+ This software is provided 'as-is', without any express or implied
382
+ warranty. In no event will the authors be held liable for any damages
383
+ arising from the use of this software.
384
+
385
+ Permission is granted to anyone to use this software for any purpose,
386
+ including commercial applications, and to alter it and redistribute it
387
+ freely, subject to the following restrictions:
388
+
389
+ 1. The origin of this software must not be misrepresented; you must not
390
+ claim that you wrote the original software. If you use this software in a
391
+ product, an acknowledgment in the product documentation would be
392
+ appreciated but is not required.
393
+
394
+ 2. Altered source versions must be plainly marked as such, and must not be
395
+ misrepresented as being the original software.
396
+
397
+ 3. This notice may not be removed or altered from any source distribution.
398
+
399
+ Sample codes/resources under sample/GLExcess are provided under the GNU General
400
+ Public License version 2. See sample/GLExcess/GPL2.txt .
401
+
402
+ Sample codes under sample/OrangeBook are provided under the BSD 3-Clause License.
403
+ See sample/OrangeBook/3Dlabs-License.txt .
404
+
405
+ -------------------------------------------------------------------------------
406
+
407
+ # Ruby 用 OpenGL ラッパー (とその自動生成スクリプト) #
408
+
409
+ ## Version 2 が利用可能です ##
410
+
411
+ [Version 1.6 系の opengl-bindings](https://rubygems.org/gems/opengl-bindings) も引き続き利用できるようにしますが、[opengl-bindings2](https://rubygems.org/gems/opengl-bindings2) への移行を検討してください。
412
+
413
+ ### API の修正
414
+
415
+ Version 2 では OpenGL API が `module GL` の public メソッドとして定義され、`include OpenGL` を実行する必要がなくなりました。
416
+
417
+ ```ruby
418
+ # opengl-bindings
419
+ require 'opengl'
420
+ include OpenGL
421
+ # ...
422
+ glEnable(GL_DEPTH_TEST)
423
+ ```
424
+
425
+ ```ruby
426
+ # opengl-bindings2
427
+ require 'opengl'
428
+ # ...
429
+ GL.Enable(GL::DEPTH_TEST)
430
+ ```
431
+
432
+ ### 効率の改善
433
+
434
+ API を呼ぶたびに走っていた無駄な `nil` のチェックが Version 2 では削除されています。
435
+
436
+ ```ruby
437
+ # opengl-bindings1
438
+ module OpenGL
439
+ #...
440
+ def self.get_command( sym )
441
+ if GL_FUNCTIONS_MAP[sym] == nil
442
+ bind_command( sym )
443
+ end
444
+ return GL_FUNCTIONS_MAP[sym]
445
+ end
446
+
447
+ #...
448
+
449
+ def glEnable(_cap_)
450
+ f = OpenGL::get_command(:glEnable) # Every API call caused redundant nil check here
451
+ f.call(_cap_)
452
+ end
453
+ ```
454
+
455
+ ```ruby
456
+ # opengl-bindings2
457
+ module GL
458
+ #...
459
+ def self.Enable(_cap_)
460
+ GL_FUNCTIONS_MAP[:glEnable].call(_cap_) # Hashmap is built on initialization so there's no need to do nil check at every API call
461
+ end
462
+ ```
463
+
464
+ ---
465
+
466
+ ## 特徴 ##
467
+
468
+ * 標準ライブラリ Fiddle を使っています ⇒ opengl ( https://rubygems.org/gems/opengl ) のように拡張ライブラリをビルドする必要がありません
469
+ * 関数とenumのラッパーコードは Khronos の XML API registry ( https://github.com/KhronosGroup/OpenGL-Registry ) の gl.xml から自動生成しています
470
+
471
+
472
+ ## インストール ##
473
+
474
+ RubyGems経由で ( https://rubygems.org/gems/opengl-bindings ):
475
+
476
+ $ gem install opengl-bindings
477
+
478
+ もしくは lib 以下の *.rb をコピー → その場所をロードパスに加えて次のように起動:
479
+
480
+ $ ruby -I ./lib your_app.rb
481
+
482
+
483
+ ## 使い方 ##
484
+
485
+ sample/simple.rb または sample/simple_glut.rb を参照してください。
486
+
487
+ その他のサンプルと自動生成スクリプトはこちらで開発しています:
488
+ https://github.com/vaiorabbit/ruby-opengl
489
+
490
+
491
+ ## 内容 ##
492
+
493
+ * 'opengl.rb' require することで下記のスクリプトを取り込みます:
494
+ * 'opengl_command.rb' : OpenGL 関数のラッパーコード (glDrawRangeElements, etc.)。 generator/generate_command.rb で自動生成されたものです。
495
+ * 'opengl_enum.rb' : OpenGL enum のラッパーコード (GL_TRIANGLE_STRIP, etc.)。 generator/generate_enum.rb で自動生成されたものです。
496
+ * 'opengl_common.rb' : 共通のユーティリティ関数を提供しています。
497
+ * 'opengl_platform.rb' : 動作プラットフォームの判別機能を提供しています (OpneGL.get_platform)。
498
+ * 'opengl_windows.rb' : Windows 用の機能を提供しています (wglGetProcAddress, wglGetCurrentContext, wglGetCurrentDC).
499
+ * 'opengl_macosx.rb' : Mac OS X 用の機能を提供しています (CGLGetCurrentContext, CGLGetShareGroup).
500
+ * 'opengl_linux.rb' : Linux (X Window) 用の機能を提供しています (glXGetCurrentContext, glXGetCurrentDisplay).
501
+
502
+ * 'opengl_es.rb' は 'opengl_es_command.rb' と 'opengl_es_enum.rb' を取り込む以外は 'opengl.rb' と同じです。
503
+
504
+ * 'opengl_ext.rb' を require することで下記のスクリプトを取り込みます:
505
+ * 'opengl_ext_command.rb' : OpenGL 拡張関数のラッパーコード。 generator/generate_ext_command.rb で自動生成されたものです。
506
+ * 'opengl_ext_enum.rb' : OpenGL 拡張enumのラッパーコード。 generator/generate_ext_enum.rb で自動生成されたものです。
507
+
508
+ * 'opengl_es_ext.rb' は 'opengl_es_ext_command.rb' と 'opengl_es_ext_enum.rb' を取り込む以外は 'opengl_ext.rb' と同じです。
509
+
510
+ * 'glfw.rb'
511
+ * GLFW のラッパーコードです(自動生成ではありません)
512
+
513
+ * 'glut.rb'
514
+ * GLUT ラッパー。API Level 4 までサポートしています (GLUT_API_VERSION = 4)。
515
+
516
+
517
+ * 'glu.rb'
518
+ * GLU のラッパーコードです(自動生成ではありません)。
519
+
520
+ * 'generator/gl.xml'
521
+ * Khronos 公式の XML API registry です。
522
+
523
+ * 'generator/Rakefile'
524
+ * 自動生成関連のタスクを自動化するためのものです。'rake' と打てば gl.xml の取得とラッパーコードの生成を実行します。
525
+ * gl.xml の取得だけなど、単体のタスクなら 'get_gl_xml.rb' などの個別Rubyスクリプトでも実行できます。
526
+
527
+ * 'sample/simple.rb', 'sample/simple_glut.rb'
528
+ * 一番簡単なサンプルです。
529
+ * simple.rb : 同じ場所に glfw3.dll (Windows) もしくは libglfw.dylib (Mac OS X) を置いてください。詳細は sample/README.md に記載されています。
530
+ * simple_glut.rb : (Windows の場合) freeglut.dll を置いてください。詳細は sample/README.md に記載されています。
531
+
532
+ * 'sample/data', 'sample/util'
533
+ * サンプルで共有する機能・データの配置場所です。
534
+
535
+
536
+ ## 必要なもの ##
537
+
538
+ * Fiddle
539
+ * libffi のラッパーです
540
+ * Fiddle のメモリリーク問題 (https://bugs.ruby-lang.org/issues/9599) が修正された Ruby 2.1.2 以降での利用を推奨します
541
+
542
+ ### サンプル用 ###
543
+
544
+ GLFW か GLUT を用意してください。ウィンドウやレンダリングコンテキストの管理に必要です。
545
+
546
+ * GLFW
547
+ * http://www.glfw.org/
548
+ * http://www.glfw.org/download.html
549
+
550
+ * freeglut
551
+ * http://freeglut.sourceforge.net
552
+ * http://freeglut.sourceforge.net/index.php#download
553
+
554
+
555
+ ## テストした環境 ##
556
+
557
+ * Ruby
558
+ * ruby 4.0.0 (2025-12-25 revision 553f1675f3) +PRISM [x64-mingw-ucrt]
559
+ * ruby 4.0.0 (2025-12-25 revision 553f1675f3) +PRISM [arm64-darwin25]
560
+
561
+ * Windows 11 Pro (Version 25H2, OS Build 26200.7462)
562
+
563
+ > ruby report_env.rb
564
+ Version : 4.5.0 NVIDIA 591.44
565
+ Vendor : NVIDIA Corporation
566
+ Renderer : NVIDIA GeForce RTX 4080 Laptop GPU/PCIe/SSE2
567
+ Shader : 4.50 NVIDIA
568
+
569
+ * macOS 26.2 / Mac mini (M1 2020)
570
+
571
+ $ ruby report_env.rb
572
+ Version : 4.1 Metal - 90.5
573
+ Vendor : Apple
574
+ Renderer : Apple M1
575
+ Shader : 4.10
576
+
577
+ * Arch Linux kernel 4.1.2-2-ARCH, Nvidia Driver, x86_64
578
+ * NVIDIA GeForce GTS 450
579
+ * OpenGL 4.5.0
580
+
581
+ $ ruby report_env.rb
582
+ Version: 4.5.0 NVIDIA 352.21
583
+
584
+ * Arch Linux kernel 4.1.4-1-ARCH, Nouveau Driver, x86_64
585
+ * NVIDIA GeForce GTS 450
586
+ * OpenGL 3.0
587
+
588
+ $ ruby report_env.rb
589
+ Version: 3.0 Mesa 10.6.3
590
+
591
+ <details>
592
+ <summary>以前のバージョン</summary>
593
+
594
+ * Ruby
595
+ * ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +PRISM [x64-mingw-ucrt]
596
+ * ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [arm64-darwin23]
597
+ * ruby 3.2.0 (2022-12-25 revision a528908271) [arm64-darwin21]
598
+ * ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [arm64-darwin20]
599
+ * ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x64-mingw32]
600
+ * ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [arm64-darwin20]
601
+ * ruby 3.0.1p64 (2021-04-05 revision 0fb782ee38) [arm64-darwin20]
602
+ * ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x64-mingw32]
603
+ * ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [arm64-darwin20]
604
+ * ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [arm64-darwin20]
605
+ * ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x64-mingw32]
606
+ * ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-darwin19]
607
+ * ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-darwin18]
608
+ * ruby 2.6.1p33 (2019-01-30 revision 66950) [x86_64-darwin18]
609
+ * ruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-darwin18]
610
+ * ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]
611
+ * ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-darwin17]
612
+ * ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin16]
613
+ * ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-darwin16]
614
+ * ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]
615
+ * ruby 2.3.0p0 (2015-12-25 revision 53290) [x64-mingw32]
616
+ * ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin15]
617
+ * ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin14]
618
+ * ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]
619
+ * ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-darwin14]
620
+ * ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-darwin14]
621
+ * ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin14]
622
+ * ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0]
623
+ * ruby 2.1.2p95 (2014-05-08 revision 45877) [i386-mingw32]
624
+ * ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-darwin12.0]
625
+ * ruby 2.0.0p353 (2013-11-22 revision 43784) [x86_64-darwin13.0.0]
626
+ * ruby 2.0.0p247 (2013-06-27) [i386-mingw32]
627
+
628
+ * Windows 11 Pro (Version 24H2, OS Build 26100.2605)
629
+
630
+ > ruby report_env.rb
631
+ Version : 4.5.0 NVIDIA 560.94
632
+ Vendor : NVIDIA Corporation
633
+ Renderer : NVIDIA GeForce RTX 4080 Laptop GPU/PCIe/SSE2
634
+ Shader : 4.50 NVIDIA
635
+
636
+ * Windows 10 Home, 64-bit (Version 1909, OS Build 18363.778)
637
+ * NVIDIA GeForce RTX 2060 SUPER
638
+ * OpenGL 4.5
639
+
640
+ > ruby report_env.rb
641
+ Version : 4.5.0 NVIDIA 436.30
642
+ Vendor : NVIDIA Corporation
643
+ Renderer : GeForce RTX 2060 SUPER/PCIe/SSE2
644
+ Shader : 4.50 NVIDIA
645
+
646
+ * Windows 10 Home, 64-bit (Version 1511, OS Build 10586.164)
647
+ * NVIDIA GeForce GTX 960
648
+ * OpenGL 4.5
649
+
650
+ > ruby report_env.rb
651
+ Version: 4.5.0 NVIDIA 364.72
652
+
653
+ * Windows 7 Home Premium, 64-bit (Service Pack 1)
654
+ * NVIDIA GeForce GTX 560
655
+ * OpenGL 4.3
656
+
657
+ > ruby report_env.rb
658
+ 4.3.0
659
+
660
+ * Windows 7 Home Premium, 64-bit (Service Pack 1)
661
+ * NVIDIA GeForce GTX 560
662
+ * OpenGL 4.3
663
+
664
+ > ruby report_env.rb
665
+ 4.3.0
666
+
667
+ * Mac OS X 10.8.4, 64-bit
668
+ * NVIDIA GeForce 320M on Mac mini (Mid 2010)
669
+ * OpenGL 2.1
670
+
671
+ $ ruby report_env.rb
672
+ 2.1 NVIDIA-8.12.47 310.40.00.05f01
673
+
674
+ * Mac OS X 10.10.5, 64-bit
675
+ * Intel Iris on Mac mini (Late 2014)
676
+ * OpenGL 4.1
677
+
678
+ $ ruby report_env.rb
679
+ Version: 4.1 INTEL-10.6.33
680
+
681
+ * Mac OS X 10.15.3, 64-bit
682
+ * Intel Iris on Mac mini (Late 2014)
683
+ * OpenGL 4.1
684
+
685
+ $ ruby report_env.rb
686
+ Version : 4.1 INTEL-14.4.23
687
+ Vendor : Intel Inc.
688
+ Renderer : Intel Iris OpenGL Engine
689
+ Shader : 4.10
690
+
691
+ * macOS 12.5.1, 64-bit
692
+ * Mac mini (M1 2020)
693
+ * OpenGL 4.1
694
+
695
+ $ ruby report_env.rb
696
+ Version : 4.1 Metal - 76.3
697
+ Vendor : Apple
698
+ Renderer : Apple M1
699
+ Shader : 4.10
700
+
701
+ * macOS 15.2 / Mac mini (M1 2020)
702
+
703
+ $ ruby report_env.rb
704
+ Version : 4.1 Metal - 89.3
705
+ Vendor : Apple
706
+ Renderer : Apple M1
707
+ Shader : 4.10
708
+
709
+ </details>
710
+
711
+ ## メモ ##
712
+
713
+ * Rubyスタイルの便利なインターフェースはサポートしていません (ruby-opengl2 ( http://ruby-opengl.rubyforge.org/ ) にあったような感じのもの)
714
+ * 例:
715
+ * (OpenGLオリジナルの C API)
716
+
717
+ GLuint tex_names_buf[2];
718
+ glGenTextures( 2, tex_names_buf );
719
+ GLuint tex_name = tex_names_buf[0];
720
+
721
+ * (このライブラリの場合)
722
+
723
+ tex_names_buf = ' ' * 8 # テクスチャ名(GLuint)を受け取るのに十分なサイズ String インスタンスであればOK
724
+ glGenTextures( 2, tex_names_buf )
725
+ tex_name = tex_names_buf.unpack('L2')[0]
726
+
727
+ * (ruby-opengl2 の場合)
728
+
729
+ tex_name = glGenTextures( 2 )[0] # glGenTextures が配列を返すように修正されています
730
+
731
+ * opengl-bindings を使ったプロジェクト
732
+ * ruby-gnome2
733
+ * https://github.com/ruby-gnome2/ruby-gnome2
734
+ * https://github.com/ruby-gnome2/ruby-gnome2/tree/master/gtk3/sample/misc
735
+ * gtkglarea1.rb, gtkglarea2.rb
736
+ * FXRuby - A library for cross-platform graphical user interfaces
737
+ * https://github.com/larskanis/fxruby/blob/1.6/examples/glviewer.rb
738
+ * dxsdl2r
739
+ * https://github.com/mirichi/dxsdl2r
740
+ * mittsu - A direct port of THREE.js from JavaScript/WebGL to Ruby/OpenGL
741
+ * https://rubygems.org/gems/mittsu
742
+ * https://github.com/jellymann/mittsu
743
+ * opencl-bindings - A Ruby binding for OpenCL 1.2
744
+ * https://rubygems.org/gems/opencl-bindings
745
+ * https://github.com/vaiorabbit/ruby-opencl
746
+ * perfume_dance - A BVH motion parser and playback implementation written in Ruby
747
+ * https://github.com/vaiorabbit/perfume_dance
748
+ * open.gl.rb - A port of the https://open.gl/ tutorials to Ruby
749
+ * https://github.com/mechazoidal/opendotgl_rb
750
+
751
+ * 参考になりそうなプロジェクト
752
+ * argon | neon
753
+ * https://github.com/npomf/argon
754
+ * https://bitbucket.org/npomf/neon/src
755
+ * "vaiorabbit / ruby-opengl - as the basis for the OpenGL, OpenAL, and GLFW FFI libraries."
756
+
757
+
758
+ ## ライセンス ##
759
+
760
+ * zlib/libpng ライセンスです ( http://opensource.org/licenses/Zlib )。
761
+
762
+ * sample/GLExcess 以下にあるものについては GNU General Public License version 2 です。
763
+ sample/GLExcess/GPL2.txt を参照してください。
764
+
765
+ * sample/OrangeBook 以下にあるものについては修正BSDライセンスです。
766
+ sample/OrangeBook/3Dlabs-License.txt を参照してください。
767
+