Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- async function createTextureBuffer(gl, permanence, img) {
- if (permanence == "temporary") {
- } else if (permanence == "permanent") {
- // await
- } else log("invalid permanence argument provided");
- }
- class BufferComponent {
- constructor(gl, typedArray) {
- this.arrayBuffer = createArrayBuffer(gl, typedArray);
- this.textureBuffer = createTextureBuffer(gl, "temporary");
- }
- async init() {
- // load img into texture buffer
- this.textureBuffer = await createTextureBuffer(gl, "permanent", img);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment