Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

range loop refactoring #2968

Merged
merged 3 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 7 additions & 12 deletions RenderSystems/GLSupport/src/EGL/OgreEGLSupport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,13 +210,10 @@ namespace Ogre {

void load(EGLSupport* const glSupport, EGLConfig glConfig)
{
std::map<int,int>::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);
}
}

Expand All @@ -237,12 +234,10 @@ namespace Ogre {
}
}

std::map<int,int>::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;
}
Expand Down Expand Up @@ -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,
Expand Down
16 changes: 3 additions & 13 deletions RenderSystems/GLSupport/src/OgreGLVertexArrayObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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))
Expand Down Expand Up @@ -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))
Expand Down