You should optimize your code. Like adding all meshes to a vector isnt a good idea. What about having an array of structs with a single mesh and shader. This would reduce looping times.
And you should draw each mesh in a single step, but start the render engine once and draw
ALL meshes.
Pseudo-Code:
void drawAll()
{
Renderdata *renderConfig = configureRendering();
for( SingleRender *rendering in allRenderings ) {
vector *data = rendering.data;
shader *shader = rendering.shader;
drawVector(renderConfig, data, shader);
}
finalizeRendering(); cleanUpConfig(renderConfig);}
Think about some global preconfig data which doesnt need to be created at each drawAll() like the vector and shader data.
Make time output to find the
REAL bottlenecks. :-O