Skip to main content
9 events
when toggle format what by license comment
May 3, 2013 at 23:01 comment added Roy T. Ah, in that case read this article. It talks about using Winforms together with XNA but the solution at the bottom of the article is equally applicable to your scenario blogs.msdn.com/b/shawnhar/archive/2010/12/06/… The main idea here is that while(true) just wont work properly fir the reasons UnderscoreZero gave.
May 3, 2013 at 15:24 comment added Ben Yes, I'm using WinForms to create the window.
May 3, 2013 at 15:13 comment added Roy T. But are you using WinForms or WPF to create the Window?
May 3, 2013 at 13:21 comment added Ben It's just my own framework, to be honest. I'm just trying to port over a framework I implemented in Java. Even when I run the debug executable, clicking on the program results in an "not responding" error. I believe the loop is causing the program to never idle and therefore making the system think it's still loading.
May 3, 2013 at 11:18 comment added Roy T. @Ben hmm that is unfortunate. I was sure it would be it. What frameworks do you use in C#?
May 3, 2013 at 11:17 comment added Roy T. @SethBattin ah that is a common discussion. However the answer on that question already explains that sleep(0) isn't a problem. The problem is sleep(some_time) to control your exact frame rate since it only guarantees a minimal sleep time. Fact of the matter is that the scheduler can always, and at any time, yield your thread, so doing it yourself isn't that much of a problem. As an example note that John Carmack uses sleep(0) in the Quake engine. (nanobit.net/doxy/quake3/win__main_8c-source.html line 689)
May 2, 2013 at 22:40 comment added Ben Thread.Sleep(0) didn't work unfortunately.
May 2, 2013 at 22:35 comment added Seth Battin I voted you down: sleep() is not a good thing to use while you try to control the framerate. gamedev.stackexchange.com/questions/18898/…
May 2, 2013 at 22:20 history answered Roy T. CC BY-SA 3.0