Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
Vic3Dexe's avatar
Vic3Dexe
Honored Guest
11 years ago

Win32/GL ovrHmd_ConfigureRendering crash


#define SDK_RENDER 1

HDC dc;
HWND WndHandle;
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
ovr_Initialize();
hmd = ovrHmd_Create(0);

//... creating window/context, it working itself

ovrGLConfig cfg;
cfg.OGL.Header.API = ovrRenderAPI_OpenGL;
cfg.OGL.Header.RTSize = OVR::Sizei(hmd->Resolution.w,hmd->Resolution.h);
cfg.OGL.Header.Multisample = 0;
cfg.OGL.Window = WndHandle;
cfg.OGL.DC = dc;

ovrFovPort eyeFov[2] = {hmd->DefaultEyeFov[0],hmd->DefaultEyeFov[1]};
ovrEyeRenderDesc EyeRenderDesc[2];
ovrHmd_ConfigureRendering(hmd,&cfg.Config,
ovrDistortionCap_Chromatic|ovrDistortionCap_TimeWarp|ovrDistortionCap_Overdrive,
eyeFov,EyeRenderDesc); //<--------- crash, stack fault, C000005 (access violation)
...
}

What am I doing wrong?
Can't find solution neither in 'oculus_developer_guide.pdf' nor in samples (they for D3D11 mostly).
ovrHmd_AttachToWindow(hmd,WndHandle,0,0) - not helping.

14 Replies