Sign in to follow this  

can I call glteximage2d for each color component?

This topic is 4169 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have seperate arrays for the red, green, and blue components of the pixels of an image. Can I just call glteximage2d (or 1d?) 3 times, one for each color component? something like glTexImage2D (GL_TEXTURE_2D, 0, GL_RGB, imageWidth, imageHeight, 0, GL_RED, GL_BYTE, redArray); glTexImage2D (GL_TEXTURE_2D, 0, GL_RGB, imageWidth, imageHeight, 0, GL_GREEN, GL_BYTE, greenArray); glTexImage2D (GL_TEXTURE_2D, 0, GL_RGB, imageWidth, imageHeight, 0, GL_BLUE, GL_BYTE, blueArray);

Share this post


Link to post
Share on other sites
Doesn't look like it,

Quote:
from the documentation
GL_RED:
Each element is a single red component. The GL converts it to floating point and assembles it into an RGBA element by attaching 0 for green and blue, and 1 for alpha.
...

Same goes for blue and green.

Share this post


Link to post
Share on other sites

This topic is 4169 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this