Comments (4)
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.
from openxcom.
There's already a SDL_GL_SwapBuffers
here: https://github.com/OpenXcom/OpenXcom/blob/master/src/Engine/Zoom.cpp#L680
Maybe it's in the wrong place?
from openxcom.
Right. The name flipWithZoom
does imply that it should be flipping the display - but by the looks of it, it only flips in OpenGL mode.
If I simply comment out SDL_GL_SwapBuffers()
line in Zoom::flipWithZoom
, so that it is only called in my modified version of Screen::flip()
, then the flicking problem in Windows is fixed. (It makes sense, because if we flip, then immediately flip again we're probably going to get a blank screen, or perhaps just whatever the previous buffer use to have - which might be why it seemed to work in Linux.)
I'll do a bit more testing, but my current recommendation is to rename Zoom::flipWithZoom
to Zoom::blitWithZoom
or something like that, and get remove its call to SDL_GL_SwapBuffers()
; then just keep the change that I made in Screen::flip()
(which is to either use SDL_GL_SwapBuffers()
for OpenGL mode, or SDL_Flip(_screen)
for ordinary 2D SDL mode.)
There are still a few things I'm foggy on. For example, I don't fully understand the purpose of OpenGL::refresh()
. The description says "make the buffer show up on screen"; which makes it sound exactly the same as Flip and SwapBuffers... so that's confusing to me.
from openxcom.
Ok. I've amended my original fix to do what I said in the previous post. Here it is:
karadoc@7138594
(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.
from openxcom.
Related Issues (20)
- Psi Capture does not work with Sectopods? HOT 10
- Features of the nightly version HOT 1
- Fatal Error Openxcom crash when Alien controls Marine with Blaster Launcher HOT 2
- Origin hangar tied-up if craft sold while refueling after transfer HOT 2
- [OpenXCOM TftD] XcomUtil : 'High Explosive Damage' not working as intended
- Game launches without music HOT 4
- 2 critical bugs (only floaters and no funding reducing)
- Psionic/MC training lowers existing skill to skill cap
- Support latest of macOs Ventura
- Enabling "Alternate craft equipment management" causes desync between listed inventory and actual inventory of craft. HOT 1
- [OXCE, New Battle] Soldiers not ranking up or increasing stats after battle HOT 1
- [Base Defense] YAML formatting errors on savegame HOT 5
- Pedia articles scrolling bug HOT 1
- Nightly 2023_09_09_1408 segmentation fault HOT 1
- Incorrect count of unconcious carried soldiers in Triton on aborting mission
- Segmentation Fault: xbrz::nearestNeighborScale(unsigned int const*, int, int, int, unsigned int*, int, int, int, xbrz::SliceType, int, int) HOT 5
- Blaster launchers don't crack SOME outer ufo hull HOT 1
- graphics output API for OBS capture.
- Broken links to Linux downloads
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openxcom.