app: add String method to WindowMode and Orientation

Signed-off-by: Pierre Curto <pierre.curto@gmail.com>
This commit is contained in:
Pierre Curto
2021-12-20 15:06:39 +01:00
committed by Elias Naur
parent 6534639276
commit 0117de71d3
+22
View File
@@ -81,6 +81,16 @@ func (m WindowMode) Option() Option {
}
}
func (m WindowMode) String() string {
switch m {
case Windowed:
return "windowed"
case Fullscreen:
return "fullscreen"
}
return ""
}
// Orientation is the orientation of the app (Orientation.Option sets it).
//
// Supported platforms are Android and JS.
@@ -101,6 +111,18 @@ func (o Orientation) Option() Option {
}
}
func (o Orientation) String() string {
switch o {
case AnyOrientation:
return "any"
case LandscapeOrientation:
return "landscape"
case PortraitOrientation:
return "portrait"
}
return ""
}
type frameEvent struct {
system.FrameEvent