opentomb / OpenTomb

An open-source Tomb Raider 1-5 engine remake
http://opentomb.github.io/
GNU Lesser General Public License v3.0
1.39k stars 145 forks source link

Ubuntu: System error: Could not create SDL window #561

Open neo-expert opened 6 years ago

neo-expert commented 6 years ago

OpenTomb compiles sucessfully, but after running "./OpenTomb" it says: System error: Could not create SDL window. On Ubuntu and on Elementary OS.

what can I do?

Gh0stBlade commented 6 years ago

Perhaps there's a driver issue on your system? Any further details about system specifications, driver versions and OS version should help someone else paint a bigger picture of what's going on here.

kgorecki commented 6 years ago

Most probably you don't have GLX visual set. Please check this solution: https://stackoverflow.com/questions/41338549/sdl2-cant-create-window-since-it-couldnt-find-matching-glx-visual I think that some better error message would be good here, "Could not create SDL window" doesn't give you much info. What about using SDL_GetError() instead?

RICCIARDI-Adrien commented 6 years ago

Hi, Testing on an old Pentium 4 with a GeForce 6200 running Debian Testing I think I got the same error :

System error: Could not create SDL window: Couldn't find matching GLX visual

Error might be related to antialiasing, because when I disable this feature in config file (antialias = 0;), game starts and approximately works.

kgorecki commented 6 years ago

Did you check default configuration with applied instructions from link above?

neo-expert commented 6 years ago

Yeah with antialias = 0; it works now. Thank you very much.

But I have a bit more modern hardware: Radeon HD 8970M with Intel(R) Core(TM) i7-4800MQ CPU @ 2.70GHz

kgorecki commented 6 years ago

It really starts without antialiassing. However I'd recommend to configure your OS properly. Typing 2 commands (3 if you don't have glxinfo by default) doesn't hurt. If you really deny to check the link, here's the instruction: Ensure that GLX is installed correctly by running glxinfo. At the bottom, you'll find the list of supported visuals. Here's mine:

    visual  x   bf lv rg d st  colorbuffer  sr ax dp st accumbuffer  ms  cav
  id dep cl sp  sz l  ci b ro  r  g  b  a F gb bf th cl  r  g  b  a ns b eat
----------------------------------------------------------------------------
0x022 24 tc  0  24  0 r  y .   8  8  8  0 .  .  0 16  0  0  0  0  0  0 0 None

Try running the following before running the SDL2 program:

export SDL_VIDEO_X11_VISUALID=

This causes SDL to go down a different code path to find the visual. You can also try hardcoding the visual to the visual id from glxinfo:

export SDL_VIDEO_X11_VISUALID=0x022

RICCIARDI-Adrien commented 6 years ago

Hi, I tried in an Ubuntu VM (because I have no more Pentium 4 at hand) with antialiasing enabled and got the System error: Could not create SDL window: Couldn't find matching GLX visual error.

I then set the SDL_VIDEO_X11_VISUALID variable to an empty value (by executing export SDL_VIDEO_X11_VISUALID= command) and the game managed to start.

I have no problem when running the game on my Xubuntu PC with proprietary NVIDIA drivers. Does someone remember about recent changes to antialiasing code or something related ?