| Summary: | SDL_GLContext broken on windows that have not at least once been set visible | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Matthias <matthias.schweinoch> |
| Component: | video | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | blocker | ||
| Priority: | P1 | Keywords: | target-2.0.0 |
| Version: | HG 2.0 | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Attachments: |
simple program to illustrate bug behavior
Possible fix |
||
|
Description
Matthias
2011-01-20 14:01:48 UTC
Created attachment 554 [details]
simple program to illustrate bug behavior
There is a function showAndHide() in the main program. If you remove the comments, the program works as intended. If you do not remove the comments, the bug appears (i.e. broken SDL_GLContext).
Created attachment 892 [details]
Possible fix
Please try the attached patch as a possible fix. I don't think it's related directly to hide/show, but to a general race condition.
Hey Ryan, can you look at this for SDL 2.0 release? You can probably recruit Pierre-Loup if you want. This is working here. I think we probably fixed it when we did all the tapdancing with fullscreen awhile ago, since it forced us to wait on some window mapping event or whatever, unrelated to this. The specific reason this was failing, if I had to guess, was this section of the glXMakeCurrent docs: "The first time ctx is made current to any thread, its viewport is set to the full size of drawable. Subsequent calls by any thread to glXMakeCurrent with ctx have no effect on its viewport." Probably before the window was mapped, it had a 0x0 size. If you're still having this problem with the latest SDL2 code, please see if adding "glViewport(0, 0, winw, winh);" right after the SDL_GL_CreateContext() fixes it...it's possible you had a 0x0 viewport. (And if that fixes it, maybe we should force that in SDL_GL_CreateContext().) Alternately: if you're still having this problem, see if SDL_GL_CreateContext() returned NULL. The reasons are still roughly the same, but that could also be why it failed, and we'd like to know where to fix this. --ryan. Ryan, I'm going to mark this waiting for feedback from Matthias so we get the info you're requesting. (Sorry if you get a lot of copies of this email, we're touching dozens of bug reports right now.) Tagging a bunch of bugs as target-2.0.0, Priority 1. This means we're in the final stretch for an official SDL 2.0.0 release! These are the bugs we really want to fix before shipping if humanly possible. That being said, we don't promise to fix them because of this tag, we just want to make sure we don't forget to deal with them before we bless a final 2.0.0 release, and generally be organized about what we're aiming to ship. Hopefully you'll hear more about this bug soon. If you have more information (including "this got fixed at some point, nevermind"), we would love to have you come add more information to the bug report when you have a moment. Thanks! --ryan. I'm resolving this bug, as it appears to be fixed. If you find it's still broken on the latest version of SDL, please feel free to reopen this bug. --ryan. |