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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6e37a31391af56763f0e184ea306c01229729e85
4
- data.tar.gz: 1dc24e225617941886a003c2c1164d43e813f6dc
3
+ metadata.gz: 127be46348559fd3222972da3d7989613c658620
4
+ data.tar.gz: 6e2339a15a0068487a0ea160a4b454df576cb862
5
5
  SHA512:
6
- metadata.gz: f47e25cdec3a7c21d980130429b8d4ab1f7d33755bccd305c7a90105bcd23f94e214258007743363c0f7e7ad3cb2f719001a041dec77139f4670b59c9df85bf7
7
- data.tar.gz: 9a3b4dc36e359956c7880f931831096c4518c5f6af22e574905187b08470adb02afa2f36a840778e4070efcc96a0fcc213bdc4f9b90092392f826de22e164b9c
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
- @validate_status = nil
16
- @link_status = nil
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] = uniform_location(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
- @uniform_locations[uniform_name.to_sym] =
90
- (@uniform_locations[uniform_name.to_sym] || -1)
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
- (@uniform_locations[uniform_sym] =
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.1
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-07-25 00:00:00.000000000 Z
11
+ date: 2013-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri