-
OpenGL Tesselator in VB
I'm making an app that uses OpenGL and I need to use the tesselator object. I'm coding in VB 6.0 and, when I try my code, VB disapears and Dr. Watson apears.
I've identified the lines that produces that, ¿Anyone know why?
This is my code:
Tess = gluNewTess
' The folowing 4 lines produce the trouble
gluTessCallback Tess, tcbTessBegin, AddressOf glBegin
gluTessCallback Tess, tcbTessVertex, AddressOf glVertex3dv
gluTessCallback Tess, tcbTessEnd, AddressOf glEnd
gluTessCallback Tess, tcbTessError, AddressOf TessError
gluTessNormal Tess, N(0), N(1), N(2)
gluBeginPolygon Tess
For I = 0 To nPlaca - 1
V(0) = Placa(0, I)
V(1) = Placa(1, I)
V(2) = Placa(2, I)
gluTessVertex Tess, V(0), V(0)
Next I
gluEndPolygon Tess
gluDeleteTess Tess
Please, I need help, I'm very hurried.
-
"Tess" is an object, I assume. In that case the first line should be "Set Tess = gluNewTess". Following that, you should check "If Tess Is Nothing Then Error", blah, blah.
Z.
-
Oh no!
Tess in VB is a long that means the pointer to the Tesselator Object.
gluNewTess returns a Long and the other functions require this long number to pointer to the tesselator object.