I tried to do this myself by using glUnProject(); and store the 3 last values and use them as position for the glVertex3f(); vertex positioning obviously that didn't work it would draw the line but not at the exact location of the cursor or close enough that it wasn't noticeable after running the program.
So I was trying to deciper a way to do it and I'm 100% honestly stumped....
So in other words if someone knows how to do this feel free to tell me how you did it
Thanks in Advance
: Fixed tags.