Drawing Order

This is an old ar­ti­cle from 2012. I was a kid. I learned a lot since then, so please do think twice when tak­ing ad­vice from me as a kid.

I re­al­ly want to im­ple­ment draw­ing or­der in my node based graph­ics en­gine in vs­ge.

Node based mean­ing, that I ac­tu­al­ly have a node­tree, each node con­tain­ing a point­er to the par­ent and a chil­dren list. This means that each node han­dles draw­ing of the chil­dren, so the graph­ics en­gine on­ly calls the base draw­ing func­tion (which draws its chil­dren, which draw their chil­dren).

Now back to draw­ing or­der. If I don’t use the z-Buf­fer which isn’t sup­port­ed by al­le­gro it­self, there­fore re­quires a lot of weird work wit openGL and I wouldn’t be able to use the al­le­gro blit­ting func­tions with it.

My idea was to cre­ate a list out of the node­tree and sort it by a z-co­or­di­nate. I would have to do that ev­ery frame though, which can’t be good for per­for­mance.

This post was im­port­ed from tum­blr

Tumblr

Archived blog posts from squareys.tum­blr.com.