From a1c3ec69b56401c571649071a0268400edbc3904 Mon Sep 17 00:00:00 2001 From: Allen Ray Date: Mon, 9 Oct 2023 17:33:39 -0400 Subject: [PATCH] Update glfw to v3.3 to align with pixel --- doc.go | 2 +- examples/demo/main.go | 6 +++--- frame.go | 2 +- go.mod | 6 +++--- go.sum | 8 ++++---- orphan.go | 2 +- shader.go | 32 +++++++++++++++++--------------- texture.go | 2 +- vertex.go | 2 +- 9 files changed, 32 insertions(+), 30 deletions(-) diff --git a/doc.go b/doc.go index 58f10f5..885fd1b 100644 --- a/doc.go +++ b/doc.go @@ -1,6 +1,6 @@ // Package glhf provides abstractions around the basic OpenGL primitives and operations. // -// All calls should be done from the main thread using "github.com/gopxl/mainthread" package. +// All calls should be done from the main thread using "github.com/gopxl/mainthread/v2" package. // // This package deliberately does not handle nor report trivial OpenGL errors, it's up to you to // cause none. It does of course report errors like shader compilation error and such. diff --git a/examples/demo/main.go b/examples/demo/main.go index 472a60a..dbeed2c 100644 --- a/examples/demo/main.go +++ b/examples/demo/main.go @@ -6,9 +6,9 @@ import ( _ "image/png" "os" - "github.com/go-gl/glfw/v3.1/glfw" - "github.com/gopxl/glhf" - "github.com/gopxl/mainthread" + "github.com/go-gl/glfw/v3.3/glfw" + "github.com/gopxl/glhf/v2" + "github.com/gopxl/mainthread/v2" ) func loadImage(path string) (*image.NRGBA, error) { diff --git a/frame.go b/frame.go index bd097f3..a22828f 100644 --- a/frame.go +++ b/frame.go @@ -3,8 +3,8 @@ package glhf import ( "runtime" - "github.com/gopxl/mainthread" "github.com/go-gl/gl/v3.3-core/gl" + "github.com/gopxl/mainthread/v2" ) // Frame is a fixed resolution texture that you can draw on. diff --git a/go.mod b/go.mod index e9ae5f9..62ca1d2 100644 --- a/go.mod +++ b/go.mod @@ -1,12 +1,12 @@ -module github.com/gopxl/glhf +module github.com/gopxl/glhf/v2 go 1.21 require ( github.com/go-gl/gl v0.0.0-20211210172815-726fda9656d6 - github.com/go-gl/glfw v0.0.0-20221017161538-93cebf72946b + github.com/go-gl/glfw/v3.3/glfw v0.0.0-20221017161538-93cebf72946b github.com/go-gl/mathgl v1.1.0 - github.com/gopxl/mainthread v1.0.1-0.20231009140732-f806f4d62090 + github.com/gopxl/mainthread/v2 v2.0.0-20231010001939-73dfba06ae92 github.com/pkg/errors v0.9.1 ) diff --git a/go.sum b/go.sum index db65090..4cd55ea 100644 --- a/go.sum +++ b/go.sum @@ -1,11 +1,11 @@ github.com/go-gl/gl v0.0.0-20211210172815-726fda9656d6 h1:zDw5v7qm4yH7N8C8uWd+8Ii9rROdgWxQuGoJ9WDXxfk= github.com/go-gl/gl v0.0.0-20211210172815-726fda9656d6/go.mod h1:9YTyiznxEY1fVinfM7RvRcjRHbw2xLBJ3AAGIT0I4Nw= -github.com/go-gl/glfw v0.0.0-20221017161538-93cebf72946b h1:2hdUMUOJuLQkhaPAwoyOeSzoaBydYEkXkBEuqDuDBfg= -github.com/go-gl/glfw v0.0.0-20221017161538-93cebf72946b/go.mod h1:wyvWpaEu9B/VQiV1jsPs7Mha9I7yto/HqIBw197ZAzk= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20221017161538-93cebf72946b h1:GgabKamyOYguHqHjSkDACcgoPIz3w0Dis/zJ1wyHHHU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20221017161538-93cebf72946b/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= 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/gopxl/mainthread v1.0.1-0.20231009140732-f806f4d62090 h1:v96cHl1NrrzCjR86plhBCvf165vLmYJv6BokYPD4G+c= -github.com/gopxl/mainthread v1.0.1-0.20231009140732-f806f4d62090/go.mod h1:Zs9xkkPXz7wCVgwxksXkSvcdPJYC/KDXKJHeAD3fYn4= +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/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= golang.org/x/image v0.0.0-20190321063152-3fc05d484e9f/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= diff --git a/orphan.go b/orphan.go index 3412e32..11ecfbe 100644 --- a/orphan.go +++ b/orphan.go @@ -3,7 +3,7 @@ package glhf import "github.com/go-gl/gl/v3.3-core/gl" // Init initializes OpenGL by loading function pointers from the active OpenGL context. -// This function must be manually run inside the main thread (using "github.com/gopxl/mainthread" +// This function must be manually run inside the main thread (using "github.com/gopxl/mainthread/v2" // package). // // It must be called under the presence of an active OpenGL context, e.g., always after calling diff --git a/shader.go b/shader.go index af5d78f..a350d3a 100644 --- a/shader.go +++ b/shader.go @@ -4,9 +4,9 @@ import ( "fmt" "runtime" - "github.com/gopxl/mainthread" "github.com/go-gl/gl/v3.3-core/gl" "github.com/go-gl/mathgl/mgl32" + "github.com/gopxl/mainthread/v2" ) // Shader is an OpenGL shader program. @@ -141,20 +141,22 @@ func (s *Shader) UniformFormat() AttrFormat { // // Supplied value must correspond to the type of the attribute. Correct types are these // (right-hand is the type of the value): -// Attr{Type: Int}: int32 -// Attr{Type: Float}: float32 -// Attr{Type: Vec2}: mgl32.Vec2 -// Attr{Type: Vec3}: mgl32.Vec3 -// Attr{Type: Vec4}: mgl32.Vec4 -// Attr{Type: Mat2}: mgl32.Mat2 -// Attr{Type: Mat23}: mgl32.Mat2x3 -// Attr{Type: Mat24}: mgl32.Mat2x4 -// Attr{Type: Mat3}: mgl32.Mat3 -// Attr{Type: Mat32}: mgl32.Mat3x2 -// Attr{Type: Mat34}: mgl32.Mat3x4 -// Attr{Type: Mat4}: mgl32.Mat4 -// Attr{Type: Mat42}: mgl32.Mat4x2 -// Attr{Type: Mat43}: mgl32.Mat4x3 +// +// Attr{Type: Int}: int32 +// Attr{Type: Float}: float32 +// Attr{Type: Vec2}: mgl32.Vec2 +// Attr{Type: Vec3}: mgl32.Vec3 +// Attr{Type: Vec4}: mgl32.Vec4 +// Attr{Type: Mat2}: mgl32.Mat2 +// Attr{Type: Mat23}: mgl32.Mat2x3 +// Attr{Type: Mat24}: mgl32.Mat2x4 +// Attr{Type: Mat3}: mgl32.Mat3 +// Attr{Type: Mat32}: mgl32.Mat3x2 +// Attr{Type: Mat34}: mgl32.Mat3x4 +// Attr{Type: Mat4}: mgl32.Mat4 +// Attr{Type: Mat42}: mgl32.Mat4x2 +// Attr{Type: Mat43}: mgl32.Mat4x3 +// // No other types are supported. // // The Shader must be bound before calling this method. diff --git a/texture.go b/texture.go index 81da668..0365d80 100644 --- a/texture.go +++ b/texture.go @@ -3,9 +3,9 @@ package glhf import ( "runtime" - "github.com/gopxl/mainthread" "github.com/go-gl/gl/v3.3-core/gl" "github.com/go-gl/mathgl/mgl32" + "github.com/gopxl/mainthread/v2" ) // Texture is an OpenGL texture. diff --git a/vertex.go b/vertex.go index 70cbb0f..8c80356 100644 --- a/vertex.go +++ b/vertex.go @@ -4,8 +4,8 @@ import ( "fmt" "runtime" - "github.com/gopxl/mainthread" "github.com/go-gl/gl/v3.3-core/gl" + "github.com/gopxl/mainthread/v2" "github.com/pkg/errors" )