🔒 Locked
Pointers
Advertisement
Original Post
GLvoid Init_Particles(PARTICLES* particle)
{
..
particle..
..
}
Init_Particles(&particle[0]);
____________________
Pedro Santos «» Project Y «» GameDevPT
{
..
particle..
..
}
Init_Particles(&particle[0]);
____________________
Pedro Santos «» Project Y «» GameDevPT
Hi!
In fact I want to acces each particle with an index (i)
typedef struct part
{
..
}PARTICLES;
PARTICLES particle[MAX_PARTICLES]; // = 1000
GLvoid Init_Particles(PARTICLES* particle[])
{
..
particle.. //here
..
}
Init_Particles(&particle[1000]);
What shall I change to make it work??
thnks
In fact I want to acces each particle with an index (i)
typedef struct part
{
..
}PARTICLES;
PARTICLES particle[MAX_PARTICLES]; // = 1000
GLvoid Init_Particles(PARTICLES* particle[])
{
..
particle.. //here
..
}
Init_Particles(&particle[1000]);
What shall I change to make it work??
thnks
I re-explain my problem (excuse my bad english):
I have for example:
GLvoid Render_Particles(PARTICLES* particle[1000])
and i want to acces in this function the 1000 particules by an index: i to draw them all!
particle[ index ] = (..)
But how can I call this function (with what parameters?)
Tahnks
)
I have for example:
GLvoid Render_Particles(PARTICLES* particle[1000])
and i want to acces in this function the 1000 particules by an index: i to draw them all!
particle[ index ] = (..)
But how can I call this function (with what parameters?)
Tahnks
I re-explain my problem (excuse my bad english):
I have for example:
GLvoid Render_Particles(PARTICLES* particle[1000])
and i want to acces in this function the 1000 particules by an index: i to draw them all!
particle[ index ] = (..)
But how can I call this function (with what parameters?)
Tahnks
)
I have for example:
GLvoid Render_Particles(PARTICLES* particle[1000])
and i want to acces in this function the 1000 particules by an index: i to draw them all!
particle[ index ] = (..)
But how can I call this function (with what parameters?)
Tahnks
Hey
If you have :
typedef struct part
{
..
}PARTICLES;
PARTICLES particle[MAX_PARTICLES]; // = 1000
then its a global already (er, I guess it is, actually).
Then you dont have to pass that as parameter to the
GLvoid Init_Particles(PARTICLES* particle[])
{
..
particle..
..
}
You should just do :
GLvoid Init_Particles (void)
{
int i;
for (i = 0; i < 1000; i++)
{
Render(&particle); // or something
}
}
Or you could have, instead (void), (int NumPart) in case 1000 is max (but the actual number of particles might be less than 1000).
Then you would have to change the loop as well (i=0; i < NumPart; i++)...
Or maybe Im just nuts or something (as everybody is telling him to pass the particle thing as parameter, I could be missing something here).
Cya,
-RoTTer
If you have :
typedef struct part
{
..
}PARTICLES;
PARTICLES particle[MAX_PARTICLES]; // = 1000
then its a global already (er, I guess it is, actually).
Then you dont have to pass that as parameter to the
GLvoid Init_Particles(PARTICLES* particle[])
{
..
particle..
..
}
You should just do :
GLvoid Init_Particles (void)
{
int i;
for (i = 0; i < 1000; i++)
{
Render(&particle); // or something
}
}
Or you could have, instead (void), (int NumPart) in case 1000 is max (but the actual number of particles might be less than 1000).
Then you would have to change the loop as well (i=0; i < NumPart; i++)...
Or maybe Im just nuts or something (as everybody is telling him to pass the particle thing as parameter, I could be missing something here).
Cya,
-RoTTer
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement