Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualKnolanCross

Posted 14 November 2012 - 05:27 PM

"Yes you can!"

If it is a STL vector (the one that comes by default), you should use the sort function from algorithm. Here is some documentation:
http://www.cplusplus.com/reference/algorithm/sort/

On the rendering, I don't know how Direct3D works, so I can't really help. I
If you render every object every frame, just render every element of your objects vector and you should be fine.

EDIT: Didn't see that you said you are using CPP, corrected some info.

#3KnolanCross

Posted 14 November 2012 - 05:26 PM

If it is a STL vector (the one that comes by default), you should use the sort function from algorithm. Here is some documentation:
http://www.cplusplus.com/reference/algorithm/sort/

On the rendering, I don't know how Direct3D works, so I can't really help. I
If you render every object every frame, just render every element of your objects vector and you should be fine.

EDIT: Didn't see that you said you are using CPP, corrected some info.

#2KnolanCross

Posted 14 November 2012 - 05:26 PM

If it is a STL vector (the one that comes by default), you should use the sort function from algorithm. Here is some documentation:
http://www.cplusplus.com/reference/algorithm/sort/

On the rendering, I don't know how Direct3D works, so I can't really help. I
If you render every object every frame, just render every element of your objects vector and you should be fine.

EDIT: Didn't see that you said you are using CPP, corrected some info.

#1KnolanCross

Posted 14 November 2012 - 05:25 PM

If it is a STL vector (the one that comes by default), you should use the sort function from algorithm. Here is some documentation:
http://www.cplusplus.com/reference/algorithm/sort/

Even if the vector of the language you are using is no mutable, you can simply create a new vector with ordered elements.

On the rendering, I don't know how Direct3D works, so I can't really help. I
If you render every object every frame, just render every element of your objects vector and you should be fine.

PARTNERS