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.
- checksums.yaml +4 -4
- data/ChangeLog +657 -627
- data/LICENSE.txt +1 -1
- data/README.md +536 -526
- data/lib/glfw.rb +711 -691
- 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 -1806
- 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 +8377 -8246
- data/lib/opengl_es_ext_enum.rb +6055 -5985
- data/lib/opengl_ext.rb +34 -34
- data/lib/opengl_ext_command.rb +30480 -30358
- data/lib/opengl_ext_common.rb +52 -52
- data/lib/opengl_ext_enum.rb +14082 -14008
- 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 +9 -1
- data/sample/glfw_build.sh +13 -13
- metadata +6 -7
- data/lib/glfw32.rb +0 -594
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-
|
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-
|
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-
|
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-
|
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
|