Jump to content
  • Advertisement
Sign in to follow this  

problem with a class function[SOLVED/stupid me]

This topic is 4417 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a class and a struct that look like this:
struct SBullet
 Vector2D position;
 Vector2D direction; // a normal
 double   distance;
 SBullet(Vector2D pos, Vector2D dir);  //dir is normalized
 void Update(double time_elapsed);
 void Render();

class CGun{
  //vector of all the bullets
  vector<SBullet> m_vBullets;
  //vector of all the enemies, afterwards I'll add the player to
  vector<CVehicle*> m_vEnemies;
  //update all bullets
  void  Update(double time_elapsed); 
  //add another bullet
  void  AddBullet(CVehicle* hunter, CVehicle* prey);
  //render the bullets
  void  Render();

void SBullet :: Render()
  glVertex3f((position.x)*0.4-20, (position.y)*0.4-20, 0);
  glVertex3f((position.x + direction.x)*0.4-20, 
             (position.y + direction.y)*0.4-20, 0);

void CGun :: Render()
  for(int i = 0; i < m_vBullets.size(); i++)

But for some reason I get this error in the last function: 54 C:\Dev-Cpp\Examples\steering\CGun.cpp statement cannot resolve address of overloaded function Why the error? Thanks.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!