so i managed to create the dynamic lib for gl2ps < http://www.geuz.org/gl2ps/
> on mac os x 10.4. I can import it using ctypes.

>>> gl2ps = ctypes.CDLL('libgl2ps.dylib')
>>> gl2ps
<CDLL 'libgl2ps.dylib', handle 10b660 at 7a330>

I then ran the header (gl2ps.h) through wraptypes to generate the
python code. I got bunch of errors < http://paste2.org/p/88416 > but I
can import this gl2ps.py file.

>>> import gl2ps
>>> gl2ps
<module 'gl2ps' from '/Library/Frameworks/Python.framework/Versions/
2.5/lib/python2.5/site-packages/gl2ps.pyc'>
>>> gl2ps.gl2psSetOptions()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: this function takes at least 1 argument (0 given)

I am assuming this is working so far.

But i figured i could not for example access
gl2ps.gl2psBeginPage("test", "gl2psTestSimple",
gl2ps.GL2PS_USE_CURRENT_VIEWPORT , gl2ps.GL2PS_EPS,
gl2ps.GL2PS_SIMPLE_SORT,gl2ps.GL2PS_DRAW_BACKGROUND |
gl2ps.GL2PS_USE_CURRENT_VIEWPORT, GL_RGBA, 0, NULL, 0, 0, 0, buffsize,
FILE, "out.eps")

I get this error
AttributeError: 'module' object has no attribute 'gl2psBeginPage'

I next checked gl2ps.py and found that i had no code generated for
this function gl2psBeginPage
this is what this function in C looks like

GLint gl2psBeginPage( const char *title, const char *producer,
                      GLint viewport[4],
                      GLint format, GLint sort, GLint options,
                      GLint colormode, GLint colorsize,
                      GL2PSrgba *colortable,
                      GLint nr, GLint ng, GLint nb,
                      GLint buffersize, FILE *stream,
                      const char *filename )

There are two datatypes there "FILE *stream" and "GL2PSrgba
*colortable" that i think caused the problem since ctypes does not
understand those datatypes. (i am not entirely sure if this is the
problem)
I was wondering what would be the appropriate argtype for "FILE
*stream" and "GL2PSrgba *colortable"
I started manually entering argtypes in the generated py file- but am
clueless what to enter for these two datatypes

gl2psBeginPage = _lib.gl2psBeginPage
gl2psBeginPage.restype = GLint
gl2psBeginPage.argtypes = [c_char_p, c_char_p, GLint * 4, GLint,
GLint, GLint, GLint, GLint, ?????, GLint, GLint GLint, GLint, ????,
c_char_p]


Thanks!
vaibhav

On Oct 10, 11:48 am, walgri <[EMAIL PROTECTED]> wrote:
> On 10 Ott, 00:13, "Alex Holkner" <[EMAIL PROTECTED]> wrote:> On 10/10/08, 
> vaibhav <[EMAIL PROTECTED]> wrote:
> [...]
> > This 
> > articlehttp://www.opengl.org/resources/code/samples/mjktips/Feedback.html
> > explains how to use OpenGL feedback to create postscript drawing
> > commands from OpenGL calls.  The same technique can be used for
>
> [...]
>
> http://starship.python.net/crew/theller/wiki/GL2PS
>
> Walgri
--~--~---------~--~----~------------~-------~--~----~
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