summaryrefslogtreecommitdiffstats
path: root/osdep/getch2-win.c
diff options
context:
space:
mode:
authorwm4 <wm4@mplayer2.org>2012-03-16 18:57:23 +0100
committerwm4 <wm4@mplayer2.org>2012-03-16 19:14:44 +0100
commit6de8120822c2dd9c50ef23b4977421651396f1ae (patch)
tree11a977608cfc9f50cffbce4a879dd8e9b33b029c /osdep/getch2-win.c
parent0eb21226cbfdd200f2aea5d3a9db2cdbff4773a5 (diff)
parenta8168102668337f3c11619bea7e744fc245adff1 (diff)
downloadmpv-6de8120822c2dd9c50ef23b4977421651396f1ae.tar.bz2
mpv-6de8120822c2dd9c50ef23b4977421651396f1ae.tar.xz
Merge remote-tracking branch 'origin/master' into my_master
Conflicts: command.c mp_core.h mplayer.c screenshot.c
Diffstat (limited to 'osdep/getch2-win.c')
-rw-r--r--osdep/getch2-win.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/osdep/getch2-win.c b/osdep/getch2-win.c
index 0b4d2b0bae..326cf1a7d0 100644
--- a/osdep/getch2-win.c
+++ b/osdep/getch2-win.c
@@ -55,6 +55,12 @@ int screen_height=24;
char * erase_to_end_of_line = NULL;
void get_screen_size(void){
+ CONSOLE_SCREEN_BUFFER_INFO cinfo;
+ if (GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &cinfo))
+ {
+ screen_width = cinfo.dwMaximumWindowSize.X;
+ screen_height = cinfo.dwMaximumWindowSize.Y;
+ }
}
static HANDLE in;
@@ -77,7 +83,7 @@ static int getch2_internal(void)
/*check if there are input events*/
if(!GetNumberOfConsoleInputEvents(in,&retval))
{
- printf("getch2: can't get number of input events: %i\n",GetLastError());
+ printf("getch2: can't get number of input events: %i\n",(int)GetLastError());
return -1;
}
if(retval<=0)return -1;
@@ -165,7 +171,7 @@ void getch2_enable(void)
in = GetStdHandle(STD_INPUT_HANDLE);
if(!GetNumberOfConsoleInputEvents(in,&retval))
{
- printf("getch2: %i can't get number of input events [disabling console input]\n",GetLastError());
+ printf("getch2: %i can't get number of input events [disabling console input]\n",(int)GetLastError());
getch2_status = 0;
}
else getch2_status=1;