struct data
{
unsigned int vb;
unsigned int ib;
unsigned int texture;
};
I'd like to sort those structs by vb, ib and texture. I do it thise way for the moment :
// the function used by std::sort :
bool dataGreater(data * left, data * right)
{
if (left->vb > right->vb) return(true);
if (left->vb < right->vb) return(false);
if (left->ib > right->ib) return(true);
if (left->ib < right->ib) return(false);
if (left->texture > right->texture) return(true);
if (left->texture < right->texture) return(false);
}
// the std::vector is defined like that :
std::vector<data *> m_Data;
// I sort with this line :
std::sort(m_Data.begin(), m_Data.end(), dataGreater);