opengl-bindings 1.6.11 → 1.6.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog +701 -657
- data/LICENSE.txt +1 -1
- data/README.md +676 -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 +8498 -8377
- data/lib/opengl_es_ext_enum.rb +6212 -6055
- data/lib/opengl_ext.rb +34 -34
- data/lib/opengl_ext_command.rb +30787 -30480
- data/lib/opengl_ext_common.rb +52 -52
- data/lib/opengl_ext_enum.rb +14146 -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 +3 -2
- data/sample/glfw_build.sh +14 -13
- metadata +9 -9
data/lib/opengl_ext_common.rb
CHANGED
@@ -1,52 +1,52 @@
|
|
1
|
-
module OpenGL
|
2
|
-
|
3
|
-
def self.check_extension( ext_name )
|
4
|
-
glGetString = OpenGL.get_command(:glGetString) # [INTERNAL] Shortcut to get pointer without proper user setup.
|
5
|
-
version_number = glGetString.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
|
-
glGetIntegerv = OpenGL.get_command(:glGetIntegerv)
|
10
|
-
glGetStringi = OpenGL.get_command(:glGetStringi)
|
11
|
-
extensions_count_buf = ' '
|
12
|
-
glGetIntegerv.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 = glGetStringi.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 = glGetString.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
|
-
OpenGLExt.send( define_ext_enum )
|
30
|
-
OpenGLExt.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
|
-
OpenGLExt.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
|
-
OpenGLExt.send( get_ext_command )
|
50
|
-
end
|
51
|
-
|
52
|
-
end
|
1
|
+
module OpenGL
|
2
|
+
|
3
|
+
def self.check_extension( ext_name )
|
4
|
+
glGetString = OpenGL.get_command(:glGetString) # [INTERNAL] Shortcut to get pointer without proper user setup.
|
5
|
+
version_number = glGetString.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
|
+
glGetIntegerv = OpenGL.get_command(:glGetIntegerv)
|
10
|
+
glGetStringi = OpenGL.get_command(:glGetStringi)
|
11
|
+
extensions_count_buf = ' '
|
12
|
+
glGetIntegerv.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 = glGetStringi.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 = glGetString.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
|
+
OpenGLExt.send( define_ext_enum )
|
30
|
+
OpenGLExt.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
|
+
OpenGLExt.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
|
+
OpenGLExt.send( get_ext_command )
|
50
|
+
end
|
51
|
+
|
52
|
+
end
|