From: Wonyoung Choi Date: Tue, 11 Dec 2018 02:28:26 +0000 (+0900) Subject: [Tizen] Add ITizenWindowAttributes.NativeHandle X-Git-Tag: submit/tizen_5.0/20181211.054111^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f762524579a70296f29fca877aed1d79af232afc;p=platform%2Fcore%2Fcsapi%2Fopentk.git [Tizen] Add ITizenWindowAttributes.NativeHandle Add NativeHandle property to provide the native window handle pointer. --- diff --git a/packaging/opentk.spec b/packaging/opentk.spec index d2a35d5c..260c31cb 100644 --- a/packaging/opentk.spec +++ b/packaging/opentk.spec @@ -1,6 +1,6 @@ Name: opentk Summary: C# binding for OpenGL, OpenGL ES -Version: 3.0.2 +Version: 3.0.3 Release: 1 Group: Development/Libraries License: MIT diff --git a/src/OpenTK/OpenTK.Tizen.csproj b/src/OpenTK/OpenTK.Tizen.csproj index ed8fd386..ea537e42 100644 --- a/src/OpenTK/OpenTK.Tizen.csproj +++ b/src/OpenTK/OpenTK.Tizen.csproj @@ -4,7 +4,7 @@ netstandard2.0 OpenTK 3.0.0 - 3.0.2 + 3.0.3 true true false diff --git a/src/OpenTK/Platform/Tizen/ITizenWindowAttributes.cs b/src/OpenTK/Platform/Tizen/ITizenWindowAttributes.cs old mode 100755 new mode 100644 index ad0ff7a6..da45d488 --- a/src/OpenTK/Platform/Tizen/ITizenWindowAttributes.cs +++ b/src/OpenTK/Platform/Tizen/ITizenWindowAttributes.cs @@ -10,17 +10,22 @@ namespace OpenTK.Platform.Tizen public interface ITizenWindowAttributes { /// - /// Get or set whether the window accepts a focus or not. + /// Gets or sets whether the window accepts a focus or not. /// bool IsFocusAllowed { get; set; } /// - /// Get or set opacity of the window + /// Gets or sets opacity of the window /// float WindowOpacity { get; set; } /// - /// Add a supported auxiliary hint to the window + /// Gets the native window handle. + /// + IntPtr NativeHandle { get; } + + /// + /// Adds a supported auxiliary hint to the window /// /// The auxiliary hint string /// The value string to be set diff --git a/src/OpenTK/Platform/Tizen/Sdl2Extension.cs b/src/OpenTK/Platform/Tizen/Sdl2Extension.cs old mode 100755 new mode 100644 index 025287c5..f08dca0c --- a/src/OpenTK/Platform/Tizen/Sdl2Extension.cs +++ b/src/OpenTK/Platform/Tizen/Sdl2Extension.cs @@ -75,6 +75,10 @@ namespace OpenTK.Platform.SDL2 [DllImport(lib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_Tizen_GetWindowAcceptFocus", ExactSpelling = true)] public static extern bool SDL_Tizen_GetWindowAcceptFocus(IntPtr window); + [SuppressUnmanagedCodeSecurity] + [DllImport(lib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_Tizen_GetNativeWindow", ExactSpelling = true)] + public static extern IntPtr SDL_Tizen_GetNativeWindow(IntPtr window); + [SuppressUnmanagedCodeSecurity] [DllImport(lib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_SetWindowOpacity", ExactSpelling = true)] public static extern int SDL_SetWindowOpacity(IntPtr window, float opacity); diff --git a/src/OpenTK/Platform/Tizen/TizenGameWindow.cs b/src/OpenTK/Platform/Tizen/TizenGameWindow.cs index 666539ba..1f587744 100644 --- a/src/OpenTK/Platform/Tizen/TizenGameWindow.cs +++ b/src/OpenTK/Platform/Tizen/TizenGameWindow.cs @@ -77,6 +77,14 @@ namespace OpenTK.Platform.Tizen } } + public IntPtr NativeHandle + { + get + { + return SDL2.SDL.SDL_Tizen_GetNativeWindow(WindowInfo.Handle); + } + } + protected override void OnUpdateFrame(FrameEventArgs e) { if (!Paused) @@ -117,5 +125,6 @@ namespace OpenTK.Platform.Tizen { return SDL2.SDL.SDL_Tizen_AddAuxiliaryHint(WindowInfo.Handle, hint, value); } + } }