win32.c (libcaca-0.99.beta19) | : | win32.c (libcaca-0.99.beta20.tar.bz2) | ||
---|---|---|---|---|
/* | /* | |||
* libcaca Colour ASCII-Art library | * libcaca Colour ASCII-Art library | |||
* Copyright (c) 2002-2012 Sam Hocevar <sam@hocevar.net> | * Copyright © 2002—2021 Sam Hocevar <sam@hocevar.net> | |||
* 2012 Bastian Märkisch <bmaerkisch@web.de> | * 2012 Bastian Märkisch <bmaerkisch@web.de> | |||
* All Rights Reserved | * All Rights Reserved | |||
* | * | |||
* This library is free software. It comes without any warranty, to | * This library is free software. It comes without any warranty, to | |||
* the extent permitted by applicable law. You can redistribute it | * the extent permitted by applicable law. You can redistribute it | |||
* and/or modify it under the terms of the Do What the Fuck You Want | * and/or modify it under the terms of the Do What the Fuck You Want | |||
* to Public License, Version 2, as published by Sam Hocevar. See | * to Public License, Version 2, as published by Sam Hocevar. See | |||
* http://www.wtfpl.net/ for more details. | * http://www.wtfpl.net/ for more details. | |||
*/ | */ | |||
/* | /* | |||
* This file contains the libcaca Win32 input and output driver | * This file contains the libcaca Win32 input and output driver | |||
skipping to change at line 169 | skipping to change at line 169 | |||
/* We want mouse and window resize events. */ | /* We want mouse and window resize events. */ | |||
GetConsoleMode(dp->drv.p->hin, &dp->drv.p->mode); | GetConsoleMode(dp->drv.p->hin, &dp->drv.p->mode); | |||
SetConsoleMode(dp->drv.p->hin, ENABLE_MOUSE_INPUT | ENABLE_WINDOW_INPUT); | SetConsoleMode(dp->drv.p->hin, ENABLE_MOUSE_INPUT | ENABLE_WINDOW_INPUT); | |||
cci_screen.dwSize = 1; /* must be > 0, see MSDN */ | cci_screen.dwSize = 1; /* must be > 0, see MSDN */ | |||
cci_screen.bVisible = FALSE; | cci_screen.bVisible = FALSE; | |||
SetConsoleCursorInfo(dp->drv.p->screen, &cci_screen); | SetConsoleCursorInfo(dp->drv.p->screen, &cci_screen); | |||
SetConsoleActiveScreenBuffer(dp->drv.p->screen); | SetConsoleActiveScreenBuffer(dp->drv.p->screen); | |||
dp->drv.p->buffer = malloc(width * height | dp->drv.p->buffer = _caca_alloc2d(width, height, sizeof(CHAR_INFO)); | |||
* sizeof(CHAR_INFO)); | ||||
if(dp->drv.p->buffer == NULL) | if(dp->drv.p->buffer == NULL) | |||
return -1; | return -1; | |||
return 0; | return 0; | |||
} | } | |||
static int win32_end_graphics(caca_display_t *dp) | static int win32_end_graphics(caca_display_t *dp) | |||
{ | { | |||
SetConsoleActiveScreenBuffer(dp->drv.p->hout); | SetConsoleActiveScreenBuffer(dp->drv.p->hout); | |||
CloseHandle(dp->drv.p->screen); | CloseHandle(dp->drv.p->screen); | |||
End of changes. 2 change blocks. | ||||
6 lines changed or deleted | 5 lines changed or added |