Hi everyone and thanks in advance for the help. I have the following class that throws an error on compiling where i declase a vector of pointers
I have an Engine class that I want to host multiple scenes objects stored in the vector sceneList and then pass which ever I want to render to a SceneBase pointer
#pragma once
#include "Matrix3D.h"
#include "SceneBase.h"
#include <vector>
class Engine
{
public:
static float deltaTime;
Engine();
~Engine();
void Init(int argc, char* argv[]);
void Run();
/* Forward declared GLUT callbacks registered by main. */
static void Display();
static void Update();
static void Keyboard(unsigned char c, int x, int y);
static void Resize(int width, int height);
static Matrix3D perspective;
private:
//static SceneBase *scene;
static float previousTime;
vector<SceneBase*> scenesList;
};
Line throw three error codes for each of the following error codes 2143, 4430, 2238.
Also, I have the following header that also implements a vector of pointers that do not throw any errors
#pragma once
#include "OpenGLRenderer.h"
#include "BaseObject.h"
#include "TextureManager.h"
#include <vector>
#include <iostream>
#include "Engine.h"
#include "Matrix3D.h"
using namespace std;
class SceneBase
{
public:
SceneBase();
virtual ~SceneBase();
virtual void Init() = 0;
virtual void Draw() = 0;
virtual void Update() = 0;
protected:
//List holding all objects in scene
vector<BaseObject*> list;
OpenGLRenderer rendererGL;
TextureManager textureManager;
};
On the Engine.h if i change vector<SceneBase> scenesList; to std::vector<SceneBase> scenesList; the error 2143 is not thrown but all the others are. Could anyone point what I am missing? and why this works on SceneBase.h and not in Engine.h?
Thanks