How does JS load pictures blocked by Synchronize?

problem description

if we load a picture, we often write:

class Car {
    constructor() {
        // load shader
        // load texture
    }
    draw() {
        // use shader and texture to render
    }
}

is loaded in the constructor, while draw depends on the completion of loading in the constructor. Consider using Promise , but it"s a shame that I"m not familiar with Promise . And I"m not sure if it can be used with webgl .
if anyone understands and answers, thank you very much!

Mar.29,2021

download pictures blocked by XHR, and then generate data uri or blob url, settings from blob

.

it doesn't really do any good..


there seems to be no way to use Synchronize's ajax to get image data and assign values to img, but why Synchronize?


you can new Image after onload


later, when the subject reconstructs the code, choose to load all the material concurrently with Promise at the beginning, and then start rendering, and then all the logic will be done in series.


Recursive.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e454bb-6513b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e454bb-6513b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?