This commit is contained in:
XoxJlopeZi4BB 2025-01-26 07:16:49 +04:00
parent 930ed283a2
commit d533a5ed7c

View File

@ -8,11 +8,6 @@ import (
"os" "os"
) )
var (
devfb *os.File
Width, Height int
)
func resolution() (w int, h int) { func resolution() (w int, h int) {
resFile, err := os.Open("/sys/class/graphics/fb0/virtual_size") resFile, err := os.Open("/sys/class/graphics/fb0/virtual_size")
if err != nil { if err != nil {
@ -28,8 +23,10 @@ func resolution() (w int, h int) {
return return
} }
var devfb *os.File
const Width, Height int = resolution()
func init() { func init() {
Width, Height = resolution()
var err error var err error
devfb, err = os.OpenFile("/dev/fb", os.O_WRONLY, os.ModePerm) devfb, err = os.OpenFile("/dev/fb", os.O_WRONLY, os.ModePerm)
if err != nil { if err != nil {