Commit Graph
201 Commits
Author SHA1 Message Date
scemino 936109fe4f BACKENDS: Update ImGui callbacks in OSystem and fix engines 2024-05-03 20:25:01 +02:00
scemino 8e07681356 BACKENDS: Update setImGuiRenderCallback in OSystem 2024-05-03 20:04:30 +02:00
Le Philousophe 3822d9d644 BACKENDS: Move setImGuiRenderCallback in OSystem and hide implementation
This avoids dynamic casts and having a variable defined in
backends not supporting ImGui
2024-04-28 21:48:10 +02:00
Christian Kündig 7bdadaefae EMSCRIPTEN: GRAPHICS: Fix screenshots 2024-02-27 17:07:13 +01:00
Le Philousophe e689166a2c BACKENDS: Make screenshots use the Path class 2023-12-24 13:19:25 +01:00
Eugene Sandulenko fad630323a SDL: Added config key disable_saved_screenshot_osd for disabling the OSD message 2023-07-15 11:23:29 +02:00
antoniou79 8cef7b8b69 JANITORIAL: Fix code indentation 2023-06-17 22:14:37 +03:00
antoniou79 38e88cde66 BACKENDS: GRAPHICS: Implement scaler scrolling for OpenGL
Using the Ctrl+Alt+0 or 9 keymap

Also added a guard check for kFeatureScalers to allow the actions (kActionNextScaleFilter, kActionPreviousScaleFilter) to change scaler (but not scaler factor) in sdl/sdl-graphics.cpp
2023-06-17 20:21:29 +02:00
Cameron Cawley 138a983d80 COMMON: Refactor VSync handling to match the other options 2023-01-16 18:09:53 +01:00
Cameron Cawley 350e21ba58 SDL: Better workaround for enabling the system cursor 2022-08-26 21:47:49 +01:00
Thierry Crozat 55dccdf787 SDL: Do not adjust window size when creating maximized window 2022-06-05 17:21:18 +01:00
Eugene Sandulenko 5e05f93f36 ALL: Remove Symbian port 2022-05-28 12:32:29 +02:00
D G Turner 6368cf8b72 SDL: Allow Override of ShowMouse Method for SDL Graphics
This will be required to fix the OpenPandora hack for libSDL issues
with screen limits needing to avoid calls to SDL_ShowCursor(SDL_DISABLE).
2022-04-21 19:39:05 +01:00
Le Philousophe 06bc7a25fa OPENGL: Indicate support of OpenGL even in 2D mode
This allows to check for OpenGL support in backend without having to
call initGraphics3d
2022-04-03 22:17:19 +02:00
Kalle Kietavainen ca2405ed05 SDL: Fix mouse clip to game area in HiDPI mode
The mouse position is set in window coordinates, but it's clipped to the
game area in drawable area coordinates. Previously, the scaling between
these two was not taken into account when calculating the right/bottom
edges of the game area. When the clipped mouse position was converted
back to window coordinates and rounded to the nearest integer, it could
end up on the edge of the game area, not inside of it. This leads to a
loop in which the clipped mouse position is outside of the game area and
needs to be clipped again.

This fixes bug #12646.
2022-02-16 22:15:43 +00:00
Cameron Cawley a14c5a4a53 SDL: Replace gfx_mode with scale_factor in initSizeHint() 2022-01-16 13:22:37 +02:00
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Cameron Cawley c6836c9b77 SDL: Use SDL_SetWindowMouseRect to confine the mouse area 2021-11-19 19:52:58 +01:00
Orgad Shaneh 44219dfa1a BACKENDS: Use nullptr
Using clang-tidy modernize-use-nullptr
2021-11-14 15:51:59 +02:00
Orgad Shaneh b11c5ace90 BACKENDS: JANITORIAL: Remove 'virtual' when override is specified 2021-11-14 14:31:41 +02:00
Filippos Karapetis 8f49df6aca SDL: Fix full screen toggling for 3D games
The previous SdlGraphics3dManager::toggleFullScreen() was not using
beginGFXTransaction / endGFXTransaction in toggleFullScreen().
Restore this logic for 3D games, as using transactions in such games
results in a black screen for 3D games when switching to full screen

A regression from d33487f64
2021-09-29 20:24:03 +02:00
Thierry Crozat feac996b50 SDL: Move code to handle cursor coordinate HiDPI scale to SdlWindow
SDL handles HiDPI scaling differently depending on the system. On
macOS for example the SDL window size and SDL drawable area have a
different size (factor 2 usually) while on Windows they are the
same. When HiDPI is disabled (for the SDL Surface mode for example)
they are always the same.

