示例#1
0
 def uniform_tex(self, name, tex):
     assert self._bound
     slot = self.next_tex_slot
     glActiveTexture(GL_TEXTURE0 + slot)
     glBindTexture(tex.target, tex)
     self.uniform_i(name, slot)
     glActiveTexture(GL_TEXTURE0)
     self.next_tex_slot += 1
示例#2
0
 def uniform_tex(self, name, tex):
     assert self._bound
     slot = self.next_tex_slot
     glActiveTexture(GL_TEXTURE0 + slot)
     glBindTexture(tex.target, tex)
     self.uniform_i(name, slot)
     glActiveTexture(GL_TEXTURE0)
     self.next_tex_slot += 1
示例#3
0
 def bind_textures(self, **textures):
     for i, (name, texture) in enumerate(textures.items()):
         glActiveTexture(GL_TEXTURE0 + i)
         glBindTexture(texture.target, texture)  # TODO: repair RAII!
         self.uniform_i(name, i)
     glActiveTexture(GL_TEXTURE0)
示例#4
0
 def unbind(self):
     glBindTexture(self.target, 0)
示例#5
0
 def bind(self):
     glBindTexture(self.target, self)
示例#6
0
 def bind_textures(self, **textures):
     for i, (name, texture) in enumerate(textures.items()):
         glActiveTexture(GL_TEXTURE0 + i)
         glBindTexture(texture.target, texture)  # TODO: repair RAII!
         self.uniform_i(name, i)
     glActiveTexture(GL_TEXTURE0)
示例#7
0
 def unbind(self):
     glBindTexture(self.target, 0)
示例#8
0
 def bind(self):
     glBindTexture(self.target, self)