coding in c#
i'm creating a 3d game in c#.
I'm handling user keydown event.
In my guide it uses
protected override void OnKeyDown(System.Windows.Forms.KeyDown.....)
but coding in c++ i use windows message for that...
Do I have to use OnKeyFunction or window message to handle fastler that?
Using an OnKeyDown even handler is effectively the same as handling the WM_KEYDOWN message. For better performance, you might want to look at using DirectInput.
Using OnKeyDown is fine, as is DirectInput. Do note, however, that a lot of people recommend against using WinForms for games (because of the memory overhead associated with calling DoEvents), and instead implementing your own windowing system using raw Win32, in which case you'll have to either handle WM_KEYDOWN or use DirectInput.
Quote:Original post by Holy Fuzz
Using OnKeyDown is fine, as is DirectInput. Do note, however, that a lot of people recommend against using WinForms for games (because of the memory overhead associated with calling DoEvents), and instead implementing your own windowing system using raw Win32, in which case you'll have to either handle WM_KEYDOWN or use DirectInput.
The thinking has changed on DoEvents. The latest recommendation from "the guys who know" is actually back to DoEvents now.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement