M
Manuel
Hi...yet, another problem with references...sorry...
This is my singleton header:
-----------------------------------------
class MHwindow {
private:
static MHwindow MHw;
GLuint texture;
//Constructor is private, because this is a singleton
MHwindow(GLuint &);
MHwindow& operator=(MHwindow&); // Disallowed
MHwindow(const MHwindow&); // Disallowed
public:
static MHwindow& instance() { return MHw; }
void setTexture(GLuint);
GLuint getTextures();
};
----------------------------------------
This is my singleton cpp file:
----------------------------------------
MHwindow::MHwindow(GLuint & textur)
{
pngInfo texInfo;
textur = pngBind("pippo.png", PNG_NOMIPMAP, PNG_ALPHA, NULL, GL_CLAMP,
GL_NEAREST, GL_LINEAR);
}
void MHwindow::setTexture(GLuint i){texture = i;};
GLuint MHwindow::getTextures(){return texture;};
----------------------------------------
this is the usage I'm trying:
----------------------------------------
GLuint textureID;
MHwindow MHwindow::MHw(textureID);
MHwindow& MainWindow = MHwindow::instance();
----------------------------------------
and....this is the retrun error:
In function `Z41__static_initialization_and_destruction_0ii':
undefined reference to `MHwindow::MHwindow(unsigned int)'
I'm trying to pass a reference to constructor.
:-(
This is my singleton header:
-----------------------------------------
class MHwindow {
private:
static MHwindow MHw;
GLuint texture;
//Constructor is private, because this is a singleton
MHwindow(GLuint &);
MHwindow& operator=(MHwindow&); // Disallowed
MHwindow(const MHwindow&); // Disallowed
public:
static MHwindow& instance() { return MHw; }
void setTexture(GLuint);
GLuint getTextures();
};
----------------------------------------
This is my singleton cpp file:
----------------------------------------
MHwindow::MHwindow(GLuint & textur)
{
pngInfo texInfo;
textur = pngBind("pippo.png", PNG_NOMIPMAP, PNG_ALPHA, NULL, GL_CLAMP,
GL_NEAREST, GL_LINEAR);
}
void MHwindow::setTexture(GLuint i){texture = i;};
GLuint MHwindow::getTextures(){return texture;};
----------------------------------------
this is the usage I'm trying:
----------------------------------------
GLuint textureID;
MHwindow MHwindow::MHw(textureID);
MHwindow& MainWindow = MHwindow::instance();
----------------------------------------
and....this is the retrun error:
In function `Z41__static_initialization_and_destruction_0ii':
undefined reference to `MHwindow::MHwindow(unsigned int)'
I'm trying to pass a reference to constructor.
:-(