Wip platform

Hi, these commits fix compilation in uninstalled setup and with GLES2. Would be great if you could merge this :)