Go to the documentation of this file.
10 #ifndef vtk_m_interop_BufferState_h
11 #define vtk_m_interop_BufferState_h
37 class TransferResource
40 virtual ~TransferResource() {}
122 template <
typename T>
125 this->
BufferType = vtkm::interop::internal::BufferTypePicker(t);
152 const bool haveNotEnoughRoom = this->
GetCapacity() < desiredSize;
153 const bool haveTooMuchRoom = this->
GetCapacity() > (desiredSize * 2);
154 return (haveNotEnoughRoom || haveTooMuchRoom);
166 void SetResource(vtkm::interop::internal::TransferResource* resource)
181 std::unique_ptr<vtkm::interop::internal::TransferResource>
Resource;
186 #endif //vtk_m_interop_BufferState_h
#define VTKM_SILENCE_WEAK_VTABLE_WARNING_START
Definition: ExportMacros.h:119
vtkm::Int64 GetCapacity() const
Get the capacity of the buffer in bytes.
Definition: BufferState.h:146
Manages the state for transferring an ArrayHandle to opengl.
Definition: BufferState.h:56
GLuint * GetHandle() const
get the OpenGL buffer handle
Definition: BufferState.h:101
Groups connected points that have the same field value.
Definition: Atomic.h:19
BufferState(GLuint &gLHandle, GLenum type)
Construct a BufferState using an existing GLHandle and type.
Definition: BufferState.h:71
#define VTKM_SILENCE_WEAK_VTABLE_WARNING_END
Definition: ExportMacros.h:120
vtkm::Int64 SizeOfActiveSection
Definition: BufferState.h:178
GLuint * OpenGLHandle
Definition: BufferState.h:176
bool ShouldRealloc(vtkm::Int64 desiredSize) const
Definition: BufferState.h:150
vtkm::Int64 CapacityOfBuffer
Definition: BufferState.h:179
std::unique_ptr< vtkm::interop::internal::TransferResource > Resource
Definition: BufferState.h:181
BufferState()
Definition: BufferState.h:81
vtkm::Int64 GetSize() const
Get the size of the buffer in bytes.
Definition: BufferState.h:132
GLenum BufferType
Definition: BufferState.h:177
GLuint DefaultGLHandle
Definition: BufferState.h:180
signed long long Int64
Base type to use for 64-bit signed integer numbers.
Definition: Types.h:204
GLenum GetType() const
return what OpenGL buffer type we are bound to
Definition: BufferState.h:110
vtkm::interop::internal::TransferResource * GetResource()
Definition: BufferState.h:163
~BufferState()
Definition: BufferState.h:92
BufferState(GLuint &gLHandle)
Construct a BufferState using an existing GLHandle.
Definition: BufferState.h:60
void SetType(GLenum type)
Set what type of OpenGL buffer type we should bind as.
Definition: BufferState.h:114
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:123
void operator=(const BufferState &)=delete
void SetCapacity(vtkm::Int64 capacity)
Definition: BufferState.h:160
bool HasType() const
return if this buffer has a valid OpenGL buffer type
Definition: BufferState.h:105
void SetResource(vtkm::interop::internal::TransferResource *resource)
Definition: BufferState.h:166
void SetSize(vtkm::Int64 size)
Definition: BufferState.h:137