Fix for black screen on Linux upon starting a game

Depends on @magcius's branch to be merged.
You did not rebase this on top of my branch. It will cause merge conflicts.