Texture buffer

Blitz3D Forums/Blitz3D Programming/Texture buffer

Neochrome(Posted 2003) [#1]
hi, im having some problem with loading in the same textures

tex1 = loadtexture("fire.png")
tex2 = loadtexture("fire.png")

spr1 = createsprite()
entitytexture spr1, tex1

spr2 = createsprite()
entitytexture spr2, tex2

positionentity spr2,1,0,0

setbuffer texture(tex1)
rect 20,20,2,2

setbuffer backbuffer()


when i change one texture, they BOTH change?
but when i loading a different filename it only changes the right one..

why is this?


GfK(Posted 2003) [#2]
Think about it.

If you load the same model (with textures) 20 times, would you really want 20 copies of the same texture flooding your video mem? No. That would be a complete waste of system resources.

If two textures are loaded with the same filename, and with the same texture flags set, then only one copy of the texture will exist.

You can load the same texture twice, but with *different* flags set, and you will have two copies of the texture.

OT: You may want to change that quote in your signature. People may find it offensive.


Neochrome(Posted 2003) [#3]
dang, i thought that was the case. Thanks anyways.