MCPcopy Create free account
hub / github.com/axmolengine/axmol / addImageAsync

Method addImageAsync

core/renderer/TextureCache.cpp:135–138  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

133 texture is loaded.
134 */
135void 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:

Callers 3

loadImagesMethod · 0.80
onEnterMethod · 0.80

Calls 8

getInstanceFunction · 0.85
fullPathForFilenameMethod · 0.80
findMethod · 0.45
endMethod · 0.45
emptyMethod · 0.45
isFileExistMethod · 0.45
scheduleMethod · 0.45
emplace_backMethod · 0.45

Tested by 2

loadImagesMethod · 0.64
onEnterMethod · 0.64