add TextureLoader, FileLoader submodules; update to compile again
This commit is contained in:
parent
f04947830e
commit
4d873b1296
9
.gitmodules
vendored
Normal file
9
.gitmodules
vendored
Normal 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
1
FileLoader
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit 8abf3ff02b6a8cc7024006a9379fd7e8b07cd4a6
|
2
Makefile
2
Makefile
@ -13,7 +13,7 @@ else
|
|||||||
GLLIBS := -lGL -lGLU
|
GLLIBS := -lGL -lGLU
|
||||||
endif
|
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
|
LDFLAGS := $(GLLIBS) $(WINDOWSLIBS) $(shell sdl-config --libs) -lSDL_image
|
||||||
TARGET := wfobj-view
|
TARGET := wfobj-view
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#include <GL/gl.h>
|
#include <GL/gl.h>
|
||||||
#include <GL/glu.h>
|
#include <GL/glu.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include "TextureCache.hh"
|
#include "TextureCache.h"
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
GLuint TextureCache::load(const string & filename)
|
GLuint TextureCache::load(const string & filename)
|
||||||
|
1
TextureLoader
Submodule
1
TextureLoader
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit 9855d3e577208d7c1ebc73f31489c7da9d6f7d07
|
1
wfobj
Submodule
1
wfobj
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit b714c0b08f10a4054c7ec611d0181f3ee71b7d61
|
@ -4,8 +4,8 @@
|
|||||||
#include <GL/gl.h>
|
#include <GL/gl.h>
|
||||||
#include <GL/glu.h>
|
#include <GL/glu.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include "wfobj/WFObj.hh"
|
#include "wfobj/WFObj.h"
|
||||||
#include "TextureCache/TextureCache.hh"
|
#include "TextureCache/TextureCache.h"
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
/* Some definitions */
|
/* Some definitions */
|
||||||
@ -15,10 +15,15 @@ using namespace std;
|
|||||||
|
|
||||||
TextureCache textureCache;
|
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
|
class Viewer
|
||||||
{
|
{
|
||||||
@ -31,7 +36,6 @@ private:
|
|||||||
void display();
|
void display();
|
||||||
void setProjection();
|
void setProjection();
|
||||||
|
|
||||||
WFObj m_obj;
|
|
||||||
GLuint m_list;
|
GLuint m_list;
|
||||||
float m_rotationMatrix[16];
|
float m_rotationMatrix[16];
|
||||||
int m_startx, m_starty;
|
int m_startx, m_starty;
|
||||||
@ -76,7 +80,9 @@ Viewer::Viewer(const char * filename)
|
|||||||
{
|
{
|
||||||
m_dist = 5.0;
|
m_dist = 5.0;
|
||||||
m_dragging = false;
|
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();
|
m_list = m_obj.render();
|
||||||
|
|
||||||
/* Print out the object's size */
|
/* Print out the object's size */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user