From 25987191eba8b03e5857638053e2136b7e64e05e Mon Sep 17 00:00:00 2001 From: Jean-Yves Lamoureux Date: Tue, 21 Jun 2005 16:13:41 +0000 Subject: [PATCH] GL driver : Updated documentation and added support for CACA_GEOMETRY --- src/caca.h | 6 ++++-- src/graphics.c | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/caca.h b/src/caca.h index 8a5c6e3..99b540a 100644 --- a/src/caca.h +++ b/src/caca.h @@ -39,7 +39,8 @@ * Mac OS X) using either the slang library or the ncurses library, on DOS * using the conio library, and on Windows systems using either slang or * ncurses (through Cygwin emulation) or conio. There is also a native X11 - * driver that does not require a text terminal. + * driver, and an OpenGL driver (through freeglut) that does not require a + * text terminal. * * \e libcaca is free software, released under the GNU Lesser General * Public License. This ensures that \e libcaca will always remain free @@ -61,10 +62,11 @@ * - \c ncurses uses the ncurses library. * - \c slang uses the S-Lang library. * - \c x11 uses the native X11 driver. + * - \c gl uses freeglut and opengl libraries. * * \li \b CACA_GEOMETRY: set the video display size. The format of this * variable must be XxY, with X and Y being integer values. This option - * currently only works with the X11 driver. + * currently only works with the X11 and the GL driver. * * \li \b CACA_FONT: set the rendered font. The format of this variable is * implementation dependent, but since it currently only works with the diff --git a/src/graphics.c b/src/graphics.c index 8ed3b0c..cb12b95 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -967,6 +967,10 @@ int _caca_init_graphics(void) int i; char *empty; + if(getenv("CACA_GEOMETRY") && *(getenv("CACA_GEOMETRY"))) + sscanf(getenv("CACA_GEOMETRY"), + "%ux%u", &_caca_width, &_caca_height); + if(!_caca_width) _caca_width = 80; if(!_caca_height)