[GtkGLExt] [Repost] Re: GdkGLPixmap troubles



Lindley, I think I've just spotted what the problem may be. In your code you have this:

gboolean reshapeGL(GtkWidget *widget, GdkEventConfigure *evnt, gpointer data)
{
GUIWindow* me = (GUIWindow*)data;

There's a quirk in using the 'gpointer data' object in a GTK function - it actually gets swapped in the stack if you do so, and is *not recommended* :P. The best approach is to not use the 'gpointer data' at all; instead, if you want to pass your user data to a GTK function, attach a GObject to it like so - in this example I am attaching it to the window containing the GL context:

   (-in place of setting the user data in your initialisation code-)
g_object_set_data ((GObject *)theWindowWithYourGLContext, "myUserData", &theActualData);

   And then use something like this to retrieve it:

gboolean reshapeGL(GtkWidget *widget, GdkEventConfigure *evnt, gpointer data)
{
GUIWindow* me = g_object_get_data ((GObject *)gtk_widget_get_toplevel (widget), "myUserData")));

   In your reshape (and other) functions that need it.

Regards,
       Jose.


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