I've been working on a small console game for a while now but I'm running into the limitations of the console such as "rendering" is slow it has to type all the characters. How do I transform my game to a legit windowed game.
warning: window's gui components are actually slower than the console for typing text.
1) make sure that NO work for the game that you want to preserve is inside "main". All main should do is call functions.
2) isolate all the cin and cout or similar console interface stuff. You need to preserve it, but get it out of the code and off into function calls so you can easily replace them with GUI calls.
3) Make a new windows GUI project, or if using graphics, stop here to learn directdraw or direct3d or if you want it portable, opengl. If you want it portable, use QT instead of windows gui project. The easy thing to do is to convert it to windows forms with a menu bar, buttons, and maybe a few edit boxes, etc.
4) add your code to the project, and start calling the functions that run the game from the event handlers for the buttons, menu items, etc. Replacing your cout and cin with things like "edit3.setwindowtext()" that are tied to the widgits. You may need to figure out some sort of timer that does stuff every so often "as if in a loop in main".
so I make a function for each of the cout & cin (stream stuff), and instead of having the cout, or whatever, there I just call the function it relates to and it will just do that cout or something, right?
BTW I do plan on replacing text for graphics to get rid of the typing problem
The best advice I can offer is to look for a library which abstracts the platform-dependent stuff away for you. I like SDL2. There are some tutorials around which should be able to get you started. The documentation is okay.
IMO the greatest disadvantage of SDL is that using it in idiomatic modern C++ takes a little work; the library is written in C. https://www.libsdl.org/download-2.0.php
you probably want 1 function that writes text somewhere, and pass in the text to be written to it. Currently, that function would just be a wrapper for cout, later it might be "put graphical text at location X,Y in whatever color, opacity, font, ontop of existing or behind or blend etc, more graphics stuff, ...) (don't panic, you can just simply plop text down at a place, the rest is more or less optional stuff to think about)
lol I've played Dwarf Fortress once. I wonder how they made their graphics it's actually fluent and not more like a seizure (not that it's that bad). But right now I'm watching the Cherno setup opengl for his game engine I guess I'm going off that.