mirror of
https://github.com/EnumeratedDev/stormfetch.git
synced 2026-09-16 07:56:12 +00:00
34 lines
521 B
Go
34 lines
521 B
Go
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()
|
|
}
|