From 1d0169b2b7dee8d98c1bf2f1c5da8bca4235b190 Mon Sep 17 00:00:00 2001
From: faiface <faiface@ksp.sk>
Date: Mon, 24 Apr 2017 19:34:31 +0200
Subject: [PATCH] remove fps counters from examples for simplicity and
 consistency

---
 examples/lights/main.go | 14 +-------------
 examples/smoke/main.go  | 14 --------------
 2 files changed, 1 insertion(+), 27 deletions(-)

diff --git a/examples/lights/main.go b/examples/lights/main.go
index 8faf78a..c1a6d3f 100644
--- a/examples/lights/main.go
+++ b/examples/lights/main.go
@@ -1,7 +1,6 @@
 package main
 
 import (
-	"fmt"
 	"image"
 	"math"
 	"os"
@@ -144,11 +143,7 @@ func run() {
 	oneLight := pixelgl.NewCanvas(win.Bounds())
 	allLight := pixelgl.NewCanvas(win.Bounds())
 
-	var (
-		frames = 0
-		second = time.Tick(time.Second)
-		fps30  = time.Tick(time.Second / 30)
-	)
+	fps30 := time.Tick(time.Second / 30)
 
 	start := time.Now()
 	for !win.Closed() {
@@ -198,13 +193,6 @@ func run() {
 		win.Update()
 
 		<-fps30 // maintain 30 fps, because my computer couldn't handle 60 here
-		frames++
-		select {
-		case <-second:
-			win.SetTitle(fmt.Sprintf("%s | FPS: %d", cfg.Title, frames))
-			frames = 0
-		default:
-		}
 	}
 }
 
diff --git a/examples/smoke/main.go b/examples/smoke/main.go
index 78dea1a..40007a2 100644
--- a/examples/smoke/main.go
+++ b/examples/smoke/main.go
@@ -3,7 +3,6 @@ package main
 import (
 	"container/list"
 	"encoding/csv"
-	"fmt"
 	"image"
 	"io"
 	"math"
@@ -204,11 +203,6 @@ func run() {
 
 	batch := pixel.NewBatch(&pixel.TrianglesData{}, sheet)
 
-	var (
-		second = time.Tick(time.Second)
-		frames = 0
-	)
-
 	last := time.Now()
 	for !win.Closed() {
 		dt := time.Since(last).Seconds()
@@ -224,14 +218,6 @@ func run() {
 		batch.Draw(win)
 
 		win.Update()
-
-		frames++
-		select {
-		case <-second:
-			win.SetTitle(fmt.Sprintf("%s | FPS: %d", cfg.Title, frames))
-			frames = 0
-		default:
-		}
 	}
 }
 
-- 
GitLab