I'm trying to use an object-oriented approach for split screen, with a class called View that can be preconfigured to a specific screen area. Its render() function would take its camera and render the contents to the preset region on the screen, as well as any HUD elements.
Code: Select all
class View
{
public:
void setPosition(const vector3df &pos);
void setRotation(const vector3df &rot);
View(void);
~View(void);
void setFOV(float arc);
void render(void);
void setViewport(const core::rect<s32> &area);
protected:
ICameraSceneNode *irr_camera;
ISceneManager* smgr;
IVideoDriver* driver;
core::rect<s32> viewport;
};
Below is the Game class as of now; the line that the compiler balks at is "View *camera;". The pointer array (with MAX_PLAYERS) was commented out and replaced with a single pointer to see if that was causing the error; it still happens.
Code: Select all
class game
{
public:
game(void);
~game(void);
void renderScene(void);
void setPlayers(unsigned int numPlayers);
protected:
unsigned int players;
//view* camera[MAX_PLAYERS];
View *camera;
};