Moved glLineWidth before glBegin otherwise it is invalid