add TextureLoader, FileLoader submodules; update to compile again

This commit is contained in:
Josh Holtrop 2011-03-08 13:40:29 -05:00
parent f04947830e
commit 4d873b1296
8 changed files with 27 additions and 9 deletions

9
.gitmodules vendored Normal file
View File

@ -0,0 +1,9 @@
[submodule "wfobj"]
path = wfobj
url = ../wfobj
[submodule "FileLoader"]
path = FileLoader
url = ../FileLoader.git
[submodule "TextureLoader"]
path = TextureLoader
url = ../TextureLoader.git

1
FileLoader Submodule

@ -0,0 +1 @@
Subproject commit 8abf3ff02b6a8cc7024006a9379fd7e8b07cd4a6

View File

@ -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

View File

@ -4,7 +4,7 @@
#include <GL/gl.h>
#include <GL/glu.h>
#include <iostream>
#include "TextureCache.hh"
#include "TextureCache.h"
using namespace std;
GLuint TextureCache::load(const string & filename)

1
TextureLoader Submodule

@ -0,0 +1 @@
Subproject commit 9855d3e577208d7c1ebc73f31489c7da9d6f7d07

1
wfobj Submodule

@ -0,0 +1 @@
Subproject commit b714c0b08f10a4054c7ec611d0181f3ee71b7d61

View File

@ -4,8 +4,8 @@
#include <GL/gl.h>
#include <GL/glu.h>
#include <iostream>
#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 */