Re: gtkGLmm problems....



> 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?

GtkGLContext is not widget. It's data, as GtkAdjustment.

right way in gtkGL-0.8.9,

  #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 */
    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



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