Texturing; OBJ loader
This commit is contained in:
34
objectParser.hh
Normal file
34
objectParser.hh
Normal file
@@ -0,0 +1,34 @@
|
||||
#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];
|
||||
} __attribute__((__packed__));
|
||||
|
||||
|
||||
std::tuple<std::vector<objVertexAttribs>, std::vector<uint16_t> > readObject(std::string const& filename);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user