Jump to content
  • Advertisement
Sign in to follow this  
acid2

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

This topic is 4702 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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!