Packagelaya.webgl.utils
Classpublic class Buffer2D
InheritanceBuffer2D Inheritance Buffer Inheritance laya.resource.Resource
Subclasses IndexBuffer2D, VertexBuffer2D



Public Properties
 PropertyDefined By
 Inherited_bindActive : Object
[static]
Buffer
 Inherited_bindVertexBuffer : *
[static]
Buffer
  bufferLength : int
[read-only]
Buffer2D
 InheritedbufferUsage : int
[read-only]
Buffer
  byteLength : int
[write-only]
Buffer2D
 Inherited_byteLength : int = 0
Buffer
 Inherited_enableAtributes : Array
[static]
Buffer
  _upload : Boolean = true
Buffer2D
Protected Properties
 PropertyDefined By
 Inherited_buffer : *
Buffer
 Inherited_bufferType : int
Buffer
 Inherited_bufferUsage : int
Buffer
 Inherited_gl : WebGLContext
[static]
Buffer
 Inherited_glBuffer : *
Buffer
  _maxsize : int = 0
Buffer2D
  _uploadSize : int = 0
Buffer2D
Public Methods
 MethodDefined By
  
Buffer2D
  
[static]
Buffer2D
 Inherited
_bind():void
Buffer
  
_bind_subUpload(offset:int = 0, dataStart:int = 0, dataLength:int = 0):Boolean
Buffer2D
  
_bind_upload():Boolean
Buffer2D
  
_resizeBuffer(nsz:int, copy:Boolean):Buffer2D
Buffer2D
  
append(data:*):void
Buffer2D
  
appendEx(data:*, type:Class):void
Buffer2D
  
appendEx2(data:*, type:Class, dataLen:int, perDataLen:int = 1):void
Buffer2D
  
clear():void
Buffer2D
  
getBuffer():ArrayBuffer
Buffer2D
  
getNeedUpload():Boolean
Buffer2D
  
Buffer2D
  
subUpload(offset:int = 0, dataStart:int = 0, dataLength:int = 0):Boolean
Buffer2D
  
upload():Boolean
Buffer2D
Protected Methods
 MethodDefined By
  
Buffer2D
  
_bufferSubData(offset:int = 0, dataStart:int = 0, dataLength:int = 0):void
Buffer2D
  
Buffer2D
  
[override]
Buffer2D
 Inherited
[override]
Buffer
Public Constants
 ConstantDefined By
  FLOAT32 : int = 4
[static]
Buffer2D
  SHORT : int = 2
[static]
Buffer2D
Property Detail
_maxsizeproperty
protected var _maxsize:int = 0

_uploadproperty 
public var _upload:Boolean = true

_uploadSizeproperty 
protected var _uploadSize:int = 0

bufferLengthproperty 
bufferLength:int  [read-only]


Implementation
    public function get bufferLength():int
byteLengthproperty 
byteLength:int  [write-only]


Implementation
    public function set byteLength(value:int):void
Constructor Detail
Buffer2D()Constructor
public function Buffer2D()



Method Detail
__int__()method
public static function __int__(gl:WebGLContext):void

Parameters

gl:WebGLContext

_bind_subUpload()method 
public function _bind_subUpload(offset:int = 0, dataStart:int = 0, dataLength:int = 0):Boolean

Parameters

offset:int (default = 0)
 
dataStart:int (default = 0)
 
dataLength:int (default = 0)

Returns
Boolean
_bind_upload()method 
public function _bind_upload():Boolean

Returns
Boolean
_bufferData()method 
protected function _bufferData():void

_bufferSubData()method 
protected function _bufferSubData(offset:int = 0, dataStart:int = 0, dataLength:int = 0):void

Parameters

offset:int (default = 0)
 
dataStart:int (default = 0)
 
dataLength:int (default = 0)

_checkArrayUse()method 
protected function _checkArrayUse():void

_resizeBuffer()method 
public function _resizeBuffer(nsz:int, copy:Boolean):Buffer2D

Parameters

nsz:int
 
copy:Boolean

Returns
Buffer2D
append()method 
public function append(data:*):void

Parameters

data:*

appendEx()method 
public function appendEx(data:*, type:Class):void

Parameters

data:*
 
type:Class

appendEx2()method 
public function appendEx2(data:*, type:Class, dataLen:int, perDataLen:int = 1):void

Parameters

data:*
 
type:Class
 
dataLen:int
 
perDataLen:int (default = 1)

clear()method 
public function clear():void

detoryResource()method 
override protected function detoryResource():void

getBuffer()method 
public function getBuffer():ArrayBuffer

Returns
ArrayBuffer
getNeedUpload()method 
public function getNeedUpload():Boolean

Returns
Boolean
setNeedUpload()method 
public function setNeedUpload():void

subUpload()method 
public function subUpload(offset:int = 0, dataStart:int = 0, dataLength:int = 0):Boolean

Parameters

offset:int (default = 0)
 
dataStart:int (default = 0)
 
dataLength:int (default = 0)

Returns
Boolean
upload()method 
public function upload():Boolean

Returns
Boolean
Constant Detail
FLOAT32Constant
public static const FLOAT32:int = 4

SHORTConstant 
public static const SHORT:int = 2