title: OpenGL Pyglet "Error: global name 'texture' not defined"
body: <p>The error is on line 5: glBindTexture(texture.target, texture.id)</p>
  
  <pre><code>1. import pyglet
  2. from pyglet.gl import *
  3. class CustomGroup(pyglet.graphics.Group):
  4.    def set_state(self):
  5.        glEnable(texture.target)
  6.        glBindTexture(texture.target, texture.id)
  7.    def unset_state(self):
  8.        glDisable(texture.target)
  </code></pre>
  
  <p>NameError: global name 'texture' not defined
  but i imported it on line 2.
  the full code is <a href="http://pastebin.com/10JbiCYp" rel="nofollow" title="code">here</a> </p>
  
  <p>Any help? 
  I am using python 2.7.3 with pyglet and ubuntu 12.04</p>