+ 1
Graphics with C++
Me personally, I am a visual learner and I was wondering what does C++ offer graphics wise (without any libraries).What I would like to do is, physics simulations; where I can see for example ball bouncing off of each other. Is that pissible in the terminal and if so what can you do to make it look better if that is possible. I know almost certainly that a library would make doing this visual "stuff" easier but all I want to know is if it is possible to do it in the terminal. As well as how much work would it take to make something like this possible. Thank you for your assistance
2 Réponses
+ 5
@hatsy
made text art in the past.
https://code.sololearn.com/cgTgpN54eeY2/?ref=app
or you can use os coding to add graphics.
+ 2
the c++ standard library offers no graphics capabilities. graphics in the terminal using functions from the standard library will also be very difficult because the standard library doesn‘t offer any way of redrawing just a certain letter and uses certain buffering for input and output(of course you can do it if you really want to, but it would probably be extremly ugly, i did the game of life once in the terminal and i really don‘t recommend the experience)
my personal recommendation would be using the sdl library(or maybe the sfml library if you don‘t need to address individual pixels but instead want to draw sprites)
this post might be useful for you:
https://stackoverflow.com/questions/1337529/how-to-update-a-printed-message-in-terminal-without-reprinting-linux
especially tricks with the \r and \b character