opengl-bindings 1.2.6 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog +6 -0
- data/README.md +13 -4
- data/lib/opengl_command.rb +10 -10
- data/lib/opengl_es.rb +7 -0
- data/lib/opengl_es_command.rb +1733 -0
- data/lib/opengl_es_enum.rb +616 -0
- data/lib/opengl_es_ext.rb +4 -0
- data/lib/opengl_es_ext_command.rb +2238 -0
- data/lib/opengl_es_ext_enum.rb +1074 -0
- data/lib/opengl_ext.rb +1 -30
- data/lib/opengl_ext_command.rb +54 -2
- data/lib/opengl_ext_common.rb +29 -0
- data/lib/opengl_ext_enum.rb +17 -0
- data/sample/report_env.rb +2 -1
- data/sample/report_env_es.rb +22 -0
- metadata +12 -4
data/lib/opengl_ext.rb
CHANGED
@@ -1,33 +1,4 @@
|
|
1
1
|
require_relative 'opengl_common'
|
2
|
+
require_relative 'opengl_ext_common'
|
2
3
|
require_relative 'opengl_ext_enum'
|
3
4
|
require_relative 'opengl_ext_command'
|
4
|
-
|
5
|
-
module OpenGL
|
6
|
-
def self.check_extension( ext_name )
|
7
|
-
version_number = glGetString(GL_VERSION).to_s.split(/\./)
|
8
|
-
if version_number[0].to_i >= 3
|
9
|
-
# glGetString(GL_EXTENSIONS) was deprecated in OpenGL 3.0
|
10
|
-
# Ref.: http://sourceforge.net/p/glew/bugs/120/
|
11
|
-
extensions_count_buf = ' '
|
12
|
-
glGetIntegerv( 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( 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(GL_EXTENSIONS).to_s.split(/ /)
|
21
|
-
return ext_strings.include? ext_name
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
def self.setup_extension( ext_name )
|
26
|
-
if self.check_extension( ext_name )
|
27
|
-
define_enum = "define_enum_#{ext_name}".to_sym
|
28
|
-
define_command = "define_command_#{ext_name}".to_sym
|
29
|
-
self.send( define_enum )
|
30
|
-
self.send( define_command )
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
data/lib/opengl_ext_command.rb
CHANGED
@@ -4459,9 +4459,9 @@ module OpenGL
|
|
4459
4459
|
GL_FUNCTIONS_ARGS_MAP[:glGetInteger64v] = [-Fiddle::TYPE_INT, Fiddle::TYPE_VOIDP]
|
4460
4460
|
GL_FUNCTIONS_RETVAL_MAP[:glGetInteger64v] = Fiddle::TYPE_VOID
|
4461
4461
|
module_eval(<<-SRC_GL_ARB_sync)
|
4462
|
-
def glGetInteger64v(_pname_,
|
4462
|
+
def glGetInteger64v(_pname_, _data_)
|
4463
4463
|
f = OpenGL::get_command(:glGetInteger64v)
|
4464
|
-
f.call(_pname_,
|
4464
|
+
f.call(_pname_, _data_)
|
4465
4465
|
end
|
4466
4466
|
SRC_GL_ARB_sync
|
4467
4467
|
|
@@ -8294,6 +8294,55 @@ module OpenGL
|
|
8294
8294
|
SRC_GL_EXT_cull_vertex
|
8295
8295
|
end # define_command_GL_EXT_cull_vertex
|
8296
8296
|
|
8297
|
+
def define_command_GL_EXT_debug_label
|
8298
|
+
GL_FUNCTIONS_ARGS_MAP[:glLabelObjectEXT] = [-Fiddle::TYPE_INT, -Fiddle::TYPE_INT, Fiddle::TYPE_INT, Fiddle::TYPE_VOIDP]
|
8299
|
+
GL_FUNCTIONS_RETVAL_MAP[:glLabelObjectEXT] = Fiddle::TYPE_VOID
|
8300
|
+
module_eval(<<-SRC_GL_EXT_debug_label)
|
8301
|
+
def glLabelObjectEXT(_type_, _object_, _length_, _label_)
|
8302
|
+
f = OpenGL::get_command(:glLabelObjectEXT)
|
8303
|
+
f.call(_type_, _object_, _length_, _label_)
|
8304
|
+
end
|
8305
|
+
SRC_GL_EXT_debug_label
|
8306
|
+
|
8307
|
+
GL_FUNCTIONS_ARGS_MAP[:glGetObjectLabelEXT] = [-Fiddle::TYPE_INT, -Fiddle::TYPE_INT, Fiddle::TYPE_INT, Fiddle::TYPE_VOIDP, Fiddle::TYPE_VOIDP]
|
8308
|
+
GL_FUNCTIONS_RETVAL_MAP[:glGetObjectLabelEXT] = Fiddle::TYPE_VOID
|
8309
|
+
module_eval(<<-SRC_GL_EXT_debug_label)
|
8310
|
+
def glGetObjectLabelEXT(_type_, _object_, _bufSize_, _length_, _label_)
|
8311
|
+
f = OpenGL::get_command(:glGetObjectLabelEXT)
|
8312
|
+
f.call(_type_, _object_, _bufSize_, _length_, _label_)
|
8313
|
+
end
|
8314
|
+
SRC_GL_EXT_debug_label
|
8315
|
+
end # define_command_GL_EXT_debug_label
|
8316
|
+
|
8317
|
+
def define_command_GL_EXT_debug_marker
|
8318
|
+
GL_FUNCTIONS_ARGS_MAP[:glInsertEventMarkerEXT] = [Fiddle::TYPE_INT, Fiddle::TYPE_VOIDP]
|
8319
|
+
GL_FUNCTIONS_RETVAL_MAP[:glInsertEventMarkerEXT] = Fiddle::TYPE_VOID
|
8320
|
+
module_eval(<<-SRC_GL_EXT_debug_marker)
|
8321
|
+
def glInsertEventMarkerEXT(_length_, _marker_)
|
8322
|
+
f = OpenGL::get_command(:glInsertEventMarkerEXT)
|
8323
|
+
f.call(_length_, _marker_)
|
8324
|
+
end
|
8325
|
+
SRC_GL_EXT_debug_marker
|
8326
|
+
|
8327
|
+
GL_FUNCTIONS_ARGS_MAP[:glPushGroupMarkerEXT] = [Fiddle::TYPE_INT, Fiddle::TYPE_VOIDP]
|
8328
|
+
GL_FUNCTIONS_RETVAL_MAP[:glPushGroupMarkerEXT] = Fiddle::TYPE_VOID
|
8329
|
+
module_eval(<<-SRC_GL_EXT_debug_marker)
|
8330
|
+
def glPushGroupMarkerEXT(_length_, _marker_)
|
8331
|
+
f = OpenGL::get_command(:glPushGroupMarkerEXT)
|
8332
|
+
f.call(_length_, _marker_)
|
8333
|
+
end
|
8334
|
+
SRC_GL_EXT_debug_marker
|
8335
|
+
|
8336
|
+
GL_FUNCTIONS_ARGS_MAP[:glPopGroupMarkerEXT] = []
|
8337
|
+
GL_FUNCTIONS_RETVAL_MAP[:glPopGroupMarkerEXT] = Fiddle::TYPE_VOID
|
8338
|
+
module_eval(<<-SRC_GL_EXT_debug_marker)
|
8339
|
+
def glPopGroupMarkerEXT()
|
8340
|
+
f = OpenGL::get_command(:glPopGroupMarkerEXT)
|
8341
|
+
f.call()
|
8342
|
+
end
|
8343
|
+
SRC_GL_EXT_debug_marker
|
8344
|
+
end # define_command_GL_EXT_debug_marker
|
8345
|
+
|
8297
8346
|
def define_command_GL_EXT_depth_bounds_test
|
8298
8347
|
GL_FUNCTIONS_ARGS_MAP[:glDepthBoundsEXT] = [Fiddle::TYPE_DOUBLE, Fiddle::TYPE_DOUBLE]
|
8299
8348
|
GL_FUNCTIONS_RETVAL_MAP[:glDepthBoundsEXT] = Fiddle::TYPE_VOID
|
@@ -13160,6 +13209,9 @@ module OpenGL
|
|
13160
13209
|
def define_command_GL_INGR_interlace_read
|
13161
13210
|
end # define_command_GL_INGR_interlace_read
|
13162
13211
|
|
13212
|
+
def define_command_GL_INTEL_fragment_ordering
|
13213
|
+
end # define_command_GL_INTEL_fragment_ordering
|
13214
|
+
|
13163
13215
|
def define_command_GL_INTEL_map_texture
|
13164
13216
|
GL_FUNCTIONS_ARGS_MAP[:glSyncTextureINTEL] = [-Fiddle::TYPE_INT]
|
13165
13217
|
GL_FUNCTIONS_RETVAL_MAP[:glSyncTextureINTEL] = Fiddle::TYPE_VOID
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module OpenGL
|
2
|
+
def self.check_extension( ext_name )
|
3
|
+
version_number = glGetString(GL_VERSION).to_s.split(/\./)
|
4
|
+
if version_number[0].to_i >= 3
|
5
|
+
# glGetString(GL_EXTENSIONS) was deprecated in OpenGL 3.0
|
6
|
+
# Ref.: http://sourceforge.net/p/glew/bugs/120/
|
7
|
+
extensions_count_buf = ' '
|
8
|
+
glGetIntegerv( GL_NUM_EXTENSIONS, extensions_count_buf )
|
9
|
+
extensions_count = extensions_count_buf.unpack('L')[0]
|
10
|
+
extensions_count.times do |i|
|
11
|
+
supported_ext_name = glGetStringi( GL_EXTENSIONS, i ).to_s
|
12
|
+
return true if ext_name == supported_ext_name
|
13
|
+
end
|
14
|
+
return false
|
15
|
+
else
|
16
|
+
ext_strings = glGetString(GL_EXTENSIONS).to_s.split(/ /)
|
17
|
+
return ext_strings.include? ext_name
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.setup_extension( ext_name )
|
22
|
+
if self.check_extension( ext_name )
|
23
|
+
define_enum = "define_enum_#{ext_name}".to_sym
|
24
|
+
define_command = "define_command_#{ext_name}".to_sym
|
25
|
+
self.send( define_enum )
|
26
|
+
self.send( define_command )
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
data/lib/opengl_ext_enum.rb
CHANGED
@@ -2413,6 +2413,20 @@ module OpenGL
|
|
2413
2413
|
const_set('GL_CULL_VERTEX_OBJECT_POSITION_EXT', 0x81AC) unless defined?(GL_CULL_VERTEX_OBJECT_POSITION_EXT)
|
2414
2414
|
end # define_enum_GL_EXT_cull_vertex
|
2415
2415
|
|
2416
|
+
def define_enum_GL_EXT_debug_label
|
2417
|
+
const_set('GL_PROGRAM_PIPELINE_OBJECT_EXT', 0x8A4F) unless defined?(GL_PROGRAM_PIPELINE_OBJECT_EXT)
|
2418
|
+
const_set('GL_PROGRAM_OBJECT_EXT', 0x8B40) unless defined?(GL_PROGRAM_OBJECT_EXT)
|
2419
|
+
const_set('GL_SHADER_OBJECT_EXT', 0x8B48) unless defined?(GL_SHADER_OBJECT_EXT)
|
2420
|
+
const_set('GL_BUFFER_OBJECT_EXT', 0x9151) unless defined?(GL_BUFFER_OBJECT_EXT)
|
2421
|
+
const_set('GL_QUERY_OBJECT_EXT', 0x9153) unless defined?(GL_QUERY_OBJECT_EXT)
|
2422
|
+
const_set('GL_VERTEX_ARRAY_OBJECT_EXT', 0x9154) unless defined?(GL_VERTEX_ARRAY_OBJECT_EXT)
|
2423
|
+
const_set('GL_SAMPLER', 0x82E6) unless defined?(GL_SAMPLER)
|
2424
|
+
const_set('GL_TRANSFORM_FEEDBACK', 0x8E22) unless defined?(GL_TRANSFORM_FEEDBACK)
|
2425
|
+
end # define_enum_GL_EXT_debug_label
|
2426
|
+
|
2427
|
+
def define_enum_GL_EXT_debug_marker
|
2428
|
+
end # define_enum_GL_EXT_debug_marker
|
2429
|
+
|
2416
2430
|
def define_enum_GL_EXT_depth_bounds_test
|
2417
2431
|
const_set('GL_DEPTH_BOUNDS_TEST_EXT', 0x8890) unless defined?(GL_DEPTH_BOUNDS_TEST_EXT)
|
2418
2432
|
const_set('GL_DEPTH_BOUNDS_EXT', 0x8891) unless defined?(GL_DEPTH_BOUNDS_EXT)
|
@@ -3452,6 +3466,9 @@ module OpenGL
|
|
3452
3466
|
const_set('GL_INTERLACE_READ_INGR', 0x8568) unless defined?(GL_INTERLACE_READ_INGR)
|
3453
3467
|
end # define_enum_GL_INGR_interlace_read
|
3454
3468
|
|
3469
|
+
def define_enum_GL_INTEL_fragment_ordering
|
3470
|
+
end # define_enum_GL_INTEL_fragment_ordering
|
3471
|
+
|
3455
3472
|
def define_enum_GL_INTEL_map_texture
|
3456
3473
|
const_set('GL_TEXTURE_MEMORY_LAYOUT_INTEL', 0x83FF) unless defined?(GL_TEXTURE_MEMORY_LAYOUT_INTEL)
|
3457
3474
|
const_set('GL_LAYOUT_DEFAULT_INTEL', 0) unless defined?(GL_LAYOUT_DEFAULT_INTEL)
|
data/sample/report_env.rb
CHANGED
@@ -9,7 +9,8 @@ include GLFW
|
|
9
9
|
|
10
10
|
if __FILE__ == $0
|
11
11
|
glfwInit()
|
12
|
-
|
12
|
+
glfwWindowHint(GLFW_DECORATED, 0)
|
13
|
+
window = glfwCreateWindow( 1, 1, "Report OpenGL Environment", nil, nil )
|
13
14
|
glfwMakeContextCurrent( window )
|
14
15
|
puts "Version: #{glGetString(GL_VERSION).to_s}"
|
15
16
|
puts "Extensions:"
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'opengl_es'
|
2
|
+
require 'glfw'
|
3
|
+
|
4
|
+
OpenGL.load_dll()
|
5
|
+
GLFW.load_dll()
|
6
|
+
|
7
|
+
include OpenGL
|
8
|
+
include GLFW
|
9
|
+
|
10
|
+
if __FILE__ == $0
|
11
|
+
glfwInit()
|
12
|
+
glfwWindowHint(GLFW_DECORATED, 0)
|
13
|
+
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3)
|
14
|
+
glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_ES_API)
|
15
|
+
window = glfwCreateWindow( 1, 1, "Report OpenGL Environment", nil, nil )
|
16
|
+
glfwMakeContextCurrent( window )
|
17
|
+
puts "Version: #{glGetString(GL_VERSION).to_s}"
|
18
|
+
puts "Extensions:"
|
19
|
+
puts glGetString(GL_EXTENSIONS).to_s.split(/ /)
|
20
|
+
glfwDestroyWindow( window )
|
21
|
+
glfwTerminate()
|
22
|
+
end
|
metadata
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opengl-bindings
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- vaiorabbit
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-11-02 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |
|
14
|
-
Ruby bindings for OpenGL 1.0-4.4 and all extensions using Fiddle (For MRI >= 2.0.0).
|
14
|
+
Ruby bindings for OpenGL 1.0-4.4, OpenGL ES 2.0/3.0 and all extensions using Fiddle (For MRI >= 2.0.0).
|
15
15
|
email:
|
16
16
|
- vaiorabbit@gmail.com
|
17
17
|
executables: []
|
@@ -25,8 +25,15 @@ files:
|
|
25
25
|
- lib/opengl_command.rb
|
26
26
|
- lib/opengl_common.rb
|
27
27
|
- lib/opengl_enum.rb
|
28
|
+
- lib/opengl_es.rb
|
29
|
+
- lib/opengl_es_command.rb
|
30
|
+
- lib/opengl_es_enum.rb
|
31
|
+
- lib/opengl_es_ext.rb
|
32
|
+
- lib/opengl_es_ext_command.rb
|
33
|
+
- lib/opengl_es_ext_enum.rb
|
28
34
|
- lib/opengl_ext.rb
|
29
35
|
- lib/opengl_ext_command.rb
|
36
|
+
- lib/opengl_ext_common.rb
|
30
37
|
- lib/opengl_ext_enum.rb
|
31
38
|
- lib/opengl_platform.rb
|
32
39
|
- lib/opengl_windows.rb
|
@@ -35,6 +42,7 @@ files:
|
|
35
42
|
- ChangeLog
|
36
43
|
- sample/simple.rb
|
37
44
|
- sample/report_env.rb
|
45
|
+
- sample/report_env_es.rb
|
38
46
|
- sample/glfw_build_dylib.sh
|
39
47
|
- sample/README.md
|
40
48
|
homepage: https://github.com/vaiorabbit/ruby-opengl
|
@@ -60,5 +68,5 @@ rubyforge_project:
|
|
60
68
|
rubygems_version: 2.1.4
|
61
69
|
signing_key:
|
62
70
|
specification_version: 4
|
63
|
-
summary: Bindings for OpenGL 1.0-4.4 and extensions (For MRI >= 2.0.0)
|
71
|
+
summary: Bindings for OpenGL 1.0-4.4, ES 2.0/3.0 and extensions (For MRI >= 2.0.0)
|
64
72
|
test_files: []
|