Sign in to follow this  

[MDX] Very low fps in window, fine fullscreen?

This topic is 4421 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

The topic generally sums it up. When I run my application in a window, the fps is 32. It used to be 60 (and 140 odd with immediate present interval), but now I can't get it higher than 32, and I have no idea what I've changed. Looked at the fps in pix shows it goes... 60-57-56-30-17-16-20-60-rinse and repeat. Pretty bizzare, because I don't recall changing anything significant. When I run fullscreen, its a steady 60 - with very little flucuation. Any ideas on what this could be? I use an Application.DoEvents() loop if that helps, and here are my present params:
            PresentParameters pParams = new PresentParameters();

            pParams.AutoDepthStencilFormat = DepthFormat.D16;
            pParams.Windowed = !fullscreen;
            pParams.SwapEffect = SwapEffect.Discard;
            pParams.EnableAutoDepthStencil = true;
            pParams.MultiSample = MultiSampleType.FourSamples;
            pParams.PresentationInterval = PresentInterval.Immediate;

            CreateFlags flags = 0;

            _devCaps = Manager.GetDeviceCaps(Manager.Adapters.Default.Adapter, DeviceType.Hardware);

            if (_devCaps.DeviceCaps.SupportsHardwareTransformAndLight)
            {
                flags = CreateFlags.HardwareVertexProcessing;
                if (_devCaps.DeviceCaps.SupportsPureDevice)
                    flags |= CreateFlags.PureDevice;
            }
            else
                flags = CreateFlags.SoftwareVertexProcessing;

            if (fullscreen)
            {
                pParams.BackBufferCount = 1;
                pParams.BackBufferFormat = Manager.Adapters.Default.CurrentDisplayMode.Format;
                pParams.BackBufferHeight = 768;
                pParams.BackBufferWidth = 1024;
            }

            _device = new Device(Manager.Adapters.Default.Adapter, DeviceType.Hardware, c, flags, pParams);

Fire suggestions at me, this is driving me insane :(

Share this post


Link to post
Share on other sites
Ok, just ran windowed again, and now its 64 fps.. and I haven't changed anything o.O It seems to be another app causing this - could it be because i use app.doevents() ?

Share this post


Link to post
Share on other sites
Check Task Manager and see what else is running. Exit every other application and see how things run then.

Are you using a Debug Build or Release? For any performance monitoring you should use the Release version of DirectX and a Release build of your Exe.

DoEvents isn't very efficient. I wrote a tutorial on a better message loop:
Message Loop Tutorial (.Net)

Share this post


Link to post
Share on other sites
First of all, get rid of Application.DoEvents(). Every call to the method will increase the size of your application in memory. If you open your task manager and run your program you will notice this.

Use Tom Miller's "Good" Render loop to solve this.

I will look at the rest of your code when I wake up.
I hope this helps.
Take care.

Share this post


Link to post
Share on other sites
wow Drunken, you took my fps from 64 to 124.... incredible :O

Thank you so much for making me change my loop! It would seem that the low fps is caused by another running application, I'm not sure what though.

Share this post


Link to post
Share on other sites

This topic is 4421 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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