Using Graphics2D direct transforms have issues that it can seriously damage the whole screen graphics if transforms are misused or in failure because it shares the peer-transform. As in fact I don't have much to conceal between both methods, either choose Graphisc2D or AffineTransform to your fit. I DO prefer making AffineTransform on singular drawImage() callbacks.

What must be clear is the context of the matricial transform, that is if running from the peer graphics, (i.e. g.translate() , g.rot..) ensure to store the original context and translate correctly, because you have to restore the original state after making your painting as follows to getTransform() <-> setTransform(). Whenever an exception occurs between getTransform() <-> setTransform() you have to catch it and restore back with setTransform(toTheoriginalContextMatrixTransform). ...

Ah, well that makes sense. Coming from an OpenGL background, I'm used to worrying about not corrupting the matrix and being smart about glPushMatrix, glPopMatrix, and glLoadIdentity. So it doesn't seem unusual to me to have to transform back afterwards.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org