Deactivate screensaver on SDL2
This commit is contained in:
parent
647ab3026a
commit
0ab980bfe7
2 changed files with 6 additions and 0 deletions
|
@ -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);
|
||||
|
|
|
@ -75,6 +75,8 @@ namespace OpenTK.Platform.SDL2
|
|||
{
|
||||
lock (sync)
|
||||
{
|
||||
SDL.DisableScreenSaver();
|
||||
|
||||
var bounds = device.Bounds;
|
||||
var flags = TranslateFlags(options);
|
||||
flags |= WindowFlags.OPENGL;
|
||||
|
|
Loading…
Reference in a new issue