Guest User

async question

a guest
Jun 7th, 2026
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. async function createTextureBuffer(gl, permanence, img) {
  2. if (permanence == "temporary") {
  3.  
  4. } else if (permanence == "permanent") {
  5. // await
  6. } else log("invalid permanence argument provided");
  7. }
  8.  
  9.  
  10. class BufferComponent {
  11. constructor(gl, typedArray) {
  12. this.arrayBuffer = createArrayBuffer(gl, typedArray);
  13. this.textureBuffer = createTextureBuffer(gl, "temporary");
  14. }
  15.  
  16. async init() {
  17. // load img into texture buffer
  18. this.textureBuffer = await createTextureBuffer(gl, "permanent", img);
  19. }
  20. }
  21.  
  22.  
Advertisement
Add Comment
Please, Sign In to add comment