I am trying to make a framework using SDL 2.0 and O-OP.
Here I have a CGraphicsManager class:
namespace tde {
class CGraphicsManager : public Singleton<CGraphicsManager>
{
private:
static SDL_Window* mWindow;
static SDL_Renderer* mRenderer;
public:
~CGraphicsManager();
static Uint32 Init(const char* title, Vector2i& size, Uint32 flags);
static SDL_Window* getWindow(){ return mWindow; }
static SDL_Renderer* getRenderer() { return mRenderer; }
};
}
And when I try to do so:
SDL_RenderClear(Graphics.getRenderer());
The compiler says:
error C2248: Singleton::Singleton can't reach private member in Singleton<'tde::CGraphicsManager'>
I tried to make mWindow and mRenderer static members but this way don't work. Help me to store window and renderer somehow in this sistem to make them visible and avalible in tde namespace!