Hi,
I have not used C++ in about a year (Been using C# a lot lately ;))
I am receiving an error when I try to compile a new OpenGL project I am working on and I can't see where I have gone wrong, though i wouldn't be surprised if I have done something the C# way instead of the C++ way.
Anyway, here is the error:
File: GameEngine.h
Line: 28
Message: 'GameScreen' was not declared in this scope
Here is the contents of GameEngine.h:
#ifndef GAMEENGINE_H
#define GAMEENGINE_H
#include "GameScreen.h"
#include <SDL.h>
#include <SDL_opengl.h>
#include <GL/glu.h>
#include <vector>
//The main class in the game. Makes sure everything gets called at the right time and inits all other parts of the game.
class GameEngine
{
public:
GameEngine(); //Constructor
~GameEngine(); //Destructor
bool Initialize(); //Tell init OpenGL/SDL and tell main if the engine can be Run
void Run(); //This contains the game loop
bool QuitGame; //Set to true to quit the game
protected:
void Process(); //Processes all the input
void Update(); //Does animations and update physics type stuff
void Draw(); //Draws the scene
void Resize(int Width, int Height); //Handles the resize event
std::vector<GameScreen *> GameScreens; //A list of GameScreen pointers
};
#endif
and here is the code for GameScreen.h:
#ifndef GAMESCREEN_H
#define GAMESCREEN_H
#include "GameEngine.h"
#include "GameObject.h"
#include <SDL.h>
#include <vector>
//This is the base class for all the game screens: Menu's, pause screens, the UI and the game world
class GameScreen
{
public:
GameScreen(); //Constructor
virtual ~GameScreen(); //Destructor
virtual void Process(SDL_Event *tmpEvent); //Processes input and other events
virtual void Update(); //Updates things like physics and animation
virtual void Draw(); //Renders the screen
protected:
GameEngine *Parent; //Pointer to the GameEngine - Allows us to modify QuitGame from this class
std::vector<GameObject *> GameObjects; //A list of GameObject pointers
};
#endif
Thanks.