Deactivate screensaver on SDL2

This commit is contained in:
Thomas Altenburger 2016-02-10 17:55:47 +01:00
parent 647ab3026a
commit 0ab980bfe7
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;