summaryrefslogtreecommitdiffstats
path: root/matchblox/engine/C_3DObject.cpp
diff options
context:
space:
mode:
authorDennis Peeten <dpeeten@onsneteindhoven.nl>2008-05-27 16:58:31 (GMT)
committerDennis Peeten <dpeeten@onsneteindhoven.nl>2008-05-27 16:58:31 (GMT)
commit950aa6929386d478f5a45739c4abd70500f1fef7 (patch)
tree25a70bc3aa26fd7bee8542a76b352c15976d9c6d /matchblox/engine/C_3DObject.cpp
parent47dcce1ed989159bbe0fc2a98ebeda4f5dc99772 (diff)
download2iv55-950aa6929386d478f5a45739c4abd70500f1fef7.zip
2iv55-950aa6929386d478f5a45739c4abd70500f1fef7.tar.gz
2iv55-950aa6929386d478f5a45739c4abd70500f1fef7.tar.bz2
Diffstat (limited to 'matchblox/engine/C_3DObject.cpp')
-rw-r--r--matchblox/engine/C_3DObject.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/matchblox/engine/C_3DObject.cpp b/matchblox/engine/C_3DObject.cpp
index b9186cd..24c759a 100644
--- a/matchblox/engine/C_3DObject.cpp
+++ b/matchblox/engine/C_3DObject.cpp
@@ -1,3 +1,4 @@
+#include <GL/glew.h>
#include <GL/glut.h>
#include <vector>
#include <iostream>
@@ -78,15 +79,22 @@ void C_3DObject::TransRotateScale()
glScaled(m_Scale.x, m_Scale.y, m_Scale.z);
}
-void C_3DObject::Render()
+void C_3DObject::Render(GLint f_iTexLocation)
{
//apply OpenGL settings for rendering this Object
glPushAttrib(GL_TEXTURE_BIT);
glEnable(GL_TEXTURE_2D);
//modulate the texture color with the computed material
//colors
+ glActiveTexture(GL_TEXTURE0);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glBindTexture(GL_TEXTURE_2D, m_uiColorTex);
+
+
+ if (f_iTexLocation != 0)
+ {
+ glUniform1i(f_iTexLocation, 0);
+ }
//set material properties
glMaterialfv(GL_FRONT, GL_AMBIENT, m_Mat.m_fAmb);