Forums
installing STB and GLM - Printable Version

+- Forums (http://www.scratchpadgames.net/forums)
+-- Forum: MagPi articles (http://www.scratchpadgames.net/forums/forumdisplay.php?fid=7)
+--- Forum: General Chat (http://www.scratchpadgames.net/forums/forumdisplay.php?fid=8)
+--- Thread: installing STB and GLM (/showthread.php?tid=136)



installing STB and GLM - Brian Beuken - 09-25-2018

Unless you know how to use git on your Raspberry, the article where STB was first installed doesn't make it totally clear how to do it. The "what you need" insert provides you with a shortcut which might not make sense.

The simplest way is to enter this in your terminal

git clone https://github.com/nothings/stb.git

and voila you will now have an STB dir in your /Home/Pi directory

likewise for GLM 
git clone https://github.com/g-truc/glm.git

Installs GLM, in the /Home/Pi directory ready to use (this is a much bigger download though and not all is needed but best to have it all)

Bullet is installed on your terminal window with
sudo apt-get install libbullet-dev

One very tiny point to consider with git cloning, is that unlike an apt-install. The files you place on your computer do not update automatically on an apt-get update/upgrade cycle when the libs update.
Glm in particular updates from time to time, though stb is pretty much finished with.  (oh no its not, its had a couple of small updates)
So you may, have occasions when working with other people, where you have different versions of the libs. Be careful to check what others are using, and update this from time to time with another git pull and try to always use the latest version (unless, as can happen, you find the latest version does not work with your code)

Edit... Also if you are using a Raspberry 4 or an X11 render buffer, we need to change the resolution to be less than 1080p as most MP2 and MP4 GPU systems can't quite handle full screen games at that res. Raspberry's other than the 4B can resize their display buffer to the screen res allowing smaller render buffers to keep the speed up but for X11 a different method is needed. I've found a nice library that allows us to do that, and is installed with

sudo apt-get install libxrandr-dev

Do this after you install your mesa libs. The new graphics.h/cpp files will shortly have a change resolution function to set and reset resolution on X11 systems. you also need to include xrandr as a library in your cofiguration files.
Of course you can also choose to set your SBC up in a lower graphic resolution using whatever built in display change systems you have, such as xrandr on the commandline, but then your system has to stay at that resplution. Your call.


RE: installing STB and GLM - jomoengineer - 04-15-2019

From the folder where the code was downloaded with 'git clone' you can run 'git pull' to pull the latest GitHub check-ins.

Also, with apt-get, there is no guarantee you will get the latest or the best. Sometimes it best to go to the git repo and pull the latest checked in code and build and install from there. Of course, it is wise to check the Readme and see what was added or taken away from the posted code.