[GtkGLExt] [Repost] Re: GdkGLPixmap troubles
- From: Jose Commins <axora axora net>
- To: gtkglext-list gnome org
- Subject: [GtkGLExt] [Repost] Re: GdkGLPixmap troubles
- Date: Tue, 08 Sep 2009 13:38:32 +0100
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]