Give sorted configs a unique ID without changing the original set
TRAC #12323
This fixes building on Visual C++ 2010, which has const iterators for STL sets as specified by C++0x.
Signed-off-by: Shannon Woods
Singed-off-by: Daniel Koch

Author:    Nicolas Capens

git-svn-id: https://angleproject.googlecode.com/svn/trunk@302 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libEGL/Display.cpp b/src/libEGL/Display.cpp
index d39a5bb..39949b2 100644
--- a/src/libEGL/Display.cpp
+++ b/src/libEGL/Display.cpp
@@ -103,6 +103,8 @@
             D3DDISPLAYMODE currentDisplayMode;
             mD3d9->GetAdapterDisplayMode(mAdapter, &currentDisplayMode);
 
+            ConfigSet configSet;
+
             for (int formatIndex = 0; formatIndex < sizeof(renderTargetFormats) / sizeof(D3DFORMAT); formatIndex++)
             {
                 D3DFORMAT renderTargetFormat = renderTargetFormats[formatIndex];
@@ -124,15 +126,24 @@
                             {
                                 // FIXME: Enumerate multi-sampling
 
-                                mConfigSet.add(currentDisplayMode, mMinSwapInterval, mMaxSwapInterval, renderTargetFormat, depthStencilFormat, 0);
+                                configSet.add(currentDisplayMode, mMinSwapInterval, mMaxSwapInterval, renderTargetFormat, depthStencilFormat, 0);
                             }
                         }
                     }
                 }
             }
-        }
 
-        mConfigSet.enumerate();
+            // Give the sorted configs a unique ID and store them internally
+            EGLint index = 1;
+            for (ConfigSet::Iterator config = configSet.mSet.begin(); config != configSet.mSet.end(); config++)
+            {
+                Config configuration = *config;
+                configuration.mConfigID = index;
+                index++;
+
+                mConfigSet.mSet.insert(configuration);
+            }
+        }
     }
 
     if (!isInitialized())