use std::vector instead of manual memory management

Change-Id: I17da6947caffde0ba10717475da36dd265069ce5
use std::vector instead of manual memory management

Change-Id: I021068716b0c3f4bc858eeb76da684dce316ba60
small fix for missed code

Change-Id: Ida611464603a8a6229b771380ce5c6b20aa268ef
use std::min and std::max

Change-Id: I5b8901606af2699a7d32978c897af73901fbc230
more clean-up

Change-Id: Ie774afc8ab2c881c5f82be286c84fb3eb37821c1
more formatting and TODO comments

for GL_QUADS see for example
http://stackoverflow.com/questions/6644099/what-is-so-bad-about-gl-quads

Change-Id: Ife53f1ac09125bc7e42c8aa91c53d7e7991ac0bf