build with loadTexture(), not rendering textures yet
This commit is contained in:
parent
834f0c59c9
commit
913e8f6287
@ -3,12 +3,13 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
env = Environment(LIBS = ['GL', 'GLU'],
|
||||
env = Environment(LIBS = ['GL', 'GLU', 'SDL_image'],
|
||||
CFLAGS = ['-Wall'],
|
||||
CXXFLAGS = ['-Wall'])
|
||||
env.ParseConfig('sdl-config --cflags --libs')
|
||||
|
||||
env.Program('wfobj-view', [Glob('*.cc'), Glob('wfobj/WFObj.cc')])
|
||||
sources = [Glob('*.cc'), Glob('wfobj/WFObj.cc'), Glob('loadTexture/*.c')]
|
||||
env.Program('wfobj-view', sources)
|
||||
|
||||
if len(os.listdir('wfobj')) == 0:
|
||||
sys.stderr.write('Warning: wfobj submodule not initialized\n')
|
||||
|
2
wfobj
2
wfobj
@ -1 +1 @@
|
||||
Subproject commit 01a90fdef791dba32b455dc43726bb9de590ab8f
|
||||
Subproject commit 1918cc89bf954db83d079cfe4566a719fdc65237
|
@ -9,6 +9,7 @@
|
||||
#include <GL/glu.h>
|
||||
#include <iostream>
|
||||
#include "wfobj/WFObj.h"
|
||||
#include "loadTexture/loadTexture.h"
|
||||
using namespace std;
|
||||
|
||||
/* Some definitions */
|
||||
@ -43,6 +44,18 @@ private:
|
||||
GLint m_ambient_loc, m_diffuse_loc, m_specular_loc, m_shininess_loc;
|
||||
};
|
||||
|
||||
static GLuint load_texture(const char *fname)
|
||||
{
|
||||
GLuint id = loadTexture(fname);
|
||||
if (id != 0)
|
||||
{
|
||||
glBindTexture(GL_TEXTURE_2D, id);
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
}
|
||||
return id;
|
||||
}
|
||||
|
||||
char * loadFile(const char *fname)
|
||||
{
|
||||
struct stat st;
|
||||
|
Loading…
x
Reference in New Issue
Block a user