aboutsummaryrefslogtreecommitdiff
path: root/BuddhaTest/include
diff options
context:
space:
mode:
authorAndreas Grois <andi@grois.info>2018-03-10 18:48:52 +0100
committerAndreas Grois <andi@grois.info>2018-03-10 18:48:52 +0100
commit5127d05dfdc877b0fc06e6ec228cfef09b98539a (patch)
treeb19026c071757e87dad660a623b5862d88a02bd7 /BuddhaTest/include
parentf57e2e048fbbea265c513769879e39c27b2b9c8e (diff)
Add command line parsing
Diffstat (limited to 'BuddhaTest/include')
-rw-r--r--BuddhaTest/include/Helpers.h31
1 files changed, 30 insertions, 1 deletions
diff --git a/BuddhaTest/include/Helpers.h b/BuddhaTest/include/Helpers.h
index a25aa31..61bd7a0 100644
--- a/BuddhaTest/include/Helpers.h
+++ b/BuddhaTest/include/Helpers.h
@@ -3,13 +3,14 @@
#include <GLFW/glfw3.h>
#include <vector>
#include <stdio.h> //includes FILE typedef
+#include <string>
namespace Helpers
{
GLuint LoadShaders(const char * vertex_file_path, const char * fragment_file_path);
GLuint LoadComputeShader(const char * compute_file_path, unsigned int localSizeX, unsigned int localSizeY, unsigned int localSizeZ);
- void WriteOutputPNG(const std::vector<uint32_t>& data, unsigned int width, unsigned int bufferHeight, double gamma, double colorScale);
+ void WriteOutputPNG(const std::string& path, const std::vector<uint32_t>& data, unsigned int width, unsigned int bufferHeight, double gamma, double colorScale);
/** Wraps around a C file descriptor. Libpng could be taught to use C++ streams, but I'm too lazy and rather wrap this ugly thing up, so it gets cleaned... */
class ScopedCFileDescriptor
@@ -22,4 +23,32 @@ namespace Helpers
private:
FILE * Descriptor;
};
+
+ struct RenderSettings
+ {
+ unsigned int imageWidth = 1920;
+ unsigned int imageHeight = 1080;
+
+ unsigned int windowWidth = 1024;
+ unsigned int windowHeight = 576;
+
+ unsigned int orbitLengthRed = 10;
+ unsigned int orbitLengthGreen = 100;
+ unsigned int orbitLengthBlue = 1000;
+
+ unsigned int localWorkgroupSizeX = 1024;
+ unsigned int localWorkgroupSizeY = 1;
+ unsigned int localWorkgroupSizeZ = 1;
+
+ unsigned int globalWorkGroupSizeX = 1024;
+ unsigned int globalWorkGroupSizeY = 1;
+ unsigned int globalWorkGroupSizeZ = 1;
+
+ std::string pngFilename = "";
+ double pngGamma = 1.0;
+ double pngColorScale = 2.0;
+
+ bool CheckValidity();
+ bool ParseCommandLine(int argc, char * argv[]);
+ };
}