[Bf-blender-cvs] [5eb9a08] soc-2014-viewport_fx: Update of GHOST_ContextNone so that functions recently added to the interface have dummy implementations that are no-ops but still "succeed" at doing nothing (the defaults in GHOST_Context "fail" to do nothing)

Jason Wilkins noreply at git.blender.org
Wed Jun 25 23:42:40 CEST 2014


Commit: 5eb9a088fd4c05ce20199e33657b6e3526bedf14
Author: Jason Wilkins
Date:   Wed Jun 25 09:17:59 2014 -0500
https://developer.blender.org/rB5eb9a088fd4c05ce20199e33657b6e3526bedf14

Update of GHOST_ContextNone so that functions recently added to the interface have dummy implementations that are no-ops but still "succeed" at doing nothing (the defaults in GHOST_Context "fail" to do nothing)

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

M	intern/ghost/intern/GHOST_ContextNone.cpp
M	intern/ghost/intern/GHOST_ContextNone.h

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

diff --git a/intern/ghost/intern/GHOST_ContextNone.cpp b/intern/ghost/intern/GHOST_ContextNone.cpp
index 2aea930..cbdd3a1 100644
--- a/intern/ghost/intern/GHOST_ContextNone.cpp
+++ b/intern/ghost/intern/GHOST_ContextNone.cpp
@@ -48,7 +48,14 @@ GHOST_TSuccess GHOST_ContextNone::activateDrawingContext()
 
 
 
-GHOST_TSuccess GHOST_ContextNone::initializeDrawingContext(bool, GHOST_TUns16)
+GHOST_TSuccess GHOST_ContextNone::updateDrawingContext()
+{
+	return GHOST_kSuccess;
+}
+
+
+
+GHOST_TSuccess GHOST_ContextNone::initializeDrawingContext()
 {
 	return GHOST_kSuccess;
 }
@@ -58,4 +65,20 @@ GHOST_TSuccess GHOST_ContextNone::initializeDrawingContext(bool, GHOST_TUns16)
 GHOST_TSuccess GHOST_ContextNone::releaseNativeHandles()
 {
 	return GHOST_kSuccess;
-}
\ No newline at end of file
+}
+
+
+
+GHOST_TSuccess GHOST_ContextNone::setSwapInterval(int interval)
+{
+	m_swapInterval = interval;
+
+	return GHOST_kSuccess;
+}
+
+
+
+int GHOST_ContextNone::getSwapInterval()
+{
+	return m_swapInterval;
+}
diff --git a/intern/ghost/intern/GHOST_ContextNone.h b/intern/ghost/intern/GHOST_ContextNone.h
index 1f5a89d..a6c7bb6 100644
--- a/intern/ghost/intern/GHOST_ContextNone.h
+++ b/intern/ghost/intern/GHOST_ContextNone.h
@@ -40,6 +40,12 @@
 class GHOST_ContextNone : public GHOST_Context
 {
 public:
+
+	GHOST_ContextNone(bool stereoVisual, GHOST_TUns16 numOfAASamples)
+		: GHOST_Context(stereoVisual, numOfAASamples)
+		, m_swapInterval(1)
+	{}
+
 	/**
 	 * Dummy function
 	 * \return  Always succeeds
@@ -54,17 +60,36 @@ public:
 
 	/**
 	 * Dummy function
-	 * \param stereoVisual		ignored
-	 * \param numOfAASamples	ignored
 	 * \return Always succeeds
 	 */
-	virtual GHOST_TSuccess initializeDrawingContext(bool = false, GHOST_TUns16 = 0);
+	virtual GHOST_TSuccess updateDrawingContext();
 
 	/**
 	 * Dummy function
 	 * \return Always succeeds
 	 */
-	GHOST_TSuccess releaseNativeHandles();
+	virtual GHOST_TSuccess initializeDrawingContext();
+
+	/**
+	 * Dummy function
+	 * \return Always succeeds
+	 */
+	virtual GHOST_TSuccess releaseNativeHandles();
+
+	/**
+	 * Dummy function
+	 * \return Always succeeds
+	 */
+	virtual GHOST_TSuccess setSwapInterval(int interval);
+
+	/**
+	 * Dummy function
+	 * \return Whatever was set by setSwapInterval
+	 */
+	virtual int getSwapInterval();
+
+private:
+	int m_swapInterval;
 };




More information about the Bf-blender-cvs mailing list