opengl-bindings 1.5.1 → 1.5.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 55b6e6b435b1fe04ac0be0e5095edab84d9627c8
4
- data.tar.gz: 4cabf98166e02b2e43ab321c9da9cc0538b3bed9
3
+ metadata.gz: 9d4a60f9ec6d0edcd730c35b05c2f9df9c9dff38
4
+ data.tar.gz: d8bfff5e139aef4e2b2bb0278a0824332db86b09
5
5
  SHA512:
6
- metadata.gz: 3cc184347f44b8e4d0bcbeb50642e543134466673d94bf8cb05c9f09d6e8f9eabf7b03f65988b97d0afd514e8ec16c10d7f1d6c115c83dc40c7d2dd06ff3d810
7
- data.tar.gz: 6a0c188e965ff000ef95c5a83377167be5c0762b8e277622fb913c307c5896c2994591f057455dad1e9ebf2a198bf7ce2ad148c5576d301440347e23e1e123db
6
+ metadata.gz: e5398895ad2c8c2c126672f22b45fb549f3c988fbe916abcb6a031371955ada73cb3f393d7259309ad0bb10c07ae69b3515b7a11f7ee330008e0f3041072c181
7
+ data.tar.gz: 7cbe82566492a6a5520173590cffaa320f5d512f9fea172c8b732e90b2aafa2ee0297f04b30898103b7949d4a32f5dc85bb653b1635f3f2911738016987faff6
data/ChangeLog CHANGED
@@ -1,3 +1,15 @@
1
+ 2015-11-14 vaiorabbit <http://twitter.com/vaiorabbit>
2
+
3
+ * lib/opengl_linux.rb (glXGetCurrentDisplay): Fixed wrong signature.
4
+
5
+ 2015-11-07 vaiorabbit <http://twitter.com/vaiorabbit>
6
+
7
+ * lib/opengl_macosx.rb, lib/opengl_linux.rb: Added.
8
+
9
+ 2015-11-03 vaiorabbit <http://twitter.com/vaiorabbit>
10
+
11
+ * sample/DebugOutput/debug_output.rb: Fidex '$debug_log_callback' to '$debug_log_callback.to_i' (now runnable both C edition and pure-Ruby edition).
12
+
1
13
  2015-10-24 vaiorabbit <http://twitter.com/vaiorabbit>
2
14
 
3
15
  * Updated using latest gl.xml.
data/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  ...and wrapper code generator.
6
6
 
7
7
  * Created : 2013-08-28
8
- * Last modified : 2015-10-24
8
+ * Last modified : 2015-11-14
9
9
 
10
10
 
11
11
  ## Features ##
@@ -44,7 +44,9 @@ https://github.com/vaiorabbit/ruby-opengl
44
44
  * 'opengl_enum.rb' : OpenGL enum wrapper (GL_TRIANGLE_STRIP, etc.). Generated via generator/generate_enum.rb.
45
45
  * 'opengl_common.rb' : Provides utility functions.
46
46
  * 'opengl_platform.rb' : Provides platform check functions (OpneGL.get_platform).
47
- * 'opengl_windows.rb' : Provides functions for Windows platform (wglGetProcAddress).
47
+ * 'opengl_windows.rb' : Provides functions for Windows platform (wglGetProcAddress, wglGetCurrentContext, wglGetCurrentDC).
48
+ * 'opengl_macosx.rb' : Provides functions for Mac OS X platform (CGLGetCurrentContext, CGLGetShareGroup).
49
+ * 'opengl_linux.rb' : Provides functions for Linux (X Window) platform (glXGetCurrentContext, glXGetCurrentDisplay).
48
50
 
49
51
  * 'opengl_es.rb' is almost the same with 'opengl.rb', except for including 'opengl_es_command.rb' and 'opengl_es_enum.rb'.
50
52
 
