adding some (sadly, non-portable) glue to determine the dirname that contains the gtkclient executable so that vertexshader .cg code can be loaded without first cd'ing to the directory that contains the executable.
adding some (sadly, non-portable) glue to determine the dirname that contains
the gtkclient executable so that vertexshader .cg code can be loaded
without first cd'ing to the directory that contains the executable.

tl;dr use the /proc/ filesystem to get the full path to the executable
then use dirname (from libgen.h) to get the directory part of that path
then look for cgfiles in that path 

joeyo/spk,joeyo/spk,joeyo/spk,joeyo/spk,joeyo/spk