From ea60faadf68c3fe27f880f456e40e31880a5a780 Mon Sep 17 00:00:00 2001 From: duysqubix Date: Wed, 11 Oct 2023 13:47:05 -0500 Subject: [PATCH 01/15] refactoring project --- backends/opengl/.init | 0 backends/sdl/.init | 0 backends/vulcan/.init | 0 go.mod | 3 ++- go.sum | 10 ++++++++++ {imdraw => plugins/imdraw}/imdraw.go | 0 {imdraw => plugins/imdraw}/imdraw_test.go | 0 {text => plugins/text}/atlas.go | 0 {text => plugins/text}/atlas_test.go | 0 {text => plugins/text}/doc.go | 0 {text => plugins/text}/text.go | 0 {text => plugins/text}/text_test.go | 0 circle_test.go => tests/circle_test.go | 0 color_test.go => tests/color_test.go | 0 data_test.go => tests/data_test.go | 0 drawer_test.go => tests/drawer_test.go | 0 geometry_test.go => tests/geometry_test.go | 0 line_test.go => tests/line_test.go | 0 math_test.go => tests/math_test.go | 0 matrix_test.go => tests/matrix_test.go | 0 pixel_test.go => tests/pixel_test.go | 0 rectangle_test.go => tests/rectangle_test.go | 0 vector_test.go => tests/vector_test.go | 0 23 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 backends/opengl/.init create mode 100644 backends/sdl/.init create mode 100644 backends/vulcan/.init rename {imdraw => plugins/imdraw}/imdraw.go (100%) rename {imdraw => plugins/imdraw}/imdraw_test.go (100%) rename {text => plugins/text}/atlas.go (100%) rename {text => plugins/text}/atlas_test.go (100%) rename {text => plugins/text}/doc.go (100%) rename {text => plugins/text}/text.go (100%) rename {text => plugins/text}/text_test.go (100%) rename circle_test.go => tests/circle_test.go (100%) rename color_test.go => tests/color_test.go (100%) rename data_test.go => tests/data_test.go (100%) rename drawer_test.go => tests/drawer_test.go (100%) rename geometry_test.go => tests/geometry_test.go (100%) rename line_test.go => tests/line_test.go (100%) rename math_test.go => tests/math_test.go (100%) rename matrix_test.go => tests/matrix_test.go (100%) rename pixel_test.go => tests/pixel_test.go (100%) rename rectangle_test.go => tests/rectangle_test.go (100%) rename vector_test.go => tests/vector_test.go (100%) diff --git a/backends/opengl/.init b/backends/opengl/.init new file mode 100644 index 0000000..e69de29 diff --git a/backends/sdl/.init b/backends/sdl/.init new file mode 100644 index 0000000..e69de29 diff --git a/backends/vulcan/.init b/backends/vulcan/.init new file mode 100644 index 0000000..e69de29 diff --git a/go.mod b/go.mod index ea927d5..8f4bdff 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/go-gl/glfw/v3.3/glfw v0.0.0-20221017161538-93cebf72946b github.com/go-gl/mathgl v1.1.0 github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 - github.com/gopxl/glhf/v2 v2.0.0-20231011010357-90c5b7c2543d + github.com/gopxl/glhf/v2 v2.0.0 github.com/gopxl/mainthread/v2 v2.0.0 github.com/pkg/errors v0.9.1 github.com/stretchr/testify v1.8.4 @@ -17,5 +17,6 @@ require ( require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/stretchr/objx v0.5.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 43dad41..f563458 100644 --- a/go.sum +++ b/go.sum @@ -1,3 +1,4 @@ +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/go-gl/gl v0.0.0-20211210172815-726fda9656d6 h1:zDw5v7qm4yH7N8C8uWd+8Ii9rROdgWxQuGoJ9WDXxfk= @@ -12,6 +13,8 @@ github.com/gopxl/glhf/v2 v2.0.0-20231010004459-fc58b4a8f7d0 h1:QCfBCpS1GprFdtyKy github.com/gopxl/glhf/v2 v2.0.0-20231010004459-fc58b4a8f7d0/go.mod h1:2TW8DIqHAPiQhv6EAXThEA/fgl+Ky8Lgd3XevyJqmSY= github.com/gopxl/glhf/v2 v2.0.0-20231011010357-90c5b7c2543d h1:DK2rpfmPeqdYlvdypfE5B7PTwkkKAAlCvzoBNZuwxWc= github.com/gopxl/glhf/v2 v2.0.0-20231011010357-90c5b7c2543d/go.mod h1:InKwj5OoVdOAkpzsS0ILwpB+RrWBLw1i7aFefiGmrp8= +github.com/gopxl/glhf/v2 v2.0.0 h1:SJtNy+TXuTBRjMersNx722VDJ0XHIooMH2+7+99LPIc= +github.com/gopxl/glhf/v2 v2.0.0/go.mod h1:InKwj5OoVdOAkpzsS0ILwpB+RrWBLw1i7aFefiGmrp8= github.com/gopxl/mainthread/v2 v2.0.0-20231010001939-73dfba06ae92 h1:+17VMm30TmRoIlA/S29R29A7Sqbak/6OLKjq6iX/I7U= github.com/gopxl/mainthread/v2 v2.0.0-20231010001939-73dfba06ae92/go.mod h1:/uFQhUiSP53SSU/RQ5w0FFkljRArJlaQkDPza3zE2V8= github.com/gopxl/mainthread/v2 v2.0.0 h1:jRbeWFzX6/UyhRab00xS3xIVYywBgc0DgwPgwS6EVYw= @@ -20,6 +23,12 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.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/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= golang.org/x/image v0.0.0-20190321063152-3fc05d484e9f/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= @@ -28,5 +37,6 @@ golang.org/x/image v0.13.0/go.mod h1:6mmbMOeV28HuMTgA6OSRkdXKYw/t5W9Uwn2Yv1r3Yxk golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/imdraw/imdraw.go b/plugins/imdraw/imdraw.go similarity index 100% rename from imdraw/imdraw.go rename to plugins/imdraw/imdraw.go diff --git a/imdraw/imdraw_test.go b/plugins/imdraw/imdraw_test.go similarity index 100% rename from imdraw/imdraw_test.go rename to plugins/imdraw/imdraw_test.go diff --git a/text/atlas.go b/plugins/text/atlas.go similarity index 100% rename from text/atlas.go rename to plugins/text/atlas.go diff --git a/text/atlas_test.go b/plugins/text/atlas_test.go similarity index 100% rename from text/atlas_test.go rename to plugins/text/atlas_test.go diff --git a/text/doc.go b/plugins/text/doc.go similarity index 100% rename from text/doc.go rename to plugins/text/doc.go diff --git a/text/text.go b/plugins/text/text.go similarity index 100% rename from text/text.go rename to plugins/text/text.go diff --git a/text/text_test.go b/plugins/text/text_test.go similarity index 100% rename from text/text_test.go rename to plugins/text/text_test.go diff --git a/circle_test.go b/tests/circle_test.go similarity index 100% rename from circle_test.go rename to tests/circle_test.go diff --git a/color_test.go b/tests/color_test.go similarity index 100% rename from color_test.go rename to tests/color_test.go diff --git a/data_test.go b/tests/data_test.go similarity index 100% rename from data_test.go rename to tests/data_test.go diff --git a/drawer_test.go b/tests/drawer_test.go similarity index 100% rename from drawer_test.go rename to tests/drawer_test.go diff --git a/geometry_test.go b/tests/geometry_test.go similarity index 100% rename from geometry_test.go rename to tests/geometry_test.go diff --git a/line_test.go b/tests/line_test.go similarity index 100% rename from line_test.go rename to tests/line_test.go diff --git a/math_test.go b/tests/math_test.go similarity index 100% rename from math_test.go rename to tests/math_test.go diff --git a/matrix_test.go b/tests/matrix_test.go similarity index 100% rename from matrix_test.go rename to tests/matrix_test.go diff --git a/pixel_test.go b/tests/pixel_test.go similarity index 100% rename from pixel_test.go rename to tests/pixel_test.go diff --git a/rectangle_test.go b/tests/rectangle_test.go similarity index 100% rename from rectangle_test.go rename to tests/rectangle_test.go diff --git a/vector_test.go b/tests/vector_test.go similarity index 100% rename from vector_test.go rename to tests/vector_test.go From c3f36dd3f2f304d8b429cec2f0bb9a9e59fa7721 Mon Sep 17 00:00:00 2001 From: duysqubix Date: Wed, 11 Oct 2023 13:53:06 -0500 Subject: [PATCH 02/15] updated references for imdraw/text tests --- plugins/imdraw/imdraw_test.go | 2 +- plugins/text/atlas_test.go | 2 +- plugins/text/text_test.go | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/imdraw/imdraw_test.go b/plugins/imdraw/imdraw_test.go index 1d38436..14ea655 100644 --- a/plugins/imdraw/imdraw_test.go +++ b/plugins/imdraw/imdraw_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/gopxl/pixel/v2" - "github.com/gopxl/pixel/v2/imdraw" + "github.com/gopxl/pixel/v2/plugins/imdraw" ) func BenchmarkPush(b *testing.B) { diff --git a/plugins/text/atlas_test.go b/plugins/text/atlas_test.go index 95daa6d..6827d52 100644 --- a/plugins/text/atlas_test.go +++ b/plugins/text/atlas_test.go @@ -3,7 +3,7 @@ package text_test import ( "testing" - "github.com/gopxl/pixel/v2/text" + "github.com/gopxl/pixel/v2/plugins/text" "golang.org/x/image/font/inconsolata" ) diff --git a/plugins/text/text_test.go b/plugins/text/text_test.go index 3d53d83..cfbba1f 100644 --- a/plugins/text/text_test.go +++ b/plugins/text/text_test.go @@ -9,9 +9,9 @@ import ( "golang.org/x/image/font/basicfont" "golang.org/x/image/font/gofont/goregular" - "github.com/gopxl/pixel/v2" - "github.com/gopxl/pixel/v2/text" "github.com/golang/freetype/truetype" + "github.com/gopxl/pixel/v2" + "github.com/gopxl/pixel/v2/plugins/text" ) func TestClear(t *testing.T) { From 7c5d12e0fcec9633daf1e10fb888a4b7b6892502 Mon Sep 17 00:00:00 2001 From: duysqubix Date: Wed, 11 Oct 2023 13:55:37 -0500 Subject: [PATCH 03/15] updated changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 64f31d7..f28756c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] - Adding `Focus()` method to `Window` to focus the window via API. +- Restructure Pixel Project + - Converted `imdraw` and `text` packages to `plugins` + - moved all `*_test.go` files to `test` package ## [v1.0.0](https://github.com/gopxl/pixel/v2/compare/v1.0.0...dev) - Multiple Window Management Framework From f590ba5f86eb8d12410dc4f50557dc8de8559f22 Mon Sep 17 00:00:00 2001 From: duysqubix Date: Wed, 11 Oct 2023 13:59:32 -0500 Subject: [PATCH 04/15] created readme for imdraw --- plugins/imdraw/README.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 plugins/imdraw/README.md diff --git a/plugins/imdraw/README.md b/plugins/imdraw/README.md new file mode 100644 index 0000000..4672399 --- /dev/null +++ b/plugins/imdraw/README.md @@ -0,0 +1,39 @@ +# IMDraw + +
+ IMDraw is an immediate-mode-like shape drawer and BasicTarget. IMDraw supports TrianglesPosition, + TrianglesColor, TrianglesPicture and PictureColor. + + IMDraw, other than a regular BasicTarget, is used to draw shapes. To draw shapes, you first need + to Push some points to IMDraw: +```go + imd := pixel.NewIMDraw(pic) use nil pic if you only want to draw primitive shapes + imd.Push(pixel.V(100, 100)) + imd.Push(pixel.V(500, 100)) +``` + Once you have Pushed some points, you can use them to draw a shape, such as a line: + + `imd.Line(20) //draws a 20 units thick line`` + + Set exported fields to change properties of Pushed points: + +```go + imd.Color = pixel.RGB(1, 0, 0) + imd.Push(pixel.V(200, 200)) + imd.Circle(400, 0) +``` + Here is the list of all available point properties (need to be set before Pushing a point): + - Color - applies to all + - Picture - coordinates, only applies to filled polygons + - Intensity - picture intensity, only applies to filled polygons + - Precision - curve drawing precision, only applies to circles and ellipses + - EndShape - shape of the end of a line, only applies to lines and outlines + + And here's the list of all shapes that can be drawn (all, except for line, can be filled or + outlined): + - Line + - Polygon + - Circle + - Circle arc + - Ellipse + - Ellipse arc \ No newline at end of file From cffd7c208f4c7bdaba874a7d40dc0af59eab7241 Mon Sep 17 00:00:00 2001 From: duysqubix Date: Wed, 11 Oct 2023 19:53:48 -0500 Subject: [PATCH 05/15] renamed and removed some starting dirs --- backends/vulcan/.init | 0 backends/{sdl => vulkan}/.init | 0 2 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 backends/vulcan/.init rename backends/{sdl => vulkan}/.init (100%) diff --git a/backends/vulcan/.init b/backends/vulcan/.init deleted file mode 100644 index e69de29..0000000 diff --git a/backends/sdl/.init b/backends/vulkan/.init similarity index 100% rename from backends/sdl/.init rename to backends/vulkan/.init From cf9e6294eba4af069f5af7ede439f6b0001c1cb5 Mon Sep 17 00:00:00 2001 From: duysqubix Date: Wed, 11 Oct 2023 19:55:44 -0500 Subject: [PATCH 06/15] renamed some more dirs --- {plugins => ext}/README.md | 0 {plugins => ext}/gameloop/README.md | 0 {plugins => ext}/gameloop/gameloop.go | 0 {plugins => ext}/imdraw/README.md | 0 {plugins => ext}/imdraw/imdraw.go | 0 {plugins => ext}/imdraw/imdraw_test.go | 0 {plugins => ext}/text/atlas.go | 0 {plugins => ext}/text/atlas_test.go | 0 {plugins => ext}/text/doc.go | 0 {plugins => ext}/text/text.go | 0 {plugins => ext}/text/text_test.go | 0 11 files changed, 0 insertions(+), 0 deletions(-) rename {plugins => ext}/README.md (100%) rename {plugins => ext}/gameloop/README.md (100%) rename {plugins => ext}/gameloop/gameloop.go (100%) rename {plugins => ext}/imdraw/README.md (100%) rename {plugins => ext}/imdraw/imdraw.go (100%) rename {plugins => ext}/imdraw/imdraw_test.go (100%) rename {plugins => ext}/text/atlas.go (100%) rename {plugins => ext}/text/atlas_test.go (100%) rename {plugins => ext}/text/doc.go (100%) rename {plugins => ext}/text/text.go (100%) rename {plugins => ext}/text/text_test.go (100%) diff --git a/plugins/README.md b/ext/README.md similarity index 100% rename from plugins/README.md rename to ext/README.md diff --git a/plugins/gameloop/README.md b/ext/gameloop/README.md similarity index 100% rename from plugins/gameloop/README.md rename to ext/gameloop/README.md diff --git a/plugins/gameloop/gameloop.go b/ext/gameloop/gameloop.go similarity index 100% rename from plugins/gameloop/gameloop.go rename to ext/gameloop/gameloop.go diff --git a/plugins/imdraw/README.md b/ext/imdraw/README.md similarity index 100% rename from plugins/imdraw/README.md rename to ext/imdraw/README.md diff --git a/plugins/imdraw/imdraw.go b/ext/imdraw/imdraw.go similarity index 100% rename from plugins/imdraw/imdraw.go rename to ext/imdraw/imdraw.go diff --git a/plugins/imdraw/imdraw_test.go b/ext/imdraw/imdraw_test.go similarity index 100% rename from plugins/imdraw/imdraw_test.go rename to ext/imdraw/imdraw_test.go diff --git a/plugins/text/atlas.go b/ext/text/atlas.go similarity index 100% rename from plugins/text/atlas.go rename to ext/text/atlas.go diff --git a/plugins/text/atlas_test.go b/ext/text/atlas_test.go similarity index 100% rename from plugins/text/atlas_test.go rename to ext/text/atlas_test.go diff --git a/plugins/text/doc.go b/ext/text/doc.go similarity index 100% rename from plugins/text/doc.go rename to ext/text/doc.go diff --git a/plugins/text/text.go b/ext/text/text.go similarity index 100% rename from plugins/text/text.go rename to ext/text/text.go diff --git a/plugins/text/text_test.go b/ext/text/text_test.go similarity index 100% rename from plugins/text/text_test.go rename to ext/text/text_test.go From 815a664a0d6b45205a929ac0faa5d1621537b622 Mon Sep 17 00:00:00 2001 From: duysqubix Date: Wed, 11 Oct 2023 20:00:18 -0500 Subject: [PATCH 07/15] renamed plugins -> ext --- ext/README.md | 8 +++++--- ext/imdraw/imdraw_test.go | 2 +- ext/text/atlas_test.go | 2 +- ext/text/text_test.go | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/ext/README.md b/ext/README.md index aea80bf..977888d 100644 --- a/ext/README.md +++ b/ext/README.md @@ -1,14 +1,16 @@ -# Plugins +# Extensions ## Introduction -Plugins are a way to extend the features and functionality of Pixel. They are the communities contribution +Extensions are a way to *extend* the features and functionality of Pixel. They are the communities contribution to pushing Pixel to the next level. -## Plugin List +## Extension List * [gameloop](gameloop/README.md) - A plugin that allows you to run a game loop in Pixel. +* [imdraw](imdraw/README.md) - A plugin that allows you to draw primitives in Pixel. +* [text](text/README.md) - A plugin that allows you to draw text in Pixel. ## Creating a Plugin diff --git a/ext/imdraw/imdraw_test.go b/ext/imdraw/imdraw_test.go index 14ea655..47dc436 100644 --- a/ext/imdraw/imdraw_test.go +++ b/ext/imdraw/imdraw_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/gopxl/pixel/v2" - "github.com/gopxl/pixel/v2/plugins/imdraw" + "github.com/gopxl/pixel/v2/ext/imdraw" ) func BenchmarkPush(b *testing.B) { diff --git a/ext/text/atlas_test.go b/ext/text/atlas_test.go index 6827d52..97746c3 100644 --- a/ext/text/atlas_test.go +++ b/ext/text/atlas_test.go @@ -3,7 +3,7 @@ package text_test import ( "testing" - "github.com/gopxl/pixel/v2/plugins/text" + "github.com/gopxl/pixel/v2/ext/text" "golang.org/x/image/font/inconsolata" ) diff --git a/ext/text/text_test.go b/ext/text/text_test.go index cfbba1f..1bb54bd 100644 --- a/ext/text/text_test.go +++ b/ext/text/text_test.go @@ -11,7 +11,7 @@ import ( "github.com/golang/freetype/truetype" "github.com/gopxl/pixel/v2" - "github.com/gopxl/pixel/v2/plugins/text" + "github.com/gopxl/pixel/v2/ext/text" ) func TestClear(t *testing.T) { From f590424b57d0b2781d247bce9c9a3ec10e7d1dd4 Mon Sep 17 00:00:00 2001 From: duysqubix Date: Wed, 11 Oct 2023 20:08:23 -0500 Subject: [PATCH 08/15] moved pixelgl -> backends/opengl --- {pixelgl => backends/opengl}/canvas.go | 0 {pixelgl => backends/opengl}/doc.go | 0 {pixelgl => backends/opengl}/glframe.go | 0 {pixelgl => backends/opengl}/glpicture.go | 0 {pixelgl => backends/opengl}/glshader.go | 0 {pixelgl => backends/opengl}/gltriangles.go | 0 {pixelgl => backends/opengl}/input.go | 0 {pixelgl => backends/opengl}/joystick.go | 0 {pixelgl => backends/opengl}/monitor.go | 0 {pixelgl => backends/opengl}/run.go | 0 {pixelgl => backends/opengl}/util.go | 0 {pixelgl => backends/opengl}/window.go | 0 ext/gameloop/gameloop.go | 2 +- tests/pixel_test.go | 2 +- 14 files changed, 2 insertions(+), 2 deletions(-) rename {pixelgl => backends/opengl}/canvas.go (100%) rename {pixelgl => backends/opengl}/doc.go (100%) rename {pixelgl => backends/opengl}/glframe.go (100%) rename {pixelgl => backends/opengl}/glpicture.go (100%) rename {pixelgl => backends/opengl}/glshader.go (100%) rename {pixelgl => backends/opengl}/gltriangles.go (100%) rename {pixelgl => backends/opengl}/input.go (100%) rename {pixelgl => backends/opengl}/joystick.go (100%) rename {pixelgl => backends/opengl}/monitor.go (100%) rename {pixelgl => backends/opengl}/run.go (100%) rename {pixelgl => backends/opengl}/util.go (100%) rename {pixelgl => backends/opengl}/window.go (100%) diff --git a/pixelgl/canvas.go b/backends/opengl/canvas.go similarity index 100% rename from pixelgl/canvas.go rename to backends/opengl/canvas.go diff --git a/pixelgl/doc.go b/backends/opengl/doc.go similarity index 100% rename from pixelgl/doc.go rename to backends/opengl/doc.go diff --git a/pixelgl/glframe.go b/backends/opengl/glframe.go similarity index 100% rename from pixelgl/glframe.go rename to backends/opengl/glframe.go diff --git a/pixelgl/glpicture.go b/backends/opengl/glpicture.go similarity index 100% rename from pixelgl/glpicture.go rename to backends/opengl/glpicture.go diff --git a/pixelgl/glshader.go b/backends/opengl/glshader.go similarity index 100% rename from pixelgl/glshader.go rename to backends/opengl/glshader.go diff --git a/pixelgl/gltriangles.go b/backends/opengl/gltriangles.go similarity index 100% rename from pixelgl/gltriangles.go rename to backends/opengl/gltriangles.go diff --git a/pixelgl/input.go b/backends/opengl/input.go similarity index 100% rename from pixelgl/input.go rename to backends/opengl/input.go diff --git a/pixelgl/joystick.go b/backends/opengl/joystick.go similarity index 100% rename from pixelgl/joystick.go rename to backends/opengl/joystick.go diff --git a/pixelgl/monitor.go b/backends/opengl/monitor.go similarity index 100% rename from pixelgl/monitor.go rename to backends/opengl/monitor.go diff --git a/pixelgl/run.go b/backends/opengl/run.go similarity index 100% rename from pixelgl/run.go rename to backends/opengl/run.go diff --git a/pixelgl/util.go b/backends/opengl/util.go similarity index 100% rename from pixelgl/util.go rename to backends/opengl/util.go diff --git a/pixelgl/window.go b/backends/opengl/window.go similarity index 100% rename from pixelgl/window.go rename to backends/opengl/window.go diff --git a/ext/gameloop/gameloop.go b/ext/gameloop/gameloop.go index a1fc33e..7aebd5f 100644 --- a/ext/gameloop/gameloop.go +++ b/ext/gameloop/gameloop.go @@ -4,7 +4,7 @@ import ( "errors" "time" - "github.com/gopxl/pixel/v2/pixelgl" + "github.com/gopxl/pixel/v2/backends/opengl" ) type EasyWindow interface { diff --git a/tests/pixel_test.go b/tests/pixel_test.go index eac12cb..2d95623 100644 --- a/tests/pixel_test.go +++ b/tests/pixel_test.go @@ -9,7 +9,7 @@ import ( _ "image/png" "github.com/gopxl/pixel/v2" - "github.com/gopxl/pixel/v2/pixelgl" + pixelgl "github.com/gopxl/pixel/v2/backends/opengl" ) // onePixelImage is the byte representation of a 1x1 solid white png file From d87844333998dab3f7ed85dae0f5642bcf90c3d2 Mon Sep 17 00:00:00 2001 From: duysqubix Date: Wed, 11 Oct 2023 20:10:11 -0500 Subject: [PATCH 09/15] optimized some error calls --- tests/math_test.go | 12 ++++++------ tests/vector_test.go | 3 +-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/tests/math_test.go b/tests/math_test.go index ad828c1..fe11c22 100644 --- a/tests/math_test.go +++ b/tests/math_test.go @@ -1,7 +1,6 @@ package pixel_test import ( - "fmt" "math" "testing" @@ -10,10 +9,11 @@ import ( // closeEnough will shift the decimal point by the accuracy required, truncates the results and compares them. // Effectively this compares two floats to a given decimal point. -// Example: -// closeEnough(100.125342432, 100.125, 2) == true -// closeEnough(math.Pi, 3.14, 2) == true -// closeEnough(0.1234, 0.1245, 3) == false +// +// Example: +// closeEnough(100.125342432, 100.125, 2) == true +// closeEnough(math.Pi, 3.14, 2) == true +// closeEnough(0.1234, 0.1245, 3) == false func closeEnough(got, expected float64, decimalAccuracy int) bool { gotShifted := got * math.Pow10(decimalAccuracy) expectedShifted := expected * math.Pow10(decimalAccuracy) @@ -40,7 +40,7 @@ func TestClamp(t *testing.T) { for _, tc := range tests { result := pixel.Clamp(tc.number, tc.min, tc.max) if result != tc.expected { - t.Error(fmt.Sprintf("Clamping %v with min %v and max %v should have given %v, but gave %v", tc.number, tc.min, tc.max, tc.expected, result)) + t.Errorf("Clamping %v with min %v and max %v should have given %v, but gave %v", tc.number, tc.min, tc.max, tc.expected, result) } } } diff --git a/tests/vector_test.go b/tests/vector_test.go index 3a30920..1425f56 100644 --- a/tests/vector_test.go +++ b/tests/vector_test.go @@ -1,7 +1,6 @@ package pixel_test import ( - "fmt" "testing" "github.com/gopxl/pixel/v2" @@ -21,7 +20,7 @@ func TestFloor(t *testing.T) { for _, tc := range tests { result := tc.input.Floor() if result != tc.expected { - t.Error(fmt.Sprintf("Expected %v but got %v", tc.expected, result)) + t.Errorf("Expected %v but got %v", tc.expected, result) } } } From fb9254d1c0c10831d06d51b2e7d0212da024bd8a Mon Sep 17 00:00:00 2001 From: duysqubix Date: Wed, 11 Oct 2023 20:11:00 -0500 Subject: [PATCH 10/15] removed placeholder file --- backends/opengl/.init | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 backends/opengl/.init diff --git a/backends/opengl/.init b/backends/opengl/.init deleted file mode 100644 index e69de29..0000000 From 735f64c5e4a598dc37829e3870321230b47b2ef4 Mon Sep 17 00:00:00 2001 From: duysqubix Date: Wed, 11 Oct 2023 20:12:26 -0500 Subject: [PATCH 11/15] renamed plugins to extensions --- ext/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/README.md b/ext/README.md index 977888d..1cbcfab 100644 --- a/ext/README.md +++ b/ext/README.md @@ -8,9 +8,9 @@ to pushing Pixel to the next level. ## Extension List -* [gameloop](gameloop/README.md) - A plugin that allows you to run a game loop in Pixel. -* [imdraw](imdraw/README.md) - A plugin that allows you to draw primitives in Pixel. -* [text](text/README.md) - A plugin that allows you to draw text in Pixel. +* [gameloop](gameloop/README.md) - An extension that allows you to run a game loop in Pixel. +* [imdraw](imdraw/README.md) - An extension that allows you to draw primitives in Pixel. +* [text](text/README.md) - An extension that allows you to draw text in Pixel. ## Creating a Plugin From d5ec4d4ca309231021d2e20bced6cd8c19674164 Mon Sep 17 00:00:00 2001 From: duysqubix Date: Wed, 11 Oct 2023 20:16:20 -0500 Subject: [PATCH 12/15] updated readme --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f28756c..9e37a17 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,8 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] - Adding `Focus()` method to `Window` to focus the window via API. - Restructure Pixel Project - - Converted `imdraw` and `text` packages to `plugins` + - Converted `imdraw` and `text` packages to `extensions` - moved all `*_test.go` files to `test` package + - moved `pixelgl` package to `backends/opengl` ## [v1.0.0](https://github.com/gopxl/pixel/v2/compare/v1.0.0...dev) - Multiple Window Management Framework From ac90e264af2cd49b57e228fd7894dce3a420e952 Mon Sep 17 00:00:00 2001 From: duysqubix Date: Wed, 11 Oct 2023 20:30:07 -0500 Subject: [PATCH 13/15] go mod tidy --- go.mod | 1 - go.sum | 14 -------------- 2 files changed, 15 deletions(-) diff --git a/go.mod b/go.mod index 8f4bdff..1966237 100644 --- a/go.mod +++ b/go.mod @@ -17,6 +17,5 @@ require ( require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/stretchr/objx v0.5.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index f563458..b86c224 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,3 @@ -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/go-gl/gl v0.0.0-20211210172815-726fda9656d6 h1:zDw5v7qm4yH7N8C8uWd+8Ii9rROdgWxQuGoJ9WDXxfk= @@ -9,26 +8,14 @@ github.com/go-gl/mathgl v1.1.0 h1:0lzZ+rntPX3/oGrDzYGdowSLC2ky8Osirvf5uAwfIEA= github.com/go-gl/mathgl v1.1.0/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/gopxl/glhf/v2 v2.0.0-20231010004459-fc58b4a8f7d0 h1:QCfBCpS1GprFdtyKyswadqpVLk068vOe4AasenQVvU0= -github.com/gopxl/glhf/v2 v2.0.0-20231010004459-fc58b4a8f7d0/go.mod h1:2TW8DIqHAPiQhv6EAXThEA/fgl+Ky8Lgd3XevyJqmSY= -github.com/gopxl/glhf/v2 v2.0.0-20231011010357-90c5b7c2543d h1:DK2rpfmPeqdYlvdypfE5B7PTwkkKAAlCvzoBNZuwxWc= -github.com/gopxl/glhf/v2 v2.0.0-20231011010357-90c5b7c2543d/go.mod h1:InKwj5OoVdOAkpzsS0ILwpB+RrWBLw1i7aFefiGmrp8= github.com/gopxl/glhf/v2 v2.0.0 h1:SJtNy+TXuTBRjMersNx722VDJ0XHIooMH2+7+99LPIc= github.com/gopxl/glhf/v2 v2.0.0/go.mod h1:InKwj5OoVdOAkpzsS0ILwpB+RrWBLw1i7aFefiGmrp8= -github.com/gopxl/mainthread/v2 v2.0.0-20231010001939-73dfba06ae92 h1:+17VMm30TmRoIlA/S29R29A7Sqbak/6OLKjq6iX/I7U= -github.com/gopxl/mainthread/v2 v2.0.0-20231010001939-73dfba06ae92/go.mod h1:/uFQhUiSP53SSU/RQ5w0FFkljRArJlaQkDPza3zE2V8= github.com/gopxl/mainthread/v2 v2.0.0 h1:jRbeWFzX6/UyhRab00xS3xIVYywBgc0DgwPgwS6EVYw= github.com/gopxl/mainthread/v2 v2.0.0/go.mod h1:/uFQhUiSP53SSU/RQ5w0FFkljRArJlaQkDPza3zE2V8= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.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/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= -github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= golang.org/x/image v0.0.0-20190321063152-3fc05d484e9f/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= @@ -37,6 +24,5 @@ golang.org/x/image v0.13.0/go.mod h1:6mmbMOeV28HuMTgA6OSRkdXKYw/t5W9Uwn2Yv1r3Yxk golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From cc7841a7e86e930b01e0a4ef5ff69422e6bab554 Mon Sep 17 00:00:00 2001 From: duysqubix Date: Wed, 11 Oct 2023 20:31:55 -0500 Subject: [PATCH 14/15] renamed package pixelgl to opengl --- backends/opengl/canvas.go | 2 +- backends/opengl/doc.go | 2 +- backends/opengl/glframe.go | 2 +- backends/opengl/glpicture.go | 2 +- backends/opengl/glshader.go | 2 +- backends/opengl/gltriangles.go | 2 +- backends/opengl/input.go | 2 +- backends/opengl/joystick.go | 2 +- backends/opengl/monitor.go | 2 +- backends/opengl/run.go | 2 +- backends/opengl/util.go | 2 +- backends/opengl/window.go | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/backends/opengl/canvas.go b/backends/opengl/canvas.go index b1917fe..34d452c 100644 --- a/backends/opengl/canvas.go +++ b/backends/opengl/canvas.go @@ -1,4 +1,4 @@ -package pixelgl +package opengl import ( "fmt" diff --git a/backends/opengl/doc.go b/backends/opengl/doc.go index c8acbbc..06b9ed4 100644 --- a/backends/opengl/doc.go +++ b/backends/opengl/doc.go @@ -2,4 +2,4 @@ // library, specifically Window and Canvas. // // It also contains a few additional utilities to help extend Pixel with OpenGL graphical effects. -package pixelgl +package opengl diff --git a/backends/opengl/glframe.go b/backends/opengl/glframe.go index 72c8c66..f943ea1 100644 --- a/backends/opengl/glframe.go +++ b/backends/opengl/glframe.go @@ -1,4 +1,4 @@ -package pixelgl +package opengl import ( "github.com/gopxl/glhf/v2" diff --git a/backends/opengl/glpicture.go b/backends/opengl/glpicture.go index 635c587..3f16504 100644 --- a/backends/opengl/glpicture.go +++ b/backends/opengl/glpicture.go @@ -1,4 +1,4 @@ -package pixelgl +package opengl import ( "math" diff --git a/backends/opengl/glshader.go b/backends/opengl/glshader.go index 97c4f84..48b3d0e 100644 --- a/backends/opengl/glshader.go +++ b/backends/opengl/glshader.go @@ -1,4 +1,4 @@ -package pixelgl +package opengl import ( "github.com/go-gl/mathgl/mgl32" diff --git a/backends/opengl/gltriangles.go b/backends/opengl/gltriangles.go index dcf1921..7220d4a 100644 --- a/backends/opengl/gltriangles.go +++ b/backends/opengl/gltriangles.go @@ -1,4 +1,4 @@ -package pixelgl +package opengl import ( "fmt" diff --git a/backends/opengl/input.go b/backends/opengl/input.go index 6f8f20e..73c1eb7 100644 --- a/backends/opengl/input.go +++ b/backends/opengl/input.go @@ -1,4 +1,4 @@ -package pixelgl +package opengl import ( "time" diff --git a/backends/opengl/joystick.go b/backends/opengl/joystick.go index 25fd374..6a7d905 100644 --- a/backends/opengl/joystick.go +++ b/backends/opengl/joystick.go @@ -1,4 +1,4 @@ -package pixelgl +package opengl import ( "github.com/go-gl/glfw/v3.3/glfw" diff --git a/backends/opengl/monitor.go b/backends/opengl/monitor.go index efb3e7f..8580bc6 100644 --- a/backends/opengl/monitor.go +++ b/backends/opengl/monitor.go @@ -1,4 +1,4 @@ -package pixelgl +package opengl import ( "github.com/go-gl/glfw/v3.3/glfw" diff --git a/backends/opengl/run.go b/backends/opengl/run.go index a4cc1f4..a11cb99 100644 --- a/backends/opengl/run.go +++ b/backends/opengl/run.go @@ -1,4 +1,4 @@ -package pixelgl +package opengl import ( "github.com/go-gl/glfw/v3.3/glfw" diff --git a/backends/opengl/util.go b/backends/opengl/util.go index 68c99fc..969b60c 100644 --- a/backends/opengl/util.go +++ b/backends/opengl/util.go @@ -1,4 +1,4 @@ -package pixelgl +package opengl import ( "math" diff --git a/backends/opengl/window.go b/backends/opengl/window.go index 6763383..1ae636e 100644 --- a/backends/opengl/window.go +++ b/backends/opengl/window.go @@ -1,4 +1,4 @@ -package pixelgl +package opengl import ( "fmt" From 8458582de01a40f8da55ccebcb3eb3434e6c5aa6 Mon Sep 17 00:00:00 2001 From: duysqubix Date: Wed, 11 Oct 2023 20:35:00 -0500 Subject: [PATCH 15/15] completely removed all instances of pixelgl --- README.md | 3 +-- backends/opengl/doc.go | 2 +- ext/gameloop/README.md | 4 ++-- ext/gameloop/gameloop.go | 8 ++++---- tests/pixel_test.go | 8 ++++---- 5 files changed, 12 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 1706c71..5a5479d 100644 --- a/README.md +++ b/README.md @@ -144,8 +144,7 @@ If you're using Windows and having trouble building Pixel, please check [this guide](https://github.com/gopxl/pixel/v2/wiki/Building-Pixel-on-Windows) on the [wiki](https://github.com/gopxl/pixel/v2/wiki). -[PixelGL](https://godoc.org/github.com/gopxl/pixel/v2/pixelgl) backend uses OpenGL to render -graphics. Because of that, OpenGL development libraries are needed for compilation. The dependencies +OpenGL development libraries are needed for compilation. The dependencies are same as for [GLFW](https://github.com/go-gl/glfw). The OpenGL version used is **OpenGL 3.3**. diff --git a/backends/opengl/doc.go b/backends/opengl/doc.go index 06b9ed4..22003a1 100644 --- a/backends/opengl/doc.go +++ b/backends/opengl/doc.go @@ -1,4 +1,4 @@ -// Package pixelgl implements efficient OpenGL targets and utilities for the Pixel game development +// Package opengl implements efficient OpenGL targets and utilities for the Pixel game development // library, specifically Window and Canvas. // // It also contains a few additional utilities to help extend Pixel with OpenGL graphical effects. diff --git a/ext/gameloop/README.md b/ext/gameloop/README.md index 0130898..fc4c93f 100644 --- a/ext/gameloop/README.md +++ b/ext/gameloop/README.md @@ -6,7 +6,7 @@ Defines an `EasyWindow` interface with the following methods ```go type EasyWindow interface { - Win() *pixelgl.Window // get underlying GLFW window + Win() *opengl.Window // get underlying GLFW window Setup() error // setup window Update() error // update window Draw() error // draw to window @@ -38,7 +38,7 @@ window1 := MyNewWindow() // assume MyNewWindow implements EasyWindow interface window2 := MyOtherWindow() // assume MyOtherWindow implements EasyWindow interface manager := NewWindowManager() -manager.InsertWindows([]pixelgl.EasyWindow{ +manager.InsertWindows([]opengl.EasyWindow{ window1, window2, }) diff --git a/ext/gameloop/gameloop.go b/ext/gameloop/gameloop.go index 7aebd5f..49bd3e8 100644 --- a/ext/gameloop/gameloop.go +++ b/ext/gameloop/gameloop.go @@ -8,10 +8,10 @@ import ( ) type EasyWindow interface { - Win() *pixelgl.Window // get underlying GLFW window - Setup() error // setup window - Update() error // update window - Draw() error // draw to window + Win() *opengl.Window // get underlying GLFW window + Setup() error // setup window + Update() error // update window + Draw() error // draw to window } type WindowManager struct { diff --git a/tests/pixel_test.go b/tests/pixel_test.go index 2d95623..faceb67 100644 --- a/tests/pixel_test.go +++ b/tests/pixel_test.go @@ -9,7 +9,7 @@ import ( _ "image/png" "github.com/gopxl/pixel/v2" - pixelgl "github.com/gopxl/pixel/v2/backends/opengl" + "github.com/gopxl/pixel/v2/backends/opengl" ) // onePixelImage is the byte representation of a 1x1 solid white png file @@ -39,7 +39,7 @@ var onePixelImage = []byte{ } func TestMain(m *testing.M) { - pixelgl.Run(func() { + opengl.Run(func() { os.Exit(m.Run()) }) } @@ -53,13 +53,13 @@ func TestSprite_Draw(t *testing.T) { sprite := pixel.NewSprite(pic, pic.Bounds()) - cfg := pixelgl.WindowConfig{ + cfg := opengl.WindowConfig{ Title: "testing", Bounds: pixel.R(0, 0, 150, 150), Invisible: true, } - win, err := pixelgl.NewWindow(cfg) + win, err := opengl.NewWindow(cfg) if err != nil { t.Fatalf("Could not create window: %v", err) }