I'm trying to make a 3d game.
I just started with opengl in c++ but I ran into a problem.
What I have now.
Creating the array: std::vector<Bullet*> bulls;
In the display function:
1 2 3 4 5 6 7 8 9
for (unsignedint i=0; i<bulls.size(); i++)
{
glBegin(GL_LINE);
glColor3f(0.0f,1.0f,0.0f);
glVertex3f(bulls[i]->Get_prevx,0,bulls[i]->Get_prevz);//this is were it crashes
glVertex3f(bulls[i]->Get_x,0,bulls[i]->Get_y);
glEnd();
bulls[i]->Move_Bullet();
}
I already fixed it myself.
I made the variables public and accessed them with
glVertex3f(bulls[i]->prevx,0,bulls[i]->prevz);
glVertex3f(bulls[i]->bulx,0,bulls[i]->buly);