I am extremely rusty with my C++ skills. I want to pass my camera object to the terrain class, so I can cull some subgrids from my view frustrum.
So, my initial idea was to pass the camera in the terrain constructor.
I have my camera declared like this:
Camera g_Camera;and after I initialize the camera I call the constructor for my terrain.
I am really unsure how I should accomplish this, but I would save a "Camera &" in my terrain class and just pass over the reference in the constructor. But I get these errors:
1>c:\***\thegame\terrain.cpp(13): error C2758: 'Terrain::mCamera' : must be initialized in constructor base/member initializer list 1> c:\***\thegame\terrain.h(72) : see declaration of 'Terrain::mCamera' 1>c:\***\thegame\terrain.cpp(128): error C2327: 'Terrain::mCamera' : is not a type name, static, or enumerator 1>c:\***\thegame\terrain.cpp(128): error C2065: 'mCamera' : undeclared identifier 1>c:\***\thegame\terrain.cpp(128): error C2228: left of '.getPos' must have class/struct/union 1> type is ''unknown-type''
Can anyone outline the correct way to do this? [Full code below]