opengl-bindings 1.6.11 → 1.6.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog +669 -657
- data/LICENSE.txt +1 -1
- data/README.md +656 -536
- data/lib/glfw.rb +711 -711
- data/lib/glu.rb +366 -366
- data/lib/glut.rb +576 -576
- data/lib/opengl.rb +43 -43
- data/lib/opengl_command.rb +7347 -7347
- data/lib/opengl_common.rb +54 -54
- data/lib/opengl_enum.rb +1818 -1818
- data/lib/opengl_es.rb +31 -31
- data/lib/opengl_es_command.rb +2517 -2517
- data/lib/opengl_es_ext.rb +28 -28
- data/lib/opengl_es_ext_command.rb +8432 -8377
- data/lib/opengl_es_ext_enum.rb +6133 -6055
- data/lib/opengl_ext.rb +34 -34
- data/lib/opengl_ext_command.rb +30778 -30480
- data/lib/opengl_ext_common.rb +52 -52
- data/lib/opengl_ext_enum.rb +14137 -14082
- data/lib/opengl_linux.rb +63 -63
- data/lib/opengl_macosx.rb +68 -68
- data/lib/opengl_platform.rb +43 -43
- data/lib/opengl_windows.rb +71 -71
- data/sample/glfw_build.bat +0 -0
- data/sample/glfw_build.sh +13 -13
- metadata +9 -9
data/lib/opengl_linux.rb
CHANGED
@@ -1,63 +1,63 @@
|
|
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
|
40
|
-
|
41
|
-
=begin
|
42
|
-
Ruby-OpenGL : Yet another OpenGL wrapper for Ruby (and wrapper code generator)
|
43
|
-
Copyright (c) 2013-2021 vaiorabbit <http://twitter.com/vaiorabbit>
|
44
|
-
|
45
|
-
This software is provided 'as-is', without any express or implied
|
46
|
-
warranty. In no event will the authors be held liable for any damages
|
47
|
-
arising from the use of this software.
|
48
|
-
|
49
|
-
Permission is granted to anyone to use this software for any purpose,
|
50
|
-
including commercial applications, and to alter it and redistribute it
|
51
|
-
freely, subject to the following restrictions:
|
52
|
-
|
53
|
-
1. The origin of this software must not be misrepresented; you must not
|
54
|
-
claim that you wrote the original software. If you use this software
|
55
|
-
in a product, an acknowledgment in the product documentation would be
|
56
|
-
appreciated but is not required.
|
57
|
-
|
58
|
-
2. Altered source versions must be plainly marked as such, and must not be
|
59
|
-
misrepresented as being the original software.
|
60
|
-
|
61
|
-
3. This notice may not be removed or altered from any source
|
62
|
-
distribution.
|
63
|
-
=end
|
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
|
40
|
+
|
41
|
+
=begin
|
42
|
+
Ruby-OpenGL : Yet another OpenGL wrapper for Ruby (and wrapper code generator)
|
43
|
+
Copyright (c) 2013-2021 vaiorabbit <http://twitter.com/vaiorabbit>
|
44
|
+
|
45
|
+
This software is provided 'as-is', without any express or implied
|
46
|
+
warranty. In no event will the authors be held liable for any damages
|
47
|
+
arising from the use of this software.
|
48
|
+
|
49
|
+
Permission is granted to anyone to use this software for any purpose,
|
50
|
+
including commercial applications, and to alter it and redistribute it
|
51
|
+
freely, subject to the following restrictions:
|
52
|
+
|
53
|
+
1. The origin of this software must not be misrepresented; you must not
|
54
|
+
claim that you wrote the original software. If you use this software
|
55
|
+
in a product, an acknowledgment in the product documentation would be
|
56
|
+
appreciated but is not required.
|
57
|
+
|
58
|
+
2. Altered source versions must be plainly marked as such, and must not be
|
59
|
+
misrepresented as being the original software.
|
60
|
+
|
61
|
+
3. This notice may not be removed or altered from any source
|
62
|
+
distribution.
|
63
|
+
=end
|
data/lib/opengl_macosx.rb
CHANGED
@@ -1,68 +1,68 @@
|
|
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
|
45
|
-
|
46
|
-
=begin
|
47
|
-
Ruby-OpenGL : Yet another OpenGL wrapper for Ruby (and wrapper code generator)
|
48
|
-
Copyright (c) 2013-2021 vaiorabbit <http://twitter.com/vaiorabbit>
|
49
|
-
|
50
|
-
This software is provided 'as-is', without any express or implied
|
51
|
-
warranty. In no event will the authors be held liable for any damages
|
52
|
-
arising from the use of this software.
|
53
|
-
|
54
|
-
Permission is granted to anyone to use this software for any purpose,
|
55
|
-
including commercial applications, and to alter it and redistribute it
|
56
|
-
freely, subject to the following restrictions:
|
57
|
-
|
58
|
-
1. The origin of this software must not be misrepresented; you must not
|
59
|
-
claim that you wrote the original software. If you use this software
|
60
|
-
in a product, an acknowledgment in the product documentation would be
|
61
|
-
appreciated but is not required.
|
62
|
-
|
63
|
-
2. Altered source versions must be plainly marked as such, and must not be
|
64
|
-
misrepresented as being the original software.
|
65
|
-
|
66
|
-
3. This notice may not be removed or altered from any source
|
67
|
-
distribution.
|
68
|
-
=end
|
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
|
45
|
+
|
46
|
+
=begin
|
47
|
+
Ruby-OpenGL : Yet another OpenGL wrapper for Ruby (and wrapper code generator)
|
48
|
+
Copyright (c) 2013-2021 vaiorabbit <http://twitter.com/vaiorabbit>
|
49
|
+
|
50
|
+
This software is provided 'as-is', without any express or implied
|
51
|
+
warranty. In no event will the authors be held liable for any damages
|
52
|
+
arising from the use of this software.
|
53
|
+
|
54
|
+
Permission is granted to anyone to use this software for any purpose,
|
55
|
+
including commercial applications, and to alter it and redistribute it
|
56
|
+
freely, subject to the following restrictions:
|
57
|
+
|
58
|
+
1. The origin of this software must not be misrepresented; you must not
|
59
|
+
claim that you wrote the original software. If you use this software
|
60
|
+
in a product, an acknowledgment in the product documentation would be
|
61
|
+
appreciated but is not required.
|
62
|
+
|
63
|
+
2. Altered source versions must be plainly marked as such, and must not be
|
64
|
+
misrepresented as being the original software.
|
65
|
+
|
66
|
+
3. This notice may not be removed or altered from any source
|
67
|
+
distribution.
|
68
|
+
=end
|
data/lib/opengl_platform.rb
CHANGED
@@ -1,43 +1,43 @@
|
|
1
|
-
require 'rbconfig'
|
2
|
-
|
3
|
-
module OpenGL
|
4
|
-
@@opengl_platform = case RbConfig::CONFIG['host_os']
|
5
|
-
when /mswin|msys|mingw|cygwin/
|
6
|
-
:OPENGL_PLATFORM_WINDOWS
|
7
|
-
when /darwin/
|
8
|
-
:OPENGL_PLATFORM_MACOSX
|
9
|
-
when /linux/
|
10
|
-
:OPENGL_PLATFORM_LINUX
|
11
|
-
else
|
12
|
-
raise RuntimeError, "OpenGL : Unknown OS: #{host_os.inspect}"
|
13
|
-
end
|
14
|
-
|
15
|
-
def self.get_platform()
|
16
|
-
return @@opengl_platform
|
17
|
-
end
|
18
|
-
|
19
|
-
end
|
20
|
-
|
21
|
-
=begin
|
22
|
-
Ruby-OpenGL : Yet another OpenGL wrapper for Ruby (and wrapper code generator)
|
23
|
-
Copyright (c) 2013-2021 vaiorabbit <http://twitter.com/vaiorabbit>
|
24
|
-
|
25
|
-
This software is provided 'as-is', without any express or implied
|
26
|
-
warranty. In no event will the authors be held liable for any damages
|
27
|
-
arising from the use of this software.
|
28
|
-
|
29
|
-
Permission is granted to anyone to use this software for any purpose,
|
30
|
-
including commercial applications, and to alter it and redistribute it
|
31
|
-
freely, subject to the following restrictions:
|
32
|
-
|
33
|
-
1. The origin of this software must not be misrepresented; you must not
|
34
|
-
claim that you wrote the original software. If you use this software
|
35
|
-
in a product, an acknowledgment in the product documentation would be
|
36
|
-
appreciated but is not required.
|
37
|
-
|
38
|
-
2. Altered source versions must be plainly marked as such, and must not be
|
39
|
-
misrepresented as being the original software.
|
40
|
-
|
41
|
-
3. This notice may not be removed or altered from any source
|
42
|
-
distribution.
|
43
|
-
=end
|
1
|
+
require 'rbconfig'
|
2
|
+
|
3
|
+
module OpenGL
|
4
|
+
@@opengl_platform = case RbConfig::CONFIG['host_os']
|
5
|
+
when /mswin|msys|mingw|cygwin/
|
6
|
+
:OPENGL_PLATFORM_WINDOWS
|
7
|
+
when /darwin/
|
8
|
+
:OPENGL_PLATFORM_MACOSX
|
9
|
+
when /linux/
|
10
|
+
:OPENGL_PLATFORM_LINUX
|
11
|
+
else
|
12
|
+
raise RuntimeError, "OpenGL : Unknown OS: #{host_os.inspect}"
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.get_platform()
|
16
|
+
return @@opengl_platform
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
|
21
|
+
=begin
|
22
|
+
Ruby-OpenGL : Yet another OpenGL wrapper for Ruby (and wrapper code generator)
|
23
|
+
Copyright (c) 2013-2021 vaiorabbit <http://twitter.com/vaiorabbit>
|
24
|
+
|
25
|
+
This software is provided 'as-is', without any express or implied
|
26
|
+
warranty. In no event will the authors be held liable for any damages
|
27
|
+
arising from the use of this software.
|
28
|
+
|
29
|
+
Permission is granted to anyone to use this software for any purpose,
|
30
|
+
including commercial applications, and to alter it and redistribute it
|
31
|
+
freely, subject to the following restrictions:
|
32
|
+
|
33
|
+
1. The origin of this software must not be misrepresented; you must not
|
34
|
+
claim that you wrote the original software. If you use this software
|
35
|
+
in a product, an acknowledgment in the product documentation would be
|
36
|
+
appreciated but is not required.
|
37
|
+
|
38
|
+
2. Altered source versions must be plainly marked as such, and must not be
|
39
|
+
misrepresented as being the original software.
|
40
|
+
|
41
|
+
3. This notice may not be removed or altered from any source
|
42
|
+
distribution.
|
43
|
+
=end
|
data/lib/opengl_windows.rb
CHANGED
@@ -1,71 +1,71 @@
|
|
1
|
-
require 'fiddle'
|
2
|
-
|
3
|
-
module OpenGL
|
4
|
-
|
5
|
-
WGL_FUNCTIONS_MAP = {}
|
6
|
-
WGL_FUNCTIONS_ARGS_MAP = {}
|
7
|
-
WGL_FUNCTIONS_RETVAL_MAP = {}
|
8
|
-
|
9
|
-
def self.get_wgl_command( sym )
|
10
|
-
if WGL_FUNCTIONS_MAP[sym] == nil
|
11
|
-
bind_wgl_command( sym )
|
12
|
-
end
|
13
|
-
return WGL_FUNCTIONS_MAP[sym]
|
14
|
-
end
|
15
|
-
|
16
|
-
def self.bind_wgl_command( sym )
|
17
|
-
WGL_FUNCTIONS_MAP[sym] = Fiddle::Function.new( @@gl_dll[sym.to_s],
|
18
|
-
WGL_FUNCTIONS_ARGS_MAP[sym],
|
19
|
-
WGL_FUNCTIONS_RETVAL_MAP[sym] )
|
20
|
-
raise RuntimeError if WGL_FUNCTIONS_RETVAL_MAP[sym] == nil
|
21
|
-
end
|
22
|
-
|
23
|
-
WGL_FUNCTIONS_ARGS_MAP[:wglGetProcAddress] = [Fiddle::TYPE_VOIDP]
|
24
|
-
WGL_FUNCTIONS_RETVAL_MAP[:wglGetProcAddress] = Fiddle::TYPE_VOIDP
|
25
|
-
|
26
|
-
def self.wglGetProcAddress(_lpszProc_)
|
27
|
-
f = OpenGL::get_wgl_command(:wglGetProcAddress)
|
28
|
-
f.call(_lpszProc_)
|
29
|
-
end
|
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
|
-
|
47
|
-
end
|
48
|
-
|
49
|
-
=begin
|
50
|
-
Ruby-OpenGL : Yet another OpenGL wrapper for Ruby (and wrapper code generator)
|
51
|
-
Copyright (c) 2013-2021 vaiorabbit <http://twitter.com/vaiorabbit>
|
52
|
-
|
53
|
-
This software is provided 'as-is', without any express or implied
|
54
|
-
warranty. In no event will the authors be held liable for any damages
|
55
|
-
arising from the use of this software.
|
56
|
-
|
57
|
-
Permission is granted to anyone to use this software for any purpose,
|
58
|
-
including commercial applications, and to alter it and redistribute it
|
59
|
-
freely, subject to the following restrictions:
|
60
|
-
|
61
|
-
1. The origin of this software must not be misrepresented; you must not
|
62
|
-
claim that you wrote the original software. If you use this software
|
63
|
-
in a product, an acknowledgment in the product documentation would be
|
64
|
-
appreciated but is not required.
|
65
|
-
|
66
|
-
2. Altered source versions must be plainly marked as such, and must not be
|
67
|
-
misrepresented as being the original software.
|
68
|
-
|
69
|
-
3. This notice may not be removed or altered from any source
|
70
|
-
distribution.
|
71
|
-
=end
|
1
|
+
require 'fiddle'
|
2
|
+
|
3
|
+
module OpenGL
|
4
|
+
|
5
|
+
WGL_FUNCTIONS_MAP = {}
|
6
|
+
WGL_FUNCTIONS_ARGS_MAP = {}
|
7
|
+
WGL_FUNCTIONS_RETVAL_MAP = {}
|
8
|
+
|
9
|
+
def self.get_wgl_command( sym )
|
10
|
+
if WGL_FUNCTIONS_MAP[sym] == nil
|
11
|
+
bind_wgl_command( sym )
|
12
|
+
end
|
13
|
+
return WGL_FUNCTIONS_MAP[sym]
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.bind_wgl_command( sym )
|
17
|
+
WGL_FUNCTIONS_MAP[sym] = Fiddle::Function.new( @@gl_dll[sym.to_s],
|
18
|
+
WGL_FUNCTIONS_ARGS_MAP[sym],
|
19
|
+
WGL_FUNCTIONS_RETVAL_MAP[sym] )
|
20
|
+
raise RuntimeError if WGL_FUNCTIONS_RETVAL_MAP[sym] == nil
|
21
|
+
end
|
22
|
+
|
23
|
+
WGL_FUNCTIONS_ARGS_MAP[:wglGetProcAddress] = [Fiddle::TYPE_VOIDP]
|
24
|
+
WGL_FUNCTIONS_RETVAL_MAP[:wglGetProcAddress] = Fiddle::TYPE_VOIDP
|
25
|
+
|
26
|
+
def self.wglGetProcAddress(_lpszProc_)
|
27
|
+
f = OpenGL::get_wgl_command(:wglGetProcAddress)
|
28
|
+
f.call(_lpszProc_)
|
29
|
+
end
|
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
|
+
|
47
|
+
end
|
48
|
+
|
49
|
+
=begin
|
50
|
+
Ruby-OpenGL : Yet another OpenGL wrapper for Ruby (and wrapper code generator)
|
51
|
+
Copyright (c) 2013-2021 vaiorabbit <http://twitter.com/vaiorabbit>
|
52
|
+
|
53
|
+
This software is provided 'as-is', without any express or implied
|
54
|
+
warranty. In no event will the authors be held liable for any damages
|
55
|
+
arising from the use of this software.
|
56
|
+
|
57
|
+
Permission is granted to anyone to use this software for any purpose,
|
58
|
+
including commercial applications, and to alter it and redistribute it
|
59
|
+
freely, subject to the following restrictions:
|
60
|
+
|
61
|
+
1. The origin of this software must not be misrepresented; you must not
|
62
|
+
claim that you wrote the original software. If you use this software
|
63
|
+
in a product, an acknowledgment in the product documentation would be
|
64
|
+
appreciated but is not required.
|
65
|
+
|
66
|
+
2. Altered source versions must be plainly marked as such, and must not be
|
67
|
+
misrepresented as being the original software.
|
68
|
+
|
69
|
+
3. This notice may not be removed or altered from any source
|
70
|
+
distribution.
|
71
|
+
=end
|
data/sample/glfw_build.bat
CHANGED
File without changes
|
data/sample/glfw_build.sh
CHANGED
@@ -1,13 +1,13 @@
|
|
1
|
-
#
|
2
|
-
# For Mac OS X + Xcode + CMake users.
|
3
|
-
#
|
4
|
-
# Ref.: https://github.com/malkia/ufo/blob/master/build/OSX/glfw.sh
|
5
|
-
#
|
6
|
-
git clone --depth=1 https://github.com/glfw/glfw.git glfw_master
|
7
|
-
cd glfw_master/
|
8
|
-
mkdir build
|
9
|
-
cd build
|
10
|
-
export MACOSX_DEPLOYMENT_TARGET=10.14
|
11
|
-
cmake -D CMAKE_BUILD_TYPE=Release -D GLFW_NATIVE_API=1 -D CMAKE_OSX_ARCHITECTURES="x86_64;arm64" -D BUILD_SHARED_LIBS=ON -D CMAKE_C_COMPILER=clang ../
|
12
|
-
make
|
13
|
-
cp -R src/libglfw* ../..
|
1
|
+
#
|
2
|
+
# For Mac OS X + Xcode + CMake users.
|
3
|
+
#
|
4
|
+
# Ref.: https://github.com/malkia/ufo/blob/master/build/OSX/glfw.sh
|
5
|
+
#
|
6
|
+
git clone --depth=1 https://github.com/glfw/glfw.git glfw_master
|
7
|
+
cd glfw_master/
|
8
|
+
mkdir build
|
9
|
+
cd build
|
10
|
+
export MACOSX_DEPLOYMENT_TARGET=10.14
|
11
|
+
cmake -D CMAKE_BUILD_TYPE=Release -D GLFW_NATIVE_API=1 -D CMAKE_OSX_ARCHITECTURES="x86_64;arm64" -D BUILD_SHARED_LIBS=ON -D CMAKE_C_COMPILER=clang ../
|
12
|
+
make
|
13
|
+
cp -R src/libglfw* ../..
|
metadata
CHANGED
@@ -1,19 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opengl-bindings
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- vaiorabbit
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-09 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description:
|
14
|
-
|
15
|
-
|
16
|
-
'
|
13
|
+
description: |
|
14
|
+
[Please consider migrating to opengl-bindings2 (https://rubygems.org/gems/opengl-bindings2)]
|
15
|
+
Ruby bindings for OpenGL - 4.6, OpenGL ES - 3.2 and all extensions using Fiddle (For MRI >= 2.0.0). GLFW/GLUT/GLU bindings are also available.
|
17
16
|
email:
|
18
17
|
- vaiorabbit@gmail.com
|
19
18
|
executables: []
|
@@ -50,7 +49,7 @@ files:
|
|
50
49
|
- sample/report_env.rb
|
51
50
|
- sample/simple.rb
|
52
51
|
- sample/simple_glut.rb
|
53
|
-
homepage: https://github.com/vaiorabbit/ruby-opengl
|
52
|
+
homepage: https://github.com/vaiorabbit/ruby-opengl/tree/version/1.6
|
54
53
|
licenses:
|
55
54
|
- Zlib
|
56
55
|
metadata: {}
|
@@ -69,8 +68,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
69
68
|
- !ruby/object:Gem::Version
|
70
69
|
version: '0'
|
71
70
|
requirements: []
|
72
|
-
rubygems_version: 3.
|
71
|
+
rubygems_version: 3.3.3
|
73
72
|
signing_key:
|
74
73
|
specification_version: 4
|
75
|
-
summary: Bindings for OpenGL -4.6, ES -
|
74
|
+
summary: "[Attention : Version 2 is now available] Bindings for OpenGL -4.6, ES -
|
75
|
+
3.2 and extensions (For MRI >= 2.0.0)"
|
76
76
|
test_files: []
|