[gtkglarea/jjardon/gtk3: 2/21] gtkgl/gdkgl: Port to GTK+3



commit ff98ad9d71bba0338cd4f16464590a709132ee9d
Author: Javier Jardón <jjardon gnome org>
Date:   Wed Mar 19 22:15:44 2014 +0000

    gtkgl/gdkgl: Port to GTK+3

 gtkgl/gdkgl.c |   14 +++++++-------
 gtkgl/gdkgl.h |    4 ++--
 2 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/gtkgl/gdkgl.c b/gtkgl/gdkgl.c
index c3062e6..ce549ec 100644
--- a/gtkgl/gdkgl.c
+++ b/gtkgl/gdkgl.c
@@ -353,9 +353,9 @@ GdkGLContext *gdk_gl_context_attrlist_share_new(int *attrlist, GdkGLContext *sha
 }
 
 
-gint gdk_gl_make_current(GdkDrawable *drawable, GdkGLContext *context)
+gint gdk_gl_make_current(GdkWindow *gdkwindow, GdkGLContext *context)
 {
-  g_return_val_if_fail (GDK_IS_DRAWABLE(drawable), FALSE);
+  g_return_val_if_fail (GDK_IS_WINDOW(gdkwindow), FALSE);
   g_return_val_if_fail (GDK_IS_GL_CONTEXT(context), FALSE);
 
 #if defined GDK_WINDOWING_WIN32
@@ -394,7 +394,7 @@ gint gdk_gl_make_current(GdkDrawable *drawable, GdkGLContext *context)
 
   return TRUE;
 #elif defined GDK_WINDOWING_X11
-  return (glXMakeCurrent(context->xdisplay, GDK_WINDOW_XWINDOW(drawable),
+  return (glXMakeCurrent(context->xdisplay, gdk_x11_window_get_xid (gdkwindow),
                         context->glxcontext) == True) ? TRUE : FALSE;
 
 #if 0
@@ -413,14 +413,14 @@ gint gdk_gl_make_current(GdkDrawable *drawable, GdkGLContext *context)
 #endif
 }
 
-void gdk_gl_swap_buffers(GdkDrawable *drawable)
+void gdk_gl_swap_buffers(GdkWindow *gdkwindow)
 {
 #if defined GDK_WINDOWING_WIN32
   HDC   hdc;
   HWND  hwnd;
 #endif
 
-  g_return_if_fail (GDK_IS_DRAWABLE(drawable));
+  g_return_if_fail (GDK_IS_WINDOW(gdkwindow));
 
 #if defined GDK_WINDOWING_WIN32
   hwnd = (HWND) gdk_win32_drawable_get_handle (drawable);
@@ -433,9 +433,9 @@ void gdk_gl_swap_buffers(GdkDrawable *drawable)
   SwapBuffers (hdc);
   ReleaseDC (hwnd, hdc);
 #elif defined GDK_WINDOWING_X11
-  GdkDisplay *gdkdisplay = gdk_window_get_display (GDK_WINDOW (drawable));
+  GdkDisplay *gdkdisplay = gdk_window_get_display (GDK_WINDOW (gdkwindow));
   glXSwapBuffers(gdk_x11_display_get_xdisplay (gdkdisplay),
-                 GDK_WINDOW_XID (GDK_WINDOW (drawable)));
+                 gdk_x11_window_get_xid (gdkwindow));
 #else
   g_warning ("gdk_gl_swap_buffers not implemented on " PLATFORM);
 #endif
diff --git a/gtkgl/gdkgl.h b/gtkgl/gdkgl.h
index 0fe63e0..29068fa 100644
--- a/gtkgl/gdkgl.h
+++ b/gtkgl/gdkgl.h
@@ -90,8 +90,8 @@ GdkGLContext *gdk_gl_context_new(GdkVisual *visual);
 GdkGLContext *gdk_gl_context_share_new(GdkVisual *visual, GdkGLContext *sharelist, gint direct);
 GdkGLContext *gdk_gl_context_attrlist_share_new(int *attrlist, GdkGLContext *sharelist, gint direct);
 
-gint          gdk_gl_make_current(GdkDrawable *drawable, GdkGLContext *context);
-void          gdk_gl_swap_buffers(GdkDrawable *drawable);
+gint          gdk_gl_make_current(GdkWindow *gdkwindow, GdkGLContext *context);
+void          gdk_gl_swap_buffers(GdkWindow *gdkwindow);
 
 
 void          gdk_gl_wait_gdk(void);


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