libsdl-org / sdl12-compat

An SDL-1.2 compatibility layer that uses SDL 2.0 behind the scenes.
Other
193 stars 40 forks source link

crrcsim/Wayland: ssgInit called without a valid OpenGL context #252

Closed smcv closed 1 year ago

smcv commented 1 year ago

Prerequisites:

To reproduce:

Expected result: all work (ignoring #251 which is a separate issue).

Actual result: with Wayland selected:

INFO: sdl12-compat, built on Oct  3 2022 at 09:40:31, talking to SDL2 2.24.1
Locale : en_GB.UTF-8 Internal codeset: iso8859-15
CRRCsim 0.9.13 started at 2022-10-13 13:34:20
Running on Linux 5.19.0-2-amd64
Using plib version 1.8.5
Compiled with SDL version 1.2.15
(Linked SDL version is 1.2.58)
Configured data path: /usr/share/crrcsim
Data file search path:
  .
  /home/desktop/.crrcsim
  /usr/share/crrcsim
  /usr/local/share/games/crrcsim
  /usr/share/games/crrcsim
RAND_MAX = 2147483647
Configuration file is /home/desktop/.crrcsim/crrcsim.xml
Configuration version is 2
T_Config: Setting location to scenery/davis-orig.xml, sky variant 0
Thermals: strength_mean=5.000000 strength_sigma=1.000000 radius_mean=70.000000 radius_sigma=10.000000
Thermals: density=0.000002 lifetime_mean=240.000000 lifetime_sigma=60.000000
Wind: 7.00 ft/s at 270.00 deg, turbulence (rel.) 1.0
std::string reconfigureInputMethod()
New input method: MOUSE
T_TX_Interface::T_TX_Interface
T_TX_InterfaceSoftware::T_TX_InterfaceSoftware(int method)
T_TX_Mixer::T_TX_Mixer()
int T_TX_InterfaceSoftware::init(SimpleXMLTransfer* config)
int T_TX_Interface::init(SimpleXMLTransfer* config)
T_TX_Mixer::init(cfg, child)
 <-- inputMethod.mouse
Loading mixer settings from inputMethod.mouse:
T_AxisMapper::init(cfg, child)
 <-- inputMethod.mouse
mapper set to radio type 6
Screen resolution : 1920 x 1080 
Loading default videomode from config...
Failed to setup videomode 800x600, fullscreen=0
Failed to setup videomode 800x600, fullscreen=0
Failed to setup videomode 640x480, fullscreen=0
Failed to setup videomode 800x600, fullscreen=0
Using the following rendering mode:
  Renderer:    AMD Radeon RX Vega (vega10, LLVM 14.0.6, DRM 3.47, 5.19.0-2-amd64)
  Vendor:      AMD
  GL version:  4.6 (Compatibility Profile) Mesa 22.2.0
  RGBA bpp:    8/8/8/0
  Depth bpp:   24
  Stencil bpp: 8
  Modelview stack: 1 / 32    Projection stack: 1 / 32
Opened audio device: 16 bit signed audio (mono) at 48000 Hz
Initialized sine samples: 480
FATAL: ssgInit called without a valid OpenGL context.
smcv commented 1 year ago

This game uses plib (which seems to be more or less a SDL competitor, so I don't know why it uses both plib and SDL...) and plib seems to be X11-specific. Perhaps the same trick I suggested on #249 would help here.

smcv commented 1 year ago

This wasn't fixed by https://github.com/libsdl-org/sdl12-compat/commit/2a96bb35d7562f75c710e5824a49eb14c13c1bac, please reopen. If we can find a suitable symbol to detect "this is using plib in a way that is probably not Wayland-friendly" then we can probably expand the automatic quirks?

smcv commented 1 year ago

plib seems to be dead upstream (the last release was in 2006 and it has unfixed security vulnerabilities in its issue tracker), so I'm not going to waste time trying to get plib fixed.

Unfortunately its ABI is C++, so we'll have to use a mangled name to recognise it.

smcv commented 1 year ago

269 seems to avoid this.