What parts of the transform get reset in the draw loop? Does the matrix stack get reset?

Asking because this wasn’t clear in the reference. I thought that the entire matrix stack was discarded, but I ran into the cannot push more than 32 time error. Are the translate, rotate, and scale the only things that are reset? What about the styling?

Hi @LordXerus,

It only resets the current transformation matrix, not the transformation stack. Means you have to take care and use push and pop transformation matrices carefully.

Style will be handled a bit different. It will also not resetted but expanded and not stops at a depth of 32.

Cheers
---- mnse

4 Likes

Good answer.

pushMatrix();

...

popMatrix();

must always come as a pair

1 Like

What does style being expanded mean?

1 Like

See here…

Reference: expand

To be more concrete. The stack which is used to store the current style properties by pushStyle() is expanded and not limited by 32 elements as the stack which is used for pushMatrix().

Cheers
—mnse

1 Like

Hello @LordXerus,

Reference was already provided.

You can see where it is used in the source code:

I often check the source to see what is going on under the hood.

:)

1 Like