Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDL OpenGL window permenantly black on second thread when inited later in the program on Mojave #3036

Closed
SDLBugzilla opened this issue Feb 11, 2021 · 0 comments
Labels
wontfix This will not be worked on

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: 2.0.9
Reported for operating system, platform: Mac OS X (All), x86_64

Comments on the original bug report:

On 2018-10-23 03:46:59 +0000, Daniel Bokser wrote:

Created attachment 3392
Test program

When a SDL OpenGL window is opened after an SDL_PollEvent, and is rendered on a second thread in macOS Mojave, the window is permanently black. I have attached a sample program with this structure. This program works fine in Linux and while I have confirmation that this exact program works on High Sierra, my SDL project which has this structure worked fine on High Sierra.

This occurs with all latest fixes on 2.0.9

On 2018-10-23 11:58:53 +0000, Daniel Bokser wrote:

Clarification:

while I have confirmation that this exact program works on High Sierra
should be
while I do NOT have confirmation that this exact program works on High Sierra

On 2018-10-23 18:03:46 +0000, Ryan C. Gordon wrote:

Created attachment 3394
(maybe) Simplified test program

I've been working on this for hours and hours, and I can't coerce this to work. If LATE_INIT is zero, it works, if it's one, it doesn't.

Same result with SDL's render API (USE_RENDERER 1) or just using OpenGL from two threads, so it's not an SDL renderer bug.

I think it's a macOS bug, honestly. I haven't found a workaround, beyond creating all the contexts upfront.

On 2018-10-24 12:06:50 +0000, Daniel Bokser wrote:

Ah that sucks. Maybe I will try to file a bug with Apple, even though it will probably be futile. For some reason even after uninstalling Xcode 10 and installing Xcode 9, it still seems linking to the Xcode 10 libs, so gotta figure that out now. Thank you very much for trying!

On 2018-10-28 03:11:22 +0000, wrote:

I have similar problem while running one thread. See super-simple "test3.cpp". If I call SDL_PollEvent(), then drawing wont happen. I need to manually move window first.

Found another similar report on stackoverflow: https://stackoverflow.com/questions/51992402/sdl-pollevent-prevents-render-unless-window-moved-or-resized

This may be a showstopper on Mojave. I'm just starting using SDL so I might missed something though.

In test program, "#if 1" will give me black window. "#if 0" will give me a blue window.

On 2018-10-28 03:12:45 +0000, wrote:

Created attachment 3403
Very simple demo of problem, as described in my post.

On 2018-10-28 13:09:26 +0000, Alex Szpakowski wrote:

Are you using the latest SDL source code? There was a separate bug report for that which had some fixes go into SDL recently: https://bugzilla.libsdl.org/show_bug.cgi?id=4272

On 2018-10-28 16:54:01 +0000, wrote:

I'm using stable 2.0.8. True, my problem does indeed seem to match bug 4272 better. Sorry for noise.

On 2018-11-02 23:46:46 +0000, Sam Lantinga wrote:

Please reopen this bug if it isn't fixed in 2.0.9.

Thanks!

On 2018-11-04 23:02:28 +0000, Daniel Bokser wrote:

Confirmed that this bug is not fixed in 2.0.9.

On 2018-11-04 23:52:51 +0000, Ryan C. Gordon wrote:

(In reply to Daniel Bokser from comment # 9)

Confirmed that this bug is not fixed in 2.0.9.

I think Sam was talking to Marcus (who was reporting the same issue as Bug # 4272) ... the initial bug reported here is believed to be a macOS Mojave bug, and beyond our control, at least with current beliefs. If a workaround is found, I'm happy to revisit, but right now I'm out of ideas.

--ryan.

@SDLBugzilla SDLBugzilla added bug wontfix This will not be worked on labels Feb 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

1 participant