5 minutes ago, matt77hias said:And what if you use an object which maps on construction and unmaps on destruction?
I thought about that and I don't like that solution, because now the destructor needs to reference the graphics device, and I must still call the destructor before the draw manually in most cases (by a dummy scope for example). Calling a function explicitly is more self documenting.