How to use Shaders with vertex & index buffers? I'm trying to render a randomly generated terrain with vertex buffers and OpenGL. I want to use a shader to color the terrain, but it seemms like my shader isn't used. I have used shaders before when drawing triangles manually on the CPU and didn't have any problems there.

activate and deactivate is just glUseProgram(m_ShaderProgram) and glUseProgram(0);

This is my draw method: 

void Terrain::drawTest() {

    glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_IndexBuffer);
    glBindBuffer(GL_ARRAY_BUFFER, m_VertexBuffer);

    glEnableClientState(GL_VERTEX_ARRAY);
    glEnableClientState(GL_NORMAL_ARRAY);

    // setup position &amp; normal pointers
    glVertexPointer(3, GL_FLOAT, sizeof(TerrainVertex), BUFFER_OFFSET(0));
    glNormalPointer(GL_FLOAT, sizeof(TerrainVertex), BUFFER_OFFSET(12));

    m_ShaderProgram.activate();
    glDrawElements(GL_TRIANGLES, indicesCount, GL_UNSIGNED_INT, BUFFER_OFFSET(0));
    m_ShaderProgram.deactivate();

    glDisableClientState(GL_VERTEX_ARRAY);
    glDisableClientState(GL_NORMAL_ARRAY);
}


And my shaders look like this:

Vertex shader:

varying vec3 Normal;
varying vec3 Position;
varying vec2 Texcoord;

void main(void) {
    Position = (gl_ModelViewMatrix * gl_Vertex).xyz;
    Normal = gl_NormalMatrix * gl_Normal;
    Texcoord = gl_MultiTexCoord0.xy;
    gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
}


Fragment shader:

varying vec3 Normal;
varying vec3 Position;
varying vec2 Texcoord;

void main(void) {
   gl_FragColor = vec4(1.0,1.0,0,0);
}


Result:


As you can see the fragment shader doesn't seem to do anything and I can't figure out what the problem is.
Apparently there was just a problem with the loading of the shader. A bug that crept into the code from an old project...

EDIT: The GLuint of the compiled shader was never saved in the class and only local to the load function. Just a stupid mistake really.