I have this function defined in header:
template<typename T>
void GfxDevice::BindConstantBuffer(unsigned int stage, GfxConstantBuffer<T>* constantBuffer, unsigned int binding)
{
GfxBufferResource* bufferResource = constantBuffer->GetBufferResource();
if (!bufferResource->Initialized())
bufferResource->Initialize();
BindConstantBuffer(stage, bufferResource->GetBuffer(), binding);
}
I get linker error because compiler won't link Initialize() function that is defined in .cpp file. Is there any way of resolving that and that Initialize() stay in the cpp?