SDL SetVideoMode failed: Couldn’t find matching GLX visual

Problem

I tried starting ufoai after installing it and got an error saying:

SDL SetVideoMode failed: Couldn't find matching GLX visual

While googling for the error I could see it also happens with Quake2, though I haven’t installed that myself so I only have the general rather than specific solution for that program.

Cause

This happens with many SDL programs at startup, because the program can’t detect the video mode X windows is in, so it tries with the default settings, and if they are not compatible with the current mode, you get the “SDL SetVideoMode failed: Couldn’t find matching GLX visual” error.

Solution

In general the solution is to explicitely set the video mode the program is supposed to use so it matches the current mode.

For ufoai specifically, this was done by creating a config.cfg in ~/.ufoai/2.2/base containing

  set r_bitdepth "16"
  set r_colordepth "4"

since that’s what matched the screen configuration I was using.

Other programs are likely to have a similar way to control which values the program should call SetVideoMode with.

Tags: , , ,

Leave a Reply

You must be logged in to post a comment.