Jump to content
  • Advertisement
Sign in to follow this  
thedodgeruk

vectorMyModel* MyMesh::vModel // static

This topic is 3006 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


#include "MyModel"

class MyMesh
{

static vector<MyModel*> vModel; // static
}


this does not work , but got told this does

vector<MyModel*> MyMesh::vModel; // static

but how do i refer no this with push_back from main ie


#include "MyMesh"
void main
{
MyMesh::vModel.push_back(mmm);
}

but how do i refer to it please

Share this post


Link to post
Share on other sites
Advertisement
Why do you use a static at all? You should give that a try:

	
#include "MyModel"

//Deceleration of class "MyMesh"
class MyMesh
{
vector<MyModel*> vModel; //not static
}




and then:

#include "MyMesh"

//Some little spaceship
MyMesh SpaceShip;

void main()
{
//Put something into the vector
SpaceShip.vModel.push_back(/*Something*/);
}




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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!