opengl-bindings 1.6.10 → 1.6.11

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