For an assignment I need to write a program that on the first click will draw a point, on the second click will draw a line and on the third click will make the triangle. All of this is done in OpenGL.
I don't need any code, but as I'm brand new to all of this I'm having a difficult time understanding how to send this to the GPU with glDrawArrays(), as the function takes in a mode
. I know I want to keep appending the points to an array - but as the mode keeps changing (GL_POINTS, GL_LINE_LOOP, GL_TRIANGLES) I don't know how to store it.
Any and all conceptual help would be really appreciated.