Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/bondRenderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class BondRenderer
shader->setUniform<glm::vec4>("lightColour", glm::vec4(1.0f,1.0f,1.0f,1.0f));
shader->setUniform<float>("ambientLight", 0.1f);
setBondScale(1.0f);
setGlobalAlpha(globalAlpha);
setGlobalAlpha(1.0f);
init();
for (const auto & ibonds : bonds)
{
Expand Down
1 change: 1 addition & 0 deletions include/consoleWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ This is free software, and you are welcome to redistribute it under certain cond
Commands.push_back("CLEAR");
AutoScroll = true;
ScrollToBottom = false;
focussed = false;
addLog(std::string(banner));
}
~ConsoleWindow()
Expand Down
7 changes: 5 additions & 2 deletions include/infoWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,24 @@ void infoWindow
const std::unique_ptr<Structure> & structure,
const Camera & camera,
const VisualisationState & visualisationState,
const float & delta
const float delta
)
{
auto cx = fixedLengthNumber(camera.position().x, 6);
auto cy = fixedLengthNumber(camera.position().y, 6);
auto cz = fixedLengthNumber(camera.position().z, 6);

auto ift = fixedLengthNumber(delta,6);
auto fps = fixedLengthNumber(1.0/(delta*1e-3),4);

ImGui::Begin("Information");

unsigned size = std::ceil(structure->frameCount()/10.0);
ImGui::Text("Structure: %s", structure->getPath().c_str());
ImGui::Text("Frame %*lu / %*lu", size, visualisationState.frame+1, size, structure->frameCount());
ImGui::Text("Frame caching %s", (structure->framePositionsLoaded() ? "complete." : "in progress."));
ImGui::Text("Camera %s, %s, %s", cx.c_str(), cy.c_str(), cz.c_str());
ImGui::Text("Frame Time (FPS) %s ms (%s)", fixedLengthNumber(delta,6).c_str(), fixedLengthNumber(1.0/(delta*1e-3),4).c_str());
ImGui::Text("Frame Time (FPS) %s ms (%s)", ift.c_str(), fps.c_str());

ImGui::End();
}
Expand Down
8 changes: 5 additions & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ int main(int argv, char ** argc)
jGLInstance->setMSAA(options.msaa.value);

double deltas[60];
double delta = 0;
for (int i = 0; i < 60; i++) { deltas[i] = 0.0; }

float delta = 0;
unsigned frameId = 0;
bool readInProgress = false;
bool playBackward = false;
Expand Down Expand Up @@ -351,7 +353,6 @@ int main(int argv, char ** argc)
{
setTransparencySorting(structure->atoms, atomRenderer, bondRenderer);
}
visualisationState.elementsUpdated = false;
}

bondRenderer.draw();
Expand All @@ -371,9 +372,9 @@ int main(int argv, char ** argc)
ImGui_ImplGlfw_NewFrame();
ImGui::NewFrame();

infoWindow(structure, camera, visualisationState, delta);
CameraWindow().draw(options);
consoleWindow.draw("Console", console);
infoWindow(structure, camera, visualisationState, delta);
ImGui::Render();
ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData());
}
Expand Down Expand Up @@ -457,6 +458,7 @@ int main(int argv, char ** argc)
auto toc = std::chrono::high_resolution_clock::now();
deltas[frameId] = std::chrono::duration_cast<std::chrono::milliseconds>(toc-tic).count();
frameId = (frameId+1) % 60;
visualisationState.elementsUpdated = false;
}

jGLInstance->finish();
Expand Down
Loading