diff options
| author | 8o7wer <8o7wermobile@gmail.com> | 2019-05-10 17:56:35 -0800 |
|---|---|---|
| committer | 8o7wer <8o7wermobile@gmail.com> | 2019-05-10 17:56:35 -0800 |
| commit | f8fde9e8d0b8270f082b778b44627a03dd59c57c (patch) | |
| tree | 85a814bf4f3c67d1151d76b43899d8af54664856 /win/monitor.go | |
| parent | dc5d91b238e9260b2e61224fc8b8cabbb3440323 (diff) | |
| download | gui-f8fde9e8d0b8270f082b778b44627a03dd59c57c.zip | |
Revert "Added the ability to get width, height, and refresh rate from the monitor through win.GetPrimaryMonitor()."
This reverts commit dc5d91b238e9260b2e61224fc8b8cabbb3440323.
Diffstat (limited to 'win/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 -} |