Commit 82c5a51b authored by Robert Menzel's avatar Robert Menzel
Browse files

VertexArrayObjectControlFile can load arbitrary meshes but will get marked deprecated soon

parent 181fc1ce
...@@ -22,16 +22,16 @@ namespace OpenGL{ ...@@ -22,16 +22,16 @@ namespace OpenGL{
class GeometryDataControlFileATB; class GeometryDataControlFileATB;
class GeometryDataControlFileOBJ : public ACGL::OpenGL::GeometryDataControlFile class GeometryDataControlFileMesh : public ACGL::OpenGL::GeometryDataControlFile
{ {
friend void initStaticFileTypes(void); friend void initStaticFileTypes(void);
friend class GeometryDataControlFileATB; friend class GeometryDataControlFileATB;
public: public:
GeometryDataControlFileOBJ(const std::string& _filename) : GeometryDataControlFile(_filename,Base::Settings::the()->getFullGeometryPath()) {} GeometryDataControlFileMesh(const std::string& _filename) : GeometryDataControlFile(_filename,Base::Settings::the()->getFullGeometryPath()) {}
virtual ~GeometryDataControlFileOBJ(void) {} virtual ~GeometryDataControlFileMesh(void) {}
// the entry point that gets registered in registerType() // the entry point that gets registered in registerType()
static SharedGeometryDataControlFile creator(const std::string& _filename) { return SharedGeometryDataControlFile(new GeometryDataControlFileOBJ(_filename)); } static SharedGeometryDataControlFile creator(const std::string& _filename) { return SharedGeometryDataControlFile(new GeometryDataControlFileMesh(_filename)); }
private: private:
virtual bool load(SharedGeometryData& geometry) const; virtual bool load(SharedGeometryData& geometry) const;
...@@ -39,13 +39,14 @@ private: ...@@ -39,13 +39,14 @@ private:
// register the file extension 'obj' for this loader // register the file extension 'obj' for this loader
static ACGL::int_t registerType(void) static ACGL::int_t registerType(void)
{ {
sTypeID = GeometryDataControlFileFactory::the()->registerType("obj", &GeometryDataControlFileOBJ::creator); sTypeID = GeometryDataControlFileFactory::the()->registerType("obj", &GeometryDataControlFileMesh::creator);
sTypeID = GeometryDataControlFileFactory::the()->registerType("vap", &GeometryDataControlFileMesh::creator);
return sTypeID; return sTypeID;
} }
}; };
ACGL_SMARTPOINTER_TYPEDEFS(GeometryDataControlFileOBJ) ACGL_SMARTPOINTER_TYPEDEFS(GeometryDataControlFileMesh)
} // OpenGL } // OpenGL
} // ACGL } // ACGL
......
...@@ -21,9 +21,9 @@ using namespace ACGL::OpenGL; ...@@ -21,9 +21,9 @@ using namespace ACGL::OpenGL;
using namespace ACGL::Utils; using namespace ACGL::Utils;
using namespace ACGL::Base; using namespace ACGL::Base;
bool GeometryDataControlFileOBJ::load(SharedGeometryData& geometry) const bool GeometryDataControlFileMesh::load(SharedGeometryData& geometry) const
{ {
geometry = loadGeometryDataFromOBJ(getFullFilePath()); geometry = loadGeometryData(getFullFilePath());
if (geometry) if (geometry)
return true; return true;
else else
......
...@@ -30,7 +30,7 @@ void ACGL::OpenGL::initStaticFileTypes(void) ...@@ -30,7 +30,7 @@ void ACGL::OpenGL::initStaticFileTypes(void)
// //
// Geometry, Meshes, Vertex data // Geometry, Meshes, Vertex data
// //
GeometryDataControlFileOBJ::registerType(); GeometryDataControlFileMesh::registerType();
GeometryDataControlFileATB::registerType(); GeometryDataControlFileATB::registerType();
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment