Day 2 of the Level Editor project
We need to poll the mouse, so we define a new class: #ifndef _MOUSE_H_ #define _MOUSE_H_ class Mouse { public: BOOL buttonPressed; unsigned int coordX; unsigned int coordY; }; #endif In the class GL_Window we create a new variable Mouse *mouse; that references to this class. In our Initialize method of class Game, we write g_mouse = window->mouse; so that we can reference to the mouse data by means of g_mouse in analogy to g_keys. To the Window method, we add the following lines: case WM_LBUTTONDOWN: window->mouse->buttonPressed = true; window->mouse->coordX = GET_X_LPARAM(lParam); window->mouse->coordY = GET_Y_LPARAM(lParam); break; case WM_LBUTTONUP: window->mouse->buttonPressed = false; window->mouse->coordX = GET_X_LPARAM(lParam); window->mouse->coordY = GET_Y_LPARAM(lParam); break; Then we also need a new data structure for keeping up with the level details: class LevelDrawElement { public: LevelE