Stephen Hewitt wrote:
d st[100];// fill in each st somewhere// p is allocated in a Vertex buffermemcpy(p, &st, sizeof(st));
That works until you do something like this:
d* st = new d[100];
memcpy(p, st, sizeof(st)); // oops! won't work
memcpy(p, st, sizeof(d) * 100); // works!
If you want to change the size of the array, it is better to do this:
const unsigned long ARRAY_SIZE = 100;
d st[ARRAY_SIZE];
memcpy(p, st, sizeof(d) * ARRAY_SIZE);
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week Zac