mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-01-25 20:11:10 +00:00
Merge pull request #351 from mrhelmut/SDL2Screensaver
Deactivate screensaver on SDL2
This commit is contained in:
commit
7b19b28a12
|
@ -294,6 +294,10 @@ namespace OpenTK.Platform.SDL2
|
||||||
[DllImport(lib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_HideWindow", ExactSpelling = true)]
|
[DllImport(lib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_HideWindow", ExactSpelling = true)]
|
||||||
public static extern void HideWindow(IntPtr window);
|
public static extern void HideWindow(IntPtr window);
|
||||||
|
|
||||||
|
[SuppressUnmanagedCodeSecurity]
|
||||||
|
[DllImport(lib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_DisableScreenSaver", ExactSpelling = true)]
|
||||||
|
public static extern void DisableScreenSaver();
|
||||||
|
|
||||||
[SuppressUnmanagedCodeSecurity]
|
[SuppressUnmanagedCodeSecurity]
|
||||||
[DllImport(lib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_Init", ExactSpelling = true)]
|
[DllImport(lib, CallingConvention = CallingConvention.Cdecl, EntryPoint = "SDL_Init", ExactSpelling = true)]
|
||||||
public static extern int Init(SystemFlags flags);
|
public static extern int Init(SystemFlags flags);
|
||||||
|
|
|
@ -75,6 +75,8 @@ namespace OpenTK.Platform.SDL2
|
||||||
{
|
{
|
||||||
lock (sync)
|
lock (sync)
|
||||||
{
|
{
|
||||||
|
SDL.DisableScreenSaver();
|
||||||
|
|
||||||
var bounds = device.Bounds;
|
var bounds = device.Bounds;
|
||||||
var flags = TranslateFlags(options);
|
var flags = TranslateFlags(options);
|
||||||
flags |= WindowFlags.OPENGL;
|
flags |= WindowFlags.OPENGL;
|
||||||
|
|
Loading…
Reference in a new issue