#How to make a smoother terminal animation in c++

25 messages · Page 1 of 1 (latest)

raven lanceBOT
#

When your question is answered use !solved or the button below to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

silver crest
#

if your terminal supports ANSI escape codes, you could speed up rendering by only printing characters that change between frames

#

this should also avoid the flickering

turbid haven
#

I wonder if something like FTXUI could help here

silver crest
#

e.g. cpp std::print("\x1B[{};{}H{}", 5, 16, '#'); prints # on row 5 in column 16

turbid haven
#

I know it has really smooth animations in it

silver crest
#

i wonder if ftxui does exactly what i explained here

#

or if it does something even smarter

ripe raven
#

You could try not clearing the screen, and only moving the cursor to the top-left corner. And then printing on top of whatever is already there

silver crest
#

good idea, that might be enough

hollow jay
#

So I was messing around today when I had time, and I tried the method where I move the the home position, put it didn't really work.

ripe raven
#

Wdym by didn't work?

hollow jay
#

sorry, im trying to get the win snippet tool work properly

#

so no overwrite happen at all. I don't know why

ripe raven
hollow jay
#

bc i tried in a smaller program

#

and there it worked

hollow jay
#

Okey I got it. There was a problem with the order of instructions. I'm very stupid.

raven lanceBOT
# raven lance

Thank you and let us know if you have any more questions!

This thread is now set to auto-hide after an hour of inactivity