diff options
| author | Id405 <8o7wermobile@gmail.com> | 2019-05-10 21:02:54 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-05-10 21:02:54 -0800 |
| commit | 1393e8c733ccefb687d588d53627878147190b1c (patch) | |
| tree | 227d5a0824cd5918789861a55e3999580278ffa1 | |
| parent | 8b2b10d1d4a09fb436580c598379182ddf3d2c25 (diff) | |
| download | gui-1393e8c733ccefb687d588d53627878147190b1c.zip | |
Delete monitor.go
| -rw-r--r-- | win/monitor.go | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/win/monitor.go b/win/monitor.go deleted file mode 100644 index 931484a..0000000 --- a/win/monitor.go +++ /dev/null @@ -1,42 +0,0 @@ -package win - -import ( - "github.com/faiface/mainthread" - "github.com/go-gl/glfw/v3.2/glfw" -) - - -// Holds information on a monitor -type Monitor struct { - Width, Height int - RefreshRate int -} - -// Returns a struct containing information about the primary monitor -func GetPrimaryMonitor() (Monitor, error) { - returns := mainthread.CallVal( func() interface{} { - err := glfw.Init() - if err != nil { - return err - } - - return glfw.GetPrimaryMonitor().GetVideoMode() - }) - - monitor := Monitor{0, 0, 0} - var err error = nil - - switch v := returns.(type) { - case *glfw.VidMode: - videoMode := v - - width := videoMode.Width - height := videoMode.Height - refreshRate := videoMode.RefreshRate - monitor = Monitor{width, height, refreshRate} - case error: - err = v - } - - return monitor, err -} |