add a check to gl::GetError + use PI const
basic map generation. ugly