[gtkglarea/jjardon/gtk3: 2/12] gtkgl/gdkgl: Port to GTK+3
- From: Javier Jardón <jjardon src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkglarea/jjardon/gtk3: 2/12] gtkgl/gdkgl: Port to GTK+3
- Date: Thu, 20 Mar 2014 17:05:29 +0000 (UTC)
commit 886a37abdbf617afd3ca833051969b0d14f44eb1
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 da2c8d7..efad04a 100644
--- a/gtkgl/gdkgl.c
+++ b/gtkgl/gdkgl.c
@@ -376,9 +376,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
@@ -417,7 +417,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
@@ -436,14 +436,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);
@@ -456,9 +456,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]