OpenGL Visual C++, how do I erase something I drew with OpenGL? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

OpenGL Visual C++, how do I erase something I drew with OpenGL?

I made a graph with OpenGL that allows me to draw during run time with an input function I made thing is I want to clear the lines how do I do that?

28th Mar 2018, 3:47 PM
Jacob
5 Answers
+ 7
I wonder if system("clear"); might work?
28th Mar 2018, 9:18 PM
Eric Zatarack
Eric Zatarack - avatar
+ 7
@Jacob thx for learning me on that
29th Mar 2018, 12:40 PM
Eric Zatarack
Eric Zatarack - avatar
+ 1
lets assume your drawing function is called "draw()" make an if statement around it, so under certain condition draw won't be called and your method won't execute on next refresh of screen. if (cond) { draw(function); }
28th Mar 2018, 4:15 PM
Jakub Stasiak
Jakub Stasiak - avatar
0
That’s not how it works I stored my class in a vector I clear the vector therefore when it goes through my for loop it’s still there even though draw() is no longer being called on it
28th Mar 2018, 4:18 PM
Jacob
0
No it does not work because OpenGL makes its own window system(“CLS”) only clears the output window not OpenGL’s window
29th Mar 2018, 12:19 PM
Jacob