Showing the changes to interface/src/Application.cpp (1 of 100 files). Show all
Unified · Split
| @@ -394,6 +394,11 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 393 unmodified lines | |||
| 394 | static_cast<NodeList*>(dependency)->deleteLater(); | 394 | static_cast<NodeList*>(dependency)->deleteLater(); |
| 395 | }); | 395 | }); |
| 396 | 396 | ||
| 397 | // setup a timer for domain-server check ins | ||
| 398 | QTimer* domainCheckInTimer = new QTimer(nodeList.data()); | ||
| 399 | connect(domainCheckInTimer, &QTimer::timeout, nodeList.data(), &NodeList::sendDomainServerCheckIn); | ||
| 400 | domainCheckInTimer->start(DOMAIN_SERVER_CHECK_IN_MSECS); | ||
| 401 | |||
| 397 | // put the NodeList and datagram processing on the node thread | 402 | // put the NodeList and datagram processing on the node thread |
| 398 | nodeList->moveToThread(nodeThread); | 403 | nodeList->moveToThread(nodeThread); |
| 399 | 404 | ||
| @@ -887,12 +892,6 @@ void Application::paintGL() { · 487 unmodified lines | |||
| 887 | 892 | ||
| 888 | { | 893 | { |
| 889 | PerformanceTimer perfTimer("renderOverlay"); | 894 | PerformanceTimer perfTimer("renderOverlay"); |
| 890 | /* | ||
| 891 | gpu::Context context(new gpu::GLBackend()); | ||
| 892 | RenderArgs renderArgs(&context, nullptr, getViewFrustum(), lodManager->getOctreeSizeScale(), | ||
| 893 | lodManager->getBoundaryLevelAdjust(), RenderArgs::DEFAULT_RENDER_MODE, | ||
| 894 | RenderArgs::MONO, RenderArgs::RENDER_DEBUG_NONE); | ||
| 895 | */ | ||
| 896 | _applicationOverlay.renderOverlay(&renderArgs); | 895 | _applicationOverlay.renderOverlay(&renderArgs); |
| 897 | } | 896 | } |
| 898 | 897 | ||
| @@ -968,6 +967,8 @@ void Application::paintGL() { · 69 unmodified lines | |||
| 968 | } else if (TV3DManager::isConnected()) { | 967 | } else if (TV3DManager::isConnected()) { |
| 969 | TV3DManager::display(&renderArgs, _myCamera); | 968 | TV3DManager::display(&renderArgs, _myCamera); |
| 970 | } else { | 969 | } else { |
| 970 | PROFILE_RANGE(__FUNCTION__ "/mainRender"); | ||
| 971 | |||
| 971 | DependencyManager::get<GlowEffect>()->prepare(&renderArgs); | 972 | DependencyManager::get<GlowEffect>()->prepare(&renderArgs); |
| 972 | 973 | ||
| 973 | // Viewport is assigned to the size of the framebuffer | 974 | // Viewport is assigned to the size of the framebuffer |
| @@ -1002,6 +1003,7 @@ void Application::paintGL() { · 28 unmodified lines | |||
| 1002 | 1003 | ||
| 1003 | 1004 | ||
| 1004 | if (!OculusManager::isConnected() || OculusManager::allowSwap()) { | 1005 | if (!OculusManager::isConnected() || OculusManager::allowSwap()) { |
| 1006 | PROFILE_RANGE(__FUNCTION__ "/bufferSwap"); | ||
| 1005 | _glWidget->swapBuffers(); | 1007 | _glWidget->swapBuffers(); |
| 1006 | } | 1008 | } |
| 1007 | 1009 | ||
| @@ -1051,6 +1053,7 @@ void Application::resetCameras(Camera& camera, const glm::uvec2& size) { · 43 unmodified lines | |||
| 1051 | } | 1053 | } |
| 1052 | 1054 | ||
| 1053 | void Application::resizeGL() { | 1055 | void Application::resizeGL() { |
| 1056 | PROFILE_RANGE(__FUNCTION__); | ||
| 1054 | // Set the desired FBO texture size. If it hasn't changed, this does nothing. | 1057 | // Set the desired FBO texture size. If it hasn't changed, this does nothing. |
| 1055 | // Otherwise, it must rebuild the FBOs | 1058 | // Otherwise, it must rebuild the FBOs |
| 1056 | QSize renderSize; | 1059 | QSize renderSize; |
| @@ -1519,6 +1522,7 @@ void Application::focusOutEvent(QFocusEvent* event) { · 462 unmodified lines | |||
| 1519 | } | 1522 | } |
| 1520 | 1523 | ||
| 1521 | void Application::mouseMoveEvent(QMouseEvent* event, unsigned int deviceID) { | 1524 | void Application::mouseMoveEvent(QMouseEvent* event, unsigned int deviceID) { |
| 1525 | PROFILE_RANGE(__FUNCTION__); | ||
| 1522 | // Used by application overlay to determine how to draw cursor(s) | 1526 | // Used by application overlay to determine how to draw cursor(s) |
| 1523 | _lastMouseMoveWasSimulated = deviceID > 0; | 1527 | _lastMouseMoveWasSimulated = deviceID > 0; |
| 1524 | if (!_lastMouseMoveWasSimulated) { | 1528 | if (!_lastMouseMoveWasSimulated) { |
| @@ -1785,9 +1789,6 @@ void Application::checkFPS() { · 260 unmodified lines | |||
| 1785 | _frameCount = 0; | 1789 | _frameCount = 0; |
| 1786 | _datagramProcessor->resetCounters(); | 1790 | _datagramProcessor->resetCounters(); |
| 1787 | _timerStart.start(); | 1791 | _timerStart.start(); |
| 1788 | |||
| 1789 | // ask the node list to check in with the domain server | ||
| 1790 | DependencyManager::get<NodeList>()->sendDomainServerCheckIn(); | ||
| 1791 | } | 1792 | } |
| 1792 | 1793 | ||
| 1793 | void Application::idle() { | 1794 | void Application::idle() { |
| @@ -1833,6 +1834,7 @@ void Application::idle() { · 39 unmodified lines | |||
| 1833 | PerformanceTimer perfTimer("update"); | 1834 | PerformanceTimer perfTimer("update"); |
| 1834 | PerformanceWarning warn(showWarnings, "Application::idle()... update()"); | 1835 | PerformanceWarning warn(showWarnings, "Application::idle()... update()"); |
| 1835 | const float BIGGEST_DELTA_TIME_SECS = 0.25f; | 1836 | const float BIGGEST_DELTA_TIME_SECS = 0.25f; |
| 1837 | PROFILE_RANGE(__FUNCTION__ "/idleUpdate"); | ||
| 1836 | update(glm::clamp((float)timeSinceLastUpdate / 1000.0f, 0.0f, BIGGEST_DELTA_TIME_SECS)); | 1838 | update(glm::clamp((float)timeSinceLastUpdate / 1000.0f, 0.0f, BIGGEST_DELTA_TIME_SECS)); |
| 1837 | } | 1839 | } |
| 1838 | { | 1840 | { |
| @@ -2934,6 +2936,7 @@ QRect Application::getDesirableApplicationGeometry() { · 1095 unmodified lines | |||
| 2934 | // or the "myCamera". | 2936 | // or the "myCamera". |
| 2935 | // | 2937 | // |
| 2936 | void Application::loadViewFrustum(Camera& camera, ViewFrustum& viewFrustum) { | 2938 | void Application::loadViewFrustum(Camera& camera, ViewFrustum& viewFrustum) { |
| 2939 | PROFILE_RANGE(__FUNCTION__); | ||
| 2937 | // We will use these below, from either the camera or head vectors calculated above | 2940 | // We will use these below, from either the camera or head vectors calculated above |
| 2938 | viewFrustum.setProjection(camera.getProjection()); | 2941 | viewFrustum.setProjection(camera.getProjection()); |
| 2939 | 2942 | ||
| @@ -3438,9 +3441,8 @@ void Application::displaySide(RenderArgs* renderArgs, Camera& theCamera, bool se · 498 unmodified lines | |||
| 3438 | // Assuming nothing get's rendered through that | 3441 | // Assuming nothing get's rendered through that |
| 3439 | 3442 | ||
| 3440 | if (!selfAvatarOnly) { | 3443 | if (!selfAvatarOnly) { |
| 3441 | |||
| 3442 | // render models... | ||
| 3443 | if (DependencyManager::get<SceneScriptingInterface>()->shouldRenderEntities()) { | 3444 | if (DependencyManager::get<SceneScriptingInterface>()->shouldRenderEntities()) { |
| 3445 | // render models... | ||
| 3444 | PerformanceTimer perfTimer("entities"); | 3446 | PerformanceTimer perfTimer("entities"); |
| 3445 | PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings), | 3447 | PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings), |
| 3446 | "Application::displaySide() ... entities..."); | 3448 | "Application::displaySide() ... entities..."); |
| @@ -3448,11 +3450,11 @@ void Application::displaySide(RenderArgs* renderArgs, Camera& theCamera, bool se · 1 unmodified line | |||
| 3448 | RenderArgs::DebugFlags renderDebugFlags = RenderArgs::RENDER_DEBUG_NONE; | 3450 | RenderArgs::DebugFlags renderDebugFlags = RenderArgs::RENDER_DEBUG_NONE; |
| 3449 | 3451 | ||
| 3450 | if (Menu::getInstance()->isOptionChecked(MenuOption::PhysicsShowHulls)) { | 3452 | if (Menu::getInstance()->isOptionChecked(MenuOption::PhysicsShowHulls)) { |
| 3451 | renderDebugFlags = (RenderArgs::DebugFlags) (renderDebugFlags | (int) RenderArgs::RENDER_DEBUG_HULLS); | 3453 | renderDebugFlags = (RenderArgs::DebugFlags) (renderDebugFlags | (int)RenderArgs::RENDER_DEBUG_HULLS); |
| 3452 | } | 3454 | } |
| 3453 | if (Menu::getInstance()->isOptionChecked(MenuOption::PhysicsShowOwned)) { | 3455 | if (Menu::getInstance()->isOptionChecked(MenuOption::PhysicsShowOwned)) { |
| 3454 | renderDebugFlags = | 3456 | renderDebugFlags = |
| 3455 | (RenderArgs::DebugFlags) (renderDebugFlags | (int) RenderArgs::RENDER_DEBUG_SIMULATION_OWNERSHIP); | 3457 | (RenderArgs::DebugFlags) (renderDebugFlags | (int)RenderArgs::RENDER_DEBUG_SIMULATION_OWNERSHIP); |
| 3456 | } | 3458 | } |
| 3457 | renderArgs->_debugFlags = renderDebugFlags; | 3459 | renderArgs->_debugFlags = renderDebugFlags; |
| 3458 | _entities.render(renderArgs); | 3460 | _entities.render(renderArgs); |
| @@ -4807,7 +4809,6 @@ mat4 Application::getEyeProjection(int eye) const { · 1348 unmodified lines | |||
| 4807 | if (isHMDMode()) { | 4809 | if (isHMDMode()) { |
| 4808 | return OculusManager::getEyeProjection(eye); | 4810 | return OculusManager::getEyeProjection(eye); |
| 4809 | } | 4811 | } |
| 4810 | |||
| 4811 | return _viewFrustum.getProjection(); | 4812 | return _viewFrustum.getProjection(); |
| 4812 | } | 4813 | } |
| 4813 | 4814 | ||