Go to the documentation of this file.
18 #ifndef viskores_interop_BufferState_h
19 #define viskores_interop_BufferState_h
45 class TransferResource
48 virtual ~TransferResource() {}
130 template <
typename T>
133 this->
BufferType = viskores::interop::internal::BufferTypePicker(t);
160 const bool haveNotEnoughRoom = this->
GetCapacity() < desiredSize;
161 const bool haveTooMuchRoom = this->
GetCapacity() > (desiredSize * 2);
162 return (haveNotEnoughRoom || haveTooMuchRoom);
174 void SetResource(viskores::interop::internal::TransferResource* resource)
189 std::unique_ptr<viskores::interop::internal::TransferResource>
Resource;
194 #endif //viskores_interop_BufferState_h
void SetSize(viskores::Int64 size)
Definition: BufferState.h:145
GLuint DefaultGLHandle
Definition: BufferState.h:188
GLuint * GetHandle() const
get the OpenGL buffer handle
Definition: BufferState.h:109
viskores::interop::internal::TransferResource * GetResource()
Definition: BufferState.h:171
GLenum GetType() const
return what OpenGL buffer type we are bound to
Definition: BufferState.h:118
std::unique_ptr< viskores::interop::internal::TransferResource > Resource
Definition: BufferState.h:189
void operator=(const BufferState &)=delete
BufferState()
Definition: BufferState.h:89
GLenum BufferType
Definition: BufferState.h:185
signed long long Int64
Base type to use for 64-bit signed integer numbers.
Definition: Types.h:212
void SetType(GLenum type)
Set what type of OpenGL buffer type we should bind as.
Definition: BufferState.h:122
void DeduceAndSetType(T t)
deduce the buffer type from the template value type that was passed in, and set that as our type
Definition: BufferState.h:131
viskores::Int64 GetCapacity() const
Get the capacity of the buffer in bytes.
Definition: BufferState.h:154
Groups connected points that have the same field value.
Definition: Atomic.h:27
GLuint * OpenGLHandle
Definition: BufferState.h:184
Manages the state for transferring an ArrayHandle to opengl.
Definition: BufferState.h:64
void SetCapacity(viskores::Int64 capacity)
Definition: BufferState.h:168
BufferState(GLuint &gLHandle)
Construct a BufferState using an existing GLHandle.
Definition: BufferState.h:68
bool HasType() const
return if this buffer has a valid OpenGL buffer type
Definition: BufferState.h:113
#define VISKORES_SILENCE_WEAK_VTABLE_WARNING_END
Definition: ExportMacros.h:128
#define VISKORES_SILENCE_WEAK_VTABLE_WARNING_START
Definition: ExportMacros.h:127
BufferState(GLuint &gLHandle, GLenum type)
Construct a BufferState using an existing GLHandle and type.
Definition: BufferState.h:79
viskores::Int64 SizeOfActiveSection
Definition: BufferState.h:186
void SetResource(viskores::interop::internal::TransferResource *resource)
Definition: BufferState.h:174
bool ShouldRealloc(viskores::Int64 desiredSize) const
Definition: BufferState.h:158
viskores::Int64 CapacityOfBuffer
Definition: BufferState.h:187
~BufferState()
Definition: BufferState.h:100
viskores::Int64 GetSize() const
Get the size of the buffer in bytes.
Definition: BufferState.h:140