Use foreach loops in RenderBase.cpp