tex update lock, VisualData"Re"Distributor

This commit is contained in:
Charles J. Cliffe
2015-09-10 21:48:18 -04:00
parent 4301d0d434
commit 0a6d409065
5 changed files with 31 additions and 4 deletions
+5 -1
View File
@@ -99,6 +99,7 @@ void WaterfallCanvas::processInputQueue() {
if (linesPerSecond) {
if (lpsIndex >= targetVis) {
tex_update.lock();
while (lpsIndex >= targetVis) {
SpectrumVisualData *vData;
if (!visualDataQueue.empty()) {
@@ -115,6 +116,7 @@ void WaterfallCanvas::processInputQueue() {
break;
}
}
tex_update.unlock();
}
}
if (processed) {
@@ -235,7 +237,9 @@ void WaterfallCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) {
glContext->BeginDraw(0,0,0);
waterfallPanel.calcTransform(CubicVR::mat4::identity());
tex_update.lock();
waterfallPanel.draw();
tex_update.unlock();
std::vector<DemodulatorInstance *> &demods = wxGetApp().getDemodMgr().getDemodulators();
@@ -314,7 +318,7 @@ void WaterfallCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) {
glContext->EndDraw();
glFlush();
// glFlush();
SwapBuffers();
}
+1
View File
@@ -72,6 +72,7 @@ private:
Timer gTimer, testTimer;
double lpsIndex;
bool preBuf;
std::mutex tex_update;
// event table
wxDECLARE_EVENT_TABLE();
};