My compiler says:
error C2660: 'UberMaterial::Initialize' : function does not take 2 arguments
When I write this:
#include "BaseMaterial.h"
#include "UberMaterial.h"
UberMaterial* m_pGameLevelMaterial;
m_pGameLevelMaterial->Initialize(m_pContentManager, m_pLevel->GetDevice());
The base class:
class BaseMaterial
{
public:
BaseMaterial(tstring shaderFilename);
virtual ~BaseMaterial(){}
void Initialize(ContentManager *pContentManager, ID3D10Device *pD3DDevice);
//[More Code...]
protected:
virtual void Initialize(ContentManager *pContentManager) = 0;
//[More Code...]
};
The inherited class:
#include "BaseMaterial.h"
class UberMaterial:public BaseMaterial
{
//[More Code...]
protected:
virtual void Initialize(ContentManager *pContentManager);
//[More Code...]
};
Can anyone tell me what the problem is?
If you need more code, just comment and I’ll post it. But the whole thing is rather large, so I didn’t include it at this point.
Yes, by default, an overload in a derived class will hide a different overload from a base class. You can re-expose the base-class overload with
using: