Original Post
Okay, sry the topic might be a bit misleading, but I couldn´t think of something more fitting. Please take a look at this header I wrote: Now this works like a charm. Except when I uncomment the third constructor EntityView(Entity* e, IRenderable* r). As soon as I add this constructor I get spilled with errors like this one: "error C2460: 'PUKE::Logic::EntityView::Entity' : uses 'PUKE::Logic::EntityView', which is being defined e:\coding\jnr\src\engine\gamelogic\EntityView.h(14) : see declaration of 'PUKE::Logic::EntityView'" Of course I get the missing type specifier errors then, too. As I just added the simple SetRenderable(...) method to the class that is not a critical problem, still I´m quite interested what the heck is going on there and why it´s okay to use an Entity* all over the place and a IRenderable*, too, but the compiler jumps at me as soon as I want to have that constructor. The most surprising thing to me is that the class Entity now seems to be a member of PUKE::Logic::EntityView, at least according to that error. I´m using VS2005, C++ and the DirectX SDK February 2006. Any ideas appreciated.
#pragma once
#include "Entity.h"
#include "../Interfaces/IRenderable.h"
namespace PUKE
{
namespace Logic
{
class Entity;
class __declspec(dllexport) EntityView
{
public:
EntityView();
EntityView(Entity* e);
//EntityView(Entity* e, IRenderable* r);
~EntityView();
virtual void Update();
void AttachEntity(Entity* e);
void DetachEntity(bool tellEntity = true);
PUKE::GFX::IRenderable* GetRenderable(){return this->m_pRenderable;}
void SetRenderable(PUKE::GFX::IRenderable* in){this->m_pRenderable = in;}
protected:
Entity* m_pEntity;
PUKE::GFX::IRenderable* m_pRenderable;
};
};
};