In the game I''m creating I''ve thought of a problem I am going to have to solve eventually and I''m not sure how I''m going to do it yet.
The way I understand it, when you create an array of classes such as:
MyClass a[10];
or
MyClass *prt = new MyClass[10];
the default constructor is called 10 times, one for each instance of the class within the array. (Feel free to correct me if I''m wrong). So, this is where my problem arises, I am not sure how I could create a default constructor for my classes and I will need to do some type of array allocation eventually.
Currently my constructor prototype would be:
MyClass(HWND hwnd, HDC backBuffer);
So, as you would guess, I''m planning on passing the hwnd and back buffer to each instance of the class as I instantiate them, so that the class can perform it''s own drawing and such. All of this is done in WIN32.
So anyone have any ideas how I can solve this? I''m worried that with a default constructor I have no way of sending the correct handle to my window and back buffer, which the classes need.