Jump to content
  • Advertisement
Sign in to follow this  
EODCyismARDEM

can I call glteximage2d for each color component?

This topic is 4382 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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!