36 lines
715 B
C++
36 lines
715 B
C++
#ifndef __OPENGLPLAYGROUND_OBJECTPARSER_HH__
|
|
#define __OPENGLPLAYGROUND_OBJECTPARSER_HH__
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#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<objVertexAttribs>, std::vector<uint16_t> > readObject(std::string const& filename);
|
|
|
|
#endif
|