aboutsummaryrefslogtreecommitdiffstats
path: root/LibOVR/Src/Kernel
diff options
context:
space:
mode:
authorBrad Davis <[email protected]>2014-08-11 21:18:59 -0700
committerBrad Davis <[email protected]>2014-08-11 21:18:59 -0700
commit04a03e83f135fbfccbc960b13e05729490ccd375 (patch)
tree7878b192a3fd24eb69f54744dc17f44f53b0ac1a /LibOVR/Src/Kernel
parent0f49ce8fc6aa54224e4c0d6fda8c4527ad39cce1 (diff)
Adding 0.4.1 windows files
Diffstat (limited to 'LibOVR/Src/Kernel')
-rw-r--r--LibOVR/Src/Kernel/OVR_System.cpp38
-rw-r--r--LibOVR/Src/Kernel/OVR_System.h2
2 files changed, 21 insertions, 19 deletions
diff --git a/LibOVR/Src/Kernel/OVR_System.cpp b/LibOVR/Src/Kernel/OVR_System.cpp
index 8d5d201..8fb93b5 100644
--- a/LibOVR/Src/Kernel/OVR_System.cpp
+++ b/LibOVR/Src/Kernel/OVR_System.cpp
@@ -35,6 +35,7 @@ limitations under the License.
namespace OVR {
+extern bool anyRiftsInExtendedMode();
// Stack of destroy listeners (push/pop semantics)
static SystemSingletonInternal *SystemShutdownListenerStack = 0;
@@ -49,17 +50,12 @@ void SystemSingletonInternal::PushDestroyCallbacks()
SystemShutdownListenerStack = this;
}
-
-// Initializes System core, installing allocator.
-void System::Init(Log* log, Allocator *palloc)
+void System::DirectDisplayInitialize()
{
- if (!Allocator::GetInstance())
- {
- Log::SetGlobalLog(log);
- Timer::initializeTimerSystem();
- Allocator::setInstance(palloc);
- Display::Initialize();
#ifdef OVR_OS_WIN32
+ // Set up display code for Windows
+ Win32::DisplayShim::GetInstance();
+
// This code will look for the first display. If it's a display
// that's extending the destkop, the code will assume we're in
// compatibility mode. Compatibility mode prevents shim loading
@@ -68,19 +64,23 @@ void System::Init(Log* log, Allocator *palloc)
// we load the shim so we can render to it.
// If no display is available, we revert to whatever the
// driver tells us we're in
- Ptr<DisplaySearchHandle> searchHandle = *Display::GetDisplaySearchHandle();
- Ptr<Display> pDisplay = NULL;
- if (Display::GetDisplayCount(searchHandle) > 0)
- {
- pDisplay = Display::GetDisplay(0, searchHandle);
+ bool anyExtendedRifts = anyRiftsInExtendedMode() || Display::InCompatibilityMode( false );
+
+ Win32::DisplayShim::GetInstance().Initialize(anyExtendedRifts);
+#endif
}
- if( pDisplay == NULL )
- Win32::DisplayShim::GetInstance().Initialize(Display::InCompatibilityMode());
- else
- Win32::DisplayShim::GetInstance().Initialize(!pDisplay->ApplicationExclusive);
-#endif
+// Initializes System core, installing allocator.
+void System::Init(Log* log, Allocator *palloc)
+{
+ if (!Allocator::GetInstance())
+ {
+ Log::SetGlobalLog(log);
+ Timer::initializeTimerSystem();
+ Allocator::setInstance(palloc);
+ Display::Initialize();
+ DirectDisplayInitialize();
}
else
{
diff --git a/LibOVR/Src/Kernel/OVR_System.h b/LibOVR/Src/Kernel/OVR_System.h
index a85cd49..3bc2254 100644
--- a/LibOVR/Src/Kernel/OVR_System.h
+++ b/LibOVR/Src/Kernel/OVR_System.h
@@ -151,6 +151,8 @@ public:
Destroy();
}
+ static void OVR_CDECL DirectDisplayInitialize();
+
// Returns 'true' if system was properly initialized.
static bool OVR_CDECL IsInitialized();