| 1508 | } |
| 1509 | |
| 1510 | void PlayLayer::onDrawImGui() |
| 1511 | { |
| 1512 | extern bool _showDebugImgui; |
| 1513 | if (!_showDebugImgui) |
| 1514 | return; |
| 1515 | ImGui::SetNextWindowPos({1000.0f, 200.0f}, ImGuiCond_FirstUseEver); |
| 1516 | |
| 1517 | ImGui::Begin("PlayLayer Debug"); |
| 1518 | |
| 1519 | ImGui::Text("%s", std::to_string(_player1->_queuedHold).c_str()); |
| 1520 | |
| 1521 | ImGui::Checkbox("Freeze Player", &m_freezePlayer); |
| 1522 | ImGui::Checkbox("Platformer Mode (Basic)", &m_platformerMode); |
| 1523 | |
| 1524 | #ifdef AX_PLATFORM_PC |
| 1525 | if (ImGui::Checkbox("Fullscreen", &fullscreen)) |
| 1526 | { |
| 1527 | int a; |
| 1528 | auto monitor = glfwGetMonitors(&a)[monitorN]; |
| 1529 | auto mode = glfwGetVideoMode(monitor); |
| 1530 | |
| 1531 | if (fullscreen) |
| 1532 | glfwSetWindowMonitor(static_cast<GLViewImpl*>(ax::Director::getInstance()->getGLView())->getWindow(), |
| 1533 | monitor, 0, 0, mode->width, mode->height, mode->refreshRate); |
| 1534 | else |
| 1535 | { |
| 1536 | glfwSetWindowMonitor(static_cast<GLViewImpl*>(ax::Director::getInstance()->getGLView())->getWindow(), |
| 1537 | NULL, 0, 0, 1280, 720, 0); |
| 1538 | glfwWindowHint(GLFW_DECORATED, true); |
| 1539 | } |
| 1540 | } |
| 1541 | #endif |
| 1542 | |
| 1543 | ImGui::SameLine(); |
| 1544 | |
| 1545 | if (ImGui::ArrowButton("full", ImGuiDir_Right)) |
| 1546 | ImGui::OpenPopup("Fullscreen Settings"); |
| 1547 | |
| 1548 | if (ImGui::BeginPopupModal("Fullscreen Settings", NULL, ImGuiWindowFlags_AlwaysAutoResize)) |
| 1549 | { |
| 1550 | ImGui::InputInt("Monitor", &monitorN); |
| 1551 | if (ImGui::Button("Close")) |
| 1552 | ImGui::CloseCurrentPopup(); |
| 1553 | ImGui::EndPopup(); |
| 1554 | } |
| 1555 | |
| 1556 | if (ImGui::Button("Exit")) |
| 1557 | { |
| 1558 | this->exit(); |
| 1559 | } |
| 1560 | |
| 1561 | ImGui::Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / ImGui::GetIO().Framerate, |
| 1562 | ImGui::GetIO().Framerate); |
| 1563 | |
| 1564 | ImGui::Text("yVel %.3f", _player1->getYVel()); |
| 1565 | |
| 1566 | ImGui::Checkbox("Show Hitboxes", &showDn); |
| 1567 | ImGui::Checkbox("Gain the power of invincibility", &noclip); |
nothing calls this directly
no test coverage detected