Implementing Clipping in opengl with C++

Hi guys, I’m in the process of doing my first opengl assignment in my graphics class. I’m supposed to draw lines and polygons using glDrawPixels and after that implement clipping. I can’t seem to figure it out, do you guys have any resources or anything to put me in the correct direction? I was thinking of having a temporary buffer using vectors to display the clipping window and the new polygon/line and then switching back to the original buffer when the user exits out of clipping.

What exactely do you mean by clipping? Do you mean near/far clipping? Do you want to apply custom clipping planes to geometry? Or are we talking about only rendering into a
specific area of the screen (you mentioned a clipping window)?

For the later, see glScissor and glEnable(GL_SCISSOR_TEST).