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
Crash when using display filters on some systems (fix included) #1433
Comments
Ok... I've just tested my 'fix' on Windows, and the results are not great. It's causing some crazy flickering weirdness. So I guess I haven't worked out a fix after all. Sorry. I'll let you know if I learn more. |
There's already a |
Right. The name If I simply comment out I'll do a bit more testing, but my current recommendation is to rename There are still a few things I'm foggy on. For example, I don't fully understand the purpose of |
Ok. I've amended my original fix to do what I said in the previous post. Here it is: (I figure that since no one relies on my repository, I can just force history changing commits for neatness.) I've tested this (briefly) on both Windows and Linux, with and without shaders. I did not notice any problems related to that. So I think this time is is properly fixed! That said, one time during my testing I did get a crash in Windows while switching shaders. It wasn't with the final code that I'm uploading now, but it was with a version without the Screen::flip(). Essentially what I'm saying is that I don't think my patch here is going to fix #1389 after all. I now believe that's something unrelated. I haven't been able to reliably reproduce the crash. It just seems to sometimes happen when switching between shaders. |
Backstory (maybe not important):
In the past I've noticed intermittent crashes on Windows when setting some display filters. I mostly just ignored it. Recently I've started running openxcom on Linux, and I ran into a couple of problems:
After some searching I worked out that both these problems are due to how sdl1 interacts with newer linux systems; and I was able to fix both of these problems by using sdl1.2-compat, which replace the normal sdl runtime with a version that uses sdl2 as a backend. (No recompiling required.) This worked well, except it that it introduced a new problem.
Main issue and solution:
The problem was that any time I set any display filter, the game would immediately crash. It would display a box saying "Use SDL_GL_SwapBuffers() on OpenGL surface", and then it would seg-fault. Restarting the game kept the same faulty display filter settings, so I had to delete the config file every time I wanted to start the game without crashing.
In any case, I took the advice of the error message and made a minor change to the code, which you can see here:
karadoc@e2d44cb
Essentially, I'm telling it to use
SDL_GL_SwapBuffers
instead ofSDL_Flip
when OpenGL is in use. I don't know much about OpenGL, but this change fixed the issue for me. I've tested it both with libsdl1.2debian (which is what I had originally) and libsdl1.2-compat (which is what I'm now using to fix the original problems). It works with and without display filters with both versions of the run time, with no crashes. I haven't yet tested on Windows though.Note: this is probably the same issue as #1389.
The text was updated successfully, but these errors were encountered: