returns the new scene if one is selected
| 1649 | |
| 1650 | // returns the new scene if one is selected |
| 1651 | int DoUI() |
| 1652 | { |
| 1653 | // gui may set a new scene |
| 1654 | int newScene = -1; |
| 1655 | |
| 1656 | if (g_showHelp) |
| 1657 | { |
| 1658 | const int numParticles = NvFlexGetActiveCount(g_flex); |
| 1659 | const int numDiffuse = NvFlexGetDiffuseParticles(g_flex, NULL, NULL, NULL); |
| 1660 | |
| 1661 | int x = g_screenWidth - 200; |
| 1662 | int y = g_screenHeight - 23; |
| 1663 | |
| 1664 | // imgui |
| 1665 | unsigned char button = 0; |
| 1666 | if (g_lastb == SDL_BUTTON_LEFT) |
| 1667 | button = IMGUI_MBUT_LEFT; |
| 1668 | else if (g_lastb == SDL_BUTTON_RIGHT) |
| 1669 | button = IMGUI_MBUT_RIGHT; |
| 1670 | |
| 1671 | imguiBeginFrame(g_lastx, g_screenHeight - g_lasty, button, 0); |
| 1672 | |
| 1673 | x += 180; |
| 1674 | |
| 1675 | int fontHeight = 13; |
| 1676 | |
| 1677 | if (1) |
| 1678 | { |
| 1679 | DrawImguiString(x, y, Vec3(1.0f), IMGUI_ALIGN_RIGHT, "Frame: %d", g_frame); y -= fontHeight * 2; |
| 1680 | |
| 1681 | if (!g_ffmpeg) |
| 1682 | { |
| 1683 | DrawImguiString(x, y, Vec3(1.0f), IMGUI_ALIGN_RIGHT, "Frame Time: %.2fms", g_realdt*1000.0f); y -= fontHeight * 2; |
| 1684 | |
| 1685 | // If detailed profiling is enabled, then these timers will contain the overhead of the detail timers, so we won't display them. |
| 1686 | if (!g_profile) |
| 1687 | { |
| 1688 | DrawImguiString(x, y, Vec3(1.0f), IMGUI_ALIGN_RIGHT, "Sim Time (CPU): %.2fms", g_updateTime*1000.0f); y -= fontHeight; |
| 1689 | DrawImguiString(x, y, Vec3(0.97f, 0.59f, 0.27f), IMGUI_ALIGN_RIGHT, "Sim Latency (GPU): %.2fms", g_simLatency); y -= fontHeight * 2; |
| 1690 | } |
| 1691 | else |
| 1692 | { |
| 1693 | y -= fontHeight * 3; |
| 1694 | } |
| 1695 | } |
| 1696 | |
| 1697 | DrawImguiString(x, y, Vec3(1.0f), IMGUI_ALIGN_RIGHT, "Particle Count: %d", numParticles); y -= fontHeight; |
| 1698 | DrawImguiString(x, y, Vec3(1.0f), IMGUI_ALIGN_RIGHT, "Diffuse Count: %d", numDiffuse); y -= fontHeight; |
| 1699 | DrawImguiString(x, y, Vec3(1.0f), IMGUI_ALIGN_RIGHT, "Rigid Count: %d", g_buffers->rigidOffsets.size() > 0 ? g_buffers->rigidOffsets.size() - 1 : 0); y -= fontHeight; |
| 1700 | DrawImguiString(x, y, Vec3(1.0f), IMGUI_ALIGN_RIGHT, "Spring Count: %d", g_buffers->springLengths.size()); y -= fontHeight; |
| 1701 | DrawImguiString(x, y, Vec3(1.0f), IMGUI_ALIGN_RIGHT, "Num Substeps: %d", g_numSubsteps); y -= fontHeight; |
| 1702 | DrawImguiString(x, y, Vec3(1.0f), IMGUI_ALIGN_RIGHT, "Num Iterations: %d", g_params.numIterations); y -= fontHeight * 2; |
| 1703 | |
| 1704 | DrawImguiString(x, y, Vec3(1.0f), IMGUI_ALIGN_RIGHT, "Device: %s", g_deviceName); y -= fontHeight * 2; |
| 1705 | } |
| 1706 | |
| 1707 | if (g_profile) |
| 1708 | { |
no test coverage detected