From 38283d0e55363cd13407a605ae32a1e3bc04d07b Mon Sep 17 00:00:00 2001 From: udhos Date: Fri, 24 May 2019 17:37:22 -0300 Subject: [PATCH 1/9] Support for Modules. --- README.md | 8 ++++++++ go.mod | 14 ++++++++++++++ go.sum | 23 +++++++++++++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 go.mod create mode 100644 go.sum diff --git a/README.md b/README.md index 0e5b038..6a2f2cc 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,14 @@ do. go get github.com/faiface/pixel ``` +If you are using Modules (Go 1.11 or higher) and want a mutable copy of the source code: + +``` +git clone https://github.com/faiface/pixel ;# clone outside of GOPATH +cd pixel +go install ./... +``` + See [requirements](#requirements) for the list of libraries necessary for compilation. ## Tutorial diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..30f836c --- /dev/null +++ b/go.mod @@ -0,0 +1,14 @@ +module github.com/faiface/pixel + +go 1.12 + +require ( + github.com/faiface/glhf v0.0.0-20181018222622-82a6317ac380 + github.com/faiface/mainthread v0.0.0-20171120011319-8b78f0a41ae3 + github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7 // indirect + github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1 + github.com/go-gl/mathgl v0.0.0-20190416160123-c4601bc793c7 + github.com/pkg/errors v0.8.1 + github.com/stretchr/testify v1.3.0 + golang.org/x/image v0.0.0-20190523035834-f03afa92d3ff +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..f406908 --- /dev/null +++ b/go.sum @@ -0,0 +1,23 @@ +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/faiface/glhf v0.0.0-20181018222622-82a6317ac380 h1:FvZ0mIGh6b3kOITxUnxS3tLZMh7yEoHo75v3/AgUqg0= +github.com/faiface/glhf v0.0.0-20181018222622-82a6317ac380/go.mod h1:zqnPFFIuYFFxl7uH2gYByJwIVKG7fRqlqQCbzAnHs9g= +github.com/faiface/mainthread v0.0.0-20171120011319-8b78f0a41ae3 h1:baVdMKlASEHrj19iqjARrPbaRisD7EuZEVJj6ZMLl1Q= +github.com/faiface/mainthread v0.0.0-20171120011319-8b78f0a41ae3/go.mod h1:VEPNJUlxl5KdWjDvz6Q1l+rJlxF2i6xqDeGuGAxa87M= +github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7 h1:SCYMcCJ89LjRGwEa0tRluNRiMjZHalQZrVrvTbPh+qw= +github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7/go.mod h1:482civXOzJJCPzJ4ZOX/pwvXBWSnzD4OKMdH4ClKGbk= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1 h1:QbL/5oDUmRBzO9/Z7Seo6zf912W/a6Sr4Eu0G/3Jho0= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/mathgl v0.0.0-20190416160123-c4601bc793c7 h1:THttjeRn1iiz69E875U6gAik8KTWk/JYAHoSVpUxBBI= +github.com/go-gl/mathgl v0.0.0-20190416160123-c4601bc793c7/go.mod h1:yhpkQzEiH9yPyxDUGzkmgScbaBVlhC06qodikEM0ZwQ= +github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +golang.org/x/image v0.0.0-20190321063152-3fc05d484e9f/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190523035834-f03afa92d3ff h1:+2zgJKVDVAz/BWSsuniCmU1kLCjL88Z8/kv39xCI9NQ= +golang.org/x/image v0.0.0-20190523035834-f03afa92d3ff/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= From dd5e0d8b09c31278f1c675acc515ca6f83a1b340 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Friedrich=20Gro=C3=9Fe?= Date: Sun, 19 May 2019 14:30:35 +0200 Subject: [PATCH 2/9] Adding NoIconify and AlwaysOnTop GLFW window hints --- pixelgl/window.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pixelgl/window.go b/pixelgl/window.go index 8e65277..10c16ce 100644 --- a/pixelgl/window.go +++ b/pixelgl/window.go @@ -46,6 +46,16 @@ type WindowConfig struct { // Undecorated Window ommits the borders and decorations (close button, etc.). Undecorated bool + // NoIconify specifies whether fullscreen windows should not automatically + // iconify (and restore the previous video mode) on focus loss. + NoIconify bool + + // AlwaysOnTop specifies whether the windowed mode window will be floating + // above other regular windows, also called topmost or always-on-top. + // This is intended primarily for debugging purposes and cannot be used to + // implement proper full screen windows. + AlwaysOnTop bool + // VSync (vertical synchronization) synchronizes Window's framerate with the framerate of // the monitor. VSync bool @@ -100,6 +110,8 @@ func NewWindow(cfg WindowConfig) (*Window, error) { glfw.WindowHint(glfw.Resizable, bool2int[cfg.Resizable]) glfw.WindowHint(glfw.Decorated, bool2int[!cfg.Undecorated]) + glfw.WindowHint(glfw.Floating, bool2int[cfg.AlwaysOnTop]) + glfw.WindowHint(glfw.AutoIconify, bool2int[!cfg.NoIconify]) var share *glfw.Window if currWin != nil { From 23171aea6cc878d38230422c3c6084a1678fa4ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Friedrich=20Gro=C3=9Fe?= Date: Thu, 30 May 2019 14:36:11 +0200 Subject: [PATCH 3/9] Add missing github.com/golang/freetype dependency --- go.mod | 1 + go.sum | 2 ++ 2 files changed, 3 insertions(+) diff --git a/go.mod b/go.mod index 30f836c..c9d5ef2 100644 --- a/go.mod +++ b/go.mod @@ -8,6 +8,7 @@ require ( github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7 // indirect github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1 github.com/go-gl/mathgl v0.0.0-20190416160123-c4601bc793c7 + github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 github.com/pkg/errors v0.8.1 github.com/stretchr/testify v1.3.0 golang.org/x/image v0.0.0-20190523035834-f03afa92d3ff diff --git a/go.sum b/go.sum index f406908..20d14f9 100644 --- a/go.sum +++ b/go.sum @@ -10,6 +10,8 @@ github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1 h1:QbL/5oDUmRBzO9/Z7Seo github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/mathgl v0.0.0-20190416160123-c4601bc793c7 h1:THttjeRn1iiz69E875U6gAik8KTWk/JYAHoSVpUxBBI= github.com/go-gl/mathgl v0.0.0-20190416160123-c4601bc793c7/go.mod h1:yhpkQzEiH9yPyxDUGzkmgScbaBVlhC06qodikEM0ZwQ= +github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g= +github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= From 109cb03faea0bcfeab3fa23e261d349c2c15f204 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Friedrich=20Gro=C3=9Fe?= Date: Thu, 30 May 2019 14:47:19 +0200 Subject: [PATCH 4/9] Update TravisCI to fail if dependencies are missing in go.mod --- .travis.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index e9613ac..9b9d774 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,12 +20,7 @@ services: go: - tip - - 1.8.x - - 1.7.4 - -install: - - go get -t ./... + - 1.12.x script: - - go test -i -race ./... - - go test -v -race ./... + - go test -v -race -mod=readonly ./... From c5c5127c8da65814a0805c1cf04ca167ced2fff7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Friedrich=20Gro=C3=9Fe?= Date: Thu, 30 May 2019 14:52:32 +0200 Subject: [PATCH 5/9] Fix small typo in README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6a2f2cc..8eae673 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ go get github.com/faiface/pixel If you are using Modules (Go 1.11 or higher) and want a mutable copy of the source code: ``` -git clone https://github.com/faiface/pixel ;# clone outside of GOPATH +git clone https://github.com/faiface/pixel # clone outside of $GOPATH cd pixel go install ./... ``` From d513ffd1925bbb6d8f44c6d8576ac6e5ab740c4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Friedrich=20Gro=C3=9Fe?= Date: Thu, 30 May 2019 14:56:19 +0200 Subject: [PATCH 6/9] Force TravisCI to run tests using dependencies from the go.mod file --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 9b9d774..f541340 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,6 +18,9 @@ addons: services: - xvfb +env: + - GO111MODULE=on + go: - tip - 1.12.x From a5c3bec92889cd6cd50008ca32680ceaa7fde430 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Friedrich=20Gro=C3=9Fe?= Date: Thu, 30 May 2019 15:23:12 +0200 Subject: [PATCH 7/9] Prevent default TravisCI install action --- .travis.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.travis.yml b/.travis.yml index f541340..ca39e27 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,5 +25,10 @@ go: - tip - 1.12.x +install: + - # Do nothing. This is needed to prevent the default install action + # "go get -t -v ./..." from happening here because we want it to happen + # inside script step. + script: - go test -v -race -mod=readonly ./... From 8a9191c2838319c3b1f002ee5e1a56ee9628b27f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Friedrich=20Gro=C3=9Fe?= Date: Sun, 23 Jun 2019 11:12:53 +0200 Subject: [PATCH 8/9] Start to maintain a change log --- CHANGELOG.md | 29 +++++++++++++++++++++++++++++ README.md | 2 ++ 2 files changed, 31 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..f3762f9 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,29 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] +- Add more examples +- Add position as out variable from vertex shader +- Add experimental joystick support +- Add mouse cursor operations +- Add `Vec.Floor(…)` function +- Add circle geometry +- Fix `Matrix.Unproject(…)` for rotated matrix +- Add 2D Line geometry +- Add floating point round error correction +- Performance improvements +- Fix race condition in `NewGLTriangles(…)` +- Add `TriangleData` benchmarks and improvements +- Add zero rectangle variable for utility and consistency +- Add support for Go Modules +- Add `NoIconify` and `AlwaysOnTop` window hints + +## [v0.8.0] - 2018-10-10 +Changelog for this and older versions can be found on the corresponding [GitHub +releases](https://github.com/faiface/pixel/releases). + +[Unreleased]: https://github.com/faiface/pixel/compare/v0.8.0...HEAD +[v0.8.0]: https://github.com/faiface/pixel/releases/tag/v0.8.0 diff --git a/README.md b/README.md index 8eae673..e6b1142 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,8 @@ go install ./... See [requirements](#requirements) for the list of libraries necessary for compilation. +All significant (e.g. breaking) changes are documented in the [CHANGELOG.md](CHANGELOG.md). + ## Tutorial The [Wiki of this repo](https://github.com/faiface/pixel/wiki) contains an extensive tutorial From 2aa6d2d212722e838f4e92e6802df351403d0941 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Friedrich=20Gro=C3=9Fe?= Date: Sat, 29 Jun 2019 14:38:59 +0200 Subject: [PATCH 9/9] Update wording about tracked changes in README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e6b1142..a949c2e 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ go install ./... See [requirements](#requirements) for the list of libraries necessary for compilation. -All significant (e.g. breaking) changes are documented in the [CHANGELOG.md](CHANGELOG.md). +All significant changes are documented in [CHANGELOG.md](CHANGELOG.md). ## Tutorial