Commit graph

159 commits

Author SHA1 Message Date
Le Philousophe
2d1b05bf17 BACKENDS: SDL: Fix sdlGetAttribute shim on SDL2
sdlGetAttribute returns true on success (like SDL_GL_GetAttribute on
SDL3), but SDL_GL_GetAttribute on SDL2 return 0 on success.
2025-02-22 10:57:49 +01:00
scemino
8afb2c1f62 BACKENDS: Add SDL3 backend + update imgui 2025-02-18 22:13:56 +01:00
Cameron Cawley
255562991c GRAPHICS: OPENGL: Enable more features with OpenGL ES 3 2024-12-24 13:25:39 +02:00
Cameron Cawley
26a2e738fd ANDROID: Fix build after FrameBuffer class changes 2024-11-30 23:36:34 +01:00
Cameron Cawley
a9ca83819d BACKENDS: OPENGL: Use the shared Texture class for the overlay in 3D games 2024-11-30 18:21:47 +02:00
Le Philousophe
f04f248f20 BACKENDS: SDL: Implement ImGui API to load images 2024-09-29 17:04:03 +02:00
Le Philousophe
2eebb5db02 BACKENDS: SDL: Add SDL2 Renderer support for ImGui
Some adaptations will be needed for the the engines.
2024-09-29 17:04:03 +02:00
Le Philousophe
c8c3a316d6 ANDROID: Properly apply touch settings when starting a game
The 2D graphics backend is recycled from the GUI when starting a game.
As a consequence, touch settings were never applied.
2024-09-14 16:51:19 +02:00
Le Philousophe
a98df4e445 ANDROID: Rework the virtual gamepad controller
- Use a SVG asset to allow for better scalability
- Make the controller visible when touching the screen
- Allow for oblique moving by placing finger between two directions
- Add more buttons on the center area of the screen (GUIDE, START, LEFT
  STICK, RIGHT STICK) and simplify right area (only four buttons)
- Don't track all fingers, only the ones needed
- Cleanup now unused code
2024-08-31 16:45:32 +02:00
Le Philousophe
678a8fe4cb ANDROID: Add alpha setting to textures in 3D backend
This allows to tune the transparency of the texture easily.
2024-08-31 16:45:32 +02:00
Le Philousophe
0fe0cbc93f BACKENDS: OPENGL: Fix save and restore of GL_BLEND functions
All functions must be set at once.
2024-08-14 20:47:23 +02:00
Le Philousophe
17a1b37dda BACKENDS: SDL: Refactor ImGui processing
This unifies the ImGui processing for both 2D and 3D engine.
This also make sure we don't destroy ImGui if init failed (like on older
OpenGL).
The destroy callback is also called whenever we destroy the context.
2024-06-30 15:57:03 +02:00
Le Philousophe
85509bd428 ANDROID: Use float constants
This avoids promotion to double
2024-06-22 11:52:21 +02:00
Hubert Maier
e0c6a23c04 JANITORIAL: Fix arbitary typo in ios-graphics3d.h 2024-05-18 13:52:31 +02:00
Eugene Sandulenko
34be774f4b
BACKENDS: IMGUI: Bump ImGui to v1.90.6 2024-05-17 22:19:46 +02:00
Eugene Sandulenko
4cd62e3398
BACKENDS: IMGUI: Renamed modified files to minimize diff with upstream 2024-05-17 01:46:45 +02:00
scemino
8e07681356 BACKENDS: Update setImGuiRenderCallback in OSystem 2024-05-03 20:04:30 +02:00
Le Philousophe
7a4f6aa2af OPENGLSDL3D: Make ImGui init and deinit variableless
It is inited only when context is created and deinited when it is
destroyed
2024-04-28 21:48:10 +02:00
Le Philousophe
e6a7d6bc9b OPENGLSDL: Don't compile code when not on SDL 2.0 2024-04-28 21:48:10 +02:00
scemino
b721f95ffe BACKENDS: Add imgui in OpenGL backend 2024-04-28 13:59:31 +02:00
Hubert Maier
794f292b5d
AMIGAOS: Use compiler defines 2024-03-16 01:59:27 +02:00
Lars Sundström
69554e0e52 IOS7: Fix memory leak when switching 3D framebuffers
When a 3D game does not support arbitrary resolutions a framebuffer
has to be created. The initSize method can be called multiple times
with different resolutions. Make sure to delete any existing
framebuffer before creating a new.
2024-03-15 14:26:51 +01:00
scemino
9ff903dd75 BACKENDS: Fix imgui width sdl1 2024-03-07 20:08:26 +01:00
scemino
8807ab74db BACKENDS: New imgui proposition 2024-03-07 20:08:26 +01:00
scemino
9c7098fb84 BACKENDS: Fix regression imgui windows not visible 2024-03-07 20:08:26 +01:00
scemino
b917604200 BACKENDS: Fix create random IniFilename
This was due to a pointer not kept in memory
2024-03-07 20:08:26 +01:00
scemino
0cba66b204 TWP: Move ImGui to backends 2024-03-07 20:08:26 +01:00
Christian Kündig
7bdadaefae EMSCRIPTEN: GRAPHICS: Fix screenshots 2024-02-27 17:07:13 +01:00
Le Philousophe
27c7572bd7 ANDROID: Get HiDPI density from Android metrics 2024-01-24 21:53:07 +01:00
Cameron Cawley
5b1b14ad80 COMMON: Mark more symbols as const 2023-12-26 20:23:59 +01:00
Le Philousophe
e689166a2c BACKENDS: Make screenshots use the Path class 2023-12-24 13:19:25 +01:00
Le Philousophe
2097e32e3d ANDROID: Check for initSurface failures
Without a surface we can't do anything, so error out
2023-12-10 17:39:46 +01:00
Le Philousophe
0ea1b5aef6 GRAPHICS3D: Clear screen while hiding overlay 2023-11-26 16:12:14 +01:00
Le Philousophe
eae8491722 GRAPHICS3D: Properly disable scissor test while rendering surfaces
Restore it afterwards for the engine.
2023-11-26 13:02:33 +01:00
Eugene Sandulenko
b391fb261e
Revert "IOS: Remove unnecessary include"
This reverts commit a5794a6953.
2023-11-16 11:44:00 +01:00
Eugene Sandulenko
a5794a6953
IOS: Remove unnecessary include 2023-11-16 02:05:43 +01:00
Cameron Cawley
bcc9259382 BACKENDS: Report if the backend supports cursors with alpha channels 2023-10-29 02:02:11 +02:00
Lars Sundström
a705235d1a IOS7: Add touch mode configurations in menu, 2D & 3D games
In the Android port it's possible to configure differnet touch modes
in ScummVM menus, 2D games and 3D games. Add the same possibility in
the iOS port. In Android it's possible to configure a touch based
game controller as well. That's not in scope for iOS in this commit
but can be added in the future.
2023-10-10 20:55:48 +02:00
antoniou79
525d4ae46c ANDROID: GRAPHICS3D: Fix typo for virtual method 2023-08-07 08:52:15 +03:00
Cameron Cawley
d8cca29783 BACKENDS: Allow filling part of the screen with OSystem::fillScreen 2023-08-06 23:03:46 +02:00
Le Philousophe
e3877d2606 ANDROID: Move game at the top of screen when keyboard is shown 2023-07-09 11:48:27 +02:00
Lars Sundström
6a74f7b32b IOS7: Implement iOSGraphics3dManager
Add a graphic manager rendering 3D graphics for engines supporting
3D games. The manager is implemented using the 3D graphic managers
for Android and SDL as models.

