transfere les donnees dans un buffer statique.
511 {
512 if(m_buffer == 0)
513 glGenBuffers(1, &m_buffer);
514
515 assert(m_buffer);
516 glBindBuffer(GL_COPY_READ_BUFFER, m_buffer);
517 if(length > m_size)
518 {
519 m_size= (length / (16*1024*1024) + 1) * (16*1024*1024);
520 assert(m_size >= length);
521
522
523 glBufferData(GL_COPY_READ_BUFFER, m_size, nullptr, GL_DYNAMIC_DRAW);
524 printf(
"[UpdateBuffer] allocate %dMo staging buffer...\n",
int(m_size / 1024 / 1024));
525 }
526
527
528 glBufferSubData(GL_COPY_READ_BUFFER, 0, length, data);
529
530 glCopyBufferSubData(GL_COPY_READ_BUFFER, target, 0, offset, length);
531 }
void printf(Text &text, const int px, const int py, const char *format,...)
affiche un texte a la position x, y. meme utilisation que printf().