03-10-2005, 10:32 AM
A better way is to do away with arrays and use straight pointers.
ie:
That way, you're treating the pointer like a structure
ie:
Code:
type vector
x as single
y as single
z as single
end type
type model
numverts as integer
vertex as vector
end type
dim vb as model ptr
vb->numverts = 5000
vb->vertex = allocate(vb->numverts *LEN(vector))
'to access each element...
for i = 0 to vb->numverts -1
vb->vertex[i].x = rnd
vb->vertex[i].y = rnd
vb->vertex[i].z = rnd
next i
deallocate vb->vertex
deallocate vb
That way, you're treating the pointer like a structure