   Binding textures through render pass w/ Python
  Hi, I'm new. Wasn't sure if I should go to beginner forum or opengl forum, but this seems right.I'm using pyogl, and made a rendering pass that looks like this:for sectors in geometry.keys():for triangles in geometry[sectors]:glBegin(GL_TRIANGLES)for vertices in triangles:glTexCoord2f(vertices[3],vertices[4])glVertex3f(vertices[0],vertices[1],vertices[2]) glEnd()...which I'm very proud of (I'm new ;))I'm assuming that glBindTexture binds the texture to each successive triangle, but I'm wondering if calling that method in this rendering pass (forever and ever) is unnecessary, and, if so, what can I do?Right now my geometry data looks like this:{"sector name":[[(x,y,z,u,v),(x,y,z,u,v),(x,y,z,u,v)][...]]}if the sector name becomes a texture, is that too much overhead, as glBindTexture will still be applied each loop? Or is this all dandy, and can I make the code:for sectors in geometry.keys():for triangles in geometry[sectors]:glBindTexture(GL_TEXTURE_2D,data[0])glBegin(GL_TRIANGLES)for vertices in triangles:glTexCoord2f(vertices[3],vertices[4])glVertex3f(vertices[0],vertices[1],vertices[2])glEnd()(geometry now looking like {"yada":[[texture,(x,y,z,u,v)...][...]]}  )   
  OpenGL is a state machine and whatever state you set (such as the currently bound texture) will stay that way until you change it.  So bind the texture once and render everything that will use that texture, then bind the next texture and render everything which uses that one, etc.   ;  Excellent, thank you.   