opengl-bindings2 2.0.0.rc1 → 2.0.0rc2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog +691 -686
- data/README.md +564 -564
- data/lib/glfw.rb +699 -699
- data/lib/glu.rb +366 -366
- data/lib/glut.rb +575 -575
- data/lib/opengl.rb +36 -36
- data/lib/opengl_command.rb +7356 -7356
- data/lib/opengl_common.rb +81 -81
- data/lib/opengl_enum.rb +1818 -1818
- data/lib/opengl_es.rb +31 -31
- data/lib/opengl_es_command.rb +2526 -2526
- data/lib/opengl_es_enum.rb +1011 -1011
- data/lib/opengl_es_ext.rb +28 -28
- data/lib/opengl_es_ext_command.rb +8969 -8969
- data/lib/opengl_es_ext_enum.rb +6078 -6078
- data/lib/opengl_ext.rb +28 -28
- data/lib/opengl_ext_command.rb +33331 -33331
- data/lib/opengl_ext_common.rb +52 -52
- data/lib/opengl_ext_enum.rb +14137 -14137
- 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/README.md +55 -55
- data/sample/glfw_get.bat +6 -6
- data/sample/glfw_get.sh +3 -3
- data/sample/report_env.rb +7 -7
- data/sample/simple.rb +57 -57
- metadata +3 -3
data/lib/opengl_ext_common.rb
CHANGED
@@ -1,52 +1,52 @@
|
|
1
|
-
module GL
|
2
|
-
|
3
|
-
def self.check_extension(ext_name)
|
4
|
-
get_string = GL.get_command(:glGetString) # [INTERNAL] Shortcut to get pointer without proper user setup.
|
5
|
-
version_number = get_string.call(GL::VERSION).to_s.split(/\./)
|
6
|
-
if version_number[0].to_i >= 3
|
7
|
-
# glGetString(GL_EXTENSIONS) was deprecated in OpenGL 3.0
|
8
|
-
# Ref.: http://sourceforge.net/p/glew/bugs/120/
|
9
|
-
get_integerv = GL.get_command(:glGetIntegerv)
|
10
|
-
get_stringi = GL.get_command(:glGetStringi)
|
11
|
-
extensions_count_buf = ' '
|
12
|
-
get_integerv.call(GL::NUM_EXTENSIONS, extensions_count_buf)
|
13
|
-
extensions_count = extensions_count_buf.unpack('L')[0]
|
14
|
-
extensions_count.times do |i|
|
15
|
-
supported_ext_name = get_stringi.call(GL::EXTENSIONS, i).to_s
|
16
|
-
return true if ext_name == supported_ext_name
|
17
|
-
end
|
18
|
-
return false
|
19
|
-
else
|
20
|
-
ext_strings = get_string.call(GL::EXTENSIONS).to_s.split(/ /)
|
21
|
-
return ext_strings.include? ext_name
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
def self.setup_extension(ext_name, skip_check: false)
|
26
|
-
if skip_check || self.check_extension(ext_name)
|
27
|
-
define_ext_enum = "define_ext_enum_#{ext_name}".to_sym
|
28
|
-
define_ext_command = "define_ext_command_#{ext_name}".to_sym
|
29
|
-
GLExt.send(define_ext_enum)
|
30
|
-
GLExt.send(define_ext_command)
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
def self.setup_extension_all(skip_check: false)
|
35
|
-
self.methods.each do |method_name|
|
36
|
-
if method_name =~ /define_ext_command_(.*)/
|
37
|
-
setup_extension($1, skip_check)
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
def self.get_extension_enum_symbols(ext_name)
|
43
|
-
get_ext_enum = "get_ext_enum_#{ext_name}".to_sym
|
44
|
-
GLExt.send(get_ext_enum)
|
45
|
-
end
|
46
|
-
|
47
|
-
def self.get_extension_command_symbols(ext_name)
|
48
|
-
get_ext_command = "get_ext_command_#{ext_name}".to_sym
|
49
|
-
GLExt.send(get_ext_command)
|
50
|
-
end
|
51
|
-
|
52
|
-
end
|
1
|
+
module GL
|
2
|
+
|
3
|
+
def self.check_extension(ext_name)
|
4
|
+
get_string = GL.get_command(:glGetString) # [INTERNAL] Shortcut to get pointer without proper user setup.
|
5
|
+
version_number = get_string.call(GL::VERSION).to_s.split(/\./)
|
6
|
+
if version_number[0].to_i >= 3
|
7
|
+
# glGetString(GL_EXTENSIONS) was deprecated in OpenGL 3.0
|
8
|
+
# Ref.: http://sourceforge.net/p/glew/bugs/120/
|
9
|
+
get_integerv = GL.get_command(:glGetIntegerv)
|
10
|
+
get_stringi = GL.get_command(:glGetStringi)
|
11
|
+
extensions_count_buf = ' '
|
12
|
+
get_integerv.call(GL::NUM_EXTENSIONS, extensions_count_buf)
|
13
|
+
extensions_count = extensions_count_buf.unpack('L')[0]
|
14
|
+
extensions_count.times do |i|
|
15
|
+
supported_ext_name = get_stringi.call(GL::EXTENSIONS, i).to_s
|
16
|
+
return true if ext_name == supported_ext_name
|
17
|
+
end
|
18
|
+
return false
|
19
|
+
else
|
20
|
+
ext_strings = get_string.call(GL::EXTENSIONS).to_s.split(/ /)
|
21
|
+
return ext_strings.include? ext_name
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.setup_extension(ext_name, skip_check: false)
|
26
|
+
if skip_check || self.check_extension(ext_name)
|
27
|
+
define_ext_enum = "define_ext_enum_#{ext_name}".to_sym
|
28
|
+
define_ext_command = "define_ext_command_#{ext_name}".to_sym
|
29
|
+
GLExt.send(define_ext_enum)
|
30
|
+
GLExt.send(define_ext_command)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def self.setup_extension_all(skip_check: false)
|
35
|
+
self.methods.each do |method_name|
|
36
|
+
if method_name =~ /define_ext_command_(.*)/
|
37
|
+
setup_extension($1, skip_check)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def self.get_extension_enum_symbols(ext_name)
|
43
|
+
get_ext_enum = "get_ext_enum_#{ext_name}".to_sym
|
44
|
+
GLExt.send(get_ext_enum)
|
45
|
+
end
|
46
|
+
|
47
|
+
def self.get_extension_command_symbols(ext_name)
|
48
|
+
get_ext_command = "get_ext_command_#{ext_name}".to_sym
|
49
|
+
GLExt.send(get_ext_command)
|
50
|
+
end
|
51
|
+
|
52
|
+
end
|