|
|
@ -41,6 +41,7 @@ void GLWidget::initializeGL() { |
|
|
|
glClearDepth(1); |
|
|
|
glClearDepth(1); |
|
|
|
glClearColor(.15, .15, .15, 1); |
|
|
|
glClearColor(.15, .15, .15, 1); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
simulation->semaphore.acquire(); |
|
|
|
uploadStaticDataToGPU(); |
|
|
|
uploadStaticDataToGPU(); |
|
|
|
|
|
|
|
|
|
|
|
overlay->init(); |
|
|
|
overlay->init(); |
|
|
@ -180,7 +181,7 @@ void GLWidget::uploadStaticDataToGPU() { |
|
|
|
|
|
|
|
|
|
|
|
glBindVertexArray(0); |
|
|
|
glBindVertexArray(0); |
|
|
|
|
|
|
|
|
|
|
|
simulation->pendulaMutex.unlock(); |
|
|
|
simulation->semaphore.release(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void GLWidget::changePosition() { |
|
|
|
void GLWidget::changePosition() { |
|
|
@ -196,7 +197,7 @@ void GLWidget::changePosition() { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
glUnmapBuffer(GL_ARRAY_BUFFER); |
|
|
|
glUnmapBuffer(GL_ARRAY_BUFFER); |
|
|
|
simulation->pendulaMutex.unlock(); |
|
|
|
simulation->semaphore.release(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void GLWidget::resizeGL(int w, int h) { |
|
|
|
void GLWidget::resizeGL(int w, int h) { |
|
|
|