replace sub texture writing calls to fit with gles2