glTexImage2D - single channel blitting
Hi,
I see the formats GL_RGBA and such, but is there a fast way of doing single channel blitting to a texture rather than storing, and updating a character array which I then have to blit?
Thanks.
As long as the channel's data is all contiguous, just use GL_ALPHA for the format. This is assuming your texture data is in GL_ALPHA format. If not, then there is not a way to only update a single channel since the data is not stored contiguously.
Thanks so much, that's a great help!
[Edited by - Genjix on March 17, 2007 4:50:22 AM]
// to update only R channel from a continuous block of red pixel data glTexImage2D (textarget, 0, GL_RGBA8, actual_width, actual_height, 0, GL_ALPHA, GL_UNSIGNED_BYTE, red_pixels-3);
[Edited by - Genjix on March 17, 2007 4:50:22 AM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement