diff --git a/RenderSystems/GLSupport/src/EGL/OgreEGLSupport.cpp b/RenderSystems/GLSupport/src/EGL/OgreEGLSupport.cpp index d9ee1fbce22..01a63f15dfb 100755 --- a/RenderSystems/GLSupport/src/EGL/OgreEGLSupport.cpp +++ b/RenderSystems/GLSupport/src/EGL/OgreEGLSupport.cpp @@ -210,13 +210,10 @@ namespace Ogre { void load(EGLSupport* const glSupport, EGLConfig glConfig) { - std::map::iterator it; - - for (it = fields.begin(); it != fields.end(); it++) + for (auto& f : fields) { - it->second = EGL_NONE; - - glSupport->getGLConfigAttrib(glConfig, it->first, &it->second); + f.second = EGL_NONE; + glSupport->getGLConfigAttrib(glConfig, f.first, &f.second); } } @@ -237,12 +234,10 @@ namespace Ogre { } } - std::map::iterator it; - - for (it = fields.begin(); it != fields.end(); it++) + for (auto& f : fields) { - if (it->first != EGL_CONFIG_CAVEAT && - fields[it->first] > alternative.fields[it->first]) + if (f.first != EGL_CONFIG_CAVEAT && + fields[f.first] > alternative.fields[f.first]) { return true; } @@ -312,7 +307,7 @@ namespace Ogre { ::EGLContext EGLSupport::createNewContext(EGLDisplay eglDisplay, ::EGLConfig glconfig, - ::EGLContext shareList) const + ::EGLContext shareList) const { EGLint contextAttrs[] = { EGL_CONTEXT_MAJOR_VERSION, 3, diff --git a/RenderSystems/GLSupport/src/OgreGLVertexArrayObject.cpp b/RenderSystems/GLSupport/src/OgreGLVertexArrayObject.cpp index f9df00cfdeb..d4088fbe68d 100644 --- a/RenderSystems/GLSupport/src/OgreGLVertexArrayObject.cpp +++ b/RenderSystems/GLSupport/src/OgreGLVertexArrayObject.cpp @@ -43,7 +43,7 @@ namespace Ogre { rs->_destroyVao(mCreatorContext, mVAO); } } - + void GLVertexArrayObject::bind(GLRenderSystemCommon* rs) { if(mCreatorContext && mCreatorContext != rs->_getCurrentContext()) // VAO is unusable with current context, destroy it @@ -69,13 +69,8 @@ namespace Ogre { if(mNeedsUpdate) return true; - VertexDeclaration::VertexElementList::const_iterator elemIter, elemEnd; - elemEnd = mElementList.end(); - - for (elemIter = mElementList.begin(); elemIter != elemEnd; ++elemIter) + for (const auto& elem : mElementList) { - const VertexElement & elem = *elemIter; - uint16 source = elem.getSource(); if (!vertexBufferBinding->isBufferBound(source)) @@ -111,13 +106,8 @@ namespace Ogre { mAttribsBound.clear(); mInstanceAttribsBound.clear(); - VertexDeclaration::VertexElementList::const_iterator elemIter, elemEnd; - elemEnd = mElementList.end(); - - for (elemIter = mElementList.begin(); elemIter != elemEnd; ++elemIter) + for (const auto& elem : mElementList) { - const VertexElement& elem = *elemIter; - uint16 source = elem.getSource(); if (!vertexBufferBinding->isBufferBound(source))