# HG changeset patch # User sam # Date 1703662155 -25200 # Node ID 194f0a398141bdb7f629fe811c311027124e24cc # Parent ce66095e19e39121a846f0aadbf0185e908da700 add: better api for fullscreen management diff -r ce66095e19e3 -r 194f0a398141 semicongine/engine.nim --- a/semicongine/engine.nim Tue Dec 26 21:12:14 2023 +0700 +++ b/semicongine/engine.nim Wed Dec 27 14:29:15 2023 +0700 @@ -45,6 +45,7 @@ exitHandler: proc(engine: var Engine) resizeHandler: proc(engine: var Engine) eventHandler: proc(engine: var Engine, event: Event) + fullscreen: bool proc destroy*(engine: var Engine) = @@ -207,4 +208,7 @@ func windowWasResized*(engine: Engine): auto = engine.input.windowWasResized func showSystemCursor*(engine: Engine) = engine.window.showSystemCursor() func hideSystemCursor*(engine: Engine) = engine.window.hideSystemCursor() -proc fullscreen*(engine: var Engine, enable: bool) = engine.window.fullscreen(enable) +func fullscreen*(engine: Engine): bool = engine.fullscreen +proc `fullscreen=`*(engine: var Engine, enable: bool) = + engine.fullscreen = enable + engine.window.fullscreen(engine.fullscreen)