glVertexAttribXX(0, #value#) is the same as a glVertexXX(#value#) in that it issues a vertex so can only be called inside glBegin/glEnd. The others should be okay to call outside glBegin/glEnd though.