aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Grois <Andreas.grois@stillalive-studios.com>2018-03-17 10:52:21 +0100
committerAndreas Grois <Andreas.grois@stillalive-studios.com>2018-03-17 10:52:21 +0100
commitd927208ab36f32f9150d2908a4c70fd039f413ef (patch)
treef7c792280b1f4146f11fc33af8ab3dcc3def203b
parent422c8bb40723588ced0dad8ea5052f6e07e85ddf (diff)
Fix a few warnings spit out by MSVC compiler:
-rw-r--r--BuddhaTest/src/BuddhaTest.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/BuddhaTest/src/BuddhaTest.cpp b/BuddhaTest/src/BuddhaTest.cpp
index 14f4dd3..daf7fa5 100644
--- a/BuddhaTest/src/BuddhaTest.cpp
+++ b/BuddhaTest/src/BuddhaTest.cpp
@@ -4,6 +4,7 @@
#include <iostream>
#include <vector>
#include <chrono>
+#include <algorithm>
void error_callback(int error, const char* description)
{
@@ -149,7 +150,7 @@ int main(int argc, char * argv[])
uint32_t iterationsPerFrame = 1;
- Helpers::PIDController<float, uint32_t> pid{0.0f,0.0f,1e-8f};
+ Helpers::PIDController<float, std::chrono::high_resolution_clock::time_point::rep> pid{0.0f,0.0f,1e-8f};
const uint32_t targetFrameDuration{1000000/settings.targetFrameRate};
/* Loop until the user closes the window */
@@ -193,7 +194,7 @@ int main(int argc, char * argv[])
if(frameDuration > 0)
{
const auto error{targetFrameDuration - frameDuration};
- const auto pidOutput{pid.Update(frameDuration,error)};
+ const auto pidOutput{pid.Update((frameDuration),float(error))};
iterationsPerFrame = std::max(1,static_cast<int>(pidOutput));
//std::cout << iterationsPerFrame << " " << pidOutput << std::endl;
@@ -212,7 +213,7 @@ int main(int argc, char * argv[])
//too lazy to change WriteOutputPng...
std::vector<uint32_t> combinedBuffer(3*pixelCount);
- for(int i=0;i<3*pixelCount;++i)
+ for(uint32_t i=0;i<3*pixelCount;++i)
{
combinedBuffer[i] = readBackBuffers[i%3][i/3];
}