Skip to content

Commit

Permalink
Windows|Oculus Rift: Updated linker options, added ATL dependency
Browse files Browse the repository at this point in the history
LibOVR 0.4.1 has a dependency on ATL, which is no longer provided with
VS 2013 Express.
  • Loading branch information
skyjake committed Aug 26, 2014
1 parent e013bdc commit 30dd561
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
9 changes: 9 additions & 0 deletions doomsday/dep_atl.pri
@@ -0,0 +1,9 @@
# Build configuration for ATL.
win32 {
isEmpty(ATL_LIB_DIR) {
error("dep_atl: Active Template Library (ATL) lib path not defined, check your config_user.pri (ATL_LIB_DIR)")
}

# Windows.
LIBS += -L$$ATL_LIB_DIR
}
9 changes: 6 additions & 3 deletions doomsday/dep_ovr.pri
Expand Up @@ -3,9 +3,13 @@
exists($${LIBOVR_DIR}/Include/OVR.h) {
INCLUDEPATH += $${LIBOVR_DIR}/Include
win32 {
LIBS += $${LIBOVR_DIR}/Lib/Win32/libovr.lib
include(dep_atl.pri)

deng_debug: LIBS += $${LIBOVR_DIR}/Lib/Win32/VS2013/libovrd.lib
else: LIBS += $${LIBOVR_DIR}/Lib/Win32/VS2013/libovr.lib

# Additional windows libraries needed to avoid link errors when using Rift
LIBS += shell32.lib winmm.lib
LIBS += shell32.lib winmm.lib ws2_32.lib
}
macx {
deng_debug: LIBS += $${LIBOVR_DIR}/Lib/Mac/Debug/libovr.a
Expand All @@ -25,7 +29,6 @@ exists($${LIBOVR_DIR}/Include/OVR.h) {
LIBS += -lX11 -ludev -lXinerama
}
DEFINES += DENG_HAVE_OCULUS_API
# message("Found Oculus Rift SDK")
} else {
# message("Oculus Rift SDK not found")
}
8 changes: 2 additions & 6 deletions doomsday/libappfw/src/vr/oculusrift.cpp
Expand Up @@ -241,8 +241,8 @@ DENG2_PIMPL(OculusRift)
cfg.OGL.Header.RTSize = hmd->Resolution;
cfg.OGL.Header.Multisample = buf.sampleCount();
#ifdef WIN32
cfg.OGL.Window = window->nativeHandle();
//cfg.OGL.DC = dc;
cfg.OGL.Window = (HWND) window->nativeHandle();
cfg.OGL.DC = NULL;
#endif
if(!ovrHmd_ConfigureRendering(hmd, &cfg.Config, distortionCaps, fov, render))
{
Expand All @@ -267,11 +267,7 @@ DENG2_PIMPL(OculusRift)
<< render[i].ViewAdjust.z;
}*/

#ifdef WIN32
ovrHmd_AttachToWindow(hmd, (HWND) window->nativeHandle(), NULL, NULL);
#else
ovrHmd_AttachToWindow(hmd, window->nativeHandle(), NULL, NULL);
#endif

/*
float clearColor[4] = { 0.0f, 0.5f, 1.0f, 0.0f };
Expand Down

0 comments on commit 30dd561

Please sign in to comment.