diff options
author | Travis CI <zmoelnig@travis-ci.umlaeute.mur.at> | 2015-10-08 08:47:46 +0000 |
---|---|---|
committer | Travis CI <zmoelnig@travis-ci.umlaeute.mur.at> | 2015-10-08 08:47:46 +0000 |
commit | 2c44164418368a684437d2374ef1e9f0931f7a66 (patch) | |
tree | 1777d4d3d40af82daf55f034bbac63ee0ed5e99b /Gem/develop/include | |
parent | 710af9daabfe1936cca248f1d9416f861bbe96e6 (diff) |
Gem a4d9bc89797fec9b1b4f0278431e3d30315b414c osx/i386
built 'master:a4d9bc89797fec9b1b4f0278431e3d30315b414c' for osx/i386
Diffstat (limited to 'Gem/develop/include')
-rw-r--r-- | Gem/develop/include/Gem/Gem/ContextData.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/Gem/develop/include/Gem/Gem/ContextData.h b/Gem/develop/include/Gem/Gem/ContextData.h index 74804da..94f51b3 100644 --- a/Gem/develop/include/Gem/Gem/ContextData.h +++ b/Gem/develop/include/Gem/Gem/ContextData.h @@ -53,6 +53,7 @@ template<class ContextDataType = int> ////////// // Constructor + /* coverity[uninit_member] we track the un-initialization ourselves */ ContextData(void) : m_haveDefaultValue(false) {;} ContextData(ContextDataType v) : m_haveDefaultValue(true), m_defaultValue(v) {;} @@ -66,9 +67,9 @@ template<class ContextDataType = int> * * @usage ContextData<GLenum>m_fun; m_fun=GL_FUNC_ADD; * - * @pre We are in a draw process. + * @pre We have a valid context. * @note Should only be called from the draw function. - * Results are un-defined for other functions. + * Results are un-defined if there is no valid context */ virtual operator ContextDataType() { @@ -78,17 +79,19 @@ template<class ContextDataType = int> /** * assigns a value to the correct context * - * @pre We are in a draw process. + * @pre We have a valid context. * @note Should only be called from the draw function. - * Results are un-defined for other functions. + * Results are un-defined if there is no valid context */ virtual ContextDataType&operator = (ContextDataType value) { /* simplistic approach to handle out-of-context assignments: * assign the value to all context instances + * and use it as default value for future contexts */ if(INVALID_CONTEXT==getCurContext()) { doSetAll(value); + m_defaultValue=value; m_haveDefaultValue=true; } return (*getPtrToCur()=value); @@ -120,7 +123,7 @@ template<class ContextDataType = int> /** * Returns a pointer to the correct data element in the current context. * - * @pre We are in the draw function. + * @pre We have a valid context. * @post Synchronized. * @note ASSERT: Same context is rendered by same thread each time. */ |