go-sdl2 icon indicating copy to clipboard operation
go-sdl2 copied to clipboard

doesn't draw content initially on macOS Mojave

Open Noofbiz opened this issue 7 years ago • 3 comments
trafficstars

Currently, when you open a window with a GLContext in macOS Mojave, drawing doesn't start until you manually move the window. To fix it, the NSGLContext has to be updated a couple times before calling Window.GLSwap(). I have a fix for it here that makes the NSGLContext calls that can be used before GLSwap(). I'm wondering if you guys would like that incorporated into go-sdl2 in the glswap call?

Noofbiz avatar Oct 12 '18 23:10 Noofbiz

Hi @Noofbiz, it sounds like maybe SDL2 itself need to fix this. Perhaps you could report it to them at https://discourse.libsdl.org? Although without a native C version of a program that reproduces this issue, I can't be 100% sure it's their issue.

veeableful avatar Oct 13 '18 06:10 veeableful

Yeah, the issue is in SDL itself. Looks like it's already been reported here.

Noofbiz avatar Oct 13 '18 19:10 Noofbiz

Are you polling any events? I discovered that even on non-GL windows the window doesn't raise or draw window decorations without pumping events. You don't even have to do anything with the events, but you have to at least consume the first two (sdl.WINDOWEVENT_SHOWN, followed by sdl.WINDOWEVENT_EXPOSED) before the window appears.

bartgrantham avatar Dec 16 '18 13:12 bartgrantham