25 if ( data_ ==
nullptr )
41 [[nodiscard]] std::size_t
size() const noexcept
43 return dirty_ ? glSize_ : 0;
46 [[nodiscard]] std::size_t
glSize() const noexcept
51 [[nodiscard]]
bool dirty() const noexcept
58 std::size_t glSize_{ 0 };
71 auto memSize =
sizeof( T ) * glSize;
72 if ( buffer_.size() < memSize )
73 buffer_.resize( memSize );
75 return {
reinterpret_cast<T*
>( buffer_.data() ), glSize, dirty };
78 size_t heapBytes()
const {
return buffer_.heapBytes(); }
std::vector<V>-like container that is 1) resized without initialization of its elements,...
Definition MRBuffer.h:54
Definition MRRenderHelpers.h:16
std::size_t size() const noexcept
Definition MRRenderHelpers.h:41
T * data() const noexcept
Definition MRRenderHelpers.h:36
RenderBufferRef()=default
RenderBufferRef(T *data, std::size_t glSize, bool dirty)
Definition MRRenderHelpers.h:20
std::size_t glSize() const noexcept
Definition MRRenderHelpers.h:46
bool dirty() const noexcept
Definition MRRenderHelpers.h:51
T & operator[](std::size_t i) const noexcept
Definition MRRenderHelpers.h:30
Definition MRRenderHelpers.h:64
size_t heapBytes() const
Definition MRRenderHelpers.h:78
RenderBufferRef< T > prepareBuffer(std::size_t glSize, bool dirty=true)
Definition MRRenderHelpers.h:67
Definition MRCameraOrientationPlugin.h:7
MRVIEWER_API Vector2i calcTextureRes(int bufferSize, int maxTextWidth)