To conio.h or not to conio.h?

I have been building some pseudo code for a text-based game. While reserching some ideas I ran into some suggestions to learn about conio.h so I could use its getch() and text colors. I also ran into some forums that slammed similar suggestions saying that conio.h was not standardized so one should not use it. I want to remain OS independent and from research using system commands to do anything has many cons. Any suggestions on what I should do? Ways to do text colors would be nice but not essential.
text-based game


grumble grumble.

http://cplusplus.com/forum/articles/7311/page3.html#msg153518

EDIT:

I really need to get around to writing an article on this. The number of these posts has skyrocketed.
Last edited on
Haha, It's not really a serious game. It's just a way for me to test what I know, and to expand on what knowledge I have. I have also heard that conio.h is almost essential for a rogue-like game which is where I would like to peak at non-GUI applications. If I want to make a half decent game down the road I might be going with OpenGL and OpenAL, but for now I need to know if conio.h is really worth my time.

An after thought is what will I use for non-game programs? Like I stated, I would like to remain OS independent, but I have yet to find a way to do that. Maybe I should move to Java...
Well I finished this: http://cplusplus.com/forum/articles/28558/

Haha, It's not really a serious game. It's just a way for me to test what I know, and to expand on what knowledge I have.


But you'd be expanding in the wrong direction. If you plan on leaving the console for future games, why waste time learning more about the console?

An after thought is what will I use for non-game programs? Like I stated, I would like to remain OS independent, but I have yet to find a way to do that. Maybe I should move to Java...


There are widgetry libs out there you can use. Qt and wxWidgets are two of the big name ones. Both cross platform.
I see your point. If I decide to continue with this little test I will just use standard c++ and not worry about polishing it for console's sake. It is in the pseudo code stage anyway so it will be very easy to change it's design for a GUI.

The SFML you have mentioned in the links you gave me looks very promising to start with. I'll give it a look over and see if it's for me.

This is the first time I have heard of widgetry libraries. I will study up on them, especially Qt and/or wxWidgets.

Thank you for the info and the advice. I was wondering why this C++ game programming book never mentioned any thing about console manipulation other than \n or endl.
Actually you can design your game clearly into the non-GUI and GUI portion. This mean you can swap the GUI API in and out easily without "disturbing" those non-GUI business logic. That is what I did for my own pet Android game.

Btw, Android do support C++ in some limited ways but it is still Java predominantly. My experience is when I tap the screen too quickly or furiously I can feel the 'lag' I presume is Android Dalvik machine doing the garbage collection aggressively.

I believe serious game should still be programmed in C++ for maximum performance and smooth-ness :)
I have heard of NCurses. They say it is a really good option for rogue-likes. Whether or not I want to do a rogue-like, I think I can spend some time reading up on it.

Not too fond of Java or Flash for that matter, however that is what people keep telling me to start with before delving deeper into C++. Java and Flash have way too much overhead for my tastes and I lost count of how many games I played that would have been really good if they weren't made in flash. Oh well, to each his own.

Thank you for the info and the links. I have looked for a Curses tutorial before and didn't find one, but NCurses seems to be a better, more up-to-date choice anyways.
NCurses is an excellent library, but I agree with Disch; if you want to try your hand at game development, the console is the wrong place to start.
I agree. Instead of taking your time to learn console tricks and NCurses, why not use the same time (or less!) to learn how to render to the screen and read user input in a way thay will be useful when you move on to bigger problems?
Topic archived. No new replies allowed.