47 #ifndef vtkStateStorage_h
48 #define vtkStateStorage_h
50 #include "vtkRenderingOpenGL2Module.h"
55 #ifndef NDEBUG // a debug implementation
64 this->Storage.clear();
65 this->StorageOffsets.clear();
66 this->StorageNames.clear();
71 void Append(
const T &
value,
const char *
name);
75 this->WhatWasDifferent =
"";
76 if (this->Storage.size() != b.
Storage.size())
78 this->WhatWasDifferent =
"Different state sizes";
81 for (
size_t i = 0; i < this->Storage.size(); ++i)
83 if (this->Storage[i] != b.
Storage[i])
86 while (this->StorageOffsets.size() > block + 1 && this->StorageOffsets[block+1] >= i)
90 this->WhatWasDifferent = this->StorageNames[block] +
" was different";
119 const char *start = reinterpret_cast<const char *>(&
value);
120 this->
Storage.insert(this->
Storage.end(), start, start +
sizeof(T));
123 #else // release implementation
131 void Clear() { this->Storage.clear(); }
135 void Append(
const T &
value,
const char *
name);
138 return this->Storage != b.
Storage;
147 std::vector<unsigned char> Storage;
156 const char *start = reinterpret_cast<const char *>(&
value);
157 this->
Storage.insert(this->
Storage.end(), start, start +
sizeof(T));
160 #endif // Release implementation
162 #endif // vtkStateStorage_h