Delete of unused variables
Adjust for OSX compiler

This adjust enables to build application on OSX.
Edit for OSG 3.2.0

Add #ifdef BIND_PER_PRIMITIVE because macro for
OSG version not found. BIND_PER_PRIMITIVE is not
deffined in OSG version 3.2.0.