In this recipe, we will learn how to navigate an Ogre scene using a mouse input in an MFC environment.
We'll start by following the Creating an MFC Ogre application recipe from Chapter 1, Delving Deep into Application Design, to create an Ogre MFC application named MouseInput
, and we'll add a mouse input to move the camera in the 3D scene.
1. The first thing to do is open the MFC Class Wizard, by clicking on Class Wizard on the Project menu. Select MouseInput in the Project listbox, and then CMouseInputView in the Class name list-box.
2. Next, we add message handlers for several mouse messages and end up with a message map that looks similar to the following:
BEGIN_MESSAGE_MAP(CMouseInputView, CView) ON_WM_CONTEXTMENU() ON_WM_RBUTTONUP() ON_WM_PAINT() ON_WM_TIMER() ON_WM_LBUTTONDOWN() ON_WM_LBUTTONUP() ON_WM_MBUTTONDOWN() ON_WM_MBUTTONUP() ON_WM_MOUSEHOVER() ON_WM_MOUSEHWHEEL() ON_WM_MOUSEMOVE() ON_WM_MOUSEWHEEL...