Mercurial > games > semicongine
changeset 398:194f0a398141
add: better api for fullscreen management
author | sam <sam@basx.dev> |
---|---|
date | Wed, 27 Dec 2023 14:29:15 +0700 |
parents | ce66095e19e3 |
children | 73e96ca349fd |
files | semicongine/engine.nim |
diffstat | 1 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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)