One way would be messing with UV coordinates each frame.
Or you can use a shader. Here's a quick test hack I just made:
Vertex shader:
void main()
{
// transform the vertex position
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
// transform the texture coordinates
gl_TexCoord[0] = gl_Vertex/64;
// forward the vertex color
gl_FrontColor = gl_Color;
}
Fragment shader:
sampler2D texture;
void main()
{
// lookup the pixel in the texture
vec4 c = texture2D(texture, gl_TexCoord[0].xy);
gl_FragColor = c;
}
Applied to a sprite, that made the sprite's texture (which was set to repeat) stay in place as the sprite moved.
The 64 in the vertex shader was the resolution of the sprite's texture.