Faulty Documentation: Misleading Comment and Pointless Settings in Layer Code
In the current documentation there are the following lines of code:
// Display all of the HUD texture.
hudLayer.Viewport.Pos.x = 0.0f;
hudLayer.Viewport.Pos.y = 0.0f;
hudLayer.Viewport.Size.w = 1.0f;
hudLayer.Viewport.Size.h = 1.0f;The comment gave me the impression, that some kind of UV mapping is done here. I wanted to view all of my texture, too. So this seems correct. After spending much painful time, I realized that the size is supposed to be the pixels and that's not a UV mapping. The corrected lines should be like this:
ID3D11Texture2D* tex = nullptr;
ovr_GetTextureSwapChainBufferDX(Session, TheHudTextureSwapChain, 0, IID_PPV_ARGS(&tex));
D3D11_TEXTURE2D_DESC desc;
tex->GetDesc(&desc);
// Display all of the HUD texture.
hudLayer.Viewport.Pos.x = 0.0f;
hudLayer.Viewport.Pos.y = 0.0f;
hudLayer.Viewport.Size.w = desc.Width;
hudLayer.Viewport.Size.h = desc.Height;Or you correct the comment:
// Displays only the first pixel of the HUD texture:
hudLayer.Viewport.Pos.x = 0.0f;
hudLayer.Viewport.Pos.y = 0.0f;
hudLayer.Viewport.Size.w = 1.0f;
hudLayer.Viewport.Size.h = 1.0f;The sample "Direct Quad" did it right, but there are developers who actually read the documentation... I would like to end with a citation of another user: "just a bit frustrating seeing a 2 billion $ funding not being able to test the very simplest of Documentation leading to developers sometimes loosing weeks"