Commit 4d3356ad authored by Lars Krecklau's avatar Lars Krecklau

This patch hopefully fixes bug #233, but now we only have static registration...

This patch hopefully fixes bug #233, but now we only have static registration of file types. In the future, we may have to find another solution for dynamic file type extensions by shared libraries (IO plugins).
parent 11b4167d
cmake @ 15115c56
Subproject commit 809ae57efe0fb1b44c069aacfabd3f5f988cafdb
Subproject commit 15115c56e314569265d0ca4bba3fad1993c2777f
......@@ -9,12 +9,15 @@
#include <ACGL/ACGL.hh>
#include <ACGL/OpenGL/Controller/TextureDataControlFile.hh>
#include <ACGL/OpenGL/InitStaticFileTypes.hh>
namespace ACGL{
namespace OpenGL{
class TextureDataControlFileJPG : public TextureDataControlFile
{
friend void initStaticFileTypes(void);
// ========================================================================================================= \/
// ============================================================================================ CONSTRUCTORS \/
// ========================================================================================================= \/
......@@ -38,6 +41,9 @@ private:
public:
static int_t getTypeID(void) { return sTypeID; }
private:
static int_t registerType(void);
// =================================================================================================== \/
// ============================================================================================ FIELDS \/
// =================================================================================================== \/
......
......@@ -9,12 +9,15 @@
#include <ACGL/ACGL.hh>
#include <ACGL/OpenGL/Controller/TextureDataControlFile.hh>
#include <ACGL/OpenGL/InitStaticFileTypes.hh>
namespace ACGL{
namespace OpenGL{
class TextureDataControlFilePNG : public TextureDataControlFile
{
friend void initStaticFileTypes(void);
// ========================================================================================================= \/
// ============================================================================================ CONSTRUCTORS \/
// ========================================================================================================= \/
......@@ -38,6 +41,9 @@ private:
public:
static int_t getTypeID(void) { return sTypeID; }
private:
static int_t registerType(void);
// =================================================================================================== \/
// ============================================================================================ FIELDS \/
// =================================================================================================== \/
......
......@@ -31,4 +31,10 @@ bool TextureDataControlFileJPG::load(SharedTextureData& texture) const
return true;
}
int_t TextureDataControlFileJPG::sTypeID = TextureDataControlFileFactory::the()->registerType("jpg", &TextureDataControlFileJPG::creator);
int_t TextureDataControlFileJPG::registerType(void)
{
sTypeID = TextureDataControlFileFactory::the()->registerType("jpg", &TextureDataControlFileJPG::creator);
return sTypeID;
}
int_t TextureDataControlFileJPG::sTypeID = -1;
......@@ -31,4 +31,10 @@ bool TextureDataControlFilePNG::load(SharedTextureData& texture) const
return true;
}
int_t TextureDataControlFilePNG::sTypeID = TextureDataControlFileFactory::the()->registerType("png", &TextureDataControlFilePNG::creator);
int_t TextureDataControlFilePNG::registerType(void)
{
sTypeID = TextureDataControlFileFactory::the()->registerType("png", &TextureDataControlFilePNG::creator);
return sTypeID;
}
int_t TextureDataControlFilePNG::sTypeID = -1;
......@@ -12,7 +12,7 @@ using namespace ACGL::OpenGL;
void ACGL::OpenGL::initStaticFileTypes(void)
{
ACGL::Utils::debug() << "TextureDataControlFileJPG type ID: " << TextureDataControlFileJPG::getTypeID() << std::endl;
ACGL::Utils::debug() << "TextureDataControlFilePNG type ID: " << TextureDataControlFilePNG::getTypeID() << std::endl;
ACGL::Utils::debug() << "TextureDataControlFileJPG type ID: " << TextureDataControlFileJPG::registerType() << std::endl;
ACGL::Utils::debug() << "TextureDataControlFilePNG type ID: " << TextureDataControlFilePNG::registerType() << std::endl;
}
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