Menu

#271 Parameters passed to GLU_TESS_VERTEX(_DATA) callback are wrong

v3.0.0
open
nobody
None
5
2017-03-08
2017-03-08
No

This is with PyOpenGL 3.1.0 (but also occurs with 3.0.1).

It seems the vertex callbacks registered with gluTessVertex (both for GLU_TESS_VERTEX and GLU_TESS_VERTEX_DATA) never get passed the actual vertex location of the tesselation result, but only the user data passed into gluTessVertex. Their number of arguments is one less than it should be.

See attachment for test script reproducing the issue. The output shows that the GLU_TESS_VERTEX callback only receives a single parameter value, which should have been the vertex location, but is actually the user-data value pass to gluTessVertex (see attached script):

$ ./glutesselator_bug.py    # use_vertex_data_callback = False
vertex ('other',)
vertex ('other',)
vertex ('other',)
vertex ('other',)
vertex ('other',)
vertex ('other',)
vertex ('other',)
vertex ('other',)
vertex ('other',)

In the case of setting the GLU_TESS_VERTEX_DATA callback the parameters passed are also wrong, receiving the data value as first argument and 0 as the second:

$ ./glutesselator_bug.py     # use_vertex_data_callback = True
vertex_data ('other', 0)
vertex_data ('other', 0)
vertex_data ('other', 0)
vertex_data ('other', 0)
vertex_data ('other', 0)
vertex_data ('other', 0)
vertex_data ('other', 0)
vertex_data ('other', 0)
vertex_data ('other', 0)
1 Attachments

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.