Simple function to set the texture2D for openGL ES, implemented in Objective C