const
twidth = 256;
theight = 256;
var
PBO: GLuint;
tex: GLuint;
data: array[0..theight-1, 0..twidth-1, 0..2] of Byte;
begin
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glGenBuffers(1, @PBO);
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, PBO);
glBufferData(GL_PIXEL_UNPACK_BUFFER, twidth*theight*3, @data[0,0,0], GL_STATIC_DRAW);
glGenTextures(1, @tex);
glBindTexture(GL_TEXTURE_2D, tex);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexImage2D(GL_TEXTURE_2D, 0, GL_COMPRESSED_RGB_S3TC_DXT1_EXT, twidth, theight, 0, GL_BGR, GL_UNSIGNED_BYTE, 0);
end;