I ran into a problem which I haven't figured out yet.
If Self.multitexture = 0 Then
glBindTexture(GL_TEXTURE_2D,Self.texture[0].resource)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR)
glEnable(GL_TEXTURE_2D)
glBegin(GL_TRIANGLES)
Self.mesh.drawTextured()
glEnd()
Else
glActiveTextureARB(GL_TEXTURE0_ARB)
glBindTexture(GL_TEXTURE_2D, Self.texture[0].resource)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR)
glEnable(GL_TEXTURE_2D)
glActiveTextureARB(GL_TEXTURE1_ARB)
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB) ' combine textures
glTexEnvi(GL_TEXTURE_ENV, GL_RGB_SCALE_ARB, Self.multitexturescale) ' set RGB scaling
glBindTexture(GL_TEXTURE_2D, Self.texture[1].resource)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR)
glEnable(GL_TEXTURE_2D)
glBegin(GL_TRIANGLES)
Self.mesh.drawMultiTextured()
glEnd()
End If
The code above shows how I setup the multi texture, but if I add a texture to one entity, then all entities becomes multi textured. I am thinking its because I need to somehow turn it off when doing the entities with only one texture on. But I have been searching around on the net and not finding anything yet that can enlighten me. So I am hoping one of you guys might have ideas worth trying out.