LunchMarble
LunchMarble

Reputation: 5141

Draw order sorting in opengl

I have an orthographic projection, and I am drawing sprites. The problem is that the sprites appear in the order drawn in OpenGL. I would like to assign a Z value to them, and have them draw in a sorted Z order. How can I achieve this?

Upvotes: 2

Views: 941

Answers (1)

Nicol Bolas
Nicol Bolas

Reputation: 473447

Sort them and then draw them in that order. There's really no need to go any further than that. Just stick them all in a data structure, sort them, and draw them in that order.

Upvotes: 4

Related Questions