Hi i'm currently developing an graphical application and i have a rendering function that loops through all the objects to be rendered and applies various shaders and lighting effects. I was just wondering if this is possible:
#pragma omp parallel for
for (std::vector<RenderObject*>::iterator it = objects.begin(); it < objects.end(); ++it)
object = *it;
if (object->shader == sceneShader || !object->shader)
i realise that the iterators need to be integers so do i have to attempt to convert the loop variables to use integers or will omp be able to convert the iterators into the required data types(probably not).
If so how would you loop through the various elements of a vector datastructure without using an iterator, and make use of the OMP for construct.
Apologies if this doesn't make sense, i'm a bit of a newb
Thanks in advance
i replaced the for loop with:
for(int i = 0; i < objects.size(); ++i)
object = objects.at(i);
it seems to compile will run it 2mrw.......