@@ -248,7 +250,9 @@ https://github.com/vaiorabbit/ruby-opengl
248
250
  * 'opengl_enum.rb' : OpenGL enum のラッパーコード (GL_TRIANGLE_STRIP, etc.)。 generator/generate_enum.rb で自動生成されたものです。
249
251
  * 'opengl_common.rb' : 共通のユーティリティ関数を提供しています。
250
252
  * 'opengl_platform.rb' : 動作プラットフォームの判別機能を提供しています (OpneGL.get_platform)。
251
- * 'opengl_windows.rb' : Windows用の機能を提供しています (wglGetProcAddress)
253
+ * 'opengl_windows.rb' : Windows 用の機能を提供しています (wglGetProcAddress, wglGetCurrentContext, wglGetCurrentDC).
254
+ * 'opengl_macosx.rb' : Mac OS X 用の機能を提供しています (CGLGetCurrentContext, CGLGetShareGroup).
255
+ * 'opengl_linux.rb' : Linux (X Window) 用の機能を提供しています (glXGetCurrentContext, glXGetCurrentDisplay).
252
256
 
253
257
  * 'opengl_es.rb' は 'opengl_es_command.rb' と 'opengl_es_enum.rb' を取り込む以外は 'opengl.rb' と同じです。
254
258
 
@@ -10,4 +10,10 @@ rescue LoadError
10
10
  if OpenGL.get_platform == :OPENGL_PLATFORM_WINDOWS
11
11
  require_relative 'opengl_windows'
12
12
  end
13
+ if OpenGL.get_platform == :OPENGL_PLATFORM_MACOSX
14
+ require_relative 'opengl_macosx'
15
+ end
16
+ if OpenGL.get_platform == :OPENGL_PLATFORM_LINUX
17
+ require_relative 'opengl_linux'
18
+ end
13
19
  end
