summaryrefslogtreecommitdiffstats
path: root/matchblox/engine/C_3DObject.cpp
diff options
context:
space:
mode:
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);