1
Feature requests / Sending 3D Vector to Sprite's Position
« on: April 17, 2010, 05:38:53 am »
You could do this with STL rather easily.
That is, if you're using C++. This won't be available in C.
Code: [Select]
struct depthdrawable
{
sf::Drawable* todraw;
int depth;
};
int sortdepth(depthdrawable x, depthdrawable y)
{
if (x.depth==y.depth)
{
return 0;
}
else if (x.depth<y.depth)
{
return -1;
}
else
{
return 1;
}
}
// other code
std::list<depthdrawable> draw;
// pretend that I add stuff to that
draw.sort(sortdepth);
That is, if you're using C++. This won't be available in C.