diff --git a/lime/_backend/native/NativeWindow.hx b/lime/_backend/native/NativeWindow.hx index 2a1c5053f..13ccf3e0f 100644 --- a/lime/_backend/native/NativeWindow.hx +++ b/lime/_backend/native/NativeWindow.hx @@ -101,6 +101,9 @@ class NativeWindow { if (Reflect.hasField (parent.config, "depthBuffer") && parent.config.depthBuffer) flags |= cast WindowFlags.WINDOW_FLAG_DEPTH_BUFFER; if (Reflect.hasField (parent.config, "fullscreen") && parent.config.fullscreen) flags |= cast WindowFlags.WINDOW_FLAG_FULLSCREEN; #if !cairo if (Reflect.hasField (parent.config, "hardware") && parent.config.hardware) flags |= cast WindowFlags.WINDOW_FLAG_HARDWARE; #end + if (Reflect.hasField (parent.config, "hidden") && parent.config.hidden) flags |= cast WindowFlags.WINDOW_FLAG_HIDDEN; + if (Reflect.hasField (parent.config, "maximized") && parent.config.maximized) flags |= cast WindowFlags.WINDOW_FLAG_MAXIMIZED; + if (Reflect.hasField (parent.config, "minimized") && parent.config.minimized) flags |= cast WindowFlags.WINDOW_FLAG_MINIMIZED; if (Reflect.hasField (parent.config, "resizable") && parent.config.resizable) flags |= cast WindowFlags.WINDOW_FLAG_RESIZABLE; if (Reflect.hasField (parent.config, "stencilBuffer") && parent.config.stencilBuffer) flags |= cast WindowFlags.WINDOW_FLAG_STENCIL_BUFFER; if (Reflect.hasField (parent.config, "vsync") && parent.config.vsync) flags |= cast WindowFlags.WINDOW_FLAG_VSYNC; @@ -377,5 +380,8 @@ class NativeWindow { var WINDOW_FLAG_DEPTH_BUFFER = 0x00000200; var WINDOW_FLAG_STENCIL_BUFFER = 0x00000400; var WINDOW_FLAG_ALLOW_HIGHDPI = 0x00000800; + var WINDOW_FLAG_HIDDEN = 0x00001000; + var WINDOW_FLAG_MINIMIZED = 0x00002000; + var WINDOW_FLAG_MAXIMIZED = 0x00004000; } \ No newline at end of file diff --git a/lime/app/Config.hx b/lime/app/Config.hx index 77711d4d3..0b8bfe04f 100644 --- a/lime/app/Config.hx +++ b/lime/app/Config.hx @@ -33,6 +33,9 @@ typedef WindowConfig = { @:optional var fullscreen:Bool; @:optional var hardware:Bool; @:optional var height:Int; + @:optional var hidden:Bool; + @:optional var maximized:Bool; + @:optional var minimized:Bool; @:optional var parameters:String; @:optional var resizable:Bool; @:optional var stencilBuffer:Bool; diff --git a/project/include/ui/Window.h b/project/include/ui/Window.h index ff169a5c0..3b0ed296e 100644 --- a/project/include/ui/Window.h +++ b/project/include/ui/Window.h @@ -65,7 +65,10 @@ namespace lime { WINDOW_FLAG_REQUIRE_SHADERS = 0x00000100, WINDOW_FLAG_DEPTH_BUFFER = 0x00000200, WINDOW_FLAG_STENCIL_BUFFER = 0x00000400, - WINDOW_FLAG_ALLOW_HIGHDPI = 0x00000800 + WINDOW_FLAG_ALLOW_HIGHDPI = 0x00000800, + WINDOW_FLAG_HIDDEN = 0x00001000, + WINDOW_FLAG_MINIMIZED = 0x00002000, + WINDOW_FLAG_MAXIMIZED = 0x00004000 }; diff --git a/project/src/backend/sdl/SDLWindow.cpp b/project/src/backend/sdl/SDLWindow.cpp index 609bbdab4..51208f116 100644 --- a/project/src/backend/sdl/SDLWindow.cpp +++ b/project/src/backend/sdl/SDLWindow.cpp @@ -21,6 +21,9 @@ namespace lime { if (flags & WINDOW_FLAG_FULLSCREEN) sdlFlags |= SDL_WINDOW_FULLSCREEN_DESKTOP; if (flags & WINDOW_FLAG_RESIZABLE) sdlFlags |= SDL_WINDOW_RESIZABLE; if (flags & WINDOW_FLAG_BORDERLESS) sdlFlags |= SDL_WINDOW_BORDERLESS; + if (flags & WINDOW_FLAG_HIDDEN) sdlFlags |= SDL_WINDOW_HIDDEN; + if (flags & WINDOW_FLAG_MINIMIZED) sdlFlags |= SDL_WINDOW_MINIMIZED; + if (flags & WINDOW_FLAG_MAXIMIZED) sdlFlags |= SDL_WINDOW_MAXIMIZED; #if defined (HX_WINDOWS) && defined (NATIVE_TOOLKIT_SDL_ANGLE) OSVERSIONINFOEXW osvi = { sizeof (osvi), 0, 0, 0, 0, {0}, 0, 0 }; diff --git a/templates/haxe/ApplicationMain.hx b/templates/haxe/ApplicationMain.hx index 422d4a1e8..42a2a18a0 100644 --- a/templates/haxe/ApplicationMain.hx +++ b/templates/haxe/ApplicationMain.hx @@ -85,6 +85,9 @@ class ApplicationMain { fullscreen: ::fullscreen::, hardware: ::hardware::, height: ::height::, + hidden: #if munit true #else ::hidden:: #end, + maximized: ::maximized::, + minimized: ::minimized::, parameters: "::parameters::", resizable: ::resizable::, stencilBuffer: ::stencilBuffer::, @@ -112,11 +115,7 @@ class ApplicationMain { var result = app.exec (); #if (sys && !nodejs && !emscripten) - if (result != 0) { - - Sys.exit (result); - - } + lime.system.System.exit (result); #end #else