Mason McCuskey
Spin Studios
www.spin-studios.com
Problems with DirectInput
Mason McCuskey
Spin Studios
www.spin-studios.com
I'm working on a RTS-Game and have a problem with DirectInput.
I try to initialize it like this:
#define DIRECTINPUT_VERSION 0x0300
#include
BOOL InitDInputStuff (LPDIRECTINPUT* _lpDI,
LPDIRECTINPUTDEVICE* _lpDIDMouse,
LPDIRECTINPUTDEVICE* _lpDIDKeyboard)
{
if (FAILED (DirectInputCreate (hInstance, DIRECTINPUT_VERSION, _lpDI, NULL))) return FALSE;
if (FAILED ((*_lpDI)->CreateDevice (GUID_SysMouse, _lpDIDMouse, NULL))) return FALSE;
if (FAILED ((*_lpDIDMouse)->SetDataFormat (&c_dfDIMouse))) return FALSE;
if (FAILED ((*_lpDIDMouse)->SetCooperativeLevel (hwnd, DISCL_EXCLUSIVE | DISCL_FOREGROUND))) return FALSE;
//(Keyboard Stuff will be coded later)
return TRUE;
}
but I still get WM_MOUSEMOVEs etc. DI simply doesn't work but there are no
error-codes returned. To compile it I use WATCOM v11.
Where's the problem?
while c$=""
c$=inkey$
wend
heheee...