restore state

Hi
if I draw in my x-plane plugin I destroy anything else. My stuff looks ok but how to restore the original state?
Thanks

Ehm, what? You’ve got a plugin and you destroy anything else? How is that even possible? And what state? Program state? GL state? Could you please be a little more verbose?