Problem with Brushes

BlitzMax Forums/MiniB3D Module/Problem with Brushes

Leon Drake(Posted 2007) [#1]
whenever i try to apply a new brush to a surface with an existing brush. i get an error in Renderworld saying array index is more than the max index amount.

i think it may be when i use this func


Function removesurfacebrush(surfid)
Local tbrsh,ttx0,ttx1,ttx2
tbrsh = CO_GetSurfaceBrush(surfid)
ttx0 = CO_GetBrushTexture(tbrsh,0)
ttx1 = CO_GetBrushTexture(tbrsh,1)
ttx2 = CO_GetBrushTexture(tbrsh,2)
If ttx0 <> 0 Then CO_FreeTexture(ttx0)
If ttx1 <> 0 Then CO_FreeTexture(ttx1)
If ttx2 <> 0 Then CO_FreeTexture(ttx2)
CO_FreeBrush(tbrsh)

End Function 


the CO_ is there because i have a lib that checks wether im using b3dsdk or minib3d.


simonh(Posted 2007) [#2]
I need a full sample really...


Leon Drake(Posted 2007) [#3]
its it seems to just simply replace the brush in Minib3d when i apply a new brush to a surface, unlike b3dsdk i have to remove it first before applying a new one.

or at least thats how it appears.