Iím starting to use C++ and I have some problems I hope you people can help me.
I have the following classes on their own file.
* Basic application class.
* Any application needs this.
~App(); /**< Destructor. */
int init(); /**< Application initiation. */
void checkExtensions(); /**< Check that required extensions are available. */
void idle(); /**< Function called every frame. */
void render(); /**< Render basic info, etc. */
void keyPress(int key); /**< Check if a valid key was pressed. */
The application needs just one instance of App and one instance of WinApp. And that single instance of WinApp needs to be inside my single instance of App in such way that there is no WinApp without App, and in such way that WinApp can call functions of App. How do I do that without using inheritance? I was using inheritance and I didnít have any problem but it was blending everything too much, making it WinApp more of a part of App and not some ďservice moduleĒ which is what I want.
* Class that deals with Win32 specific stuff.
* This includes mouse handling, basic loop, window creation, etc.
WinApp(); /**< Constructor. */
~WinApp(); /**< Destructor. */
int setVideoMode(int width, int height, int fs = 0); /**< Set the video mode for the application. */
void setTitle(const char *title); /**< Set the title of the window. */
void checkExtension(const char *extension); /**< Check if a needed extension is available. */
void error(); /**< Check if there was any error. */
void main(); /**< Deal with Window's messages, main loop. */
int windowWidth; /**< Width of the window. */
int windowHeight; /**< Height of the window. */
int fullScreen; /**< Fullscreen. */
char title; /**< Title of the window. */
int mouseX; /**< Location of the mouse pointer along the X axis. */
int mouseY; /**< Location of the mouse pointer along the Y axis. */
int mouseButton; /**< Check what mouse button was pressed. */
float fps; /**< Frames per second. */