fix GL_INVALID_OPERATION bug, add more api methods, better example