Missing windowMode StateVar
You have all the machinery to make a StateVar for WindowMode, but don't take the last step.
Right now to get at it you have to grab the whole WindowConfig and peel it out.
windowMode :: SDL.Window -> StateVar WindowMode
windowMode w@(Window rw) = StateVar getWindowMode (setWindowMode w) where
getWindowMode = fromNumber <$> SDL.Raw.getWindowFlags rw
This could replace setWindowMode. (Deprecate it first?).
Yep, probably just missed this in the initial StateVar work
windowMode is going to clash with the windowMode field of WindowConfig. Any votes for other names?
windowMode' ?
or windowState or something?
Possibly currentWindowMode. I don't like randomly sticking a ' for something completely different.
I like currentWindowMode
I'll have a think about this. It is a bit of a shame to have the API inconsistency of windowSize :: Window -> StateVar (V2 CInt) and currentWindowMode :: Window -> StateVar WindowMode. I'm half tempted to break the API - https://codesearch.aelve.com/haskell/search?query=windowMode&filter=import%20SDL&insensitive=off&space=off&precise=on&sources=on shows no uses other than in this library, but I'm not sure exactly how much code that searches.
You're thinking currentWindowSize, etc?
I think I'd prefer to
a. Rename all of WindowConfig's fields to have a windowConfig prefix (instead of window)
b. Move WindowConfig to a separate module, maybe dropping the field prefix entirely and prefer a qualified import.