summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/glide/fxapi.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>1999-11-15 18:05:00 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>1999-11-15 18:05:00 +0000
commit5a95679e58b3861eae5b276a1ff0b508f409f066 (patch)
treed710338617681c8cb548ec6eab491da005753343 /src/mesa/drivers/glide/fxapi.c
parente23e2759fc67973c0d2e3318f79837f88f8bad0d (diff)
update/merge with Daryll's X server changes
Diffstat (limited to 'src/mesa/drivers/glide/fxapi.c')
-rw-r--r--src/mesa/drivers/glide/fxapi.c91
1 files changed, 70 insertions, 21 deletions
diff --git a/src/mesa/drivers/glide/fxapi.c b/src/mesa/drivers/glide/fxapi.c
index baa9f3e15c..ca56188103 100644
--- a/src/mesa/drivers/glide/fxapi.c
+++ b/src/mesa/drivers/glide/fxapi.c
@@ -1,24 +1,52 @@
-/* -*- mode: C; tab-width:8; -*-
-
- fxapi.c - 3Dfx VooDoo/Mesa interface
-*/
+/* -*- mode: C; tab-width:8; -*- */
/*
- * 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.
+ * Mesa 3-D graphics library
+ * Version: 3.1
*
- * 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.
+ * Copyright (C) 1999 Brian Paul All Rights Reserved.
*
- * 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.
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
*
- ********************************************************************
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * Original Mesa / 3Dfx device driver (C) 1999 David Bucciarelli, by the
+ * terms stated above.
+ *
+ * Thank you for your contribution, David!
+ *
+ * Please make note of the above copyright/license statement. If you
+ * contributed code or bug fixes to this code under the previous (GNU
+ * Library) license and object to the new license, your code will be
+ * removed at your request. Please see the Mesa docs/COPYRIGHT file
+ * for more information.
+ *
+ * Additional Mesa/3Dfx driver developers:
+ * Daryll Strauss <daryll@precisioninsight.com>
+ * Keith Whitwell <keith@precisioninsight.com>
+ *
+ * See fxapi.h for more revision/author details.
+ */
+
+
+/* fxapi.c - 3Dfx VooDoo/Mesa interface */
+
+
+/********************************************************************
*
* Function names:
* fxMesa.... (The driver API)
@@ -820,9 +848,10 @@ void fxsignals()
/*
* Create a new FX/Mesa context and return a handle to it.
*/
-fxMesaContext GLAPIENTRY fxMesaCreateContext(GLuint win,GrScreenResolution_t res,
- GrScreenRefresh_t ref,
- const GLint attribList[])
+fxMesaContext GLAPIENTRY fxMesaCreateContext(GLuint win,
+ GrScreenResolution_t res,
+ GrScreenRefresh_t ref,
+ const GLint attribList[])
{
fxMesaContext fxMesa = NULL;
int i,type;
@@ -835,7 +864,7 @@ fxMesaContext GLAPIENTRY fxMesaCreateContext(GLuint win,GrScreenResolution_t res
GLint accumSize=0;
GLcontext *shareCtx = NULL;
GLcontext *ctx = 0;
- FX_GrContext_t glideContext = 0;
+ /*FX_GrContext_t glideContext = 0;*/
char *errorstr;
if (MESA_VERBOSE&VERBOSE_DRIVER) {
@@ -942,10 +971,30 @@ fxMesaContext GLAPIENTRY fxMesaCreateContext(GLuint win,GrScreenResolution_t res
goto errorhandler;
}
+ /* Pixel tables are use during pixel read-back */
+ if (glbHWConfig.SSTs[glbCurrentBoard].type == GR_SSTTYPE_VOODOO) {
+ fxInitPixelTables(GL_TRUE); /* use BGR pixel order on Voodoo1/2 */
+ }
+ else {
+ fxInitPixelTables(GL_FALSE); /* use RGB pixel order otherwise */
+ }
fxMesa->width=FX_grSstScreenWidth();
fxMesa->height=FX_grSstScreenHeight();
+ fxMesa->clipMinX = 0;
+ fxMesa->clipMaxX = fxMesa->width;
+ fxMesa->clipMinY = 0;
+ fxMesa->clipMaxY = fxMesa->height;
+
+ fxMesa->screen_width = fxMesa->width;
+ fxMesa->screen_height = fxMesa->height;
+ fxMesa->x_offset = 0;
+ fxMesa->y_offset = 0;
+ fxMesa->y_delta = 0;
+
+ fxMesa->needClip = 0;
+
if(verbose)
fprintf(stderr,"Glide screen size: %dx%d\n",
(int)FX_grSstScreenWidth(),(int)FX_grSstScreenHeight());
@@ -1204,7 +1253,7 @@ int GLAPIENTRY fxQueryHardware(void)
char buf[80];
FX_grGlideGetVersion(buf);
- fprintf(stderr,"Using Glide V%s\n",0);
+ fprintf(stderr,"Using Glide V%s\n","");
fprintf(stderr,"Number of boards: %d\n",glbHWConfig.num_sst);
if(glbHWConfig.SSTs[glbCurrentBoard].type==GR_SSTTYPE_VOODOO) {