Age | Commit message (Collapse) | Author |
|
Destroying and recreating the SDL window whenever the video mode
changes in SDL2 is not necessary and causes several problems:
1. In windowed mode, the game window shifts position;
2. In fullscreen mode in macOS, every time the window is
recreated, it causes the OS to play its switch-to-fullscreen
animation again and emit system alert noises;
3. The window content flickers; and
4. The engine loses events from the old destroyed window.
This patch changes the SDL backend code to avoid destroying and
recreating the SDL window when using SDL2, except when switching
OpenGL modes, since there is no way to change the OpenGL feature
of a window.
There are still some outstanding issues with OpenGL where window
size ends up getting reset even though the user has resized it;
this will probably need to be addressed at some point in another
patch.
Thanks to @bgK and @criezy for their feedback which made this
patch much better.
Co-Authored-By: Bastien Bouclet <bastien.bouclet@gmail.com>
|
|
Closes gh-948.
|
|
Updating the cursor's texture is not necessary if it is not going to be drawn.
Fixes glDrawArrays sometimes failing due to using a framebuffer with an
incomplete color attachment. In SCI32 games, the framebuffer is incomplete
because the engine does not define pixel data for the cursor.
|
|
In particular this adds a warning when failing to save a screenshot
in OpenGL mode (there was already one in SurfaceSDL mode).
|
|
|
|
This fixes bug #9701: WINDOWS: Flow of taking screenshots
on Windows is broken
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
We don't need to recreate the window when turning filtering on or off.
Only the texture needs to be recreated.
|
|
|
|
Crtl-Alt-f now enables/disables filtering instead of changing the
graphics mode. Since there is only one graphics mode now, a hotkey
to change it is a bit useless.
|
|
This implements the request from ticket #9573: SDL1/2: Different
rendering/filtering?
|
|
This replaces the two graphics modes "OpenGL (No filtering)" and
"OpenGL". Now there is a single "OpenGL" mode and filtering is
controlled by the kFeatureFilteringMode.
|
|
Also change some OSD messages to be the same or similar to
messages used by the Surface SDL code.
|
|
Previous releases also did full screen updates for transparent OSD messages.
There should be no performance regression with that regard.
Computing smaller update rects is non trivial, but should be looked into if
performance is an issue for OSD icons.
Fixes #9598
|
|
|
|
|
|
It is no longer being called by another thread.
|
|
Those outdated resize events are sent from SDL_DestroyWindow when the
window is fullscreen and doesn't have the SDL_WINDOW_FULLSCREEN_DESKTOP
flag (thus Surface SDL is not affected). Switching resolutions in fullscreen, or
switching from fullscreen to windowed will therefore cause a resize event to
be received with the former fullscreen resolution after we have already setup
the window to use the new resolution. If we don't ignore this event we end up
with a texture size and a window size that are not consistent and for example
see only a part of the texture (if the old resolution is bigger than the new one.
|
|
This fixes a crash when calling displayActivityIconOnOSD with a
NULL icon, which is used to remove the current activity icon.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Now it doesn't require full redraw, but asks to redraw the area which is
copied to.
|
|
Now OSD is always drawn.
|
|
|
|
So one can erase everything from OSD and then blit something on it.
|
|
I was lazy to implement that in OpenGLGraphicsManager and I'm not sure
it's implemented correctly in SurfaceSdlGraphicsManager, but it works
for me.
|
|
This is undefined behavior and clang warns about it.
See <http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20160118/147239.html>.
|
|
Overlays are shown with _currentShakePos offset too, so no need to
compensate the mousepointer position for overlays. This compensation
was done inconsistently in draw/undraw mouse causing the mouse trails.
|
|
|