aboutsummaryrefslogtreecommitdiff
path: root/src/util.h
diff options
context:
space:
mode:
authorAdrian Kummerlaender2018-05-21 21:16:56 +0200
committerAdrian Kummerlaender2018-05-21 21:20:08 +0200
commit617fec827652d216e2d1e5015f816c4400655d73 (patch)
treec2bdce2d375bebc4b7c9907543d57aeb642f7f82 /src/util.h
parenta8feed9d7951c9a947562ed687c704851a31ea9b (diff)
downloadcomputicle-617fec827652d216e2d1e5015f816c4400655d73.tar
computicle-617fec827652d216e2d1e5015f816c4400655d73.tar.gz
computicle-617fec827652d216e2d1e5015f816c4400655d73.tar.bz2
computicle-617fec827652d216e2d1e5015f816c4400655d73.tar.lz
computicle-617fec827652d216e2d1e5015f816c4400655d73.tar.xz
computicle-617fec827652d216e2d1e5015f816c4400655d73.tar.zst
computicle-617fec827652d216e2d1e5015f816c4400655d73.zip
Abstract texture display buffer, shader
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/util.h b/src/util.h
index 7aec674..05e9303 100644
--- a/src/util.h
+++ b/src/util.h
@@ -1,9 +1,16 @@
#pragma once
+#include <chrono>
#include <iostream>
namespace util {
+double millisecondsSince(std::chrono::time_point<std::chrono::high_resolution_clock>& pit) {
+ return std::chrono::duration_cast<std::chrono::milliseconds>(
+ std::chrono::high_resolution_clock::now() - pit
+ ).count();
+}
+
GLint getUniform(GLuint program, const std::string& name) {
const GLint uniform = glGetUniformLocation(program, name.c_str());
if ( uniform == -1 ) {