@@ -0,0 +1,39 @@
1
+ require 'fiddle'
2
+
3
+ module OpenGL
4
+
5
+ GLX_FUNCTIONS_MAP = {}
6
+ GLX_FUNCTIONS_ARGS_MAP = {}
7
+ GLX_FUNCTIONS_RETVAL_MAP = {}
8
+
9
+ def self.get_glx_command( sym )
10
+ if GLX_FUNCTIONS_MAP[sym] == nil
11
+ bind_glx_command( sym )
12
+ end
13
+ return GLX_FUNCTIONS_MAP[sym]
14
+ end
15
+
16
+ def self.bind_glx_command( sym )
17
+ GLX_FUNCTIONS_MAP[sym] = Fiddle::Function.new( @@gl_dll[sym.to_s],
18
+ GLX_FUNCTIONS_ARGS_MAP[sym],
19
+ GLX_FUNCTIONS_RETVAL_MAP[sym] )
20
+ raise RuntimeError if GLX_FUNCTIONS_RETVAL_MAP[sym] == nil
21
+ end
22
+
23
+ GLX_FUNCTIONS_ARGS_MAP[:glXGetCurrentContext] = []
24
+ GLX_FUNCTIONS_RETVAL_MAP[:glXGetCurrentContext] = Fiddle::TYPE_VOIDP
25
+
26
+ def glXGetCurrentContext()
27
+ f = OpenGL::get_glx_command(:glXGetCurrentContext)
28
+ f.call()
29
+ end
30
+
31
+ GLX_FUNCTIONS_ARGS_MAP[:glXGetCurrentDisplay] = [Fiddle::TYPE_VOIDP]
32
+ GLX_FUNCTIONS_RETVAL_MAP[:glXGetCurrentDisplay] = Fiddle::TYPE_VOIDP
33
+
34
+ def glXGetCurrentDisplay(_glx_ctxobj_)
35
+ f = OpenGL::get_glx_command(:glXGetCurrentDisplay)
36
+ f.call(_glx_ctxobj_)
37
+ end
38
+
39
+ end
@@ -0,0 +1,44 @@
1
+ require 'fiddle'
2
+
3
+ module OpenGL
4
+
5
+ CGL_FUNCTIONS_MAP = {}
6
+ CGL_FUNCTIONS_ARGS_MAP = {}
7
+ CGL_FUNCTIONS_RETVAL_MAP = {}
8
+
9
+ @@cgl_dll = nil
10
+
11
+ def self.get_cgl_command( sym )
12
+ if @@cgl_dll == nil
13
+ @@cgl_dll = Fiddle.dlopen('/System/Library/Frameworks/OpenGL.framework/OpenGL')
14
+ end
15
+ if CGL_FUNCTIONS_MAP[sym] == nil
16
+ bind_cgl_command( sym )
17
+ end
18
+ return CGL_FUNCTIONS_MAP[sym]
19
+ end
20
+
21
+ def self.bind_cgl_command( sym )
22
+ CGL_FUNCTIONS_MAP[sym] = Fiddle::Function.new( @@cgl_dll[sym.to_s],
23
+ CGL_FUNCTIONS_ARGS_MAP[sym],
24
+ CGL_FUNCTIONS_RETVAL_MAP[sym] )
25
+ raise RuntimeError if CGL_FUNCTIONS_RETVAL_MAP[sym] == nil
26
+ end
27
+
28
+ CGL_FUNCTIONS_ARGS_MAP[:CGLGetCurrentContext] = []
29
+ CGL_FUNCTIONS_RETVAL_MAP[:CGLGetCurrentContext] = Fiddle::TYPE_VOIDP
30
+
31
+ def CGLGetCurrentContext()
32
+ f = OpenGL::get_cgl_command(:CGLGetCurrentContext)
33
+ f.call()
34
+ end
35
+
36
+ CGL_FUNCTIONS_ARGS_MAP[:CGLGetShareGroup] = [Fiddle::TYPE_VOIDP]
37
+ CGL_FUNCTIONS_RETVAL_MAP[:CGLGetShareGroup] = Fiddle::TYPE_VOIDP
38
+
39
+ def CGLGetShareGroup(_cgl_ctxobj_)
40
+ f = OpenGL::get_cgl_command(:CGLGetShareGroup)
41
+ f.call(_cgl_ctxobj_)
42
+ end
43
+
44
+ end
@@ -28,4 +28,20 @@ module OpenGL
28
28
  f.call(_lpszProc_)
29
29
  end
30
30
 
31
+ WGL_FUNCTIONS_ARGS_MAP[:wglGetCurrentContext] = []
32
+ WGL_FUNCTIONS_RETVAL_MAP[:wglGetCurrentContext] = Fiddle::TYPE_VOIDP
33
+
34
+ def wglGetCurrentContext()
35
+ f = OpenGL::get_wgl_command(:wglGetCurrentContext)
36
+ f.call()
37
+ end
38
+
39
+ WGL_FUNCTIONS_ARGS_MAP[:wglGetCurrentDC] = []
40
+ WGL_FUNCTIONS_RETVAL_MAP[:wglGetCurrentDC] = Fiddle::TYPE_VOIDP
41
+
42
+ def wglGetCurrentDC()
43
+ f = OpenGL::get_wgl_command(:wglGetCurrentDC)
44
+ f.call()
45
+ end
46
+
31
47
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opengl-bindings
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1
4
+ version: 1.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - vaiorabbit
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-24 00:00:00.000000000 Z
11
+ date: 2015-11-21 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |
14
14
  Ruby bindings for OpenGL - 4.5, OpenGL ES - 3.2 and all extensions using Fiddle (For MRI >= 2.0.0). GLFW/GLUT/GLU bindings are also available.
@@ -39,6 +39,8 @@ files:
39
39
  - lib/opengl_ext_command.rb
40
40
  - lib/opengl_ext_common.rb
41
41
  - lib/opengl_ext_enum.rb
42
+ - lib/opengl_linux.rb
43
+ - lib/opengl_macosx.rb
42
44
  - lib/opengl_platform.rb
43
45
  - lib/opengl_windows.rb
44
46
  - sample/README.md