Wtf i cant loop vertecies
how come this peice of code doesnt work
CustomVertex Vertex[]=
{
for(float location;location<100;location++)
{
{ location, 50.0f, 0.5f, 0x000000, },
{ location, 250.0f, 0.5f, 0x000000, }
}
};
quote:Original post by superpig
Sorry, but I''m not even going to begin to touch this one...
y not, is it really that bad?
quote:Original post by Anonymous Poster
Hmmm....
What do you get when you use the REF device?
LMAO, AP
Duekiller: try this code:
CustomVertex Vertex[100];
for(int location; location<100; location+=2)
{
Vertex[location].x = location;
Vertex[location].y = 50.0f;
Vertex[location].z = 0.5f;
Vertex[location].diffuse = 0x00000000;
Vertex[location+1].x = location;
Vertex[location+1].y = 250.0f;
Vertex[location+1].z = 0.5f;
Vertex[location+1].diffuse = 0x00000000;
}
Richard "Superpig" Fine
Smoother than a greased baby
[TBRF|GP&T|Enginuity1|Enginuity2|Enginuity3|Enginuity4|Enginuity5]
Or, duekiller, to answer your question:
If you''re declaring something like a customvertex array, you can not have a for loop, or ANY loop at all for that matter, in the declaration. You can only have numbers. YOu have to declare it, then loop like superpig did.
If you''re declaring something like a customvertex array, you can not have a for loop, or ANY loop at all for that matter, in the declaration. You can only have numbers. YOu have to declare it, then loop like superpig did.
This really has nothing to do with DirectX. It''s an introductory C/C++ question.
Stay Casual,
Ken
Drunken Hyena
Stay Casual,
Ken
Drunken Hyena
quote:Original post by shadowman13131
Or, duekiller, to answer your question:
If you''re declaring something like a customvertex array, you can not have a for loop, or ANY loop at all for that matter, in the declaration. You can only have numbers. YOu have to declare it, then loop like superpig did.
Just to make sure the OP understands *why* he can''t have loops. The reason is that the compiler has to determine the contents of that array at compile-time, and it can''t evaluate loops or whatever and use their output to fill it.
Muhammad Haggag
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement