mirror of
https://github.com/EnumeratedDev/stormfetch.git
synced 2026-09-16 07:56:12 +00:00
Separate monitor detection code into different program
This commit is contained in:
@@ -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()
|
||||
}
|
||||
Reference in New Issue
Block a user