Solved
ovr_CreateTextureSwapChainDX Fails with code -1004
I'm not sure what's going on. My engine worked flawlessly for a long time. Then all of a sudden it won't initialize the Rift. It fails on ovr_CreateTextureSwapChainDX with -1004 (ovrError_NotInitialized). However, I previously called ovr_Initialize and ovr_Create which both succeeded. I also passed a swap chain structure and device to ovr_CreateTextureSwapChainDX. I'm using DX11. Here's some code to show what I'm passing:
texture_swap_chain_desc.Type = ovrTexture_2D;
texture_swap_chain_desc.ArraySize = 1;
texture_swap_chain_desc.Format = OVR_FORMAT_R8G8B8A8_UNORM_SRGB;
texture_swap_chain_desc.Width = buffer_size.w;
texture_swap_chain_desc.Height = buffer_size.h;
texture_swap_chain_desc.MipLevels = 1;
texture_swap_chain_desc.SampleCount = 1;
texture_swap_chain_desc.StaticImage = ovrFalse;
texture_swap_chain_desc.MiscFlags = ovrTextureMisc_DX_Typeless;
texture_swap_chain_desc.BindFlags = ovrTextureBind_DX_RenderTarget;
I've inspected the buffer_size, and it appears to hold valid values. I'm also using a DK2, but that's not been an issue. 3rd party applications run fine, so this seems to just be my program.
Forgot to mention, I'm also using the latest SDK 1.8.0 now.
Forgot to mention, I'm also using the latest SDK 1.8.0 now.
