Console Color - Possible?

Started by
10 comments, last by benryves 18 years, 8 months ago
Is this possible with Dev-C++?
The best thing to do is just choose whatever you think you'd prefer, and go for it. -Promit
Advertisement
yes it is if you download conio2 package you can do console colors.
I have done it and it works alright
Sure it is and for a good place to start look to one of our own.
Benryve's Notes
Gor435 - My Journal - MySpace - Facebook
You can do this by making use of Windows' console functions. Look at WriteConsoleOutput(). SetConsoleTextAttribute().

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/character_mode_applications.asp

:stylin:

EDIT: too fast Gor435 - nice link.
:stylin: "Make games, not war.""...if you're doing this to learn then just study a modern C++ compiler's implementation." -snk_kid
Thanks guys! I wanted to go to something like this before SDL.
The best thing to do is just choose whatever you think you'd prefer, and go for it. -Promit
Just to let you know, doing a game using console "graphics" is much more of a pain than using SDL even if you use a library that wraps it up nice and pretty like pdcurses.
Yeah,
I tried graphics in consoles and it was hard for me. Then I switched to SDL and I am doing good their. I have been studing it for 3 days and I am almost ready to make pong.
Quote:Original post by SiCrane
Just to let you know, doing a game using console "graphics" is much more of a pain than using SDL even if you use a library that wraps it up nice and pretty like pdcurses.
Indeed. Still, it's quite fun. [wink]
One thing I don't cover is setting the colour for "normal" console work (such as printf()), which could be handled with SetConsoleTextAttribute() as stylin mentioned. My methods tend to rely on writing the character/colour information to a CHAR_INFO buffer then copying that to the console window, which is probably more appropriate to the work you're doing.
On this subject, I don't know if I should write up how to manage colours/graphics better in a console window (such as I used in here). Would people find it useful?

[Website] [+++ Divide By Cucumber Error. Please Reinstall Universe And Reboot +++]

Yeah, a lot of it is tedious, but I'm going to write some functions for it.

EDIT: Your site's down now..are you working on it or did the worm hit it?
The best thing to do is just choose whatever you think you'd prefer, and go for it. -Promit
Quote:Original post by orcfan32
EDIT: Your site's down now..are you working on it or did the worm hit it?
That would be my very cheap hosting, sorry. Normally comes back in a few minutes... [rolleyes]

[Website] [+++ Divide By Cucumber Error. Please Reinstall Universe And Reboot +++]

This topic is closed to new replies.

Advertisement