opengl-bindings2 2.0.3 → 2.0.4

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