Class RawBuffer
java.lang.Object
dev.pfaff.altargui.render.RawBuffer
- All Implemented Interfaces:
Closeable
,AutoCloseable
- Direct Known Subclasses:
AbstractMappedBuffer
,ViaBufferSubDataBuffer
,ViaIntermediateBuffer
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final dev.pfaff.glass.opengl.enums.GLBufferTarget
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Begins uploading to the buffer.final void
bind()
final InfallibleAutoClosable
abstract int
capacity()
protected final void
checkCompleteUpload
(long uploaded, Uploadable uploadable) void
close()
static RawBuffer
create
(dev.pfaff.glass.opengl.enums.GLBufferTarget bindTarget, boolean isShared) void
void
protected abstract void
growBuffer
(int capacity, Runnable onRecreate) Grows the buffer to at least the specified capacity.abstract int
id()
abstract boolean
final int
length()
final void
protected abstract void
final void
setLength
(int length) Unsafe.toString()
final void
unbind()
final void
upload
(Uploadable uploadable) final void
uploadAt
(long offset, Uploadable uploadable) protected abstract void
uploadAtUnchecked
(long offset, Uploadable uploadable)
-
Field Details
-
bindTarget
protected final dev.pfaff.glass.opengl.enums.GLBufferTarget bindTarget
-
-
Constructor Details
-
RawBuffer
public RawBuffer(dev.pfaff.glass.opengl.enums.GLBufferTarget bindTarget) - Parameters:
bindTarget
- where the buffer will be bound.
-
-
Method Details
-
create
public static RawBuffer create(dev.pfaff.glass.opengl.enums.GLBufferTarget bindTarget, boolean isShared) -
bind
public final void bind() -
unbind
public final void unbind() -
growBuffer
Grows the buffer to at least the specified capacity. The buffer's contents are undefined after this operation. -
resetNoGrow
protected abstract void resetNoGrow() -
reset
- Parameters:
capacity
- the required capacity in instances.
-
beginUploading
public void beginUploading()Begins uploading to the buffer. Attempts to upload more thancapacity
might result in aBufferOverflowException
being thrown.The buffer's contents are undefined after this operation.
-
finishUploading
public void finishUploading() -
isBoundDuringUpload
public abstract boolean isBoundDuringUpload() -
boundIfNotAlreadyDuringUpload
-
checkCompleteUpload
-
uploadAtUnchecked
-
uploadAt
-
upload
-
id
public abstract int id() -
length
public final int length() -
setLength
public final void setLength(int length) Unsafe. -
capacity
public abstract int capacity() -
toString
-
dump
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-