# HG changeset patch # User John Tsiombikas # Date 1421212271 -7200 # Node ID 1a832e88854abf983bdbc8d6555a4cca51702404 # Parent 64089dd45d50ebed28c6f71461be212675485377 now also works on linux with 0.4.4 diff -r 64089dd45d50 -r 1a832e88854a src/main.c --- a/src/main.c Sun Jan 11 19:03:30 2015 +0200 +++ b/src/main.c Wed Jan 14 07:11:11 2015 +0200 @@ -158,7 +158,6 @@ glcfg.OGL.DC = wglGetCurrentDC(); #else glcfg.OGL.Disp = glXGetCurrentDisplay(); - glcfg.OGL.Win = glXGetCurrentDrawable(); #endif if(hmd->HmdCaps & ovrHmdCap_ExtendDesktop) { @@ -171,7 +170,7 @@ #ifdef WIN32 ovrHmd_AttachToWindow(hmd, glcfg.OGL.Window, 0, 0); #else - ovrHmd_AttachToWindow(hmd, (void*)glcfg.OGL.Win, 0, 0); + ovrHmd_AttachToWindow(hmd, (void*)glXGetCurrentDrawable(), 0, 0); #endif printf("running in \"direct-hmd\" mode\n"); } @@ -233,8 +232,8 @@ /* on linux for now we have to deal with screen rotation during rendering. The docs are promoting * not rotating the DK2 screen globally */ - glcfg.OGL.Header.RTSize.w = hmd->Resolution.h; - glcfg.OGL.Header.RTSize.h = hmd->Resolution.w; + glcfg.OGL.Header.BackBufferSize.w = hmd->Resolution.h; + glcfg.OGL.Header.BackBufferSize.h = hmd->Resolution.w; distort_caps |= ovrDistortionCap_LinuxDevFullscreen; ovrHmd_ConfigureRendering(hmd, &glcfg.Config, distort_caps, hmd->DefaultEyeFov, eye_rdesc); @@ -245,7 +244,7 @@ SDL_SetWindowPosition(win, prev_x, prev_y); #ifdef OVR_OS_LINUX - glcfg.OGL.Header.RTSize = hmd->Resolution; + glcfg.OGL.Header.BackBufferSize = hmd->Resolution; distort_caps &= ~ovrDistortionCap_LinuxDevFullscreen; ovrHmd_ConfigureRendering(hmd, &glcfg.Config, distort_caps, hmd->DefaultEyeFov, eye_rdesc);