Renderworld error

Blitz3D Forums/Blitz3D Programming/Renderworld error

I'm running into an intereseting runtime error. I have a function that details a landscape mesh based on heights stored in an array. Everything works for arrays smaller than 16384 but when they get bigger than that, the function still operates but calling renderworld causes a Memory Access Violation. I'm having trouble recreating this error in a controlled environment and I'm wondering if anyone can help me out? i know it's messy code, I wrote it a while back.
[code]
Function DetailLandscape()

row = 1
collumn = 1

x = 1
I = 1

While x < width*(height-1)

TS# = .25 ;terrain size
Va = AddVertex(surf, Float#(collumn), Float#(array(x)/10), row, TS*(collumn), TS*(row))
Vb = AddVertex(surf, Float#(collumn), array(x+width)/10, row + 1, TS*(collumn), TS*(row + 1))
Vc = AddVertex(surf, Float#(collumn + 1), array(x+width+1)/10, row + 1, TS*(Collumn + 1), TS*(row + 1))
Vd = AddVertex(surf, Float#(collumn + 1), array(x+1)/10, row, TS*(collumn + 1), TS*(row))


If DiagIndex(I) = 0 Then
AddTriangle(surf, Va, Vb, Vc)
AddTriangle(surf, Vc, Vd, Va)
Else If DiagIndex(I) = 1 Then
AddTriangle(surf, Vb, Vc, Vd)
AddTriangle(surf, Vd, Va, Vb)
Else
AddTriangle(surf, Va, Vb, Vc)
AddTriangle(surf, Vc, Vd, Va)
End If

x = x + 1
collumn = collumn + 1
If collumn = width Then
collumn = 1
row = row + 1
x = x + 1
End If
I = I + 1

Wend

EntityTexture landscape, planetex

End Function

[\code]
thanks guys

Sounds like you are exceeding the maximum amount of vertices you are allowed under DirectX7.

ok, that makes sense... but number of vertices allowed where? in each surface? each mesh? or all together? Would it help if I broke it into different surfaces, or do I have to use multiple meshes? (thanks for the help, btw)

I am not sure, but I think that he means in each surface.

64k per surface (so 65536 vertices)
Older cards as well have a maximum of 32768 polygons until they will fail.

k thanks