Conversation
|
@ZehMatt are you able to resurrect this? Would be useful now as some linux distros have dropped sdl2. |
This comment was marked as resolved.
This comment was marked as resolved.
|
Done, we need to update the images to have SDL3 pre-installed. |
I'm noticing that sdl3 isn't building on linux vcpkg so I've tried updating vcpkg to target the latest version. |
006e6ba to
e87094b
Compare
There was a problem hiding this comment.
This branch crashes immediately on open for me:
[INF] OpenLoco, v26.01-18 (35d1a9f6 on sdl3)
[INF] macOS (AArch64)
Process 20407 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x4)
frame #0: 0x000000010008f8c8 OpenLoco`OpenLoco::Gfx::SoftwareDrawingEngine::resize(int, int) + 168
OpenLoco`OpenLoco::Gfx::SoftwareDrawingEngine::resize:
-> 0x10008f8c8 <+168>: ldr w2, [x22, #0x4]
0x10008f8cc <+172>: mov x0, x20
0x10008f8d0 <+176>: mov x1, x21
0x10008f8d4 <+180>: bl 0x1002350b4 ; symbol stub for: SDL_CreateSurface
Target 0: (OpenLoco) stopped.
It was puzzling to me, as it already seemed to be programmed quite defensibly. Well, as it turns out, not defensibly enough. I added:
const auto* wndSurface = SDL_GetWindowSurface(_window);
+ if (wndSurface == nullptr)
+ {
+ Logging::error("SDL_GetWindowSurface (_window) failed: {}", SDL_GetError());
+ return;
+ }And got the error message:
[ERR] SDL_GetWindowSurface (_window) failed: Window framebuffer support not available
Upon which another error popped up further down the line:
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
frame #0: 0x00000001000904bc OpenLoco`OpenLoco::Gfx::SoftwareDrawingEngine::present() + 24
OpenLoco`OpenLoco::Gfx::SoftwareDrawingEngine::present:
-> 0x1000904bc <+24>: ldrb w8, [x0]
0x1000904c0 <+28>: tbz w8, #0x1, 0x1000904d0 ; <+44>
0x1000904c4 <+32>: bl 0x1002351ec ; symbol stub for: SDL_LockSurface
0x1000904c8 <+36>: cbz w0, 0x1000905c0 ; <+284>
Target 0: (OpenLoco) stopped.
Which kind of makes sense, if there is no window to present. Why this is happening at all is unclear to me, still, though. I can try to investigate some more later, on Linux as well.
|
Same issue on Arch Linux: Slightly different backtrace though: This is on a machine with just an integrated GPU chipset. |
|
Still getting a black screen on v26.01-21 (18c6952 on sdl3), sorry. |
|
Fixed by 9ce99c0. The most innocuous change! 😄
|
AaronVanGeffen
left a comment
There was a problem hiding this comment.
All good from my perspective. Maybe just rebase on top of current master to see if there are 'hidden' conflicts, i.e. not direct conflicts but surreptitious incompatibilities. There's probably nothing, but just to be on the safe side, right.
| auto& drawingEngine = Gfx::getDrawingEngine(); | ||
| drawingEngine.initialize(_window); | ||
| drawingEngine.resize(desc.width, desc.height); | ||
| drawingEngine.setVSync(cfg.vsync); |
There was a problem hiding this comment.
This vsync call was probably lost in a rebase 😄 #3669



I wanted to see what sort of pain this would be, it was okay'ish but by updating the vcpkg version it also updated OpenAL which now compiles libfmt by adding the source files directly and that causes a conflict in linking on my end so I don't even know if my changes work or not. I've created a new issue on the OpenAL repo and hopefully it will get resolved, I might solve this myself but then we would have to either use a port overlay or fetchcontent from the fork.
Edit: As for the new SDL3 API, I appreciate some changes and I dislike some others but I think generally speaking SDL3 is a good upgrade.