changing textures?

Blitz3D Forums/Blitz3D Programming/changing textures?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Sorry this sounds like such a stupid question, but I have not had to do this bit before.

ok,... so if I assign a texture to an entity like this.
box=createcube()
boxtex=loadtexture("texturename.jpg")
entitytexture box,boxtex

but later want the user to be able to select a different texture, what is the best way to do this?

freetexture only clears up the texture, but not what has been applied already, so is there a problem with piling this on top of the previous code?
freetexture boxtex
boxtex=loadtexture("texturename2.jpg")
entitytexture box,boxtex

What happens to the original texture? is it overwritten? if not how do I delete it? Or do I need to freeentity and re-texture?

Edit: one thing I thought of was to simply load the new texture as an image, and copy it to the texture, but that seems clunky, and also brings up the problem of different texture resolutions.

Thanks.