Sign in to follow this  

Help with SupportedDisplayModes...

This topic is 3743 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

Hi all!! I've started working on a game engine based on Chad's CUnit, and I am facing some problems that maybe are due to the fact that I had to port the original code (MDX 2.0) to 'traditional' MDX, and probably I screwd something in the process. The fact is that I manage to render (well.. just for a few seconds, after that it crashes stating I ran out of memory due to texture trashing) but there are some 'exceptions' I found with the DX Debug output that I would like to solve. To start with, I'm facing several 'Invalid D3DDISPLAYMODEFILTER specified. GetAdapterModeCountEx returns zero' errors on the output when scanning for devices and adapters. I would not mind about them a lot, since this is only performed at the start, but these errors are preventing me for using PIX to try to solve the other, more important problems, so I had to start with this. Below is the offensing code, and the break (and the printing of the message) happens on the foreach line, evaluating a.SupportDisplayModes.
private ArrayList enumerateDisplayModes(AdapterInformation a, AdapterEnum currentAdapter)
        {
            ArrayList adapterFormatList = new ArrayList();
            for (int i = 0; i < AdapterFormats.Length; i++)
            {
                foreach (DisplayMode d in a.SupportedDisplayModes[AdapterFormats[i]])
                {
                    currentAdapter.DisplayModeList.Add(d);

                    // Add Adapter Format used with this DisplayMode
                    if (!adapterFormatList.Contains(d.Format))
                    {
                        adapterFormatList.Add(d.Format);
                    }
                }
            }
            DisplayModeSorter sorter = new DisplayModeSorter();
            currentAdapter.DisplayModeList.Sort(sorter);
            return adapterFormatList;
        }

Any tips or clues regardin this would be really appreciated!! TIA

Share this post


Link to post
Share on other sites

This topic is 3743 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