Gles2 merge with 3dprimitives and develop

merges 3dprimitives branch and latest develop

the current way of drawing 3d primitives is not compatible with gles or gl3/4, merging the 3dprimitives branch should make it easy to port.