Python from C/SDL

Chris Gonnerman chris.gonnerman at newcenturycomputers.net
Sat Sep 7 00:23:36 EDT 2002


----- Original Message ----- 
From: "Gib Bogle" <bogle at ihug.co.nz>


> Hi,
> 
> I am a complete beginner with Python.  My interest in it is focussed on
> a great piece of open-source software called pymol, a system for
> visualization of molecules that uses Python and OpenGL.  I'd like to get
> access to pymol's graphical functions from my own program, which is
> built from C, SDL and OpenGL.

Have you looked at PyGame (www.pygame.org)?  It wraps SDL in Python.
Some pretty impressive things can be done there, and in less lines
of code than the equivalent C.

> I'm wondering if (with a bit of surgery) I'd be able to get access to
> the lower-level functionality of pymol, by which I mean the file I/O and
> rendering functions.

Probably not too hard to implement as a C module, if you are already
an accomplished C programmer.  The C API for Python is pretty easy,
once you grasp refcounting.

> I will not want to use the GUI at all.  SDL would
> create the surface(s), and handle the buffer swapping.  My goal is to be
> able to send a request to the pymol API asking for a frustum view to be
> rendered on the provided surface.
> 
> Sorry if my question is one that gets asked and answered frequently.  If
> there is a place where this has been dealt with please direct me.

Never heard this one before...

Good luck!


Chris Gonnerman -- chris.gonnerman at newcenturycomputers.net
http://newcenturycomputers.net





More information about the Python-list mailing list