Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualSamith

Posted 28 November 2013 - 10:12 AM

The debugger shows keyboardDevice_ becomes a 0x00000000 (similar to before). Again this is adapting code that works when it was done in the way the book shows.

After a quick glance at your code in not sure what's wrong, but I did notice one thing: you don't seem to ever check the result of your Init functions. In InitInput you return false if anything failed, but then you never check if InitInput returns true or not (I'm assuming, based on the code in the original post).

You should check the return values of your Init functions, and at the very least log something if they're false. It's possible that keyboardDevice_ never initialized properly (and thus was always NULL) but you won't catch that until you're update loop. You want to try and find errors as soon as possible! Crash early and crash often, as the saying goes.

EDIT: Looked at your code again. Looks like hInstance is uninitialized. You can get hInstance from WinMain.

#1Samith

Posted 28 November 2013 - 10:07 AM

The debugger shows keyboardDevice_ becomes a 0x00000000 (similar to before). Again this is adapting code that works when it was done in the way the book shows.


After a quick glance at your code in not sure what's wrong, but I did notice one thing: you don't seem to ever check the result of your Init functions. In InitInput you return false if anything failed, but then you never check if InitInput returns true or not (I'm assuming, based on the code in the original post).

You should check the return values of your Init functions, and at the very least log something if they're false. It's possible that keyboardDevice_ never initialized properly (and thus was always NULL) but you won't catch that until you're update loop. You want to try and find errors as soon as possible! Crash early and crash often, as the saying goes.

PARTNERS