Fixed Collage vertex array glitch
mf = (int(args[0]),int(args[1]))
elif cmd == 'texture':
if nvertices > 0: # dump vertex array
- glVertexPointerf(array(vertexarray,'f'))
- glTexCoordPointerf(array(texcoordarray,'f'))
- print "drawing",nvertices,"vertices"
- glDrawArrays(GL_QUADS, 0, 4)
+ glVertexPointer(3, GL_FLOAT, 0, array(vertexarray,'f'))
+ glTexCoordPointer(2, GL_FLOAT, 0, array(texcoordarray,'f'))
+ glDrawArrays(GL_QUADS, 0, nvertices)
vertexarray = []
texcoordarray = []
nvertices = 0
nvertices += 4
f.close()
# Finally,
- glVertexPointerf(array(vertexarray,'f'))
- glTexCoordPointerf(array(texcoordarray,'f'))
- #print "drawing",nvertices,"vertices"
- #print vertexarray
- #print texcoordarray
+ glVertexPointer(3, GL_FLOAT, 0, array(vertexarray,'f'))
+ glTexCoordPointer(2, GL_FLOAT, 0, array(texcoordarray,'f'))
glDrawArrays(GL_QUADS, 0, nvertices)
- #glDrawElementsui(GL_QUADS, array(range(0,nvertices),'i'))
glEndList()
tile 6 1
tile 6 2
+
+tilesize 1 1
+texture img/ByteIco.png
+tile 263 249
def update():
ground.position[0] -= 5
if ground.position[0] < 0:
- ground.position[0] = 640
+ ground.position[0] += 640
stars.position[0] -= 1
if stars.position[0] < 0:
- stars.position[0] = 640
+ stars.position[0] += 640
def draw():
stars.draw()