Separate monitor detection code into different program

This commit is contained in:
2026-04-17 13:14:04 +03:00
parent a919ffb71b
commit da463b35e3
18 changed files with 117 additions and 32 deletions
+33
View File
@@ -0,0 +1,33 @@
package main
import (
"fmt"
"os"
"strconv"
"github.com/go-gl/glfw/v3.3/glfw"
)
func main() {
defer func() {
if r := recover(); r != nil {
os.Exit(1)
}
}()
err := glfw.Init()
if err != nil {
os.Exit(1)
}
for _, monitor := range glfw.GetMonitors() {
mode := monitor.GetVideoMode()
fmt.Print(monitor.GetName() + ",")
fmt.Print(strconv.Itoa(mode.Width) + ",")
fmt.Print(strconv.Itoa(mode.Height) + ",")
fmt.Print(strconv.Itoa(mode.RefreshRate))
fmt.Println()
}
defer glfw.Terminate()
}