- glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, pbos[channel]);
- check_error();
- glBufferData(GL_PIXEL_UNPACK_BUFFER_ARB, pitch[channel] * heights[channel], NULL, GL_STREAM_DRAW);
- check_error();
- glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, 0);
- check_error();
-
- glBindTexture(GL_TEXTURE_2D, texture_num[channel]);
- check_error();
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- check_error();
- glPixelStorei(GL_UNPACK_ROW_LENGTH, pitch[channel]);
- check_error();
- glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE8, widths[channel], heights[channel], 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, NULL);
- check_error();
- glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
- check_error();