Hiradur
Posts: 96
Joined: Fri Mar 01, 2013 10:59 am

glshim: Shell script to make playing OpenGL 1.x games easy

Thu Jul 23, 2015 10:14 am

What is this about?
There are still many games which have not been ported to OpenGL ES or the RPi in particular. You can still play these games by either
a) running them in software mode. This means graphics are calculated on the CPU. Usually results in 0-5fps for any game where graphics consist of more than basic shapes.
b) running them via glshim. glshim is a FOSS library mainly developed by lunixbochs which translates OpenGL calls to OpenGL ES so that the game can utilize the PI's GPU without any modification to the game itself.

I think glshim does a good job and I'm surprised to see how little it is used here which is why I wrote a script which downloads the source code of glshim, compiles it and starts a game with the appropriate settings.
Be aware that glshim does not interfere with your system. It won't be used unless you start games via this script.

Download:
You can get the script from here: https://gist.github.com/Hiradur/781033a9d183b0e98f34

Usage:
First time:
Install dependencies:

Code: Select all

sudo apt-get install cmake libx11-dev
Make script executable:

Code: Select all

chmod +x glshim.sh
Run the script without any arguments. This will download and build the wrappers. You can update them to a newer version with this, too.

Code: Select all

./glshim.sh
After glshim built successfully:
To start a game with glshim simply pass its path to the script.

Code: Select all

./glshim.sh <path to game>
So if your game is already in PATH (it usually is when installing via apt-get) then use this to start e.g. bloboats:

Code: Select all

./glshim.sh bloboats
If your game is not in PATH (i.e. you downloaded a binary or compiled it yourself):

Code: Select all

./glshim.sh ~/rigs-of-rods/bin/RoR
If you want to pass arguments to the game use quotations marks:

Code: Select all

./glshim.sh "~/rigs-of-rods/bin/RoR -map=simple2"
If you experience low FPS you should try with TinyGLES software renderer (only available on RPi2/armv7). Due to bad video drivers this may actually be faster in some cases.

Code: Select all

./glshim.sh bloboats -tinygles
Projects used:
glshim: https://github.com/lunixbochs/glshim
-> Spreadsheet of supported GL Features here: https://docs.google.com/spreadsheets/d/ ... LVE0KTjU2k
glues: https://github.com/lunixbochs/glues
TinyGLES: https://github.com/lunixbochs/tinygles

Please report graphic glitches and other problems coming from the wrappers and not my script at their corresponding GitHub repo.


Feel free to post working games in this thread.

Return to “Gaming”