The shader needs to be "bound" before you can set a uniform. So it might look like this:
Code:
if (shaderWorks) {
//first bind the shader
program.bind();
//now set up any uniforms
program.setUniform2f("mouse", mouseX, mouseY);
}
... draw your stuff
Then, in the fragment shader, you would simply use the "mouse" uniform to modify the output color.
The uniform type determines which method you should use:
Code:
setUniform4f = vec4
setUniform3f = vec3
setUniform2f = vec2
setUniform1f = float
setUniform1i = int / sampler2D
(This is based on OpenGL/LWJGL naming, although in retrospect it might have been more Slick-like to simply overload setUniform.)