Added preproccessor switching for Win32 GTK3.
authorJarl Gullberg <jarl.gullberg@gmail.com>
Sat, 20 May 2017 23:45:12 +0000 (01:45 +0200)
committerJarl Gullberg <jarl.gullberg@gmail.com>
Sat, 20 May 2017 23:45:12 +0000 (01:45 +0200)
src/OpenTK.GLWidget/GLWidget.cs

index 90b11d4..41c2b42 100644 (file)
@@ -331,13 +331,21 @@ namespace OpenTK
 
         IWindowInfo InitializeWindows()
         {
+            #if GTK3
+            IntPtr windowHandle = gdk_win32_window_get_handle(this.Window.Handle);
+            #else
             IntPtr windowHandle = gdk_win32_drawable_get_handle(GdkWindow.Handle);
+            #endif
             return Utilities.CreateWindowsWindowInfo(windowHandle);
         }
 
+#if GTK3
+        [SuppressUnmanagedCodeSecurity, DllImport("libgdk-3-0.dll", CallingConvention = CallingConvention.Cdecl)]
+        public static extern IntPtr gdk_win32_window_get_handle(IntPtr w);
+#else
         [SuppressUnmanagedCodeSecurity, DllImport("libgdk-win32-2.0-0.dll")]
         public static extern IntPtr gdk_win32_drawable_get_handle(IntPtr d);
-
+#endif
         #endregion
 
         #region OSX Specific Initialization