Re: [gtk-list] Re: gtkGLmm problems....



AOSASA Shigeru wrote:
> It seems that the Gtk_GLContext widget is not being realized, so I have
> to manually call context->realize();  Or, did I have to write a specific
> realize_impl() function to be used by Gtk_GLContext?
 
In gtkGL-0.8, gtk_gl_adapt_widget(GtkWidget *) adapt drawing_area.  Gtk_GLContext is a class which is derived from Gtk_DrawingArea, so when a default constructor is called ->Gtk_GLContext() : Gtk_DrawingArea()
{
    gtk_gl_adapt_widget(GTK_WIDGET(gtkobject)); // this is drawing_area, and it is being adapted by
    // gtk_gl
}
 
drawing area is being adapted to draw into.
GtkGLContext is not widget. It's data, as GtkAdjustment.

right way in gtkGL-0.8.9,

when will gtkGL-0.8.9 be available?
 

  #include <gtkGL/gtkGL.h>

  int
  main (int argc, char *argv[])
  {
    GtkWidget *widget;

    gtk_init (&argc, &argv);
    gtk_gl_init (&argc, &argv);

    widget = gtk_widget_new (...);  /* any widget is available with gtkGL */

what does that mean?  You can draw into any widget?
    gtk_gl_adapt_widget (widget);

    gtk_gl_signal_connect (GTK_OBJECT (widget),
                           "__signal_name_you_want_to_connect__",
                           GTK_SIGNAL_FUNC (func_A), NULL);

    gtk_main ();
  }

  func_A (GtkWidget *widget, ...)
  {
    GTK_GL_WRAP_BEGIN (gtk_gl_context_of_widget (widget))
      {
        /* GL functions, GL functions, GL functions...       */
      }
    GTK_GL_WRAP_END;
  }

--
AOSASA Shigeru <aozasa@sakuranet.or.jp>
1b 24 28 42 40 44 3a 7b 1b 28 42 20 1b 24 28 42 4c 50 1b 28 42 # c-text

--
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null

Marsel Osipov

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