That turned out to be exactly what I needed.  Thanks again!

It looks to me like all I needed to do was change the calling
convention to WINFUNCTYPE.  I know I tried using WINFUNCTYPE ways but
apparently I didn't try the correct permutation.

ctypes is tricky and it seems like having the wrong function type gets
you some sort of obtuse messages:
ctypes.ArgumentError: argument 3: <type 'exceptions.TypeError'>:
expected CFunctionType instance instead of CFunctionType

-b

On Jul 29, 8:18 am, Ben Smith <[email protected]> wrote:
> Cool, thanks a bunch!  I'll be able to look at it later in the day.
> PyOpenGL has something that apparently works too, but I haven't been
> able to condense enough of the specifics out of it to get things going
> yet.
>
> -b
>
> On Jul 28, 6:02 am, Tartley <[email protected]> wrote:
>
>
>
> > I don't know what your specific problem is, but the ctypes wriggling
> > to get glu callbacks setup right seems a big tricky. I stole a working
> > solution using glu tessellation from Squirtle recently, and it's
> > working fine for me.
>
> > Squirtle, the original, is here. They use it to ultimately produce
> > display lists:http://www.supereffective.org/pages/Squirtle-SVG-Library
>
> > My copy is here, modified slightly - I use it to produce indexed
> > vertex arrays 
> > instead:http://code.google.com/p/svgload/source/browse/trunk/svgbatch/tessela...
>
> > Best regards,
>
> >   Jonathan
>
> > On Jul 25, 6:03 pm, Ben Smith <[email protected]> wrote:
>
> > > Hello.  Been working through the opengl superbible samples and have
> > > over fifty of them converted to python.
>
> > > I'm going mad trying to use tesselation in pyglet, a demonstration in
> > > chapter 10 of the book.  I *think* I've worked out an ugly way to get
> > > the callback functions working, but I get an access violation
> > > exception thrown from gluTessEndPolygon.  I may be incorrect about my
> > > callback functions working correctly, and that might be the source of
> > > the problem, but I thought I'd see if anyone had some insight.
>
> > > Traceback (most recent call last):
> > >   File "florida.py", line 232, in <module>
> > >     pyglet.app.run()
> > >   File "c:\Python26\lib\site-packages\pyglet\app\__init__.py", line
> > > 264, in run
> > >     EventLoop().run()
> > >   File "c:\Python26\lib\site-packages\pyglet\app\win32.py", line 74,
> > > in run
> > >     self._timer_func(0, 0, timer, 0)
> > >   File "c:\Python26\lib\site-packages\pyglet\app\win32.py", line 84,
> > > in _timer_func
> > >     sleep_time = self.idle()
> > >   File "c:\Python26\lib\site-packages\pyglet\app\__init__.py", line
> > > 193, in idle
> > >     window.dispatch_event('on_draw')
> > >   File "c:\Python26\lib\site-packages\pyglet\window\__init__.py", line
> > > 1217, in dispatch_event
> > >     EventDispatcher.dispatch_event(self, *args)
> > >   File "c:\Python26\lib\site-packages\pyglet\event.py", line 349, in
> > > dispatch_event
> > >     getattr(self, event_type)(*args)
> > >   File "florida.py", line 146, in on_draw
> > >     gluTessEndPolygon(pTess)
> > > WindowsError: exception: access violation writing 0x0027AF8D
>
> > > The file I've been slavishly hacking on is 
> > > here:http://github.com/BenSmith/PythonOpenGLSuperBible4/blob/1440145adf203...
>
> > > It won't crash right away, you'll need to press the number 2 or 3 key
> > > on your keyboard to enter the areas of code that use gluTessCallback
> > > and gluTessEndPolygon.
>
> > > Happy hacking,
> > > -b
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/pyglet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to