Just use the memory address instead the address of the array:Polo wrote:I do that: I have one memory with the vertices, one with the
indexes. The fact is I want to use these stuffs which are in
memory, and that I don't know how to do...
Code: Select all
Structure Vertex
x.f
y.f
z.f
EndStructure
VertexMem = AllocateMemory(1,SizeOf(Vertex)*8)
*mem.Vertex = VertexMem
Restore vertices
For i=0 To 7
Read var.f : *mem\x = var
Read var.f : *mem\y = var
Read var.f : *mem\z = var
*mem + SizeOf(Vertex)
Next
;...
glVertexPointer_(3, #GL_FLOAT, 0, VertexMem) ; <<-- using mem address here
DataSection
vertices:
Data.f -1.0, 1.0, 1.0
Data.f 1.0, 1.0, 1.0
Data.f 1.0, -1.0, 1.0
Data.f -1.0, -1.0, 1.0
Data.f -1.0, 1.0, -1.0
Data.f 1.0, 1.0, -1.0
Data.f 1.0, -1.0, -1.0
Data.f -1.0, -1.0, -1.0
EndDataSection
the memory address of the array. Just replace it with your
memory address.