[Bf-blender-cvs] [fcaf81c] HMD_viewport: Moved updating the OpenHMD events in the ghost system to a GHOST_System base class wich get called by the derived for OS independent updating

TheOnlyJoey noreply at git.blender.org
Thu Mar 17 15:25:29 CET 2016


Commit: fcaf81cf2daa6907b0aed54d896608eced648b88
Author: TheOnlyJoey
Date:   Thu Mar 17 15:24:27 2016 +0100
Branches: HMD_viewport
https://developer.blender.org/rBfcaf81cf2daa6907b0aed54d896608eced648b88

Moved updating the OpenHMD events in the ghost system to a GHOST_System base class wich get called by the derived for OS independent updating

===================================================================

M	intern/ghost/intern/GHOST_System.cpp
M	intern/ghost/intern/GHOST_System.h
M	intern/ghost/intern/GHOST_SystemCocoa.mm
M	intern/ghost/intern/GHOST_SystemSDL.cpp
M	intern/ghost/intern/GHOST_SystemWin32.cpp
M	intern/ghost/intern/GHOST_SystemX11.cpp

===================================================================

diff --git a/intern/ghost/intern/GHOST_System.cpp b/intern/ghost/intern/GHOST_System.cpp
index 0d9a75d..24f61b6 100644
--- a/intern/ghost/intern/GHOST_System.cpp
+++ b/intern/ghost/intern/GHOST_System.cpp
@@ -214,6 +214,15 @@ bool GHOST_System::getFullScreen(void)
 	return fullScreen;
 }
 
+bool GHOST_System::processEvents(bool waitForEvent)
+{
+	bool anyProcessed = false;
+	if (m_openHMDManager->processEvents()) {
+			anyProcessed = true;
+	}
+
+	return anyProcessed;
+}
 
 void GHOST_System::dispatchEvents()
 {
diff --git a/intern/ghost/intern/GHOST_System.h b/intern/ghost/intern/GHOST_System.h
index 2656f9c..5912805 100644
--- a/intern/ghost/intern/GHOST_System.h
+++ b/intern/ghost/intern/GHOST_System.h
@@ -181,12 +181,10 @@ public:
 	 ***************************************************************************************/
 
 	/**
-	 * Inherited from GHOST_ISystem but left pure virtual
-	 *
-	 *  virtual bool processEvents(bool waitForEvent) = 0;
+	 * Implemented for operating system independent event handling
 	 */
 
-
+	virtual bool processEvents(bool waitForEvent);
 
 	/**
 	 * Dispatches all the events on the stack.
diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm
index 4db945d..01cce84 100644
--- a/intern/ghost/intern/GHOST_SystemCocoa.mm
+++ b/intern/ghost/intern/GHOST_SystemCocoa.mm
@@ -729,6 +729,9 @@ bool GHOST_SystemCocoa::processEvents(bool waitForEvent)
 			}
 
 			[pool drain];
+
+			/* Call base class to update os independent events */
+			GHOST_System::processEvents(false);
 		} while (event != nil);
 #if 0
 	} while (waitForEvent && !anyProcessed); // Needed only for timer implementation
diff --git a/intern/ghost/intern/GHOST_SystemSDL.cpp b/intern/ghost/intern/GHOST_SystemSDL.cpp
index e9768e4..b6d0703 100644
--- a/intern/ghost/intern/GHOST_SystemSDL.cpp
+++ b/intern/ghost/intern/GHOST_SystemSDL.cpp
@@ -596,6 +596,9 @@ GHOST_SystemSDL::processEvents(bool waitForEvent)
 		if (generateWindowExposeEvents()) {
 			anyProcessed = true;
 		}
+
+		/* Call base class to update os independent events */
+		GHOST_System::processEvents(false);
 	} while (waitForEvent && !anyProcessed);
 
 	return anyProcessed;
diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp
index d8ec827..0e232bf 100644
--- a/intern/ghost/intern/GHOST_SystemWin32.cpp
+++ b/intern/ghost/intern/GHOST_SystemWin32.cpp
@@ -298,6 +298,9 @@ bool GHOST_SystemWin32::processEvents(bool waitForEvent)
 			::DispatchMessageW(&msg);
 			anyProcessed = true;
 		}
+
+		/* Call base class to update os independent events */
+		GHOST_System::processEvents(false);
 	} while (waitForEvent && !anyProcessed);
 
 	return anyProcessed;
diff --git a/intern/ghost/intern/GHOST_SystemX11.cpp b/intern/ghost/intern/GHOST_SystemX11.cpp
index b0ba570..b4e0031 100644
--- a/intern/ghost/intern/GHOST_SystemX11.cpp
+++ b/intern/ghost/intern/GHOST_SystemX11.cpp
@@ -47,7 +47,6 @@
 #include "GHOST_EventWheel.h"
 #include "GHOST_DisplayManagerX11.h"
 #include "GHOST_EventDragnDrop.h"
-#include "GHOST_OpenHMDManager.h"
 #ifdef WITH_INPUT_NDOF
 #  include "GHOST_NDOFManagerUnix.h"
 #endif
@@ -598,10 +597,8 @@ processEvents(
 			anyProcessed = true;
 		}
 #endif
-        if (m_openHMDManager->processEvents()) {
-            anyProcessed = true;
-        }
-
+		/* Call base class to update os independent events */
+		GHOST_System::processEvents(false);
 	} while (waitForEvent && !anyProcessed);
 
 	return anyProcessed;




More information about the Bf-blender-cvs mailing list