resolution sets

This commit is contained in:
2023-07-08 11:49:47 +02:00
parent 73f06f458f
commit 6028c5770f
2 changed files with 39 additions and 2 deletions

View File

@@ -2,6 +2,38 @@ package konstructor
import "image/color"
type ResolutionSet struct {
Width int
Height int
}
var QVGAResolutionSet = ResolutionSet{
Width: 320,
Height: 240,
}
var VGAResolutionSet = ResolutionSet{
Width: 640,
Height: 480,
}
var SVGAResolutionSet = ResolutionSet{
Width: 800,
Height: 600,
}
var XGAResolutionSet = ResolutionSet{
Width: 1024,
Height: 768,
}
var ResolutionSets = []ResolutionSet{
QVGAResolutionSet,
VGAResolutionSet,
SVGAResolutionSet,
XGAResolutionSet,
}
type KeyMap struct {
Up any
Down any
@@ -30,3 +62,8 @@ type Config struct {
Header *HeaderConfig
KeyMap KeyMap
}
func (c *Config) SetResolution(set ResolutionSet) {
c.Screen.Width = set.Width
c.Screen.Height = set.Height
}