generator: fix opengl < 3 and OSX