The addImageAsync logic follow the steps: - find the image has been add or not, if not add an AsyncStruct to _requestQueue (GL thread) - get AsyncStruct from _requestQueue, load res and fill image data to AsyncStruct.image, then add AsyncStruct to _responseQueue (Load thread) - on schedule callback, get AsyncStruct from _responseQueue, convert image to texture, then delete AsyncStruct (GL th
| 133 | texture is loaded. |
| 134 | */ |
| 135 | void TextureCache::addImageAsync(std::string_view path, const std::function<void(Texture2D*)>& callback) |
| 136 | { |
| 137 | addImageAsync(path, callback, path); |
| 138 | } |
| 139 | |
| 140 | /** |
| 141 | The addImageAsync logic follow the steps: |