misc fixes
HAVE_OPENGLES used only where absolutely necessary. Working on windows, no terrain on android.