I do somethong like this
GLarea = gtkgl.GtkGLArea((gtkgl.RGBA, gtkgl.DOUBLEBUFFER))
                GLarea.set_events(0)
                GLarea.size(glx, gly)

GLarea.show()
GLarea.connect("expose_event", View.expose)
                GLarea.connect("configure_event",View.onconfig)
                #GLarea.connect("realize",View.realize)
                GLarea.connect("button_release_event",View.butrelease)
                GLarea.connect("motion_notify_event",View.butmot)
                #GLarea.connect("key_press_event",self.ebev)
glViewport(newvx ,newvy , \
            constants.glmaxwidth,constants.glmaxheight)


After this, just make opengl calls. Also ...
GLarea.swap_buffers() and
GLarea.make_current()


Hope that helps.

Mathew

Rajarshi Guha wrote:

>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA1
>
>Hi,
>  I'm writing some code that currently displays gif images of molecules. I 
>would like to instead use OpenGL to render these images - I figure that I 
>need GtkGLArea. But how does this relate to the PyOpenGL bindings? From the 
>examples in the PyOpenGL package, it seems they use GLUT to manage windows 
>and events etc. So what would be the procedeure to use OpenGL commands to 
>output to the GtkGLArea
> 
>I'd appreciate it if anybody could point me to some example code.
>
>Thanks,
>
>- -- 
>- -------------------------------------------------------------------
>Rajarshi Guha                  | email: [EMAIL PROTECTED]
>417 Davey Laboratory           | web  : http:// www.jijo.cjb.net
>Dept. Of Chemistry             | ICQ  : 123242928
>Pennsylvania State University  | AIM  : LoverOfPanda
>- -------------------------------------------------------------------
>GPG Fingerprint: DCCB 4D1A 5A8B 2F5A B5F6  1F9E CDC4 5574 9017 AF2A 
>Public Key     : http://pgp.mit.edu/
>- -------------------------------------------------------------------
>All science is either physics or stamp collecting.
>               -- Ernest Rutherford
>-----BEGIN PGP SIGNATURE-----
>Version: GnuPG v1.0.6 (GNU/Linux)
>Comment: For info see http://www.gnupg.org
>
>iD8DBQE9U+qQzcRVdJAXryoRAqHmAJ4xsV0aUnfbpCZLUbEQE5pVioVa1QCgx/SD
>XJcajWC8JDTDhsFZrySxltI=
>=a4+F
>-----END PGP SIGNATURE-----
>
>_______________________________________________
>pygtk mailing list   [EMAIL PROTECTED]
>http://www.daa.com.au/mailman/listinfo/pygtk
>Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
>
>  
>


_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to