Added errors checks but there are no error correction, If it fails your won't have any overlay at all.
Warning: DX9 doesn't support resizing (TODO), DX12 has not beed tested and is not finished. No OpenGL support for now.