From 5127d05dfdc877b0fc06e6ec228cfef09b98539a Mon Sep 17 00:00:00 2001 From: Andreas Grois Date: Sat, 10 Mar 2018 18:48:52 +0100 Subject: Add command line parsing --- BuddhaTest/include/Helpers.h | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'BuddhaTest/include') 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 #include #include //includes FILE typedef +#include 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& data, unsigned int width, unsigned int bufferHeight, double gamma, double colorScale); + void WriteOutputPNG(const std::string& path, const std::vector& 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[]); + }; } -- cgit v1.2.3