[.net] Game processor picking

Started by
4 comments, last by Meowza 14 years, 2 months ago
Hello, I think I got an idea of what my game is doing in windowed mode now. When using dual processors one is used for the operating system and the other is used for hungry applications right? I think that when I run my game in full screen mode it knows which processor to use, but I think if I run it in windowed mode then C# thinks it should use the operating system processor. When my game runs in fullscreen FPS is 60+ and the processor is running full 50%, in windowed mode, FPS is 30-40 and processor is being used 1-5% <-- I think it is using the operating system processor anyone else have this problem with C#?
Advertisement
Doesn't really work like that, both processors are used for both the operating system and applications. The OS scheduler decides what's going where and the process is anything but straightforward.

How are you doing graphics for your game? (GDI+, WPF, D3D, OpenGL, something else?) Also is this on Vista/Win7?

Fullscreen mode can be measurably faster than windowed mode when using hardware acceleration, especially on weaker video cards and doubly so if you are running a compositor (i.e. Aero). In fullscreen mode, the video card can use page flipping to present the backbuffer, whereas in windowed mode it needs to copy its contents bit by bit which is quite a bit slower.

That said, without any more information this is just a wild guess. The actual reason could be anything.

[OpenTK: C# OpenGL 4.4, OpenGL ES 3.0 and OpenAL 1.1. Now with Linux/KMS support!]

Hello thx for reply Fiddler,

I am using Windows XP with SlimDX. My video card is fairly recent, Nvidia 8800 if i'm not mistaken.

My example is only drawing about 700 - 800 textures.

I just don't get why in windowed mode the game uses only 1-5% of CPU (according to taskmanager).
How are you measuring and presenting CPU usage?

GDNet+. It's only $5 a month. You know you want it.

In that case, low CPU usage might indicate that somewhere, something is sleeping. Are you calling System.Threading.Thread.Sleep() at all? Maybe SlimDX is trying to be helpful by releasing the processor when in windowed mode(*)? Is vsync enabled?

I'd suggest using a profiler, for example slimtune, to see where your CPU time is being spent. You might also wish to try a GPU profiler, like GPU PerfStudio or NVPerfHUD (for Ati and Nvidia cards respectively).

Your card should be able to maintain 60fps in windowed mode, it's just a matter of finding the bottleneck.

(*) no idea if that's true but I've seen other game libraries do that before so you never know.

[OpenTK: C# OpenGL 4.4, OpenGL ES 3.0 and OpenAL 1.1. Now with Linux/KMS support!]

Hello Tom, I am measuring with task manager, and my FPS code.

Fiddler, I'm not calling any Sleeps or nothin, and VSYNC is enabled.

"Maybe SlimDX is trying to be helpful by releasing the processor when in windowed mode(*)?"

I really think it is something like this, but maybe something to do with C#. When I was using MDX this was happening also, it was a lot worse than with SlimDX though.

I will try out SlimTune, ty for link

This topic is closed to new replies.

Advertisement