Am kinda new to OpenGL 3.0/GLSL 1.5 . So the new thing that they introduced in GLSL 1.5 was that we now have to specify Vertex attributes (gl_Vertex) and normals (gl_Normal) explicitly using glVertexAttribPointer. So i am able to draw one object using this piece of code in my display method.
glVertexAttribPointer(g_vertices, 4, GL_FLOAT, GL_FALSE, 0, cube.getVertices());
glVertexAttribPointer(g_normals, 3, GL_FLOAT, GL_FALSE, 0, cube.getNormals());
glDrawElements(GL_TRIANGLES, shape.getNumberIndices(), GL_UNSIGNED_INT, cube.getIndices()[/b]);
but when i try to use the same sequence of commands exactly after these commands to draw another object. I get an error accessing location (blah blah blah).
Is there way to draw multiple objects (having their own vertex, normal and index data) and using the same shader???