Hi, simple question:
When inheriting a class, CBitmapImage, to CBitmapFont, I get an odd compiler message re: the constructor.
The constructor for CBitmapImage is:
CBitmapImage::CBitmapImage(CDirectXEngine *g_DirectXEngine) {
DirectXEngine = g_DirectXEngine;
}
and for CBitmapFont is:
CBitmapFont::CBitmapFont(CDirectXEngine *g_DirectXEngine, int char_width_in, int char_height_in) {
DirectXEngine = g_DirectXEngine;
char_width = char_width_in;
char_height = char_height_in;
}
Now when I compile, CBitmapImage.cpp works fine, however the compiler throws up this message re: the CBitmapFont constructor:
error C2512: ''CBitmapImage'' : no appropriate default constructor available
I checked in the help files and this explanation was offered:
"No default constructor was available for the specified class, structure, or union."
"The compiler will supply a default constructor only if user-defined constructors are not provided. If you provide a constructor that takes a nonvoid parameter, then you must also provide a default constructor. The default constructor can be called with no parameters, that is, a constructor with default values for all parameters."
This is something which I didn''t know anything about - can somebody explain in simple english what this means?
This is obviously something to do with well...constructors.
Thanx.
r.