go-gl / glfw

Go bindings for GLFW 3
BSD 3-Clause "New" or "Revised" License
1.58k stars 181 forks source link

v3.3/glfw: handle GLFW_NO_WINDOW_CONTEXT error #391

Closed dmitshur closed 10 months ago

dmitshur commented 10 months ago

The GLFW_NO_WINDOW_CONTEXT error code happens when a window without a context is passed to a function that requires it to have one. This is deemed a programmer mistake, something that this Go package currently handles by loudly panicking so the mistake is fixed sooner.

Apply the same treatment to this error, which was previously missed and resulted in a "please report this in the Go package issue tracker" message being printed alongside the panic.

Fixes #389.

dmitshur commented 10 months ago

Thanks.