FindSurface on cloned Brush behaviour?

Blitz3D Forums/Blitz3D Programming/FindSurface on cloned Brush behaviour?

octothorpe(Posted 2006) [#1]
Question: How reliable is this behaviour described below? Are all the possible brush attributes matched by FindSurface? (i.e. Color, Alpha, Shininess, Texture, Blend, and FX)

FindSurface

Attempts to find a surface attached to the specified mesh and created with the specified brush. Returns the surface handle if found or 0 if not.


The above quote from the docs is incorrect. FindSurface() seems to return surfaces which were created with the same attributes as the specified brush. See example program:

Graphics3D 800,600

mesh = CreateMesh()

brush1 = CreateBrush(255, 0, 0)
surf1 = CreateSurface(mesh, brush1)

brush2 = CreateBrush(255, 0, 0)
surf2 = FindSurface(mesh, brush2)

If surf2 = surf1 Then
	Print "reusing surface"
Else
	Print "created a new, redundant surface"
EndIf


Output from example program using 1.91: "reusing surface"


DJWoodgate(Posted 2006) [#2]
It would be better to post this to the online manual. Then hopefully the next docs update will incorporate some of these clarifications. Probably wishful thinking mind, but you never know.


octothorpe(Posted 2006) [#3]
First I wanted to check with the community if this behaviour is reliable and consistant.