We need to appl this scaling when converting cursor position between
the drawable area and the SDL window.
2021-08-20 00:12:51 +01:00
Eugene Sandulenko df1341ae6a BACKENDS: Display OSD message on saved screenshots 2021-08-16 14:19:07 +02:00
Thierry Crozat 6fcfdb0514 SDL: Fix handling of cursor position on Windows HiDPI 2021-08-14 19:11:11 +01:00
Cameron Cawley c4699cb280 SDL: Move getDisplayDpiFromSdl and getDpiScalingFactor into the SdlWindow class 2021-08-14 19:09:33 +01:00
Thierry Crozat 5caacb763b SDL: Change signature of getDpiScalingFactor to return the result 2021-08-13 21:41:33 +01:00
Thierry Crozat abf782c670 COMMON: Remove kFeatureHiDPI from OSystem and use getHiDPIScreenFactor instead 2021-08-13 21:41:33 +01:00
Thierry Crozat 4ad54446f8 SDL: Get accurate HiDPI scaling on macOS
This fixes incorrect scaling on some non-retina screens that were
detected as HiDPI.
2021-08-13 21:41:33 +01:00
Thierry Crozat 63dd44a81d SDL: Implement getHiDPIScreenFactor 2021-08-13 21:41:33 +01:00
Thierry Crozat 23ca3604b8 SDL: Fix crash when switching to a 3D graphics manager
The OpenGLSdlGraphics3dManager::getSupportedFormats() implementation
returns an empty list. This caused a crash when trying to get the
first element of the list in SdlGraphicsManager::setState().

This fixes bug #12762: The longest Journey crashes
2021-07-26 23:18:17 +01:00
Cameron Cawley ac9980a9dd SDL: Fix the default scale factor for high resolution games 2021-06-23 23:31:49 +01:00
SupSuper 60f1fd98aa SDL: Use the window display index when querying display modes 2021-05-01 11:22:22 +03:00
Cameron Cawley d33487f641 SDL: Refactor OpenGLSdlGraphics3dManager to inherit from SdlGraphicsManager 2021-04-17 20:32:27 +02:00
SupSuper 3eba076fa0 SDL: Fix null check in getDisplayDpiFromSdl 2021-04-13 19:27:31 +01:00
Cameron Cawley 125fe7162d SDL: Fix compilation with SDL 2.0.3 2021-04-13 17:18:29 +01:00
SupSuper d6ba073055 BACKENDS: OPENGLSDL: Only scale mouse cursor on high-DPI platforms
Some platforms send raw coordinates, others send scaled coordinates.
We try to determine this by comparing the window size and drawable size.
2021-04-12 18:38:45 +02:00
Cameron Cawley 24b59ecb4c Revert "OPENGL: Implement high DPI support on Android (#1895)"
This reverts commit 177d709909.
2021-04-12 00:54:12 +01:00
Eugene Sandulenko 708caaa8fa BACKENDS: SDL: Do not scale mouse position for LoDPI modes 2021-04-11 21:21:44 +02:00
Eugene Sandulenko 7a23d859a5 BACKENDS: Lower hidpi scaling to factor of 1.5 2021-04-11 21:21:44 +02:00
Eugene Sandulenko 5e395d166a BACKENDS: HiDPI support in OpenGL backend 2021-04-11 21:21:44 +02:00
Cameron Cawley 21c1f0d007 SDL: Restore keyboard shortcuts for switching scalers 2021-03-15 16:48:40 +02:00
Thierry Crozat 5412533dec SDL: Fix trying to set unsupported pixel format when changing gfx mode
When switching between the SDL and OpenGL graphics managers, trying
to restore the state could fail as the two managers do not have the
same list of supported formats, so we may not be able to transfer
the pixel format from one to the other. This then resulted in an
assert.

This fixes bug #12079
2021-02-08 12:59:52 +00:00
Cameron Cawley d968d22eb1 SDL: Refactor grabbing and locking the mouse (#2522) 2020-10-14 08:03:31 +02:00
Cameron Cawley 26cd7d44e2 SDL: Implement lockMouse() in the 2D graphics managers (#2517) 2020-10-13 21:31:10 +02:00
Paweł Kołodziejski 59ba9cb715 SDL: Do not allow toggle fullscreen for backends which can lose opengl context used for 3d games. (#2514) 2020-10-13 20:27:58 +02:00
Paweł Kołodziejski 35b9cccbde ALL: Merge ResidualVM 2020-10-09 19:44:13 +02:00
Pawel Kolodziejski d8f2040dba ALL: Drop setupScreen API, use new initGraphics3d from engine API.
Enabled system API for begin/end gfx transactions, initSize, setGraphicsMode.
Function setGraphicsMode will use optional params to trigger 3d rendering
and switch to proper SDL Gfx manager.
2020-10-02 19:14:19 +02:00
Pawel Kolodziejski 6f69981904 BACKENDS: Drop launcherInitSize() and use 2d backend gfx manager for launcher. 2020-09-30 16:52:44 +02:00
Pawel Kolodziejski 6aa7cf6025 BACKENDS: Made code less different in SDL platform backend 2020-09-29 15:08:16 +02:00
Cameron Cawley 5cb84a437d SDL: Clip the coordinates sent by mouse events 2020-09-27 00:32:01 +01:00