Enable toggling use of doublebuffering for camera and time

This commit is contained in:
Erik Broberg
2016-09-13 11:52:54 -04:00
parent 5cb6d2cb05
commit d287b08c51
7 changed files with 51 additions and 15 deletions
+17 -2
View File
@@ -121,7 +121,23 @@ namespace openspace {
// Synchronization
void serialize(SyncBuffer* syncBuffer);
void deserialize(SyncBuffer* syncBuffer);
/**
* Updates camera variables from data in syncbuffer. If \param useDoubleBuffering is
* false, values will be written directly into the camera state, overwriting any
* previous values.
* If \param useDoubleBuffering is true, values will be written and stored in local
* copies, keeping the state unchanged until <code>updateDoubleBuffer</code> has
* been called.
*/
void deserialize(SyncBuffer* syncBuffer, bool useDoubleBuffering);
/**
* This method should be called from the SGCT postSynchronization stage if and only
* if method <code>deserialize</code> has previously been called with the argument
* useDoubleBuffering set to true.
*/
void updateDoubleBuffer();
void serialize(std::ostream& os) const;
void deserialize(std::istream& is);
@@ -176,7 +192,6 @@ namespace openspace {
[[deprecated("Replaced by Camera::SgctInternal::viewProjectionMatrix()")]]
const glm::mat4& viewProjectionMatrix() const;
void updateDoubleBuffer();
private:
struct SyncData {
+15 -1
View File
@@ -181,7 +181,16 @@ public:
void serialize(SyncBuffer* syncBuffer);
void deserialize(SyncBuffer* syncBuffer);
/**
* Updates time variables from data in syncbuffer. If \param useDoubleBuffering is
* false, values will be written directly into the time state, overwriting any
* previous values.
* If \param useDoubleBuffering is true, values will be written and stored in local
* copies, keeping the time state unchanged until <code>updateDoubleBuffer</code> has
* been called.
*/
void deserialize(SyncBuffer* syncBuffer, bool useDoubleBuffering);
bool timeJumped() const;
@@ -189,6 +198,11 @@ public:
bool paused() const;
/**
* This method should be called from the SGCT postSynchronization stage if and only
* if method <code>deserialize</code> has previously been called with the argument
* useDoubleBuffering set to true.
*/
void updateDoubleBuffer();
/**