In OgreWin32Input.cpp

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
Post Reply
kaiwae
Gnoblar
Posts: 9
Joined: Sat Jan 29, 2005 11:04 am

In OgreWin32Input.cpp

Post by kaiwae » Fri Feb 11, 2005 8:13 pm

In OgreWin32Input.cpp have below code

what it mean??? why annotated it

Code: Select all

            /* don't use DI
            LogManager::getSingleton().logMessage("Win32Input: Establishing mouse input.");

            // Create mouse device
            hr = mlpDI->CreateDeviceEx(GUID_SysMouse, IID_IDirectInputDevice7,
                (void**)&mlpDIMouse, NULL);


            if (FAILED(hr))
                throw Exception(hr, "Unable to create DirectInput mouse device.",
                    "Win32Input - initialise");

            // Set data format
            hr = mlpDIMouse->SetDataFormat(&c_dfDIMouse);
            if (FAILED(hr))
                throw Exception(hr, "Unable to set DirectInput mouse device data format.",
                    "Win32Input - initialise");

            // Make the window grab mouse behaviour when foreground
            hr = mlpDIMouse->SetCooperativeLevel(hWnd,
                       DISCL_BACKGROUND | DISCL_NONEXCLUSIVE);
            if (FAILED(hr))
                throw Exception(hr, "Unable to set DirectInput mouse device co-operative level.",
                    "Win32Input - initialise");

            // Acquire input
            hr = mlpDIKeyboard->Acquire();
            if (FAILED(hr))
                throw Exception(hr, "Unable to set aquire DirectInput mouse device.",
                    "Win32Input - initialise");

            LogManager::getSingleton().logMessage("Win32Input: Mouse input established.");
            */
0 x

lgoss007
Halfling
Posts: 81
Joined: Sat Mar 29, 2003 7:29 pm
Location: Florida, USA
Contact:

Post by lgoss007 » Fri Feb 11, 2005 9:18 pm

That code is to use DirectInput for the mouse (for DirectX 7 only I believe), though I'm not sure why it was commented out. If you aren't using DX7 then I believe the file being used is OgreWin32Input8.cpp (which handles DX8 and the DirectInput mouse is used).
0 x

Post Reply