c# - Multiple Forms and a Single Update,Will it work? -


i need make application in .net cf different/single forms lot of drawing/animation on each forms.i prefer have single update[my own state management , on] function can manage different states, [j2me gaming code] work without changes.i have came possible scenarios. of 1 perfect?

  1. have single form , add/delete controls manually , use of gamelooping tricks.
  2. create different forms controls , call update , application.doevents() in main thread.[ while(isapprunning){ update() application.doevents() }
  3. create update - paint loop on each of form required.
  4. any other ideas.

please give me suggestion regarding this

if game i'd drop of forms , work bare essentials, work off bitmap if possible , render either overriding main form's paint method or control resides within (perhaps panel). give better performance.

the main issue compact framework isn't designed lot of ui fun don't double-buffering free in full framework, proper transparency bitch winform controls , if hold onto ui thread little long you'll serious rendering glitches. hell might if on background threads! :o

you're never going optimal performance explicitly calling application.doevents, rule of thumb use when trouble-shooting or writing little hacks in ui.

it might worth sticking game on background thread , calling .invoke on control marshal main ui thread update display leaving ui plenty of time respond while handling user input. user input reason avoid normal winform controls, mobile devices don't have many keys it's useful able remap them avoid things textboxes have preset key events/responses.

i'd avoid using different forms showing new form can provide subtle pause, swap out controls main form avoid issue when writing business software.

at end of day it's worth experimenting various techniques see works out best. see if can tips people develop games on cf business software.

hth!


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -