Merge pull request #351 from mrhelmut/SDL2Screensaver

Deactivate screensaver on SDL2
This commit is contained in:
Harry 2016-02-25 23:34:44 +01:00
commit 7b19b28a12
2 changed files with 6 additions and 0 deletions

View file

@ -294,6 +294,10 @@ namespace OpenTK.Platform.SDL2
[DllImport(lib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_HideWindow", ExactSpelling = true)]
public static extern void HideWindow(IntPtr window);
[SuppressUnmanagedCodeSecurity]
[DllImport(lib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_DisableScreenSaver", ExactSpelling = true)]
public static extern void DisableScreenSaver();
[SuppressUnmanagedCodeSecurity]
[DllImport(lib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_Init", ExactSpelling = true)]
public static extern int Init(SystemFlags flags);

View file

@ -75,6 +75,8 @@ namespace OpenTK.Platform.SDL2
{
lock (sync)
{
SDL.DisableScreenSaver();
var bounds = device.Bounds;
var flags = TranslateFlags(options);
flags |= WindowFlags.OPENGL;