Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

DBX

OpenGL Modifying textures in OpenGL

This topic is 5519 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

Using the glTexSubImage2D function, how can I pass data that has a different pitch from width*channels? I have a bitmap in memory which covers a number of GL textures (i.e. 320 pixels wide is a 256 wide texture and a 64 wide teture), but I want to update part of this bitmap using glTexSubImage but it requires the data being sent has a set pitch.

Share this post


Link to post
Share on other sites
Advertisement
Because the large texture is being modified on occasion, and as such I would prefer to treat it as a single large bitmap (i.e. with each row contiguous).
Then when I want to update the OpenGL texture, possibly only part of each texture needs to be uploaded (i.e. the part that has changed)

(EDIT: Yes I could split it into the different textures each time, but this is an overhead that could be avoided if there is some way to specify the pitch of the source data to glTexSubImage or some variant)

[edited by - DBX on July 26, 2003 10:27:36 AM]

Share this post


Link to post
Share on other sites
Found it - glPixelStorei - it was right under my nose.
I can''t believe I am the only person on this board who knows about this function.

Share this post


Link to post
Share on other sites

  • 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!