render: split buffer swap into a separate function.

This will allow for drawing additional stuff over rendered world.
Particular use case is UI.