Re: Gtk::GLArea help, examples?



Jim-

Thanks for your help.

I remembered seeing a demo while installing the GtkGLArea module with
CPAN.pm.  I found the demo again, saw that it used OpenGL.  Unfortunately,
I had a lame OpenGL.pm (meaning a botched installation).  So, I had to
rebuild that.

Judging from many newsgroups, a lot of folks are having trouble installing
the OpenGL module.  Somebody claims to have version 0.54, but the latest
on several CPANs is 0.53, which has several compilation problems (missing
defs, perhaps differing GL versions against Mesa 3.4?).  Instead of truly
understanding this problem (sigh), I just commented out a few offending
lines and OpenGL 0.53 was installed.

Now, all seems to work, roughly like this:

    use Gtk::GLArea;
    use Gtk::GLArea::Constants;
    use OpenGL;

    init Gnome;
    init Gtk::GLArea;
    my $glarea = new Gtk::GLArea
        (GDK_GL_RGBA,
         GDK_GL_RED_SIZE,1,
         GDK_GL_GREEN_SIZE,1,
         GDK_GL_BLUE_SIZE,1,
         GDK_GL_DOUBLEBUFFER,
         GDK_GL_NONE);
      $glarea->signal_connect( "realize" => \&init );
      $glarea->signal_connect( "expose_event" => \&draw );
      $glarea->signal_connect( "configure_event" => \&reshape );


Thanks again for your help.

-Reece

-- 
Reece Hart, Ph.D.                       Genentech, Inc.  http://www.gene.com/
email: rkh gene com, GPG: 0x25EC91A0    Bioinformatics Department
650/225-6133 (voice), -5389 (fax)       1 DNA Way, MS-93
http://www.in-machina.com/~reece/       San Francisco, CA  94108





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]