Monday, July 14, 2008

Direct X Fun

Some things I've discovered:

  • You need a co-operative level of DISCL_FOREGROUND | DISCL_EXCLUSIVE or you'll still receive WM_MOUSEWHEEL messages from Windows. This was tremendous fun to debug. I bet there's some silly backwards-compatibility reason for it too, like a lot of Direct X 3 programmers relied on it.
  • If you have a function that returns a HWND, don't pass it as the first parameter to SetCooperativeLevel or interesting things will happen. Input seems to work OK, but it breaks sound.
  • Direct Input seems a nice enough API, so long as you can avoid having to pass structures around as parameters. The major exception so far is setting an input buffer size, where you have to use SetProperty.

0 comments: