opengl-core 1.3.1 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/opengl-core/aux/program.rb +15 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 127be46348559fd3222972da3d7989613c658620
|
4
|
+
data.tar.gz: 6e2339a15a0068487a0ea160a4b454df576cb862
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c2a60f84f9d14eb0dfed97adda771f21cb51009dedb3c92f4231ddd3a62693edee86e419116215bb1e08e59bbae32beecd497ed64441ccb93399f1bec9d32509
|
7
|
+
data.tar.gz: cfc68e9fb00b58fcfa492698d62476feec37c27e73809646d10ec2afb622b002f5782628aac45d1318ea0996c503b92214a0e0bc8a44e78141d8d3617b27c28f
|
@@ -7,13 +7,13 @@ class Gl::Shader ; end
|
|
7
7
|
class Gl::Program < Gl::GlInternalMarked
|
8
8
|
|
9
9
|
attr_reader :name
|
10
|
-
attr_reader :kind
|
11
10
|
|
12
11
|
def initialize(name = nil)
|
13
12
|
super()
|
14
13
|
@name = (name != 0 && name) || Gl.glCreateProgram()
|
15
|
-
|
16
|
-
@
|
14
|
+
|
15
|
+
@validate_status = nil
|
16
|
+
@link_status = nil
|
17
17
|
@uniform_locations = {}
|
18
18
|
__mark__
|
19
19
|
end
|
@@ -41,7 +41,7 @@ class Gl::Program < Gl::GlInternalMarked
|
|
41
41
|
def __reload_uniforms__
|
42
42
|
@uniform_locations.keys.each {
|
43
43
|
|key|
|
44
|
-
@uniform_locations[key] =
|
44
|
+
@uniform_locations[key] = Gl.glGetUniformLocation(@name, key.to_s)
|
45
45
|
}
|
46
46
|
end
|
47
47
|
|
@@ -86,19 +86,25 @@ class Gl::Program < Gl::GlInternalMarked
|
|
86
86
|
end
|
87
87
|
|
88
88
|
def hint_uniform(uniform_name)
|
89
|
-
|
90
|
-
|
89
|
+
uniform_name = uniform_name.to_sym
|
90
|
+
@uniform_locations[uniform_name] ||= -1
|
91
91
|
self
|
92
92
|
end
|
93
93
|
|
94
|
+
# Implicitly hints that a uniform exists.
|
94
95
|
def uniform_location(uniform_name)
|
95
96
|
uniform_sym = uniform_name.to_sym
|
96
|
-
@uniform_locations[uniform_sym]
|
97
|
-
(@
|
98
|
-
Gl.glGetUniformLocation(@name, uniform_name.to_s))
|
97
|
+
@uniform_locations[uniform_sym] ||=
|
98
|
+
Gl.glGetUniformLocation(@name, uniform_name.to_s)
|
99
99
|
end
|
100
100
|
alias_method :[], :uniform_location
|
101
101
|
|
102
|
+
def each_hinted_uniform(&block)
|
103
|
+
return @uniform_locations.each_key unless block_given?
|
104
|
+
@uniform_locations.each_key(&block)
|
105
|
+
self
|
106
|
+
end
|
107
|
+
|
102
108
|
def subroutine_uniform_location(shader_kind, uniform_name)
|
103
109
|
Gl.glGetSubroutineUniformLocation(@name, shader_kind, uniform_name)
|
104
110
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opengl-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Noel Raymond Cower
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|