Forum Discussion
caspercasper
11 years agoHonored Guest
Switch Rendering on/off several times
Hello there,
i do have a very basic console application which should create, do some rendering and shutdown an hmd on key press - and then start do it again. This happens in a extra thread.
This works fine for the first time, but afterwards i only see the mirrored window, but the oculus itself stays black.
I create the oculus with
Does anyone of you know may have experience with that?
Thanks in advance!
i do have a very basic console application which should create, do some rendering and shutdown an hmd on key press - and then start do it again. This happens in a extra thread.
This works fine for the first time, but afterwards i only see the mirrored window, but the oculus itself stays black.
I create the oculus with
ovr_Initiliaze();
ovrHmd_Create(0);
..do rendering..
ovrHmd_ConfigureRendering(hmd, NULL, 0, NULL, NULL);
ovr_AttachToWindow(hmd, NULL, NULL, NULL);
ovrHmd_Destroy(hmd);
Does anyone of you know may have experience with that?
Thanks in advance!
6 Replies
- cyberealityGrand ChampionWhat API (i.e. DirectX version or OpenGL) and OS platform are you on?
- caspercasperHonored GuestI'm using D3D11 on Windows 7/8.1 and the Oculus SDK 0.5.
Furthermore: when destroying the HMD, i also release all buffers necessary to do the rendering and create them again when i need them.
Is it even possible to create/destroy the hmd several times during the runtime of one application? - cyberealityGrand ChampionAny reason you are using such an old SDK?
- caspercasperHonored GuestWell it's not that old :?
And i had some prolems with 0.6, so i decided to step back - cyberealityGrand ChampionWell, I would advice not using the old SDK, but that may not even be your issue.
Looking at your code sample, and the comments in the SDK, I found this./// Upon success the returned ovrHmd* must be freed with ovrHmd_Destroy.
/// A second call to ovrHmd_Create or ovrHmd_CreateDebug with the same index as
/// a previously successful call will result in an error return value if the
/// previous Hmd has not been destroyed.
So I think you need to call it like this:ovr_Initialize(nullptr);
ovrHmd HMD;
ovrHmd_Create(0, &HMD);
...
ovrHmd_Destroy(HMD); - caspercasperHonored GuestBut this is exactly what i do. I do have a new hmd as soon as i start the next iteration. But still, after creating a new hmd the oculus stays black. :(
BTW.: Using the extended mode works perfectly, just direct to rift mode seems to have this problem. So i assume that the problem is somewhere around ovrHmd_AttachToWindow().
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 2 years ago
- 3 years ago
- 7 months ago