I should return to c#... I simply want to have the IrrlichtDevice, IVideoDriver and ISceneManager collected in a central class CGame. Trying to do it like this:
Now g++ gives me such errors for each of the classes:
CGame.h:22: error: ISO C++ forbids initialization of member ‘device’
CGame.h:22: error: making ‘device’ static
CGame.h:22: error: invalid in-class initialization of static data member of non-integral type ‘irr::IrrlichtDevice*’
Can anyone tell me how I get my IrrlichtDevice constructed in the CGame class...?
That seems to be nearly what I had before, with the difference that I had the constructor implementation in the cpp-file, too.... Gonna test it tomorrow, hope it works!
Hmpfgrml... In a fresh environment the class-in-class works.. But in my "real" code it doesnt. Seems like I restart off from scratch, Dances' example was a quite like mine. My code looks like yours, but it wont work. C++ is [very bad word] hard...
if I structure my code as ...
Single .cpp file
class IEventReceiver
int main ()
/* everything down here */
... then everything works fine, gui , 3d everything
But If I structure it as this thread implies, and as I have done before in other projects ( non irrlicht )
Single .h file
class game : public IEventreceiver
/* globals, variables, devices, functions , declarations*/
and then the obvious .cpp file where : device setEventreceiver ( this )
now I know I am not showing much of my code
but it is the structure that messes it up somehow I am sure
The way it messes it up is, all my GUI becomes non functional.. broken... busted... takes no commands what so ever... buttons dun work, editboxes and so on and so on
Does irrlicht have any know issues about having problems with it's IGUIEnvironment* being stored in a class