954,498 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How to print text into console fast

Well... im making some kind of graphic engine for console in c++, ASCII based, just for exercise...

anyways, i was wandering, can i print text faster? Right now i'm printing the whole map of characters (pix[160][120]) in a single line, so it is fast, however i need it faster cause the screen is flickering and it is realy annoying..
help please?

im kind of newbie to console input output streaming..

deluksic
Newbie Poster
4 posts since Jan 2012
Reputation Points: 10
Solved Threads: 0
 

The console isn't meant to support graphics engines. If you want graphics, get a graphics library where you can use tricks like double buffering to avoid the flicker effect. If you want to use ASCII art graphics, be prepared to suffer the limitations of the console. It's that simple.

Narue
Bad Cop
Administrator
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
 
The console isn't meant to support graphics engines. If you want graphics, get a graphics library where you can use tricks like double buffering to avoid the flicker effect. If you want to use ASCII art graphics, be prepared to suffer the limitations of the console. It's that simple.

Yes but itried learning opengl and it is pain in the ass to make it work! i wanted to make my own ascii engine... for now i have suport for drawing circles, lines, rectangles even fill function like a bucket in paint! Also i included the window drawing and buttons.. its actually game engine... it has the step() function wich draws the screen all over again many times per second.. What were u saying about double buffering?

deluksic
Newbie Poster
4 posts since Jan 2012
Reputation Points: 10
Solved Threads: 0
 
Yes but i tried learning opengl and it is pain in the ass to make it work!


If you're going to give up as soon as it gets hard, then programming isn't for you.What were u saying about double buffering? Double Buffering .

Narue
Bad Cop
Administrator
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
 

No, i actually started learning it, but then i couldnt find opengl2.exe for 64-bit as in tutorial they were using 32-bit. I dont know what to do now. yes i tried google but didnt find anything that was refered to console apps.

deluksic
Newbie Poster
4 posts since Jan 2012
Reputation Points: 10
Solved Threads: 0
 

You might try limiting the number of refreshes you do by using a timer. It won't make it look great, but it should eliminate the worst flickering. Perhaps 2 refreshes a second?

dmanw100
Posting Whiz in Training
242 posts since Apr 2008
Reputation Points: 104
Solved Threads: 27
 
yes i tried google but didnt find anything that was refered to console apps.


Did you not read my first post?

Narue
Bad Cop
Administrator
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
 
Did you not read my first post?

yes i did, and actually i did a little bit of research on google and yes there is double buffering in console apps and i actually managed to make a decent graphics engine for my games with refresh rates up to 30-60 fps im not sure, but it isnt visible by eye. The page i copied the code and learned the method is: http://www.tomshardware.co.uk/forum/65918-25-technique-fast-win32-console-drawing

this thread is closed.

deluksic
Newbie Poster
4 posts since Jan 2012
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: