/* $Id: xmesa1.c,v 1.25 1996/06/12 23:57:29 brianp Exp $ */

/*
 * Mesa 3-D graphics library
 * Version:  1.2
 * Copyright (C) 1995-1996  Brian Paul  (brianp@ssec.wisc.edu)
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the Free
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */


/*
$Log: xmesa1.c,v $
 * Revision 1.25  1996/06/12  23:57:29  brianp
 * gamma correction didn't work right for multiple HPCR-mode contexts
 *
 * Revision 1.24  1996/05/08  20:23:33  brianp
 * added MESA_XSYNC environment variable support
 *
 * Revision 1.23  1996/04/26  16:59:50  brianp
 * new colormap handling, added colormap argument to XMesaBindPixmap()
 *
 * Revision 1.22  1996/04/25  21:09:20  brianp
 * better XAllocColor error handling, prototyped new gl_new_context() func
 *
 * Revision 1.21  1996/03/02  21:41:05  brianp
 * added PF_8R8G8B pixel format
 *
 * Revision 1.20  1996/03/01  20:04:55  brianp
 * test for byte swapping and added a discussion of the subject
 *
 * Revision 1.19  1996/02/26  16:23:09  brianp
 * added PF_5R6G5B pixel format from Joerg Hessdoerfer
 *
 * Revision 1.18  1996/02/23  17:13:37  brianp
 * removed erroneous XImage byte swapping code
 *
 * Revision 1.17  1996/02/19  21:50:48  brianp
 * better XImage->data allocation
 *
 * Revision 1.16  1996/02/09  22:22:39  brianp
 * fixed default gamma value bug
 *
 * Revision 1.15  1996/02/06  03:25:43  brianp
 * added new gamma correction code
 *
 * Revision 1.14  1996/01/22  21:05:04  brianp
 * changed HPCR undithered pixelformat to PF_HPCR, per Alex De Bruyn
 *
 * Revision 1.13  1996/01/19  18:09:27  brianp
 * fixed potential X error handler bug in alloc_shm_back_buffer()
 *
 * Revision 1.12  1996/01/0