OpenGL texture questions

Started by
2 comments, last by chbfiv 20 years, 5 months ago
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
-BourkeIV
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)
--FirekingOwner/LeaderFiregames Development &Blackdragon Studios
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.
-BourkeIV
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
http://mitglied.lycos.de/lousyphreak/

This topic is closed to new replies.

Advertisement