split the shading code into shader.c and added reshape function