veandco / go-sdl2

SDL2 binding for Go
https://godoc.org/github.com/veandco/go-sdl2
BSD 3-Clause "New" or "Revised" License
2.17k stars 219 forks source link

Window Doesn't Show #598

Open clseibold opened 2 months ago

clseibold commented 2 months ago

Go version: 1.22 Go-SDL2 version: v0.5.0-alpha.5 SDL2 version: 2.28.5 OS: Linux Fedora 39 (Kernel 6.8.4) w/ Wayland Architecture: x86_64

After updating to the lastest alpha, the window doesn't show, but I can tell that the main loop is still running because it prints stuff in the terminal.

veeableful commented 2 months ago

Hi @clseibold, I was able to reproduce it on my Fedora machine. It seems like drawing on the window would make it show up. Could you try that to see if that works for you?

For example, adding the following after the CreateWindow function:

surface, _ := window.GetSurface()
surface.FillRect(nil, 0)
window.UpdateSurface()
clseibold commented 2 months ago

Sorry for the late response.

That code doesn't work for me. The window is still hidden.

clseibold commented 2 months ago

I moved some stuff around and got the window to show for a split second, but SDL forbids you from getting a Window surface when you plan to create and use a Renderer.

There seems to be some change that happened between 0.4.38 and 0.5.0-alpha.5 that broke things, because 0.4.38 works perfectly fine.

veeableful commented 2 months ago

Hi @clseibold, would you be able to provide the complete but minimal source code that produces the issue? I will try on my Fedora 40 laptop.