Sign in to follow this  
Meowza

[.net] Game processor picking

Recommended Posts

Meowza    100
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#?

Share this post


Link to post
Share on other sites
Fiddler    860
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.

Share this post


Link to post
Share on other sites
Meowza    100
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).

Share this post


Link to post
Share on other sites
Fiddler    860
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.

Share this post


Link to post
Share on other sites
Meowza    100
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this