コード例 #1
0
/**
* 
* Calls the ProcessControls function to update the camera's position etc.
* Rotates the camera by the current yaw, pitch and roll values, and then 
*	re-calculates the view matrix by calling the SetView3D function. 
* 
* @author Rebeccah Cox
* @param float32 _fDeltaTick
* @return void
*/
void 
CDebugCamera::Process(float32 _fDeltaTick)
{
	ProcessControls(_fDeltaTick);

	D3DXQUATERNION quatRotation;
	D3DXQuaternionRotationYawPitchRoll(&quatRotation, m_fYaw, m_fPitch, m_fRoll);

	SetViewQuaternion(m_vec3Position, quatRotation);
}
コード例 #2
0
    static LRESULT CALLBACK WindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
    {
        int wmId = 0, wmEvent = 0;
        PAINTSTRUCT ps;
        HDC hdc;

        switch (message)
        {
        case WM_CREATE:

            for_each(_child_windows.begin(), _child_windows.end(), 
                [&](std::unique_ptr<Window>& window)
            {
                window->Create(hWnd);
            });

            break;
        case WM_KEYDOWN:
            if (wParam == VK_ESCAPE)
            {
                SendMessage(hWnd, WM_CLOSE, 0, 0);
            }
            break;
        case WM_COMMAND:

            wmId = LOWORD(wParam);
            wmEvent = HIWORD(wParam);

            // Parse the menu selections:
            if (0 == lParam)
            {
                return ProcessMenuEntries(hWnd, message, wParam, lParam);
            }
            // Parse the accelerator
            else if (1 == lParam)
            {
            }
            else
            {
                ProcessControls(hWnd, message, wParam, lParam);
            }

            break;
        case WM_PAINT:
            hdc = BeginPaint(hWnd, &ps);
            EndPaint(hWnd, &ps);
            break;
        case WM_DESTROY:
            PostQuitMessage(0);
            break;
        default:
            return DefWindowProc(hWnd, message, wParam, lParam);
        }
        return 0;
    }