Jump to content
  • Advertisement

Archived

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

chbfiv

OpenGL OpenGL texture questions

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

1- If I want to change a texture on the fly, can I do it to an already loaded openGL texture, or do I need to change my texture and reload it? 2-What would the tex coords be if I wanted to have one texture, or a bunch of tiles.
-------------
| 1 | 2 | 3 |
-------------
| 4 | 5 | 6 |
-------------
| 7 | 8 | 9 |
-------------
 
NW vert of 1 would be 0,0 SE vert of 9 would be 1,1 correct? so all the other verts would be the % our of the whole? or is there a better way? (like NE vert of 1) would be .333,0

Share this post


Link to post
Share on other sites
Advertisement
as long as you keep the image data in an array, you can change it to hearts content, you''ll have to re-generate it though (im pretty sure)

Share this post


Link to post
Share on other sites
hum, all the examples I have have you create an array, fill the image data in, Gen a text Id,load into opengl texture, delete your array. If I edit my array, i need to reload it for it to update on my screen.

Share this post


Link to post
Share on other sites
you can upload parts of a texture with glTexSubImage(1/2)d, just look it up in the docs.

if you want to have your mipmaps automatically updated too (which is what you want if you use mip mapping) also have a look at GL_SGIS_generate_mipmap

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!