Added Input Classes And Fixed The Rendering

Only update the buffer one and update the graphics instance when the
buffer is set and before the image is drawn. Just a personal note.