Code for DirectX samples and helper functions