main: backport gl02 goodies

This commit is contained in:
2022-02-05 19:43:28 +08:00
parent 92b0ace7a2
commit d376a0fd39
4 changed files with 92 additions and 7 deletions

20
internal/io/config.go Normal file
View File

@ -0,0 +1,20 @@
package io
import "edgaru089.ml/go/gl01/internal/util"
var (
MainConfig struct {
WindowWidth, WindowHeight int
FramerateLimit int // 0: vsync, -1: unlimited
}
)
func LoadConfig() (err error) {
err = util.LoadJSON("main.cfg.json", &MainConfig)
if err != nil {
return
}
return
}