Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: solvespace/solvespace
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 39c348090bd8
Choose a base ref
...
head repository: solvespace/solvespace
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 9500487a3f7f
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on May 21, 2019

  1. Fix an edge case with fps measured as infinite.

    If the timer is not sufficiently high resolution but the graphics
    card is fast, we can get renderTime.count() == 0.
    whitequark committed May 21, 2019
    Copy the full SHA
    9500487 View commit details
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/draw.cpp
4 changes: 2 additions & 2 deletions src/draw.cpp
Original file line number Diff line number Diff line change
@@ -888,15 +888,15 @@ void GraphicsWindow::Paint() {

// Also display an fps counter.
RgbaColor renderTimeColor;
if(1000 / renderTime.count() < 60) {
if(renderTime.count() > 16.67) {
// We aim for a steady 60fps; draw the counter in red when we're slower.
renderTimeColor = { 255, 0, 0, 255 };
} else {
renderTimeColor = { 255, 255, 255, 255 };
}
uiCanvas.DrawBitmapText(ssprintf("rendered in %ld ms (%ld 1/s)",
(long)renderTime.count(),
(long)(1000/renderTime.count())),
(long)(1000 / std::max(0.1, renderTime.count()))),
5, 5, renderTimeColor);

canvas->FlushFrame();