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.
|
|
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
|
|
|
|
|
|
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.
|
|
Also change some OSD messages to be the same or similar to
messages used by the Surface SDL code.
|
|
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.
|
|
Compatibility profiles only exist in modern OpenGL and we request an ancient
version.
|
|
|
|
|
|
|
|
|
|
|
|
This mode should *not* be used by any new engines/code. If someone is going
to use it and says it works with the OpenGL output, please make them wear a
red uniform and beam them onto a remote planet.
|
|
Formerly, we required that the OpenGL mode was fixed at compile time. Now we
allow the code to work with whatever it is given at runtime.
It is still possible to force a context type on compile time.
|
|
This used to be used by Sword25. Since it is not supported by GLES and no
engine code uses it we drop support. Hopefully, this helps people to realize
they should not use that format in their engine.
|
|
This can and will be used for future extension usage support.
Tizen changes have been untested.
|
|
Formerly we did not initialize the mouse emulation from SdlEventSource
properly. Now hopefully joysticks etc. should work fine with the SDL OpenGL
output too.
|
|
Subclasses of OpenGLGraphicsManager are now supposed to supply a refreshScreen
function which handles actual screen updating (for example, buffer swapping).
|
|
|
|
|
|
It can be returned when there are no dimensions available for the currently selected pixel format
|
|
|
|
This is based upon skristiansson's change set to make ScummVM work with SDL2.
|
|
|
|
|
|
|
|
|
|
Thanks to fuzzie for noticing this.
|
|
Otherwise we can end up with the wrong resolution when we make
multiple resizes in quick succession.
|
|
This makes sure the default mode also works for OpenGL ES contexts.
|
|
|
|
|
|
|
|
We can do this now that we can use virtual inheritance and dynamic_cast
because we enabled RTTI.
|
|
|
|
Sadly this also requires us to extend GraphicsManager for this SDL specific
feature. However, since that's only used in the SDL backend and Tizen it
should be fine for now...
|
|
|
|
|
|
The hooking code is nearly exactly the old hooking code. Only the OpenGL SDL
creation has been adapted since it uses a different constructor now.
|
|
This breaks our Tizen port.
|
|
This reverts commit b6f7d697090ca6f90d20f0f2d5661cc4c8b71bf2. This actually
breaks fullscreen mode cycling.
|
|
Powered by:
git ls-files "*.cpp" "*.h" "*.m" "*.mm" | xargs sed -i -e 's/[ \t]*$//'
|
|
|
|
Altering the fullscreen state will automatically force a refresh now.
|
|
|
|
|