added state checks -> removed most redundant gl calls