i create a new Form inside my GameWindow derived class and show it... its not updated unless i add Application.DoEvents to override OnUpdateFrame or something? should the app or game window be doing this or its not doing for performance i guess?
Posted Saturday, 17 October, 2009 - 19:39 by the Fiddler
No, this will not work - WinForms will "steal" events from the GameWindow and vice versa.
The correct solution is to launch the Form on a different thread. If you need more than one Form, make sure that all of them are created on the same thread (and that this thread is different from the GameWindow thread).
Posted Monday, 19 October, 2009 - 01:37 by krisnye
Just as a side note: Application.DoEvents leaks memory permanently each time it is invoked. That method shouldn't be used.... it's not being used from within OpenTK is it?
Posted Monday, 19 October, 2009 - 08:11 by the Fiddler
No, OpenTK does not use the Application class at all. It also uses several tricks to avoid allocating memory per-frame - the memory allocation graph for a GameWindow should be completely flat over time.
Comments
Re: Application.DoEvents
No, this will not work - WinForms will "steal" events from the GameWindow and vice versa.
The correct solution is to launch the Form on a different thread. If you need more than one Form, make sure that all of them are created on the same thread (and that this thread is different from the GameWindow thread).
Re: Application.DoEvents
thanks ya i was noticing missing events :) esc would not sometimes
Re: Application.DoEvents
Just as a side note: Application.DoEvents leaks memory permanently each time it is invoked. That method shouldn't be used.... it's not being used from within OpenTK is it?
Re: Application.DoEvents
No, OpenTK does not use the Application class at all. It also uses several tricks to avoid allocating memory per-frame - the memory allocation graph for a GameWindow should be completely flat over time.