c# code. works on win xp doesn't work on win 7
I started making a 3d game. then I stopped for a some time and installed win7. now I wanted to keep working on it just to discover that the code freezes! on XP I render the view onto the form. and the game loop AND all the game forms run on the same thread!
this WORKED on XP. now in win7 the 3d loop still works the same BUT all the forms don't want to work on the same thread with it.
I remember something in vb that was called "doevents" not sure if there is something like this in c#...
I tried to repaint all the forms in the main loop. now all the labels update BUT the forms don't get key input and after a while freeze until windows tells me my app is stuck(all this and the main loops runs and renders the 3d with no problem)
I don't get why all worked on the sa开发者_JS百科me thread in XP and in win7 looks like I'll need to make a threading system for the forms!
and yes the code WORKS on xp!
If you must run everything on the same thread, you could use:
Application.DoEvents();
this is equivalent to "DoEvents" in VB.NET. Hope that helps...
精彩评论