Changing the texture for just one surface

Blitz3D Forums/Blitz3D Programming/Changing the texture for just one surface

Rottbott(Posted 2004) [#1]
I'm having a strange problem. I have a mesh with two surfaces. I want to change the texture for just one of the surfaces and leave the other as it is. I can't see any problems with my code, but it's not working:

B = CreateBrush()
BrushTexture(B, T)
PaintSurface(GetSurface(E, 2), B)
FreeBrush(B)


E is an entity handle, and T is a texture handle. If I set the brush colour to black, the correct surface appears black, but changing the texture doesn't appear to be working, it remains as the original texture.

Anyone know what I'm doing wrong?


ckob(Posted 2004) [#2]
what are you flagging the texture?


Ross C(Posted 2004) [#3]
I don't think you can change a texture once it's applied... I'm not 100% sure on that though :)


Rottbott(Posted 2004) [#4]
That's ridiculous. It must be possible if I recreated the surface from scratch, so why wouldn't I be able to change it as it is?

And the textures just have the default flags (1 + 8).


ckob(Posted 2004) [#5]
might have to set the texture so it can multitexture


DJWoodgate(Posted 2004) [#6]
I would say if it stays as the same texture, then it is the same texture. I'm almost 100% sure of that :)

Edit..

LOL. But not 100% sure. Sorry, I forgot about this...

It seems if you entitytexture (or paintentity, at least as far as texturing goes) something then that has priority over paintsurface. Try Paintmesh instead.

BTW. I think you can undo Entitytexture by using Paintentity with a textureless brush (just in case your entitytexture is for some reason a fait accompli).


Rottbott(Posted 2004) [#7]
DJWoodgate, that was it. Using EntityTexture beforehand was stopping this working. Using PaintSurface all round works beautifully. Thanks!


Ross C(Posted 2004) [#8]
Nice on DJ. Handy to know :o)