Package com.jme3.shader.bufferobject
Class BufferObject
java.lang.Object
com.jme3.util.NativeObject
com.jme3.shader.bufferobject.BufferObject
- Direct Known Subclasses:
- StructStd140BufferObject
A generic memory buffer that can be divided in logical regions
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic enumHint to suggest the renderer how to access this bufferstatic enumHint to suggest the renderer how the data should be used
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected ByteBufferprotected DirtyRegionsIteratorprotected ArrayList<BufferRegion>Fields inherited from class com.jme3.util.NativeObjecthandleRef, id, INVALID_ID, objectManager, OBJTYPE_AUDIOBUFFER, OBJTYPE_AUDIOSTREAM, OBJTYPE_BO, OBJTYPE_FILTER, OBJTYPE_FRAMEBUFFER, OBJTYPE_SHADER, OBJTYPE_SHADERSOURCE, OBJTYPE_TEXTURE, OBJTYPE_VERTEXBUFFER, updateNeeded
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionclone()This should create a deep clone.Creates a shallow clone of this GL Object.protected voidDeletes any associated nativebuffers.voiddeleteObject(Object rendererObject) Deletes the GL object from the GPU when it is no longer used.intGet binding pointgetData()Rewind and return buffer dataGet dirty regionsgetName()Get name of the buffer objectgetRegion(int i) Return all the regions of this layoutlongReturns a unique ID for this NativeObject.Acquire a weak reference to this NativeObject.voidinitializeEmpty(int length) Initialize an empty buffer object of the given lengthvoidMark all regions as dirtyvoidread(JmeImporter im) voidCalled when the GL context is restarted to reset all IDs.voidsetAccessHint(BufferObject.AccessHint accessHint) Set AccessHint to hint the renderer on how to access this data.voidsetBinding(int binding) Set binding pointvoidsetData(ByteBuffer data) Transfer remaining bytes of passed buffer to the internal buffer of this buffer objectvoidSet name for debugging purposesvoidsetNatureHint(BufferObject.NatureHint natureHint) Set NatureHint to hint the renderer on how to use this data.voidsetRegions(List<BufferRegion> lr) Add a region at the end of the layoutfinal voidInternal use only.voidsetUpdateNeeded(boolean dirtyAll) Indicates that the object has changed and its state needs to be updated.toString()voidReset layour definitionvoidwrite(JmeExporter ex) Methods inherited from class com.jme3.util.NativeObjectclearUpdateNeeded, dispose, getId, isUpdateNeeded, setId
- 
Field Details- 
dirtyRegionsIterator
- 
data
- 
regions
 
- 
- 
Constructor Details- 
BufferObjectpublic BufferObject()
- 
BufferObjectprotected BufferObject(int id) 
 
- 
- 
Method Details- 
setUpdateNeededpublic final void setUpdateNeeded()Internal use only. Indicates that the object has changed and its state needs to be updated. Mark all the regions as dirty.- Overrides:
- setUpdateNeededin class- NativeObject
 
- 
setUpdateNeededpublic void setUpdateNeeded(boolean dirtyAll) Indicates that the object has changed and its state needs to be updated.- Parameters:
- dirtyAll- mark all regions for update
 
- 
getBindingpublic int getBinding()Get binding point- Returns:
- the binding point
 
- 
initializeEmptypublic void initializeEmpty(int length) Initialize an empty buffer object of the given length- Parameters:
- length- expected length of the buffer object
 
- 
setDataTransfer remaining bytes of passed buffer to the internal buffer of this buffer object- Parameters:
- data- ByteBuffer containing the data to pass
 
- 
getDataRewind and return buffer data- Returns:
 
- 
getDirtyRegionsGet dirty regions- Returns:
- Helper object to iterate through dirty regions
 
- 
unsetRegionspublic void unsetRegions()Reset layour definition
- 
setRegionsAdd a region at the end of the layout- Parameters:
- lr-
 
- 
getRegionReturn all the regions of this layout- Returns:
- ordered list of regions
 
- 
markAllRegionsDirtypublic void markAllRegionsDirty()Mark all regions as dirty
- 
resetObjectpublic void resetObject()Description copied from class:NativeObjectCalled when the GL context is restarted to reset all IDs. Prevents "white textures" on display restart.- Specified by:
- resetObjectin class- NativeObject
 
- 
deleteNativeBuffersprotected void deleteNativeBuffers()Description copied from class:NativeObjectDeletes any associated nativebuffers. This is necessary because it is unlikely that native buffers will be garbage collected naturally (due to how GC works), therefore the collection must be handled manually. Only implementations that manage native buffers need to override this method. Note that the behavior that occurs when a deleted native buffer is used is not defined, therefore this method is protected- Overrides:
- deleteNativeBuffersin class- NativeObject
 
- 
deleteObjectDescription copied from class:NativeObjectDeletes the GL object from the GPU when it is no longer used. Called automatically by the GL object manager.- Specified by:
- deleteObjectin class- NativeObject
- Parameters:
- rendererObject- The renderer to be used to delete the object
 
- 
createDestructableCloneDescription copied from class:NativeObjectCreates a shallow clone of this GL Object. The deleteObject method should be functional for this object.- Specified by:
- createDestructableClonein class- NativeObject
- Returns:
- a new instance
 
- 
getUniqueIdpublic long getUniqueId()Description copied from class:NativeObjectReturns a unique ID for this NativeObject. No other NativeObject shall have the same ID.- Specified by:
- getUniqueIdin class- NativeObject
- Returns:
- unique ID for this NativeObject.
 
- 
setBindingpublic void setBinding(int binding) Set binding point- Parameters:
- binding- binding point
 
- 
getWeakRefDescription copied from class:NativeObjectAcquire a weak reference to this NativeObject.- Overrides:
- getWeakRefin class- NativeObject
- Returns:
- a weak reference (possibly a pre-existing one)
 
- 
getAccessHint
- 
setAccessHintSet AccessHint to hint the renderer on how to access this data.- Parameters:
- natureHint-
 
- 
getNatureHint
- 
setNatureHintSet NatureHint to hint the renderer on how to use this data.- Parameters:
- natureHint-
 
- 
write- Specified by:
- writein interface- Savable
- Throws:
- IOException
 
- 
read- Specified by:
- readin interface- Savable
- Throws:
- IOException
 
- 
cloneDescription copied from class:NativeObjectThis should create a deep clone. For a shallow clone, use createDestructableClone().- Overrides:
- clonein class- NativeObject
 
- 
toString- Overrides:
- toStringin class- NativeObject
 
- 
getNameGet name of the buffer object- Returns:
- the name of this buffer object, can be null
 
- 
setNameSet name for debugging purposes- Parameters:
- name- the name of this buffer object
 
 
-