Ported to OpenGL.
gprof profiling support added as a build option.