EngoEngine/engo

panic: ErrorCode(65546): Cannot make current with a window that has no OpenGL or OpenGL ES context

tetrahedronix opened this issue · 3 comments

Hi!
I tried to compile the Hello World example but I got the following error message at run time

GLFW: An invalid error was not accepted by the caller: ErrorCode(65546): Cannot make current with a window that has no OpenGL or OpenGL ES context
GLFW: Please report this bug in the Go package immediately.
panic: ErrorCode(65546): Cannot make current with a window that has no OpenGL or OpenGL ES context

goroutine 1 [running, locked to thread]:
github.com/go-gl/glfw/v3.3/glfw.acceptError(0x0, 0x0, 0x0, 0x1c96100, 0xc000012580)
	/home/tetravalente/Workspace/pkg/mod/github.com/go-gl/glfw/v3.3/glfw@v0.0.0-20201101223321-f087fae2c024/error.go:178 +0x20c
github.com/go-gl/glfw/v3.3/glfw.panicError(...)
	/home/tetravalente/Workspace/pkg/mod/github.com/go-gl/glfw/v3.3/glfw@v0.0.0-20201101223321-f087fae2c024/error.go:185
github.com/go-gl/glfw/v3.3/glfw.(*Window).MakeContextCurrent(0xc0001581b0)
	/home/tetravalente/Workspace/pkg/mod/github.com/go-gl/glfw/v3.3/glfw@v0.0.0-20201101223321-f087fae2c024/context.go:18 +0x45
github.com/EngoEngine/engo.CreateWindow(0x683fb9, 0x7, 0x190, 0x190, 0x0, 0x1)
	/home/tetravalente/Workspace/pkg/mod/github.com/!engo!engine/engo@v1.0.5/engo_glfw.go:106 +0x319
github.com/EngoEngine/engo.Run(0x0, 0x683fb9, 0x7, 0x0, 0x190, 0x190, 0x3f8000003f800000, 0x0, 0x3c, 0x0, ...)
	/home/tetravalente/Workspace/pkg/mod/github.com/!engo!engine/engo@v1.0.5/engo.go:225 +0x3e9
main.main()
	/home/tetravalente/Workspace/src/gitlab.com/tetravalence/traffic/traffic.go:28 +0x9d

My system spec

OS: Ubuntu 20.04
Nvidia driver: 450.80.02
Golang: version go1.15 linux/amd64
Engo: 1.0.5

Libraries libgl1-mesa, libglx, libglew, libglfw3, libgles are installed. I can compile and run Unreal Engine demos so I think that the problem is related to the Golang development environment.

Hello!

Using the tip of master as well as engo v1.0.5 I can't replicate on macOS with go1.15.3

It looks like the issue is on the GLFW side. Do you know if you're using Wayland instead of X? If so, I believe glfw 3.3 needs the Wayland build tag to work. Might be related to go-gl/glfw#278. If so, I can update the glfw version to the latest once that gets put in.

ETA: My Linux box is currently out of commission, so I'm not sure when I'll be able to test it out on Linux / Wayland

Thank you for your immediate response. I'm using Xorg with gnome-session.
The Hello World example works fine with MX Linux 19.2, KDE flavor. I did a fresh install of this Linux distro, then I installed golang and xorg-dev. No problem. Then I think that Ubuntu 20.04 comes with GL libraries that cause the program to start panicking.

My fault. I also imported another package that uses go-glfw causing the run time error.
Sorry for this quid pro quo. Problem solved.