I'm trying my hand at throwing together a minor roguelike in C++, but I've run into a problem - in order to get the game to display correctly, the console window has to be a bit wide (around 45 rows, 115 cols). It's easy enough to change by right clicking on the menu bar and setting the defaults for windows with the same name, but is there a way I could set it automatically from the code so I don't have to ask potential users to mess with that? I'm using Pdcurses to handle output, if that helps at all.
相关问题
- Sorting 3 numbers without branching [closed]
- How to compile C++ code in GDB?
- Why does const allow implicit conversion of refere
- thread_local variables initialization
- What uses more memory in c++? An 2 ints or 2 funct
相关文章
- window端口父进程PID查询
- Class layout in C++: Why are members sometimes ord
- How to mock methods return object with deleted cop
- Which is the best way to multiply a large and spar
- C++ default constructor does not initialize pointe
- Selecting only the first few characters in a strin
- What exactly do pointers store? (C++)
- Converting glm::lookat matrix to quaternion and ba
What OS? (because it is OS specific)
In Windows SetConsoleWindowInfo()
IIRC, this can be set in the shortcut that launches the game, but it's not text and I don't know which libraries or Windows APIs are used to modify it. That may be simpler than trying to use pdcurses.
However, don't forget Windows does have several console APIs. Start at AllocConsole in MSDN for an overview, or skip right to SetConsoleWindowInfo.
This is a really old question, but I'll post my answer anyway in case it helps someone in the future. This is what I use in MS Windows:
I use this directly before my call to
initscr();
, and it works like a charm. This is, obviously, not very portable, but it does the trick if all you're developing on is Windows.