#ifndef __OPENGLPLAYGROUND_OBJECTPARSER_HH__ #define __OPENGLPLAYGROUND_OBJECTPARSER_HH__ #include #include #include "common.hh" class ParseException : public Exception { public: ParseException(std::string const& msg) : Exception(), _msg(msg) { } virtual ~ParseException() {} std::string const& getMsg() const {return _msg;} virtual std::string toString() const { return "ParseException: " + _msg; } private: std::string _msg; }; struct objVertexAttribs { float vertex[3]; uint16_t texCoords[2]; uint32_t normal; } __attribute__((__packed__)); std::tuple, std::vector > readObject(std::string const& filename); void writeObjectPB(std::string const& filename, std::tuple, std::vector > obj); std::tuple, std::vector > readObjectPB(std::string const& filename); #endif