I'm trying to create a game for my own entertainement, and for some reason, it gives me an error.
I'm posting the entire thing so far.
Main.cpp
Code:
//Inculde the main header file
#include "main.h"
//Incude the global variable allocation header
#include "globalvar.h"
//Game initialization function. Gets the game ready to run.
int functMainStartGame()
{
global.exitgame = false;
}
//Step function, for the main program. All main program code executed here.
int functMainStep()
{
//while(global.exitgame == false)
//{
////put code for game here.
//}
}
//Game ending function. Ends classes, closes rendering system, ect.
int functMainEndGame()
{
}
int main()
{
functMainStartGame();
functMainStep();
functMainEndGame();
return 0;
}
main.h
Code:
//todo: Add header files to declare here.
//create global variable container.
struct globalStruct
{
int exitgame;
int *entities[0];
int numbofentities;
};
extern globalStruct global;//declare it
And globalvar.h
Code:
globalStruct global;
EDIT: Oh, entites.cpp too.
Code:
#include "globalvar.h"
class entMain
{
public:
int myx;
int myy;
float xspeed;
float yspeed;
entMain(int x, int y)
{
global.instances[global.numbofentities] = &this;
global.numbofentities += 1;
}
~entMain()
{
}
int entRepeatMe()
{
}
};
http://img170.imageshack.us/img170/9614/whatdk4.png
I'm,using Dev C++ v4.9.9.2.
Please note I am just beginning at C++, so it may have been something simple.
Thanks
-CornJer