void updateTransforms(void* _userPtr, unsigned int _xoff, unsigned int _yoff, unsigned int _width, unsigned int _height, const unsigned int* _pixels, void* _ownerPtr) { TextBuffer* buffer = static_cast<TextBuffer*>(_ownerPtr); const GLuint* subData = static_cast<const GLuint*>(_pixels); auto texture = buffer->getTextureTransform(); texture->setSubData(subData, _xoff, _yoff, _width, _height); }
gl::Error Buffer11::setData(const void *data, size_t size, GLenum usage) { gl::Error error = setSubData(data, size, 0); if (error.isError()) { return error; } if (usage == GL_STATIC_DRAW) { initializeStaticData(); } return error; }
void Buffer::setSubData(const std::array<T, Count> & data, GLintptr offset) { setSubData(offset, static_cast<GLsizei>(Count * sizeof(T)), data.data()); }
void Buffer::setSubData(const std::vector<T> & data, GLintptr offset) { setSubData(offset, static_cast<GLsizei>(data.size() * sizeof(T)), data.data()); }
void VertexBuffer::setSubData(const std::vector<T>& data, GLintptr offset) { setSubData(data, offset, data.size() * sizeof(T)); }