예제 #1
0
void BufferRAM2GLConverter::update(const DataRepresentation* source,
                                   DataRepresentation* destination) {
    const BufferRAM* src = static_cast<const BufferRAM*>(source);
    BufferGL* dst = static_cast<BufferGL*>(destination);

    dst->setSize(src->getSize());
    dst->upload(src->getData(), src->getSize() * src->getSizeOfElement());
}
예제 #2
0
DataRepresentation* BufferRAM2GLConverter::createFrom(const DataRepresentation* source) {
    const BufferRAM* bufferRAM = static_cast<const BufferRAM*>(source);
    BufferGL* buffer =  new BufferGL(bufferRAM->getSize(), bufferRAM->getDataFormat(),
                        bufferRAM->getBufferType(), bufferRAM->getBufferUsage());
    
    buffer->upload(bufferRAM->getData(), bufferRAM->getSize()*bufferRAM->getSizeOfElement());
    
    return buffer;
}