[PyOpenGL-Users] glTexCoordPointer
Brought to you by:
mcfletch
From: Sean R. <mrr...@ya...> - 2003-02-22 17:23:29
|
Hello, I can't get glTexCoordPointer to work in PyOpenGL. I have tried every variation of it and parameters to it and setup states, but I always get this error: $ python texcoords.py Traceback (most recent call last): File "texcoords.py", line 15, in display glTexCoordPointerf(texcoords) OpenGL.GL.GLerror: [Errno 1282] invalid operation Here is a simple program that demonstrates it in action. #--------------- begin code ------------------------ import sys from OpenGL.GL import * from OpenGL.GLUT import * points = [ (100,100), (200,100), (200,200), (100,200) ] indicies = (0,1,2,3) texcoords = [ (0.0, 0.0), (1.0, 0.0), (1.0, 1.0), (0.0, 1.0) ] def display(): glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) glVertexPointerf(points) glTexCoordPointerf(texcoords) glDrawElements( GL_QUADS, indicies) glutSwapBuffers() glutInit(sys.argv) glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_ALPHA | GLUT_DEPTH) glutInitWindowSize(400,400) glutCreateWindow('texcoords') glOrtho(0,400,0,400,0,1) glutDisplayFunc(display) glutMainLoop() #--------------- end code ------------------------ Has anyone else actually gotten this funationality to work? It is not used at all in the examples provided with the distribution. --------------------------------- "I'm not as interested in being witty as I am in being clear", Scott Meyers Sean Riley MrR...@ya... |