diff --git a/src/gpu/shader.cpp b/src/gpu/shader.cpp
index 953252d5..f44e6ceb 100644
--- a/src/gpu/shader.cpp
+++ b/src/gpu/shader.cpp
@@ -517,6 +517,22 @@ void Shader::SetUniform(ShaderUniform const &uni, mat4 const &m)
 #endif
 }
 
+void Shader::SetTexture(ShaderUniform const &uni, int id, int index)
+{
+    if (id == -1)
+        return;
+#if defined USE_D3D9 || defined _XBOX
+    /* FIXME: unimplemented */
+#elif !defined __CELLOS_LV2__
+    glActiveTexture(GL_TEXTURE0 + index);
+    //glEnable(GL_TEXTURE_2D);
+    glBindTexture(GL_TEXTURE_2D, id);
+    SetUniform(uni, index);
+#else
+    /* FIXME: unimplemented */
+#endif
+}
+
 void Shader::Bind() const
 {
 #if defined USE_D3D9 || defined _XBOX
diff --git a/src/gpu/shader.h b/src/gpu/shader.h
index 5441bed3..03ef8127 100644
--- a/src/gpu/shader.h
+++ b/src/gpu/shader.h
@@ -71,6 +71,10 @@ public:
     void SetUniform(ShaderUniform const &uni, mat3 const &m);
     void SetUniform(ShaderUniform const &uni, mat4 const &m);
 
+    /* FIXME: this should be called SetUniform, too, but we need a new
+     * type to represent textures. */
+    void SetTexture(ShaderUniform const &uni, int id, int index);
+
     void Bind() const;
     void Unbind() const;