Re: [GD-Windows] .NET main loop
Brought to you by:
vexxed72
From: Jacobo R. <ffe...@ty...> - 2004-02-18 07:27:49
|
You have an alternative method to do the main loop. You can insert a=20 delegate that executes in the idle time of the form. Here are an example=20 but it's write on C# (I use C++ managed too, but with opengl instead dx) http://xplsv.com/blogs/devdiary/ To find the section quickly: CTRL + F and search for "static void main" Jacobo Rodr=EDguez Villar Proyectos en desarrollo: http://www.typhoonlabs.com tweety wrote: > Sorry if this is OT, and if it is, please redirect (IIS joke :) ) to=20 > the appropiate list. > =20 > I'm writing a managed dx9 app and, coming from the c++ world (and=20 > seeing the sdk samples), my main loop is: > =20 > MainForm form=3Dnew MainForm(); > engine.Init(form); > while(form.Created) > { > engine.Update(); > engine.Render(); > Application.DoEvents(); > } > engine.Dispose(); > =20 > But I read in some blog that DoEvents is bad because it allocates=20 > ~200bytes per call (kinda a lot), forcing the form class into gen1=20 > garbage collection. > Now I'm asking you: what's the best way to do it? > =20 > ---------------------------------- > Peace and love, > Tweety > mi...@sy... <mailto:mi...@sy...> -=20 > twe...@us...=20 > <mailto:twe...@us...> > YahooID: tweety_04_01 |