Move opengl loader into a seperate static library, so plugins can use it
Flush after logging
Add copy_texture_region function