-
Console Functions Help
Hello, I always heard that you can not do graphics in windows 32 console. But I found this Function that says something abuot switching to Full Screen with hardware.
GetConsoleDisplayMode
Link
http://msdn.microsoft.com/library/en...splaymode.asp?
GetConsoleDisplayMode
The GetConsoleDisplayMode function retrieves the display mode of the current console.
BOOL GetConsoleDisplayMode(
LPDWORD lpModeFlags
);
Parameters
lpModeFlags
[out] Display mode of the console. This parameter can be one or more of the following values. Value Meaning
CONSOLE_FULLSCREEN Full-screen console. The console is in this mode as soon as the window is maximized. At this point, the transition to full-screen mode can still fail.
CONSOLE_FULLSCREEN_HARDWARE Full-screen console communicating directly with the video hardware. This mode is set after the console is in CONSOLE_FULLSCREEN mode to indicate that the transition to full-screen mode has completed.
Does this mean that You can Use SetConsoleDispayMode? And do Graphics in Console mode?
And How do you use Console functions? I tried passing the function CONSOLE_FULLSCREEN Full? but it didnt work.
Thanks. I would like to understand how to understand how to use Functions from the documentation :)
Byebye Have a good day and Thanks for Looking
-
Hello,
Using these Console functions take different codes per operating system, to my knowledge. Sadly, I don't believe there is a simple way to change a console to fullscreen using one variable.
Also, from short research, there are very few documents pertaining this matter. The MSDN is a good reference, but sometimes fails to show pseudo-code.
Though, one of the lasting links I have handy exist: How to switch a console window to fullscreen mode
I'm not sure how much more information I can provide. I do hope this helps.
- Stack Overflow
-
Do you know if you can do graphics in full screen mode? and how to do it? What can you do in fullscreen mode? is it just a bigger screen or can you acccess the video memory and do graphics? Ill look over the code you found. Its good. I found some other code but it was in a different language. http://forum.builder.cz/read.php?f=23&i=12485&t=12395
Maybe you can make sense of it. all the code is regular C++ stuff. The printf stuff is just in another language.
-
>> Do you know if you can do graphics in full screen mode?
ASCII graphics :)
Here's a nice tutorial on console programming in Win32:
http://www.adrianxw.dk/SoftwareSite/...Consoles1.html
As for making your console window fullscreen, I like my code the best :)
http://cboard.cprogramming.com/showthread.php?t=49825
gg
-
If you can only do ASci graphics, Why does it say CONSOLE_FULLSCREEN_HARDWARE Full-screen console communicating directly with the video hardware. What does that mean? Thanks for all the replies and links. I dont understand how to use the functions so its confusing.
-
All it really means is that the hardware video mode is changed to "full-screen text" mode.
gg
-
That is a flag returned by the GetConsoleDisplayMode() function it is to let you know that the mode was set to fullscreen and was completed and did not fail. it requires WINXP or better to work.
SetConsoleDisplayMode(hStdout,CONSOLE_FULLSCREEN_M ODE); will set the console to fullscreen
[edit]
changes to post in red Yeah I know it is availble in NT too :P
-
Yes I have Windows Xp, Are you sure you have All the code there? What is hStdout?
I dont get how to pass the arguments and use the functions on some of these. Here is the code I have.
Code:
#include <windows.h>
#include <Wincon.h>
#include <iostream>
using namespace std;
#define _WIN32_WINNT 0x0500
extern BOOL GetConsoleDisplayMode(LPDWORD lpModeFlags);
extern CONSOLE_FULLSCREEN;
extern CONSOLE_FULLSCREEN_MODE;
extern BOOL SetConsoleDisplayMode(HANDLE hConsoleOutput,DWORD dwFlags,PCOORD lpNewScreenBufferDimensions);
int main () {
SetConsoleDisplayMode(hStdout,CONSOLE_FULLSCREEN_MODE);
if(GetConsoleDisplayMode(hStdout,CONSOLE_FULLSCREEN)){
cout<<"FullScreen"<<endl;
}
system("PAUSE");
return 0;
}
When I try to use your code it says hStdout is unknown or something. and When I try to pass CONSOLE_FULLSCREEN to GetConsoleDisplayMode. It says Its the wrong type? What am I doing wrong?
-
>> ...it is for WINXP only...
It exists in all versions of NT. The Platform SDK has only advertised it on XP.
>> What is hStdout?
You'll want to learn basic C/C++ before doing anything with windows.h.
Once you've done that, click on the links I provided and read them.
gg
-
You need to get a HANDLE to the standard output. so something like
Code:
HANDLE hStdout=GetStdHandle(STD_OUTPUT_HANDLE);
you don't have to use hStdout you can name it whatever you want I just use hStdout so I
know it is an outupt handle that writes to the screen you can also
get the input handle that you can use to read information from the keyboard
HANDLE hStdin=GetStdHandle(STD_INPUT_HANDLE);
and to get the standard error to write error messages to
HANDLE hStderr=GetStdHandle(STD_ERROR_HANDLE);
When you are Getting the Display mode you are storing it in a variable.
DWORD FullScreen; or whatever you want to call it.
GetConsoleDisplayMode(hStdout,&FullScreen); //retreives the console mode and stores it in FullScreen variable;
you can test to see if the call to GetConsoleDisplayMode failed or succeeded by testing its return value.
bool test=GetConsoleDisplayMode(....
if(test==true)
//call to GetConsleDisplayMode succeeded
if(test==False)
//call to GetConsoleDisplayMode failed must be an error somewhere....
Now you can test the mode.
if(FullScreen==CONSOLE_FULLSCREEN)
//then it is still in the process of making the console fullscreen
if(FullScreen==CONSOLE_FULLSCREEN_HARDWARE)
//then the switch to fullscreen is complete