Skip to main content
gamedev.net
🔒 Locked

Basic Full Screen DOS ?

Started by Dwiel Nov 14, 2001 at 3:23 PM 6 replies 800+ views
Original Post
Dwiel
Dwiel
How can I make my C++ application, using cout, cin, or printf, etc. functions, full screen with preferably a choise of the height, width of the screen, ex. 50*80 or 50*25 or whatever. I don''t want to use DX or GL or anything new just basic stuff for maybe a 2,3,486. Thanx Tazzel3D - Zach Maybe some ASM, example or whatever, I learn by examples.
Monolith
Monolith
I believe that would require OS specific commands.
Dwiel
Dwiel
All I want is so that in Windows, My DOS program start in fullscreen, and not the windowed thing it normally starts in. I need more space.

Thanx for the fast replies

TazzelD ~ Zach
Oluseyi
Oluseyi

HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
int width = GetSystemMetrics(SM_CXMAXIMIZED),
height = GetSystemMetrics(SM_CYMAXIMIZED);
SMALL_RECT rect;
rect.Left = 0;
rect.Top = 0;
rect.Right = width;
rect.Bottom = height;
COORD c;
// the coords below should be in terms of rows and columns, not pixels
c.X = cols;
c.Y = rows;
SetConsoleScreenBufferSize(hConsole, c);
SetConsoleWindowInfo(hConsole, TRUE, ▭);
Dwiel
Dwiel
I guess what I want to know to know what to do is create, update, etc what MSDN is calling a console. Oluseyi, I am very new to windows programming, and try to stay away from it most of the time, so, what else do I need for your code to work. I don''t even know how to create the consol.

Thanx for the quick replies.

Tazzeld ~ Zach
Oluseyi
Oluseyi
Alternatively,

CONSOLE_SCREEN_BUFFER_INFO info;
GetConsoleScreenBufferInfo(hConsole, &info);
COORD c;
c.X = info.dwMaximumWindowSize.X;
c.Y = info.dwMaximumWindowSize.Y;
SetConsoleScreenBufferSize(hConsole, c);
c = GetLargestConsoleWindowSize(hConsole);
if(c.X == 0 && c.Y == 0)
return GetLastError();
rect.Left = rect.Top = 0;
rect.Right = c.X;
rect.Bottom = c.Y;
SetConsoleWindowInfo(hConsole, TRUE, ▭);

I haven''t used these functions much, so you''ll have to fool around with them to get the results you want.
Oluseyi
Oluseyi
quote:
Original post by Tazzel3D
I guess what I want to know to know what to do is create, update, etc what MSDN is calling a console. Oluseyi, I am very new to windows programming, and try to stay away from it most of the time, so, what else do I need for your code to work. I don''t even know how to create the consol.

When you create a Win32 Console application (using main()), Windows allocates a console for you automatically. Using GetStdHandle() you can get a handle to that console and modify it. You''ll need to include <windows.h>.

Look up the declarations and descriptions of each of those functions in MSDN. And get comfortable with Win32 programming; it''s going to be around quite a while longer.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.