Sign in to follow this  
Say

coding in c#

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this