Changeset 515
- Timestamp:
- Nov 21, 2005, 6:24:33 PM (15 years ago)
- Location:
- libcaca/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/examples/cacaball.c
r514 r515 60 60 int p, frame = 0, pause = 0; 61 61 62 caca_set_size(40,40); 62 63 if(caca_init()) 63 64 return 1; -
libcaca/trunk/src/caca.h
r508 r515 251 251 unsigned int caca_get_width(void); 252 252 unsigned int caca_get_height(void); 253 void caca_set_size(unsigned int width, unsigned int height); 254 void caca_set_width(unsigned int width); 255 void caca_set_height(unsigned int height); 253 256 int caca_set_window_title(char const *); 254 257 unsigned int caca_get_window_width(void); -
libcaca/trunk/src/graphics.c
r513 r515 673 673 int _caca_init_graphics(void) 674 674 { 675 676 675 677 #if defined(HAVE_SIGNAL) && (defined(USE_NCURSES) || defined(USE_SLANG)) 676 678 signal(SIGWINCH, sigwinch_handler); … … 806 808 int i; 807 809 810 if(!_caca_width && !_caca_height) 808 811 if(getenv("CACA_GEOMETRY") && *(getenv("CACA_GEOMETRY"))) 809 812 sscanf(getenv("CACA_GEOMETRY"), … … 932 935 /* Sample code to get the biggest possible window */ 933 936 //size = GetLargestConsoleWindowSize(win32_hout); 934 935 _caca_width = csbi.srWindow.Right - csbi.srWindow.Left + 1; 936 _caca_height = csbi.srWindow.Bottom - csbi.srWindow.Top + 1; 937 937 if(!_caca_width && !_caca_height) 938 { 939 _caca_width = csbi.srWindow.Right - csbi.srWindow.Left + 1; 940 _caca_height = csbi.srWindow.Bottom - csbi.srWindow.Top + 1; 941 } 938 942 size.X = _caca_width; 939 943 size.Y = _caca_height; … … 965 969 int i; 966 970 char *empty; 967 968 if(getenv("CACA_GEOMETRY") && *(getenv("CACA_GEOMETRY"))) 971 972 if(!_caca_width && !_caca_height) 973 if(getenv("CACA_GEOMETRY") && *(getenv("CACA_GEOMETRY"))) 969 974 sscanf(getenv("CACA_GEOMETRY"), 970 975 "%ux%u", &_caca_width, &_caca_height); … … 1054 1059 if(_caca_driver == CACA_DRIVER_NULL) 1055 1060 { 1061 if(!_caca_width && !_caca_height) 1056 1062 if(getenv("CACA_GEOMETRY") && *(getenv("CACA_GEOMETRY"))) 1057 1058 1059 1060 1061 1062 1063 sscanf(getenv("CACA_GEOMETRY"), 1064 "%ux%u", &_caca_width, &_caca_height); 1065 if(!_caca_width) 1066 _caca_width = 80; 1067 if(!_caca_height) 1068 _caca_height = 32; 1063 1069 } 1064 1070 else … … 1280 1286 return _caca_height * 10; 1281 1287 } 1288 1289 1290 /** \brief Set the size of the display on devices that permit it 1291 * 1292 * This function sets the display width and height, on devices 1293 * that permit it. We're talking here about the size in 1294 * CHARACTERS fo the window, NOT in pixels. 1295 * \param width The width of the window, in CHARACTERS. 1296 * \param heigth The height of the window, in CHARACTERS. 1297 */ 1298 void caca_set_size(unsigned int width, unsigned int height) 1299 { 1300 _caca_width = width; 1301 _caca_height = height; 1302 } 1303 1304 1305 1306 /** \brief Set the width of the window, in characters, if device permits it. 1307 * 1308 * This function sets the width of displayable image, in characters. 1309 * \param width The width of the window, in CHARACTERS. 1310 */ 1311 void caca_set_width(unsigned int width) 1312 { 1313 _caca_width = width; 1314 } 1315 /** \brief Set the height of the window, in characters, if device permits it. 1316 * 1317 * This function sets the height of displayable image, in characters. 1318 * \param width The width of the window, in CHARACTERS. 1319 */ 1320 void caca_set_height(unsigned int height) 1321 { 1322 _caca_height = height; 1323 } 1324 1325 1282 1326 1283 1327 /** \brief Set the refresh delay.
Note: See TracChangeset
for help on using the changeset viewer.