Skip to content

Commit

Permalink
fix restore vao bewteen js and native
Browse files Browse the repository at this point in the history
  • Loading branch information
bliu96 authored and durswd committed Mar 6, 2024
1 parent 0f04748 commit cec5921
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/js/effekseer.src.js
Original file line number Diff line number Diff line change
Expand Up @@ -532,12 +532,20 @@ const effekseer = (() => {
this.current_active_texture_id = null;

this.ext_vao = this._gl.getExtension('OES_vertex_array_object');
let vao = null;
if (this.ext_vao != null) {
this.effekseer_vao = this.ext_vao.createVertexArrayOES();
vao = this.ext_vao.createVertexArrayOES();
}
else if ('createVertexArray' in this._gl) {
this.isWebGL2VAOEnabled = true;
this.effekseer_vao = this._gl.createVertexArray();
vao = this._gl.createVertexArray();
}
if (vao) {
let GL = Module.GL;
let id = GL.getNewId(GL.vaos);
vao.name = id;
GL.vaos[id] = vao;
this.effekseer_vao = vao;
}
}

Expand Down

0 comments on commit cec5921

Please sign in to comment.