Skip to content

Commit

Permalink
More debug to debug widget
Browse files Browse the repository at this point in the history
  • Loading branch information
UnrealKaraulov committed Dec 5, 2023
1 parent 4798121 commit d2cfcfb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/editor/Gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3223,6 +3223,9 @@ void Gui::drawDebugWidget()
if (ImGui::CollapsingHeader(get_localized_string(LANG_0625).c_str(), ImGuiTreeNodeFlags_DefaultOpen))
{
ImGui::Text(fmt::format(fmt::runtime(get_localized_string(LANG_0366)), (int)cameraOrigin.x, (int)cameraOrigin.y, (int)cameraOrigin.z).c_str());
ImGui::Text(fmt::format("Mouse: {} {}", mousePos.x, mousePos.y).c_str());
ImGui::Text(fmt::format("Mouse left {} right {}", app->curLeftMouse, app->curRightMouse).c_str());
ImGui::Text(fmt::format("Time: {}", app->curTime).c_str());
ImGui::Text(fmt::format(fmt::runtime(get_localized_string(LANG_0367)), (int)cameraAngles.x, (int)cameraAngles.y, (int)cameraAngles.z).c_str());

ImGui::Text(fmt::format(fmt::runtime(get_localized_string(LANG_0368)), (unsigned int)app->pickInfo.selectedFaces.size()).c_str());
Expand Down
7 changes: 4 additions & 3 deletions src/editor/Renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,13 +289,14 @@ void Renderer::renderLoop()

while (!glfwWindowShouldClose(window))
{
glfwPollEvents();

oldTime = curTime;
curTime = glfwGetTime();
double xpos, ypos;
glfwGetCursorPos(window, &xpos, &ypos);
mousePos = vec2((float)xpos, (float)ypos);

glfwPollEvents();
mousePos = vec2((float)xpos, (float)ypos);

if (SelectedMap && SelectedMap->is_mdl_model)
glClearColor(0.25, 0.25, 0.25, 1.0);
Expand Down Expand Up @@ -1949,7 +1950,7 @@ void Renderer::getPickRay(vec3& start, vec3& pickDir)
{
double xpos, ypos;
glfwGetCursorPos(window, &xpos, &ypos);

// invert ypos
ypos = windowHeight - ypos;

Expand Down

0 comments on commit d2cfcfb

Please sign in to comment.