build driver program as well

This commit is contained in:
Josh Holtrop 2011-04-20 15:32:26 -04:00
parent 806f7890f3
commit a6eca59683
4 changed files with 5 additions and 29 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
driver

View File

@ -1,18 +0,0 @@
CXX := g++
CXXFLAGS := -O2
SOURCE := WFObj.cc driver.cc
OBJS := $(SOURCE:.cc=.o)
LDFLAGS := -lGL
TARGET := driver
all: $(TARGET)
$(TARGET): $(OBJS)
$(CXX) -o $@ $^ $(LDFLAGS)
%.o: %.cc %.hh
$(CXX) -c -o $@ $< $(CXXFLAGS)
clean:
-rm -f *~ *.o $(TARGET)

View File

@ -1,6 +1,6 @@
# vim:filetype=python # vim:filetype=python
env = Environment() env = Environment(LIBS = ['GL'])
env.Object('WFObj', 'WFObj.cc') env.Program('driver', Glob('*.cc'))

View File

@ -1,15 +1,9 @@
#include <GL/gl.h> #include <GL/gl.h>
#include <iostream> #include <iostream>
#include "WFObj.hh" #include "WFObj.h"
using namespace std; using namespace std;
GLuint loadTexture(const char * texture)
{
cout << "got texture request: '" << texture << "'" << endl;
return 33;
}
int main(int argc, char * argv[]) int main(int argc, char * argv[])
{ {
WFObj w; WFObj w;
@ -18,11 +12,10 @@ int main(int argc, char * argv[])
cout << "Usage: " << argv[0] << " <filename>" << endl; cout << "Usage: " << argv[0] << " <filename>" << endl;
return -2; return -2;
} }
if (!w.load(argv[1], &loadTexture)) if (!w.load(argv[1]))
{ {
cout << "Couldn't open '" << argv[1] << "'!" << endl; cout << "Couldn't open '" << argv[1] << "'!" << endl;
return -1; return -1;
} }
w.render();
return 0; return 0;
} }