Bug 236 - GLUtessellatorCallback: how to return userData for new combine point
Summary: GLUtessellatorCallback: how to return userData for new combine point
Alias: None
Product: Jogl
Classification: JogAmp
Component: core (show other bugs)
Version: 1
Hardware: All all
: P3 normal
Assignee: Sven Gothel
Depends on:
Reported: 2006-07-09 09:38 CEST by Sven Gothel
Modified: 2010-03-24 07:49 CET (History)
0 users

See Also:
SCM Refs:
Workaround: ---


Note You need to log in before you can comment on or make changes to this bug.
Description Sven Gothel 2010-03-24 07:49:21 CET

---- Reported by aaronanderson 2006-07-09 21:38:44 ----

There are possibly two methods on a GLUtessellatorCallback implementation that 
may be invoked when a new vertex is introduced by the GLU Tesselator:

void combine(double[] coords, Object[] data, float[] weight, Object[] outData) 
void combineData(double[] coords, Object[] data, float[] weight, Object[] 
outData, Object polygonData) 

According to the C GLU routine the last parameter in the method is a pointer a 
new userData object created by the callback that is to be associated with the 
vertex. Since Java uses pass by reference there seems to be no way to associate 
a user defined object with the new vertex thus rendering this parameter useless.

---- Additional Comments From kbr 2006-07-10 00:05:33 ----

The outgoing polygonData object is not allocated by the callback, but is
equivalent to the data passed in to gluTessBeginPolygon when it was called. This
is clearly specified in the C API. The new vertex's location is allocated by the
callback and is passed out as the first element of the outData array. The
demos.tess.Tess demo in the jogl-demos project clearly shows how to use the
combine callback.

--- Bug imported by sgothel@jausoft.com 2010-03-24 07:49 EDT  ---

This bug was previously known as _bug_ 236 at https://jogl.dev.java.net/bugs/show_bug.cgi?id=236