*** libggi/display/vgl/mode.c	Sun May 13 09:02:47 2001
--- libggi.bsd/display/vgl/mode.c	Wed Jul 11 09:50:06 2001
***************
*** 90,95 ****
--- 90,96 ----
  	char args[256];
  	int err = 0;
  	int id, i;
+ 	int pixelBytes;
  
  	err = GGI_vgl_checkmode(vis, tm);
  	if (err) return err;
***************
*** 98,108 ****
  	memset(&modeinfo, 0, sizeof(modeinfo));
  	
  	switch(gt) {
! 		case GT_1BIT : modeinfo.vi_depth = 1; break;
! 		case GT_4BIT : modeinfo.vi_depth = 4; break;
! 		case GT_8BIT : modeinfo.vi_depth = 8; break;
! 		case GT_16BIT: modeinfo.vi_depth = 16; break;
! 		case GT_32BIT: modeinfo.vi_depth = 32; break;
  
  		/* Unsupported mode depths */
  		case GT_15BIT:
--- 99,109 ----
  	memset(&modeinfo, 0, sizeof(modeinfo));
  	
  	switch(gt) {
! 		case GT_1BIT : modeinfo.vi_depth = 1; pixelBytes = 1; break;
! 		case GT_4BIT : modeinfo.vi_depth = 4; pixelBytes = 1; break;
! 		case GT_8BIT : modeinfo.vi_depth = 8; pixelBytes = 1; break;
! 		case GT_16BIT: modeinfo.vi_depth = 16; pixelBytes = 2; break;
! 		case GT_32BIT: modeinfo.vi_depth = 32; pixelBytes = 4; break;
  
  		/* Unsupported mode depths */
  		case GT_15BIT:
***************
*** 151,161 ****
  		for (i = 0; i<tm->frames; i++) {
  			if (LIBGGI_FB_SIZE(tm) >
  				(VGLDisplay->Xsize*VGLDisplay->Ysize*
! 							VGLDisplay->PixelBytes)) {
  				fprintf(stderr, "display-vgl: framebuffer too large! (%d > %d*%d*%d)\n",
  					LIBGGI_FB_SIZE(tm),
  					VGLDisplay->Xsize, VGLDisplay->Ysize, 
! 					VGLDisplay->PixelBytes);
  				return GGI_ENOMEM;
  			}
  
--- 152,162 ----
  		for (i = 0; i<tm->frames; i++) {
  			if (LIBGGI_FB_SIZE(tm) >
  				(VGLDisplay->Xsize*VGLDisplay->Ysize*
! 					pixelBytes)) {
  				fprintf(stderr, "display-vgl: framebuffer too large! (%d > %d*%d*%d)\n",
  					LIBGGI_FB_SIZE(tm),
  					VGLDisplay->Xsize, VGLDisplay->Ysize, 
! 					pixelBytes);
  				return GGI_ENOMEM;
  			}
  