Most probably Android and iOS can share much more of the code, but
that will be a separate work to refactor.
The iOSGraphics3dManager handles resize since the screen dimension
changes on rotation.

Games not supporting arbitary resolutions, e.g. Grim, are rendered
on an intermediate framebuffer with the size requested by the
engine and then rendered to the backbuffer (a framebuffer bound to
the renderbuffer) and stretched to the screen resolution off the
device.

This commit just adds the manager. It will be utilised in next
commit.

Update gitlab ci worker and update documentation.
2023-07-03 21:50:32 +02:00
Le Philousophe
ce5427960c ANDROID: Remove leftover declaration 2023-07-01 17:52:30 +02:00
Le Philousophe
d371b50d30 ANDROID: Add setting to to disable screen rotation 2023-07-01 16:26:19 +02:00
Le Philousophe
3a838c99f9 ANDROID: Various small fixes
- Comment and space fixes
- Remove outdated setting
2023-07-01 16:26:19 +02:00
Le Philousophe
1cffb9c86a ANDROID: Don't make GL calls when there is not context
This is forbidden by EGL specification
2023-06-26 15:25:27 +03:00
Le Philousophe
79da015e8f ANDROID: Various fixes to textures
- Don't create texture in constructor: it's called before the context is
  created
- Don't leak texture names when calling reinit()
- Fix allocBuffer return condition
- Don't call GL if there is no texture object
- Make sure all textures are released and inited
2023-06-26 15:25:27 +03:00
Le Philousophe
bc438d078a ANDROID: When resizing don't reset everything
Only reinitialize the needed bits.
EGLSurface needs to be reset to take the new size into account.
GLSurfaceView in AOSP does the same thing.
2023-06-26 15:25:27 +03:00
Le Philousophe
560793e571 ANDROID: Don't warp mouse when showing overlay in game 2023-06-26 15:25:27 +03:00
Le Philousophe
14d57b2b61 ANDROID: Don't use a framebuffer when it's not needed
This also fixes a bug in frame buffer placement in vertical aspect ratio
2023-06-26 15:25:27 +03:00