#pragma once #include #include #include #include //includes FILE typedef namespace Helpers { GLuint LoadShaders(const char * vertex_file_path, const char * fragment_file_path); GLuint LoadComputeShader(const char * compute_file_path); void WriteOutputPNG(const std::vector& data, unsigned int width, unsigned int height); /** 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 { public: ScopedCFileDescriptor(const char *path, const char *mode); ~ScopedCFileDescriptor(); FILE * Get() const; bool IsValid() const; private: FILE * Descriptor; }; }