diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..5e8984b --- /dev/null +++ b/.gitmodules @@ -0,0 +1,9 @@ +[submodule "wfobj"] + path = wfobj + url = ../wfobj +[submodule "FileLoader"] + path = FileLoader + url = ../FileLoader.git +[submodule "TextureLoader"] + path = TextureLoader + url = ../TextureLoader.git diff --git a/FileLoader b/FileLoader new file mode 160000 index 0000000..8abf3ff --- /dev/null +++ b/FileLoader @@ -0,0 +1 @@ +Subproject commit 8abf3ff02b6a8cc7024006a9379fd7e8b07cd4a6 diff --git a/Makefile b/Makefile index 0f13067..9d3a0b1 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ else GLLIBS := -lGL -lGLU endif -export CXXFLAGS := -O2 $(shell sdl-config --cflags) +export CXXFLAGS := -O2 $(shell sdl-config --cflags) -I$(CURDIR) LDFLAGS := $(GLLIBS) $(WINDOWSLIBS) $(shell sdl-config --libs) -lSDL_image TARGET := wfobj-view diff --git a/TextureCache/TextureCache.cc b/TextureCache/TextureCache.cc index ea38483..e4d7b20 100644 --- a/TextureCache/TextureCache.cc +++ b/TextureCache/TextureCache.cc @@ -4,7 +4,7 @@ #include #include #include -#include "TextureCache.hh" +#include "TextureCache.h" using namespace std; GLuint TextureCache::load(const string & filename) diff --git a/TextureCache/TextureCache.hh b/TextureCache/TextureCache.h similarity index 100% rename from TextureCache/TextureCache.hh rename to TextureCache/TextureCache.h diff --git a/TextureLoader b/TextureLoader new file mode 160000 index 0000000..9855d3e --- /dev/null +++ b/TextureLoader @@ -0,0 +1 @@ +Subproject commit 9855d3e577208d7c1ebc73f31489c7da9d6f7d07 diff --git a/wfobj b/wfobj new file mode 160000 index 0000000..b714c0b --- /dev/null +++ b/wfobj @@ -0,0 +1 @@ +Subproject commit b714c0b08f10a4054c7ec611d0181f3ee71b7d61 diff --git a/wfobj-view.cc b/wfobj-view.cc index 4318988..854eddd 100644 --- a/wfobj-view.cc +++ b/wfobj-view.cc @@ -4,8 +4,8 @@ #include #include #include -#include "wfobj/WFObj.hh" -#include "TextureCache/TextureCache.hh" +#include "wfobj/WFObj.h" +#include "TextureCache/TextureCache.h" using namespace std; /* Some definitions */ @@ -15,10 +15,15 @@ using namespace std; TextureCache textureCache; -GLuint loadTexture(const char * filename) +class LoadTexture : public TextureLoader { - return textureCache.load(filename); -} + public: + GLuint load(const FileLoader::Path & path, + FileLoader & fl, bool mipmaps, int mode, int quality) + { + return textureCache.load(path.fullPath); + } +}; class Viewer { @@ -31,7 +36,6 @@ private: void display(); void setProjection(); - WFObj m_obj; GLuint m_list; float m_rotationMatrix[16]; int m_startx, m_starty; @@ -76,7 +80,9 @@ Viewer::Viewer(const char * filename) { m_dist = 5.0; m_dragging = false; - m_obj.load(filename, &loadTexture); + LoadTexture lt; + WFObj m_obj(lt); + m_obj.load(FileLoader::Path(filename, "")); m_list = m_obj.render(); /* Print out the object's size */