void CShaderArray::SortShaders() { CPtrArray aux; int i,icount; int j,jcount; CShader *pSort; const char *sSort; // dumb sort .. would it ever grow big enough so we would have to do something clever? noooo icount = CPtrArray::GetSize(); for( i = 0; i < icount ; i++ ) { pSort = static_cast<CShader *>(GetAt(i)); sSort = pSort->getName(); jcount = aux.GetSize(); for( j = 0; j < jcount ; j++ ) { if (strcmp(sSort, static_cast<CShader *>(aux.GetAt(j))->getName()) < 0) break; } aux.InsertAt(j, pSort); } CPtrArray::RemoveAll(); CPtrArray::InsertAt(0, &aux); }