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);
}
Beispiel #2
0
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;
}
Beispiel #3
0
void Buffer::setSubData(const std::array<T, Count> & data, GLintptr offset)
{
    setSubData(offset, static_cast<GLsizei>(Count * sizeof(T)), data.data());
}
Beispiel #4
0
void Buffer::setSubData(const std::vector<T> & data, GLintptr offset)
{
    setSubData(offset, static_cast<GLsizei>(data.size() * sizeof(T)), data.data());
}
Beispiel #5
0
 void VertexBuffer::setSubData(const std::vector<T>& data, GLintptr offset) {
     setSubData(data, offset, data.size() * sizeof(T));
 }