Custom Gis Application with Arcgis Javascript API with modern layouting
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

8 lines
2.4 KiB

// All material copyright Esri, All Rights Reserved, unless otherwise specified.
// See https://js.arcgis.com/4.30/esri/copyright.txt for details.
//>>built
define("exports ../../core/Logger ../../core/maybe ../../core/typedArrayUtil ./enums ./Util".split(" "),function(g,m,n,p,h,q){const c=()=>m.getLogger("esri.views.webgl.VertexArrayObject");g.VertexArrayObject=class{constructor(a,b,d,e,f=null){this._context=a;this._locations=b;this._layout=d;this._buffers=e;this._indexBuffer=f;this._glName=null;this._initialized=!1}get glName(){return this._glName}get context(){return this._context}get vertexBuffers(){return this._buffers}get indexBuffer(){return this._indexBuffer}get byteSize(){return Object.keys(this._buffers).reduce((a,
b)=>a+this._buffers[b].usedMemory,null!=this._indexBuffer?this._indexBuffer.usedMemory:0)}get layout(){return this._layout}get locations(){return this._locations}get usedMemory(){return this.byteSize+(Object.keys(this._buffers).length+(this._indexBuffer?1:0))*p.typedArrayStaticSize}dispose(){if(this._context){this._context.getBoundVAO()===this&&this._context.bindVAO(null);for(const a in this._buffers)this._buffers[a]?.dispose(),delete this._buffers[a];this._indexBuffer=n.disposeMaybe(this._indexBuffer);
this.disposeVAOOnly()}else(this._glName||0<Object.getOwnPropertyNames(this._buffers).length)&&c().warn("Leaked WebGL VAO")}disposeVAOOnly(){this._glName&&(this._context.gl.deleteVertexArray(this._glName),this._glName=null,this._context.instanceCounter.decrement(h.ResourceType.VertexArrayObject,this));this._context=null}initialize(){if(!this._initialized){var {gl:a}=this._context,b=a.createVertexArray();a.bindVertexArray(b);this._bindLayout();a.bindVertexArray(null);this._glName=b;this._context.instanceCounter.increment(h.ResourceType.VertexArrayObject,
this);this._initialized=!0}}bind(){this.initialize();this._context.gl.bindVertexArray(this.glName)}_bindLayout(){const {_buffers:a,_layout:b,_indexBuffer:d}=this;a||c().error("Vertex buffer dictionary is empty!");const e=this._context.gl;for(const f in a){const k=a[f];k||c().error("Vertex buffer is uninitialized!");const l=b[f];l||c().error("Vertex element descriptor is empty!");q.bindVertexBufferLayout(this._context,this._locations,k,l)}null!=d&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,d.glName)}unbind(){this.initialize();
this._context.gl.bindVertexArray(null)}};Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});