Ported to gl3n-shared.