Setting up sorting order at runtime
Hi
I manage to set the sorting order of my shape all fine when I play with the demo parameters
Then I would like to set that SortingOrder parameter at runtime
and Draw.sortingOrder doesn't exist.
What should I do ?
cheers
ps:
Also, am I using the documentation wrong ?
I find myself digging in the sample and library code all the time to try and
find things
ex:
it took me a while to come up with things like
Draw.StencilComp = CompareFunction.Less;
Draw.StencilOpPass = StencilOp.Keep;
Draw.StencilRefID = 0;
Draw.StencilReadMask = 255;Draw.StencilWriteMask = 255;
Draw.X is for the immediate mode API, and sorting order doesn't exist in immediate mode due to the nature of how the draw calls are processed, as outlined here.
In immediate mode, the draw order is always the order in which you execute the Draw.X commands. If you want to be able to draw in any order, you'll have to use the opaque blend mode, since they make use of the depth buffer to ensure sorting is correct