Hi guys,
can you help me with this code?
in C++
Code:
struct Stream {
float *vertices;
};
void addValue(float *vertices){
Stream stream;
stream.vertices = vertices;
}
void myProcedure
{
Array <vec3> vertices;
for (uint i = 0; i < 10; i++)
vertices.add(vec3(x, y, z);
addValue((float *) vertices);
}
in Pascal
Code:
type
PArraySingle = ^TArraySingle;
TArraySingle = array of single;
Stream = record
vertices: PArraySingle;
end;
procedure addValue(vertices: PArraySingle);
var
iStream: Stream;
begin
iStream.vertices := vertices;
end;
procedure myProcedure;
var
vertices: array of TVec3;
i: integer;
begin
setlength(vertices, 10);
for i:=0 to 10-1 do
vertices[i] := vec3(x, y, z);
addValue((float *) vertices); <--- This?!!!! addValue procedure wait array of single. With this line i call addValue with array of vec3!!!
end;
Thanks in advance
Sesilla
Bookmarks