head	3.23;
access;
symbols
	merge-1:3.16.2.2
	autoconf:3.16.0.4
	experimental-1:3.16.0.2
	mesa-3-1-with-kw3:3.13
	mesa-3-1-prior-to-kw3:3.12;
locks; strict;
comment	@ * @;


3.23
date	99.08.03.14.42.02;	author keithw;	state Exp;
branches;
next	3.22;

3.22
date	99.07.31.19.58.13;	author brianp;	state Exp;
branches;
next	3.21;

3.21
date	99.07.29.17.41.13;	author miklos;	state Exp;
branches;
next	3.20;

3.20
date	99.07.14.12.42.55;	author brianp;	state Exp;
branches;
next	3.19;

3.19
date	99.07.13.15.48.01;	author brianp;	state Exp;
branches;
next	3.18;

3.18
date	99.07.12.12.05.22;	author keithw;	state Exp;
branches;
next	3.17;

3.17
date	99.06.08.01.23.54;	author brianp;	state Exp;
branches;
next	3.16;

3.16
date	99.05.08.14.47.30;	author brianp;	state Exp;
branches
	3.16.2.1;
next	3.15;

3.15
date	99.03.31.20.18.37;	author keithw;	state Exp;
branches;
next	3.14;

3.14
date	99.03.17.12.08.22;	author keithw;	state Exp;
branches;
next	3.13;

3.13
date	99.02.25.14.12.29;	author keithw;	state Exp;
branches;
next	3.12;

3.12
date	99.02.24.22.48.04;	author jens;	state Exp;
branches;
next	3.11;

3.11
date	99.02.14.03.46.34;	author brianp;	state Exp;
branches;
next	3.10;

3.10
date	99.01.03.03.28.39;	author brianp;	state Exp;
branches;
next	3.9;

3.9
date	98.11.27.14.12.05;	author brianp;	state Exp;
branches;
next	3.8;

3.8
date	98.11.27.13.59.26;	author brianp;	state Exp;
branches;
next	3.7;

3.7
date	98.11.19.03.07.14;	author brianp;	state Exp;
branches;
next	3.6;

3.6
date	98.08.21.02.43.52;	author brianp;	state Exp;
branches;
next	3.5;

3.5
date	98.07.26.02.32.43;	author brianp;	state Exp;
branches;
next	3.4;

3.4
date	98.03.27.03.30.36;	author brianp;	state Exp;
branches;
next	3.3;

3.3
date	98.03.10.01.26.57;	author brianp;	state Exp;
branches;
next	3.2;

3.2
date	98.02.20.04.49.19;	author brianp;	state Exp;
branches;
next	3.1;

3.1
date	98.02.06.01.57.42;	author brianp;	state Exp;
branches;
next	3.0;

3.0
date	98.01.31.20.43.12;	author brianp;	state Exp;
branches;
next	;

3.16.2.1
date	99.06.06.22.35.53;	author keithw;	state Exp;
branches;
next	3.16.2.2;

3.16.2.2
date	99.06.19.15.04.13;	author keithw;	state Exp;
branches;
next	;


desc
@part two of API functions
@


3.23
log
@fixes for bugs from eero and miklos
@
text
@/* $Id: api2.c,v 3.22 1999/07/31 19:58:13 brianp Exp $ */

/*
 * Mesa 3-D graphics library
 * Version:  3.1
 * 
 * Copyright (C) 1999  Brian Paul   All Rights Reserved.
 * 
 * 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.
 */



#ifdef PC_HEADER
#include "all.h"
#else
#include <stdio.h>
#include <stdlib.h>
#include "api.h"
#include "context.h"
#include "varray.h"
#include "image.h"
#include "macros.h"
#include "matrix.h"
#include "teximage.h"
#include "types.h"
#include "vb.h"
#ifdef XFree86Server
#include "GL/xf86glx.h"
#endif
#endif


/*
 * Part 2 of API functions
 */

void GLAPIENTRY glOrtho(CTX_ARG GLdouble left, GLdouble right,
                         GLdouble bottom, GLdouble top,
                         GLdouble nearval, GLdouble farval )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.Ortho)(CC, left, right, bottom, top, nearval, farval);
}


void GLAPIENTRY glPassThrough(CTX_ARG GLfloat token )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.PassThrough)(CC, token);
}


void GLAPIENTRY glPixelMapfv(CTX_ARG GLenum map, GLint mapsize, const GLfloat *values )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.PixelMapfv)( CC, map, mapsize, values );
}


void GLAPIENTRY glPixelMapuiv(CTX_ARG GLenum map, GLint mapsize, const GLuint *values )
{
   GLfloat fvalues[MAX_PIXEL_MAP_TABLE];
   GLint i;
   GET_CONTEXT;
   CHECK_CONTEXT;

   if (map==GL_PIXEL_MAP_I_TO_I || map==GL_PIXEL_MAP_S_TO_S) {
      for (i=0;i<mapsize;i++) {
         fvalues[i] = (GLfloat) values[i];
      }
   }
   else {
      for (i=0;i<mapsize;i++) {
         fvalues[i] = UINT_TO_FLOAT( values[i] );
      }
   }
   (*CC->API.PixelMapfv)( CC, map, mapsize, fvalues );
}



void GLAPIENTRY glPixelMapusv(CTX_ARG GLenum map, GLint mapsize, const GLushort *values )
{
   GLfloat fvalues[MAX_PIXEL_MAP_TABLE];
   GLint i;
   GET_CONTEXT;
   CHECK_CONTEXT;

   if (map==GL_PIXEL_MAP_I_TO_I || map==GL_PIXEL_MAP_S_TO_S) {
      for (i=0;i<mapsize;i++) {
         fvalues[i] = (GLfloat) values[i];
      }
   }
   else {
      for (i=0;i<mapsize;i++) {
         fvalues[i] = USHORT_TO_FLOAT( values[i] );
      }
   }
   (*CC->API.PixelMapfv)( CC, map, mapsize, fvalues );
}


void GLAPIENTRY glPixelStoref(CTX_ARG GLenum pname, GLfloat param )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.PixelStorei)( CC, pname, (GLint) param );
}


void GLAPIENTRY glPixelStorei(CTX_ARG GLenum pname, GLint param )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.PixelStorei)( CC, pname, param );
}


void GLAPIENTRY glPixelTransferf(CTX_ARG GLenum pname, GLfloat param )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.PixelTransferf)(CC, pname, param);
}


void GLAPIENTRY glPixelTransferi(CTX_ARG GLenum pname, GLint param )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.PixelTransferf)(CC, pname, (GLfloat) param);
}


void GLAPIENTRY glPixelZoom(CTX_ARG GLfloat xfactor, GLfloat yfactor )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.PixelZoom)(CC, xfactor, yfactor);
}


void GLAPIENTRY glPointSize(CTX_ARG GLfloat size )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.PointSize)(CC, size);
}


void GLAPIENTRY glPolygonMode(CTX_ARG GLenum face, GLenum mode )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.PolygonMode)(CC, face, mode);
}


void GLAPIENTRY glPolygonOffset(CTX_ARG GLfloat factor, GLfloat units )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.PolygonOffset)( CC, factor, units );
}


/* GL_EXT_polygon_offset */
void GLAPIENTRY glPolygonOffsetEXT(CTX_ARG GLfloat factor, GLfloat bias )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.PolygonOffset)( CC, factor, bias * DEPTH_SCALE );
}


void GLAPIENTRY glPolygonStipple(CTX_ARG const GLubyte *pattern )
{
   GLuint unpackedPattern[32];
   GET_CONTEXT;
   CHECK_CONTEXT;
   gl_unpack_polygon_stipple( CC, pattern, unpackedPattern );
   (*CC->API.PolygonStipple)(CC, unpackedPattern);
}


void GLAPIENTRY glPopAttrib(CTX_VOID )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.PopAttrib)(CC);
}


void GLAPIENTRY glPopClientAttrib(CTX_VOID )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.PopClientAttrib)(CC);
}


void GLAPIENTRY glPopMatrix(CTX_VOID )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.PopMatrix)( CC );
}


void GLAPIENTRY glPopName(CTX_VOID )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.PopName)(CC);
}


void GLAPIENTRY glPrioritizeTextures(CTX_ARG GLsizei n, const GLuint *textures,
                                      const GLclampf *priorities )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.PrioritizeTextures)(CC, n, textures, priorities);
}


void GLAPIENTRY glPushMatrix(CTX_VOID )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.PushMatrix)( CC );
}


void GLAPIENTRY glRasterPos2d(CTX_ARG GLdouble x, GLdouble y )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.RasterPos4f)( CC, (GLfloat) x, (GLfloat) y, 0.0F, 1.0F );
}


void GLAPIENTRY glRasterPos2f(CTX_ARG GLfloat x, GLfloat y )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.RasterPos4f)( CC, (GLfloat) x, (GLfloat) y, 0.0F, 1.0F );
}


void GLAPIENTRY glRasterPos2i(CTX_ARG GLint x, GLint y )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.RasterPos4f)( CC, (GLfloat) x, (GLfloat) y, 0.0F, 1.0F );
}


void GLAPIENTRY glRasterPos2s(CTX_ARG GLshort x, GLshort y )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.RasterPos4f)( CC, (GLfloat) x, (GLfloat) y, 0.0F, 1.0F );
}


void GLAPIENTRY glRasterPos3d(CTX_ARG GLdouble x, GLdouble y, GLdouble z )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.RasterPos4f)( CC, (GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F );
}


void GLAPIENTRY glRasterPos3f(CTX_ARG GLfloat x, GLfloat y, GLfloat z )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.RasterPos4f)( CC, (GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F );
}


void GLAPIENTRY glRasterPos3i(CTX_ARG GLint x, GLint y, GLint z )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.RasterPos4f)( CC, (GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F );
}


void GLAPIENTRY glRasterPos3s(CTX_ARG GLshort x, GLshort y, GLshort z )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.RasterPos4f)( CC, (GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F );
}


void GLAPIENTRY glRasterPos4d(CTX_ARG GLdouble x, GLdouble y, GLdouble z, GLdouble w )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.RasterPos4f)( CC, (GLfloat) x, (GLfloat) y,
                           (GLfloat) z, (GLfloat) w );
}


void GLAPIENTRY glRasterPos4f(CTX_ARG GLfloat x, GLfloat y, GLfloat z, GLfloat w )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.RasterPos4f)( CC, x, y, z, w );
}


void GLAPIENTRY glRasterPos4i(CTX_ARG GLint x, GLint y, GLint z, GLint w )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.RasterPos4f)( CC, (GLfloat) x, (GLfloat) y,
                           (GLfloat) z, (GLfloat) w );
}


void GLAPIENTRY glRasterPos4s(CTX_ARG GLshort x, GLshort y, GLshort z, GLshort w )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.RasterPos4f)( CC, (GLfloat) x, (GLfloat) y,
                           (GLfloat) z, (GLfloat) w );
}


void GLAPIENTRY glRasterPos2dv(CTX_ARG const GLdouble *v )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.RasterPos4f)( CC, (GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F );
}


void GLAPIENTRY glRasterPos2fv(CTX_ARG const GLfloat *v )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.RasterPos4f)( CC, (GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F );
}


void GLAPIENTRY glRasterPos2iv(CTX_ARG const GLint *v )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.RasterPos4f)( CC, (GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F );
}


void GLAPIENTRY glRasterPos2sv(CTX_ARG const GLshort *v )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.RasterPos4f)( CC, (GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F );
}


void GLAPIENTRY glRasterPos3dv(CTX_ARG const GLdouble *v )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.RasterPos4f)( CC, (GLfloat) v[0], (GLfloat) v[1],
                           (GLfloat) v[2], 1.0F );
}


void GLAPIENTRY glRasterPos3fv(CTX_ARG const GLfloat *v )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.RasterPos4f)( CC, (GLfloat) v[0], (GLfloat) v[1],
                               (GLfloat) v[2], 1.0F );
}


void GLAPIENTRY glRasterPos3iv(CTX_ARG const GLint *v )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.RasterPos4f)( CC, (GLfloat) v[0], (GLfloat) v[1],
                           (GLfloat) v[2], 1.0F );
}


void GLAPIENTRY glRasterPos3sv(CTX_ARG const GLshort *v )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.RasterPos4f)( CC, (GLfloat) v[0], (GLfloat) v[1],
                           (GLfloat) v[2], 1.0F );
}


void GLAPIENTRY glRasterPos4dv(CTX_ARG const GLdouble *v )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.RasterPos4f)( CC, (GLfloat) v[0], (GLfloat) v[1],
                           (GLfloat) v[2], (GLfloat) v[3] );
}


void GLAPIENTRY glRasterPos4fv(CTX_ARG const GLfloat *v )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.RasterPos4f)( CC, v[0], v[1], v[2], v[3] );
}


void GLAPIENTRY glRasterPos4iv(CTX_ARG const GLint *v )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.RasterPos4f)( CC, (GLfloat) v[0], (GLfloat) v[1],
                           (GLfloat) v[2], (GLfloat) v[3] );
}


void GLAPIENTRY glRasterPos4sv(CTX_ARG const GLshort *v )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.RasterPos4f)( CC, (GLfloat) v[0], (GLfloat) v[1],
                           (GLfloat) v[2], (GLfloat) v[3] );
}


void GLAPIENTRY glReadBuffer(CTX_ARG GLenum mode )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.ReadBuffer)( CC, mode );
}


void GLAPIENTRY glReadPixels(CTX_ARG GLint x, GLint y, GLsizei width, GLsizei height,
                              GLenum format, GLenum type, GLvoid *pixels )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.ReadPixels)( CC, x, y, width, height, format, type, pixels );
}


void GLAPIENTRY glRectd(CTX_ARG GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2 )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.Rectf)( CC, (GLfloat) x1, (GLfloat) y1,
                     (GLfloat) x2, (GLfloat) y2 );
}


void GLAPIENTRY glRectf(CTX_ARG GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.Rectf)( CC, x1, y1, x2, y2 );
}


void GLAPIENTRY glRecti(CTX_ARG GLint x1, GLint y1, GLint x2, GLint y2 )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.Rectf)( CC, (GLfloat) x1, (GLfloat) y1,
                         (GLfloat) x2, (GLfloat) y2 );
}


void GLAPIENTRY glRects(CTX_ARG GLshort x1, GLshort y1, GLshort x2, GLshort y2 )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.Rectf)( CC, (GLfloat) x1, (GLfloat) y1,
                     (GLfloat) x2, (GLfloat) y2 );
}


void GLAPIENTRY glRectdv(CTX_ARG const GLdouble *v1, const GLdouble *v2 )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.Rectf)(CC, (GLfloat) v1[0], (GLfloat) v1[1],
                    (GLfloat) v2[0], (GLfloat) v2[1]);
}


void GLAPIENTRY glRectfv(CTX_ARG const GLfloat *v1, const GLfloat *v2 )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.Rectf)(CC, v1[0], v1[1], v2[0], v2[1]);
}


void GLAPIENTRY glRectiv(CTX_ARG const GLint *v1, const GLint *v2 )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.Rectf)( CC, (GLfloat) v1[0], (GLfloat) v1[1],
                     (GLfloat) v2[0], (GLfloat) v2[1] );
}


void GLAPIENTRY glRectsv(CTX_ARG const GLshort *v1, const GLshort *v2 )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.Rectf)(CC, (GLfloat) v1[0], (GLfloat) v1[1],
        (GLfloat) v2[0], (GLfloat) v2[1]);
}


void GLAPIENTRY glScissor(CTX_ARG GLint x, GLint y, GLsizei width, GLsizei height)
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.Scissor)(CC, x, y, width, height);
}


GLboolean GLAPIENTRY glIsEnabled(CTX_ARG GLenum cap )
{
   GET_CONTEXT;
   CHECK_CONTEXT_RETURN(GL_FALSE);
   return (*CC->API.IsEnabled)( CC, cap );
}



void GLAPIENTRY glPushAttrib(CTX_ARG GLbitfield mask )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.PushAttrib)(CC, mask);
}


void GLAPIENTRY glPushClientAttrib(CTX_ARG GLbitfield mask )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.PushClientAttrib)(CC, mask);
}


void GLAPIENTRY glPushName(CTX_ARG GLuint name )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.PushName)(CC, name);
}


GLint GLAPIENTRY glRenderMode(CTX_ARG GLenum mode )
{
   GET_CONTEXT;
   CHECK_CONTEXT_RETURN(0);
   return (*CC->API.RenderMode)(CC, mode);
}


void GLAPIENTRY glRotated(CTX_ARG GLdouble angle, GLdouble x, GLdouble y, GLdouble z )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.Rotatef)( CC, (GLfloat) angle,
                       (GLfloat) x, (GLfloat) y, (GLfloat) z );
}


void GLAPIENTRY glRotatef(CTX_ARG GLfloat angle, GLfloat x, GLfloat y, GLfloat z )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.Rotatef)( CC, angle, x, y, z );
}


void GLAPIENTRY glSelectBuffer(CTX_ARG GLsizei size, GLuint *buffer )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.SelectBuffer)(CC, size, buffer);
}


void GLAPIENTRY glScaled(CTX_ARG GLdouble x, GLdouble y, GLdouble z )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.Scalef)( CC, (GLfloat) x, (GLfloat) y, (GLfloat) z );
}


void GLAPIENTRY glScalef(CTX_ARG GLfloat x, GLfloat y, GLfloat z )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.Scalef)( CC, x, y, z );
}


void GLAPIENTRY glShadeModel(CTX_ARG GLenum mode )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.ShadeModel)(CC, mode);
}


void GLAPIENTRY glStencilFunc(CTX_ARG GLenum func, GLint ref, GLuint mask )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.StencilFunc)(CC, func, ref, mask);
}


void GLAPIENTRY glStencilMask(CTX_ARG GLuint mask )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.StencilMask)(CC, mask);
}


void GLAPIENTRY glStencilOp(CTX_ARG GLenum fail, GLenum zfail, GLenum zpass )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.StencilOp)(CC, fail, zfail, zpass);
}

#define TEXCOORD1(s)				\
{						\
   GLuint count;				\
   GLfloat *tc;					\
   GET_IMMEDIATE;				\
   count = IM->Count;				\
   IM->Flag[count] |= VERT_TEX0_1;		\
   tc = IM->TexCoord[0][count];			\
   ASSIGN_4V(tc,s,0,0,1);			\
}

#define TEXCOORD2(s,t)				\
{						\
   GLuint count;				\
   GLfloat *tc;					\
   GET_IMMEDIATE;				\
   count = IM->Count;				\
   IM->Flag[count] |= VERT_TEX0_12;		\
   tc = IM->TexCoord[0][count];			\
   ASSIGN_4V(tc, s,t,0,1);		        \
}

#define TEXCOORD3(s,t,u)			\
{						\
   GLuint count;				\
   GLfloat *tc;					\
   GET_IMMEDIATE;				\
   count = IM->Count;				\
   IM->Flag[count] |= VERT_TEX0_123;		\
   tc = IM->TexCoord[0][count];			\
   ASSIGN_4V(tc, s,t,u,1);			\
}

#define TEXCOORD4(s,t,u,v)			\
{						\
   GLuint count;				\
   GLfloat *tc;					\
   GET_IMMEDIATE;				\
   count = IM->Count;				\
   IM->Flag[count] |= VERT_TEX0_1234;		\
   tc = IM->TexCoord[0][count];			\
   ASSIGN_4V(tc, s,t,u,v);			\
}


void GLAPIENTRY glTexCoord1d(CTX_ARG GLdouble s )
{
   TEXCOORD1(s);
}


void GLAPIENTRY glTexCoord1f(CTX_ARG GLfloat s )
{
   TEXCOORD1(s);
}


void GLAPIENTRY glTexCoord1i(CTX_ARG GLint s )
{
   TEXCOORD1(s);
}


void GLAPIENTRY glTexCoord1s(CTX_ARG GLshort s )
{
   TEXCOORD1(s);
}


void GLAPIENTRY glTexCoord2d(CTX_ARG GLdouble s, GLdouble t )
{
   TEXCOORD2(s,t);
}

void GLAPIENTRY glTexCoord2f(CTX_ARG GLfloat s, GLfloat t )
{
   TEXCOORD2(*(&s),*&t); 
}


void GLAPIENTRY glTexCoord2s(CTX_ARG GLshort s, GLshort t )
{
   TEXCOORD2(s,t);
}

void GLAPIENTRY glTexCoord2i(CTX_ARG GLint s, GLint t )
{
   TEXCOORD2(s,t);
}


void GLAPIENTRY glTexCoord3d(CTX_ARG GLdouble s, GLdouble t, GLdouble r )
{
   TEXCOORD3(s,t,r);
}


void GLAPIENTRY glTexCoord3f(CTX_ARG GLfloat s, GLfloat t, GLfloat r )
{
   TEXCOORD3(s,t,r);
}


void GLAPIENTRY glTexCoord3i(CTX_ARG GLint s, GLint t, GLint r )
{
   TEXCOORD3(s,t,r);
}


void GLAPIENTRY glTexCoord3s(CTX_ARG GLshort s, GLshort t, GLshort r )
{
   TEXCOORD3(s,t,r);
}


void GLAPIENTRY glTexCoord4d(CTX_ARG GLdouble s, GLdouble t, GLdouble r, GLdouble q )
{
   TEXCOORD4(s,t,r,q)
}


void GLAPIENTRY glTexCoord4f(CTX_ARG GLfloat s, GLfloat t, GLfloat r, GLfloat q )
{
   TEXCOORD4(s,t,r,q)
}


void GLAPIENTRY glTexCoord4i(CTX_ARG GLint s, GLint t, GLint r, GLint q )
{
   TEXCOORD4(s,t,r,q)
}


void GLAPIENTRY glTexCoord4s(CTX_ARG GLshort s, GLshort t, GLshort r, GLshort q )
{
   TEXCOORD4(s,t,r,q)
}


void GLAPIENTRY glTexCoord1dv(CTX_ARG const GLdouble *v )
{
   TEXCOORD1(v[0]);
}


void GLAPIENTRY glTexCoord1fv(CTX_ARG const GLfloat *v )
{
   TEXCOORD1(v[0]);
}


void GLAPIENTRY glTexCoord1iv(CTX_ARG const GLint *v )
{
   TEXCOORD1(v[0]);
}


void GLAPIENTRY glTexCoord1sv(CTX_ARG const GLshort *v )
{
   TEXCOORD1(v[0]);
}


void GLAPIENTRY glTexCoord2dv(CTX_ARG const GLdouble *v )
{
   TEXCOORD2(v[0],v[1]);
}


void GLAPIENTRY glTexCoord2fv(CTX_ARG const GLfloat *v )
{
   TEXCOORD2(v[0],v[1]);
}


void GLAPIENTRY glTexCoord2iv(CTX_ARG const GLint *v )
{
   TEXCOORD2(v[0],v[1]);
}


void GLAPIENTRY glTexCoord2sv(CTX_ARG const GLshort *v )
{
   TEXCOORD2(v[0],v[1]);
}


void GLAPIENTRY glTexCoord3dv(CTX_ARG const GLdouble *v )
{
   TEXCOORD2(v[0],v[1]);
}


void GLAPIENTRY glTexCoord3fv(CTX_ARG const GLfloat *v )
{
   TEXCOORD3(v[0],v[1],v[2]);
}


void GLAPIENTRY glTexCoord3iv(CTX_ARG const GLint *v )
{
   TEXCOORD3(v[0],v[1],v[2]);
}


void GLAPIENTRY glTexCoord3sv(CTX_ARG const GLshort *v )
{
   TEXCOORD3(v[0],v[1],v[2]);
}


void GLAPIENTRY glTexCoord4dv(CTX_ARG const GLdouble *v )
{
   TEXCOORD4(v[0],v[1],v[2],v[3]);
}


void GLAPIENTRY glTexCoord4fv(CTX_ARG const GLfloat *v )
{

   TEXCOORD4(v[0],v[1],v[2],v[3]);
}


void GLAPIENTRY glTexCoord4iv(CTX_ARG const GLint *v )
{
   TEXCOORD4(v[0],v[1],v[2],v[3]);
}


void GLAPIENTRY glTexCoord4sv(CTX_ARG const GLshort *v )
{
   TEXCOORD4(v[0],v[1],v[2],v[3]);
}



void GLAPIENTRY glTexGend(CTX_ARG GLenum coord, GLenum pname, GLdouble param )
{
   GLfloat p = (GLfloat) param;
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.TexGenfv)( CC, coord, pname, &p );
}


void GLAPIENTRY glTexGenf(CTX_ARG GLenum coord, GLenum pname, GLfloat param )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.TexGenfv)( CC, coord, pname, &param );
}


void GLAPIENTRY glTexGeni(CTX_ARG GLenum coord, GLenum pname, GLint param )
{
   GLfloat p = (GLfloat) param;
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.TexGenfv)( CC, coord, pname, &p );
}


void GLAPIENTRY glTexGendv(CTX_ARG GLenum coord, GLenum pname, const GLdouble *params )
{
   GLfloat p[4];
   GET_CONTEXT;
   CHECK_CONTEXT;
   p[0] = params[0];
   p[1] = params[1];
   p[2] = params[2];
   p[3] = params[3];
   (*CC->API.TexGenfv)( CC, coord, pname, p );
}


void GLAPIENTRY glTexGeniv(CTX_ARG GLenum coord, GLenum pname, const GLint *params )
{
   GLfloat p[4];
   GET_CONTEXT;
   CHECK_CONTEXT;
   p[0] = params[0];
   p[1] = params[1];
   p[2] = params[2];
   p[3] = params[3];
   (*CC->API.TexGenfv)( CC, coord, pname, p );
}


void GLAPIENTRY glTexGenfv(CTX_ARG GLenum coord, GLenum pname, const GLfloat *params )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.TexGenfv)( CC, coord, pname, params );
}




void GLAPIENTRY glTexEnvf(CTX_ARG GLenum target, GLenum pname, GLfloat param )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.TexEnvfv)( CC, target, pname, &param );
}



void GLAPIENTRY glTexEnvi(CTX_ARG GLenum target, GLenum pname, GLint param )
{
   GLfloat p[4];
   GET_CONTEXT;
   p[0] = (GLfloat) param;
   p[1] = p[2] = p[3] = 0.0;
   CHECK_CONTEXT;
   (*CC->API.TexEnvfv)( CC, target, pname, p );
}



void GLAPIENTRY glTexEnvfv(CTX_ARG GLenum target, GLenum pname, const GLfloat *param )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.TexEnvfv)( CC, target, pname, param );
}



void GLAPIENTRY glTexEnviv(CTX_ARG GLenum target, GLenum pname, const GLint *param )
{
   GLfloat p[4];
   GET_CONTEXT;
   p[0] = INT_TO_FLOAT( param[0] );
   p[1] = INT_TO_FLOAT( param[1] );
   p[2] = INT_TO_FLOAT( param[2] );
   p[3] = INT_TO_FLOAT( param[3] );
   CHECK_CONTEXT;
   (*CC->API.TexEnvfv)( CC, target, pname, p );
}


void GLAPIENTRY glTexImage1D(CTX_ARG GLenum target, GLint level, GLint internalformat,
                              GLsizei width, GLint border,
                              GLenum format, GLenum type, const GLvoid *pixels )
{
   struct gl_image *teximage = 0;
   GET_CONTEXT;
   CHECK_CONTEXT;
   if (pixels)
      teximage = gl_unpack_image( CC, width, 1, format, type, pixels, &CC->Unpack );
   (*CC->API.TexImage1D)( CC, target, level, internalformat,
                          width, border, format, type, teximage );
}


void GLAPIENTRY glTexImage2D(CTX_ARG GLenum target, GLint level, GLint internalformat,
                              GLsizei width, GLsizei height, GLint border,
                              GLenum format, GLenum type, const GLvoid *pixels )
{
   struct gl_image *teximage = 0;
   GET_CONTEXT;
   CHECK_CONTEXT;
   if (pixels) 
      teximage = gl_unpack_image( CC, width, height, format, type, pixels, &CC->Unpack );
   (*CC->API.TexImage2D)( CC, target, level, internalformat,
			 width, height, border, format, type, teximage );
}


void GLAPIENTRY glTexImage3D(CTX_ARG GLenum target, GLint level, GLint internalformat,
                              GLsizei width, GLsizei height, GLsizei depth,
                              GLint border, GLenum format, GLenum type,
                              const GLvoid *pixels )
{
   struct gl_image *teximage = 0;
   GET_CONTEXT;
   CHECK_CONTEXT;
   if (pixels)
      teximage = gl_unpack_image3D( CC, width, height, depth, format, type, pixels, &CC->Unpack );
   (*CC->API.TexImage3DEXT)( CC, target, level, internalformat,
                             width, height, depth, border, format, type, 
                             teximage );
}


void GLAPIENTRY glTexParameterf(CTX_ARG GLenum target, GLenum pname, GLfloat param )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.TexParameterfv)( CC, target, pname, &param );
}


void GLAPIENTRY glTexParameteri(CTX_ARG GLenum target, GLenum pname, GLint param )
{
   GLfloat fparam[4];
   GET_CONTEXT;
   fparam[0] = (GLfloat) param;
   fparam[1] = fparam[2] = fparam[3] = 0.0;
   CHECK_CONTEXT;
   (*CC->API.TexParameterfv)( CC, target, pname, fparam );
}


void GLAPIENTRY glTexParameterfv(CTX_ARG GLenum target, GLenum pname, const GLfloat *params )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.TexParameterfv)( CC, target, pname, params );
}


void GLAPIENTRY glTexParameteriv(CTX_ARG GLenum target, GLenum pname, const GLint *params )
{
   GLfloat p[4];
   GET_CONTEXT;
   CHECK_CONTEXT;
   if (pname==GL_TEXTURE_BORDER_COLOR) {
      p[0] = INT_TO_FLOAT( params[0] );
      p[1] = INT_TO_FLOAT( params[1] );
      p[2] = INT_TO_FLOAT( params[2] );
      p[3] = INT_TO_FLOAT( params[3] );
   }
   else {
      p[0] = (GLfloat) params[0];
      p[1] = (GLfloat) params[1];
      p[2] = (GLfloat) params[2];
      p[3] = (GLfloat) params[3];
   }
   (*CC->API.TexParameterfv)( CC, target, pname, p );
}


void GLAPIENTRY glTexSubImage1D(CTX_ARG GLenum target, GLint level, GLint xoffset,
                               GLsizei width, GLenum format,
                               GLenum type, const GLvoid *pixels )
{
   struct gl_image *image;
   GET_CONTEXT;
   CHECK_CONTEXT;
   image = gl_unpack_texsubimage( CC, width, 1, format, type, pixels );
   (*CC->API.TexSubImage1D)( CC, target, level, xoffset, width,
                             format, type, image );
}


void GLAPIENTRY glTexSubImage2D(CTX_ARG GLenum target, GLint level,
                                 GLint xoffset, GLint yoffset,
                                 GLsizei width, GLsizei height,
                                 GLenum format, GLenum type,
                                 const GLvoid *pixels )
{
   struct gl_image *image;
   GET_CONTEXT;
   CHECK_CONTEXT;
   image = gl_unpack_texsubimage( CC, width, height, format, type, pixels );
   (*CC->API.TexSubImage2D)( CC, target, level, xoffset, yoffset,
                             width, height, format, type, image );
}


void GLAPIENTRY glTexSubImage3D(CTX_ARG GLenum target, GLint level, GLint xoffset,
                                 GLint yoffset, GLint zoffset, GLsizei width,
                                 GLsizei height, GLsizei depth, GLenum format,
                                 GLenum type, const GLvoid *pixels )
{
   struct gl_image *image;
   GET_CONTEXT;
   CHECK_CONTEXT;
   image = gl_unpack_texsubimage3D( CC, width, height, depth, format, type,
                                    pixels );
   (*CC->API.TexSubImage3DEXT)( CC, target, level, xoffset, yoffset, zoffset,
                                width, height, depth, format, type, image );
}


void GLAPIENTRY glTranslated(CTX_ARG GLdouble x, GLdouble y, GLdouble z )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.Translatef)( CC, (GLfloat) x, (GLfloat) y, (GLfloat) z );
}


void GLAPIENTRY glTranslatef(CTX_ARG GLfloat x, GLfloat y, GLfloat z )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.Translatef)( CC, x, y, z );
}

/* KW: Run into bad problems in reset_vb/fixup_input if we don't fully pad
 *     the incoming vertices.
 */
#define VERTEX2(IM, x,y)			\
{						\
   GLuint count = IM->Count++;			\
   GLfloat *dest = IM->Obj[count];		\
   IM->Flag[count] |= VERT_OBJ_2;		\
   ASSIGN_4V(dest, x, y, 0, 1);			\
   if (dest == IM->Obj[VB_MAX-1])		\
      IM->maybe_transform_vb( IM );		\
}

#define VERTEX3(IM,x,y,z)			\
{						\
   GLuint count = IM->Count++;			\
   GLfloat *dest = IM->Obj[count];		\
   IM->Flag[count] |= VERT_OBJ_23;		\
   ASSIGN_4V(dest, x, y, z, 1);			\
   if (dest == IM->Obj[VB_MAX-1])		\
      IM->maybe_transform_vb( IM );		\
}

#define VERTEX4(IM, x,y,z,w)			\
{						\
   GLuint count = IM->Count++;			\
   GLfloat *dest = IM->Obj[count];		\
   IM->Flag[count] |= VERT_OBJ_234;		\
   ASSIGN_4V(dest, x, y, z, w);			\
   if (dest == IM->Obj[VB_MAX-1])		\
      IM->maybe_transform_vb( IM );		\
}


void GLAPIENTRY glVertex2d(CTX_ARG GLdouble x, GLdouble y )
{
   GET_IMMEDIATE;
   VERTEX2( IM, (GLfloat) x, (GLfloat) y );
}


void GLAPIENTRY glVertex2f(CTX_ARG GLfloat x, GLfloat y )
{
   GET_IMMEDIATE;
   VERTEX2( IM, *(&x), *(&y) );
}

/* Internal use:
 */
void gl_Vertex2f( GLcontext *ctx, GLfloat x, GLfloat y )
{
   struct immediate *im = ctx->input;
   VERTEX2( im, x, y );
}

void GLAPIENTRY glVertex2i(CTX_ARG GLint x, GLint y )
{
   GET_IMMEDIATE;
   VERTEX2( IM, (GLfloat) x, (GLfloat) y );
}

void GLAPIENTRY glVertex2s(CTX_ARG GLshort x, GLshort y )
{
   GET_IMMEDIATE;
   VERTEX2( IM, (GLfloat) x, (GLfloat) y );
}

void GLAPIENTRY glVertex3d(CTX_ARG GLdouble x, GLdouble y, GLdouble z )
{
   GET_IMMEDIATE;
   VERTEX3( IM, (GLfloat) x, (GLfloat) y, (GLfloat) z );
}


void GLAPIENTRY glVertex3f(CTX_ARG GLfloat x, GLfloat y, GLfloat z )
{
   GET_IMMEDIATE;
   VERTEX3( IM, *(&x), *(&y), *(&z) ); 
}

void GLAPIENTRY glVertex3i(CTX_ARG GLint x, GLint y, GLint z )
{
   GET_IMMEDIATE;
   VERTEX3( IM, (GLfloat) x, (GLfloat) y, (GLfloat) z );
}


void GLAPIENTRY glVertex3s(CTX_ARG GLshort x, GLshort y, GLshort z )
{
   GET_IMMEDIATE;
   VERTEX3( IM, (GLfloat) x, (GLfloat) y, (GLfloat) z );
}


void GLAPIENTRY glVertex4d(CTX_ARG GLdouble x, GLdouble y, GLdouble z, GLdouble w )
{
   GET_IMMEDIATE;
   VERTEX4( IM, (GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w );
}


void GLAPIENTRY glVertex4f(CTX_ARG GLfloat x, GLfloat y, GLfloat z, GLfloat w )
{
   GET_IMMEDIATE;
   VERTEX4( IM, *(&x), *(&y), *(&z), *(&w) );
}


void GLAPIENTRY glVertex4i(CTX_ARG GLint x, GLint y, GLint z, GLint w )
{
   GET_IMMEDIATE;
   VERTEX4( IM, (GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w );
}


void GLAPIENTRY glVertex4s(CTX_ARG GLshort x, GLshort y, GLshort z, GLshort w )
{
   GET_IMMEDIATE;
   VERTEX4( IM, (GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w );
}


void GLAPIENTRY glVertex2dv(CTX_ARG const GLdouble *v )
{
   GET_IMMEDIATE;
   VERTEX2( IM, (GLfloat) v[0], (GLfloat) v[1] );
}


void GLAPIENTRY glVertex2fv(CTX_ARG const GLfloat *v )
{
   GET_IMMEDIATE;
   VERTEX2( IM, v[0], v[1] );
}


void GLAPIENTRY glVertex2iv(CTX_ARG const GLint *v )
{
   GET_IMMEDIATE;
   VERTEX2( IM, (GLfloat) v[0], (GLfloat) v[1] );
}


void GLAPIENTRY glVertex2sv(CTX_ARG const GLshort *v )
{
   GET_IMMEDIATE;
   VERTEX2( IM, (GLfloat) v[0], (GLfloat) v[1] );
}


void GLAPIENTRY glVertex3dv(CTX_ARG const GLdouble *v )
{
   GET_IMMEDIATE;
   VERTEX3( IM, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2] );
}


void GLAPIENTRY glVertex3fv(CTX_ARG const GLfloat *v )
{
   GET_IMMEDIATE;
   VERTEX3( IM, v[0], v[1], v[2] );
}

void GLAPIENTRY glVertex3iv(CTX_ARG const GLint *v )
{
   GET_IMMEDIATE;
   VERTEX3( IM, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2] );
}


void GLAPIENTRY glVertex3sv(CTX_ARG const GLshort *v )
{
   GET_IMMEDIATE;
   VERTEX3( IM, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2] );
}


void GLAPIENTRY glVertex4dv(CTX_ARG const GLdouble *v )
{
   GET_IMMEDIATE;
   VERTEX4( IM, 
	    (GLfloat) v[0], (GLfloat) v[1], 
	    (GLfloat) v[2], (GLfloat) v[3] );
}


void GLAPIENTRY glVertex4fv(CTX_ARG const GLfloat *v )
{
   GET_IMMEDIATE;
   VERTEX4( IM, v[0], v[1], v[2], v[3] );
}


void GLAPIENTRY glVertex4iv(CTX_ARG const GLint *v )
{
   GET_IMMEDIATE;
   VERTEX4( IM, 
	    (GLfloat) v[0], (GLfloat) v[1], 
	    (GLfloat) v[2], (GLfloat) v[3] );
}


void GLAPIENTRY glVertex4sv(CTX_ARG const GLshort *v )
{
   GET_IMMEDIATE;
   VERTEX4( IM, 
	    (GLfloat) v[0], (GLfloat) v[1], 
	    (GLfloat) v[2], (GLfloat) v[3] );
}



void GLAPIENTRY glViewport(CTX_ARG GLint x, GLint y, GLsizei width, GLsizei height )
{
   GET_CONTEXT;
   (*CC->API.Viewport)( CC, x, y, width, height );
}

@


3.22
log
@initial re-org of pixel pack/unpack code
@
text
@d1 1
a1 1
/* $Id: api2.c,v 3.21 1999/07/29 17:41:13 miklos Exp $ */
a899 9
#if 0
void GLAPIENTRY glTexCoordPointer(CTX_ARG GLint size, GLenum type, GLsizei stride,
                                   const GLvoid *ptr )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   gl_TexCoordPointer(CC, size, type, stride, ptr);
}
#endif
d1010 1
a1010 1
   struct gl_image *teximage;
d1013 2
a1014 1
   teximage = gl_unpack_image( CC, width, 1, format, type, pixels, &CC->Unpack );
d1024 1
a1024 1
   struct gl_image *teximage;
d1027 2
a1028 1
   teximage = gl_unpack_image( CC, width, height, format, type, pixels, &CC->Unpack );
d1039 1
a1039 1
   struct gl_image *teximage;
d1042 2
a1043 1
   teximage = gl_unpack_image3D( CC, width, height, depth, format, type, pixels, &CC->Unpack );
a1366 9
#if 0
void GLAPIENTRY glVertexPointer(CTX_ARG GLint size, GLenum type, GLsizei stride,
                                 const GLvoid *ptr )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   gl_VertexPointer(CC, size, type, stride, ptr);
}
#endif
@


3.21
log
@added CTX_ARG, etc. to api calls
@
text
@d1 1
a1 1
/* $Id: api2.c,v 3.20 1999/07/14 12:42:55 brianp Exp $ */
d1022 1
a1022 1
   teximage = gl_unpack_image( CC, width, 1, format, type, pixels );
d1035 1
a1035 1
   teximage = gl_unpack_image( CC, width, height, format, type, pixels );
d1049 1
a1049 1
   teximage = gl_unpack_image3D( CC, width, height, depth, format, type, pixels);
@


3.20
log
@removed Windows Quake texture size hack
@
text
@d1 1
a1 1
/* $Id: api2.c,v 3.19 1999/07/13 15:48:01 brianp Exp $ */
d36 1
d53 1
a53 2

void GLAPIENTRY glOrtho( GLdouble left, GLdouble right,
d63 1
a63 1
void GLAPIENTRY glPassThrough( GLfloat token )
d71 1
a71 1
void GLAPIENTRY glPixelMapfv( GLenum map, GLint mapsize, const GLfloat *values )
d79 1
a79 1
void GLAPIENTRY glPixelMapuiv( GLenum map, GLint mapsize, const GLuint *values )
d101 1
a101 1
void GLAPIENTRY glPixelMapusv( GLenum map, GLint mapsize, const GLushort *values )
d122 1
a122 1
void GLAPIENTRY glPixelStoref( GLenum pname, GLfloat param )
d130 1
a130 1
void GLAPIENTRY glPixelStorei( GLenum pname, GLint param )
d138 1
a138 1
void GLAPIENTRY glPixelTransferf( GLenum pname, GLfloat param )
d146 1
a146 1
void GLAPIENTRY glPixelTransferi( GLenum pname, GLint param )
d154 1
a154 1
void GLAPIENTRY glPixelZoom( GLfloat xfactor, GLfloat yfactor )
d162 1
a162 1
void GLAPIENTRY glPointSize( GLfloat size )
d170 1
a170 1
void GLAPIENTRY glPolygonMode( GLenum face, GLenum mode )
d178 1
a178 1
void GLAPIENTRY glPolygonOffset( GLfloat factor, GLfloat units )
d187 1
a187 1
void GLAPIENTRY glPolygonOffsetEXT( GLfloat factor, GLfloat bias )
d189 3
a191 1
   glPolygonOffset( factor, bias * DEPTH_SCALE );
d195 1
a195 1
void GLAPIENTRY glPolygonStipple( const GLubyte *pattern )
d205 1
a205 1
void GLAPIENTRY glPopAttrib( void )
d213 1
a213 1
void GLAPIENTRY glPopClientAttrib( void )
d221 1
a221 1
void GLAPIENTRY glPopMatrix( void )
d229 1
a229 1
void GLAPIENTRY glPopName( void )
d237 1
a237 1
void GLAPIENTRY glPrioritizeTextures( GLsizei n, const GLuint *textures,
d246 1
a246 1
void GLAPIENTRY glPushMatrix( void )
d254 1
a254 1
void GLAPIENTRY glRasterPos2d( GLdouble x, GLdouble y )
d262 1
a262 1
void GLAPIENTRY glRasterPos2f( GLfloat x, GLfloat y )
d270 1
a270 1
void GLAPIENTRY glRasterPos2i( GLint x, GLint y )
d278 1
a278 1
void GLAPIENTRY glRasterPos2s( GLshort x, GLshort y )
d286 1
a286 1
void GLAPIENTRY glRasterPos3d( GLdouble x, GLdouble y, GLdouble z )
d294 1
a294 1
void GLAPIENTRY glRasterPos3f( GLfloat x, GLfloat y, GLfloat z )
d302 1
a302 1
void GLAPIENTRY glRasterPos3i( GLint x, GLint y, GLint z )
d310 1
a310 1
void GLAPIENTRY glRasterPos3s( GLshort x, GLshort y, GLshort z )
d318 1
a318 1
void GLAPIENTRY glRasterPos4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w )
d327 1
a327 1
void GLAPIENTRY glRasterPos4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w )
d335 1
a335 1
void GLAPIENTRY glRasterPos4i( GLint x, GLint y, GLint z, GLint w )
d344 1
a344 1
void GLAPIENTRY glRasterPos4s( GLshort x, GLshort y, GLshort z, GLshort w )
d353 1
a353 1
void GLAPIENTRY glRasterPos2dv( const GLdouble *v )
d361 1
a361 1
void GLAPIENTRY glRasterPos2fv( const GLfloat *v )
d369 1
a369 1
void GLAPIENTRY glRasterPos2iv( const GLint *v )
d377 1
a377 1
void GLAPIENTRY glRasterPos2sv( const GLshort *v )
d385 1
a385 1
void GLAPIENTRY glRasterPos3dv( const GLdouble *v )
d394 1
a394 1
void GLAPIENTRY glRasterPos3fv( const GLfloat *v )
d403 1
a403 1
void GLAPIENTRY glRasterPos3iv( const GLint *v )
d412 1
a412 1
void GLAPIENTRY glRasterPos3sv( const GLshort *v )
d421 1
a421 1
void GLAPIENTRY glRasterPos4dv( const GLdouble *v )
d430 1
a430 1
void GLAPIENTRY glRasterPos4fv( const GLfloat *v )
d438 1
a438 1
void GLAPIENTRY glRasterPos4iv( const GLint *v )
d447 1
a447 1
void GLAPIENTRY glRasterPos4sv( const GLshort *v )
d456 1
a456 1
void GLAPIENTRY glReadBuffer( GLenum mode )
d464 1
a464 1
void GLAPIENTRY glReadPixels( GLint x, GLint y, GLsizei width, GLsizei height,
d473 1
a473 1
void GLAPIENTRY glRectd( GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2 )
d482 1
a482 1
void GLAPIENTRY glRectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 )
d490 1
a490 1
void GLAPIENTRY glRecti( GLint x1, GLint y1, GLint x2, GLint y2 )
d499 1
a499 1
void GLAPIENTRY glRects( GLshort x1, GLshort y1, GLshort x2, GLshort y2 )
d508 1
a508 1
void GLAPIENTRY glRectdv( const GLdouble *v1, const GLdouble *v2 )
d517 1
a517 1
void GLAPIENTRY glRectfv( const GLfloat *v1, const GLfloat *v2 )
d525 1
a525 1
void GLAPIENTRY glRectiv( const GLint *v1, const GLint *v2 )
d534 1
a534 1
void GLAPIENTRY glRectsv( const GLshort *v1, const GLshort *v2 )
d543 1
a543 1
void GLAPIENTRY glScissor( GLint x, GLint y, GLsizei width, GLsizei height)
d551 1
a551 1
GLboolean GLAPIENTRY glIsEnabled( GLenum cap )
d560 1
a560 1
void GLAPIENTRY glPushAttrib( GLbitfield mask )
d568 1
a568 1
void GLAPIENTRY glPushClientAttrib( GLbitfield mask )
d576 1
a576 1
void GLAPIENTRY glPushName( GLuint name )
d584 1
a584 1
GLint GLAPIENTRY glRenderMode( GLenum mode )
d592 1
a592 1
void GLAPIENTRY glRotated( GLdouble angle, GLdouble x, GLdouble y, GLdouble z )
d601 1
a601 1
void GLAPIENTRY glRotatef( GLfloat angle, GLfloat x, GLfloat y, GLfloat z )
d609 1
a609 1
void GLAPIENTRY glSelectBuffer( GLsizei size, GLuint *buffer )
d617 1
a617 1
void GLAPIENTRY glScaled( GLdouble x, GLdouble y, GLdouble z )
d625 1
a625 1
void GLAPIENTRY glScalef( GLfloat x, GLfloat y, GLfloat z )
d633 1
a633 1
void GLAPIENTRY glShadeModel( GLenum mode )
d641 1
a641 1
void GLAPIENTRY glStencilFunc( GLenum func, GLint ref, GLuint mask )
d649 1
a649 1
void GLAPIENTRY glStencilMask( GLuint mask )
d657 1
a657 1
void GLAPIENTRY glStencilOp( GLenum fail, GLenum zfail, GLenum zpass )
d709 1
a709 1
void GLAPIENTRY glTexCoord1d( GLdouble s )
d715 1
a715 1
void GLAPIENTRY glTexCoord1f( GLfloat s )
d721 1
a721 1
void GLAPIENTRY glTexCoord1i( GLint s )
d727 1
a727 1
void GLAPIENTRY glTexCoord1s( GLshort s )
d733 1
a733 1
void GLAPIENTRY glTexCoord2d( GLdouble s, GLdouble t )
d738 1
a738 1
void GLAPIENTRY glTexCoord2f( GLfloat s, GLfloat t )
d744 1
a744 1
void GLAPIENTRY glTexCoord2s( GLshort s, GLshort t )
d749 1
a749 1
void GLAPIENTRY glTexCoord2i( GLint s, GLint t )
d755 1
a755 1
void GLAPIENTRY glTexCoord3d( GLdouble s, GLdouble t, GLdouble r )
d761 1
a761 1
void GLAPIENTRY glTexCoord3f( GLfloat s, GLfloat t, GLfloat r )
d767 1
a767 1
void GLAPIENTRY glTexCoord3i( GLint s, GLint t, GLint r )
d773 1
a773 1
void GLAPIENTRY glTexCoord3s( GLshort s, GLshort t, GLshort r )
d779 1
a779 1
void GLAPIENTRY glTexCoord4d( GLdouble s, GLdouble t, GLdouble r, GLdouble q )
d785 1
a785 1
void GLAPIENTRY glTexCoord4f( GLfloat s, GLfloat t, GLfloat r, GLfloat q )
d791 1
a791 1
void GLAPIENTRY glTexCoord4i( GLint s, GLint t, GLint r, GLint q )
d797 1
a797 1
void GLAPIENTRY glTexCoord4s( GLshort s, GLshort t, GLshort r, GLshort q )
d803 1
a803 1
void GLAPIENTRY glTexCoord1dv( const GLdouble *v )
d809 1
a809 1
void GLAPIENTRY glTexCoord1fv( const GLfloat *v )
d815 1
a815 1
void GLAPIENTRY glTexCoord1iv( const GLint *v )
d821 1
a821 1
void GLAPIENTRY glTexCoord1sv( const GLshort *v )
d827 1
a827 1
void GLAPIENTRY glTexCoord2dv( const GLdouble *v )
d833 1
a833 1
void GLAPIENTRY glTexCoord2fv( const GLfloat *v )
d839 1
a839 1
void GLAPIENTRY glTexCoord2iv( const GLint *v )
d845 1
a845 1
void GLAPIENTRY glTexCoord2sv( const GLshort *v )
d851 1
a851 1
void GLAPIENTRY glTexCoord3dv( const GLdouble *v )
d857 1
a857 1
void GLAPIENTRY glTexCoord3fv( const GLfloat *v )
d863 1
a863 1
void GLAPIENTRY glTexCoord3iv( const GLint *v )
d869 1
a869 1
void GLAPIENTRY glTexCoord3sv( const GLshort *v )
d875 1
a875 1
void GLAPIENTRY glTexCoord4dv( const GLdouble *v )
d881 1
a881 1
void GLAPIENTRY glTexCoord4fv( const GLfloat *v )
d888 1
a888 1
void GLAPIENTRY glTexCoord4iv( const GLint *v )
d894 1
a894 1
void GLAPIENTRY glTexCoord4sv( const GLshort *v )
d901 1
a901 1
void GLAPIENTRY glTexCoordPointer( GLint size, GLenum type, GLsizei stride,
d906 1
a906 1
   (*CC->API.TexCoordPointer)(CC, size, type, stride, ptr);
d910 1
a910 2

void GLAPIENTRY glTexGend( GLenum coord, GLenum pname, GLdouble param )
d919 1
a919 1
void GLAPIENTRY glTexGenf( GLenum coord, GLenum pname, GLfloat param )
d927 1
a927 1
void GLAPIENTRY glTexGeni( GLenum coord, GLenum pname, GLint param )
d936 1
a936 1
void GLAPIENTRY glTexGendv( GLenum coord, GLenum pname, const GLdouble *params )
d949 1
a949 1
void GLAPIENTRY glTexGeniv( GLenum coord, GLenum pname, const GLint *params )
d962 1
a962 1
void GLAPIENTRY glTexGenfv( GLenum coord, GLenum pname, const GLfloat *params )
d972 1
a972 1
void GLAPIENTRY glTexEnvf( GLenum target, GLenum pname, GLfloat param )
d981 1
a981 1
void GLAPIENTRY glTexEnvi( GLenum target, GLenum pname, GLint param )
d993 1
a993 1
void GLAPIENTRY glTexEnvfv( GLenum target, GLenum pname, const GLfloat *param )
d1002 1
a1002 1
void GLAPIENTRY glTexEnviv( GLenum target, GLenum pname, const GLint *param )
d1015 1
a1015 1
void GLAPIENTRY glTexImage1D( GLenum target, GLint level, GLint internalformat,
d1028 1
a1028 1
void GLAPIENTRY glTexImage2D( GLenum target, GLint level, GLint internalformat,
d1041 1
a1041 1
void GLAPIENTRY glTexImage3D( GLenum target, GLint level, GLint internalformat,
d1056 1
a1056 1
void GLAPIENTRY glTexParameterf( GLenum target, GLenum pname, GLfloat param )
d1064 1
a1064 1
void GLAPIENTRY glTexParameteri( GLenum target, GLenum pname, GLint param )
d1075 1
a1075 1
void GLAPIENTRY glTexParameterfv( GLenum target, GLenum pname, const GLfloat *params )
d1083 1
a1083 1
void GLAPIENTRY glTexParameteriv( GLenum target, GLenum pname, const GLint *params )
d1104 1
a1104 1
void GLAPIENTRY glTexSubImage1D( GLenum target, GLint level, GLint xoffset,
d1117 1
a1117 1
void GLAPIENTRY glTexSubImage2D( GLenum target, GLint level,
d1132 1
a1132 1
void GLAPIENTRY glTexSubImage3D( GLenum target, GLint level, GLint xoffset,
d1147 1
a1147 1
void GLAPIENTRY glTranslated( GLdouble x, GLdouble y, GLdouble z )
d1155 1
a1155 1
void GLAPIENTRY glTranslatef( GLfloat x, GLfloat y, GLfloat z )
d1196 1
a1196 1
void GLAPIENTRY glVertex2d( GLdouble x, GLdouble y )
d1203 1
a1203 1
void GLAPIENTRY glVertex2f( GLfloat x, GLfloat y )
d1217 1
a1217 1
void GLAPIENTRY glVertex2i( GLint x, GLint y )
d1223 1
a1223 1
void GLAPIENTRY glVertex2s( GLshort x, GLshort y )
d1229 1
a1229 1
void GLAPIENTRY glVertex3d( GLdouble x, GLdouble y, GLdouble z )
d1236 1
a1236 1
void GLAPIENTRY glVertex3f( GLfloat x, GLfloat y, GLfloat z )
d1242 1
a1242 1
void GLAPIENTRY glVertex3i( GLint x, GLint y, GLint z )
d1249 1
a1249 1
void GLAPIENTRY glVertex3s( GLshort x, GLshort y, GLshort z )
d1256 1
a1256 1
void GLAPIENTRY glVertex4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w )
d1263 1
a1263 1
void GLAPIENTRY glVertex4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w )
d1270 1
a1270 1
void GLAPIENTRY glVertex4i( GLint x, GLint y, GLint z, GLint w )
d1277 1
a1277 1
void GLAPIENTRY glVertex4s( GLshort x, GLshort y, GLshort z, GLshort w )
d1284 1
a1284 1
void GLAPIENTRY glVertex2dv( const GLdouble *v )
d1291 1
a1291 1
void GLAPIENTRY glVertex2fv( const GLfloat *v )
d1298 1
a1298 1
void GLAPIENTRY glVertex2iv( const GLint *v )
d1305 1
a1305 1
void GLAPIENTRY glVertex2sv( const GLshort *v )
d1312 1
a1312 1
void GLAPIENTRY glVertex3dv( const GLdouble *v )
d1319 1
a1319 1
void GLAPIENTRY glVertex3fv( const GLfloat *v )
d1325 1
a1325 1
void GLAPIENTRY glVertex3iv( const GLint *v )
d1332 1
a1332 1
void GLAPIENTRY glVertex3sv( const GLshort *v )
d1339 1
a1339 1
void GLAPIENTRY glVertex4dv( const GLdouble *v )
d1348 1
a1348 1
void GLAPIENTRY glVertex4fv( const GLfloat *v )
d1355 1
a1355 1
void GLAPIENTRY glVertex4iv( const GLint *v )
d1364 1
a1364 1
void GLAPIENTRY glVertex4sv( const GLshort *v )
d1374 1
a1374 1
void GLAPIENTRY glVertexPointer( GLint size, GLenum type, GLsizei stride,
d1378 2
a1379 1
   (*CC->API.VertexPointer)(CC, size, type, stride, ptr);
d1383 1
a1383 1
void GLAPIENTRY glViewport( GLint x, GLint y, GLsizei width, GLsizei height )
@


3.19
log
@fixed texture CurrentD[2] error
@
text
@d1 1
a1 1
/* $Id: api2.c,v 3.18 1999/07/12 12:05:22 keithw Exp $ */
a1030 60
#if defined(FX) && defined(__WIN32__)

   /*** Ugly hack for Windows GLQuake ***/
  
   struct gl_image *teximage;
   GLvoid *newpixels = NULL;
   GLsizei newwidth, newheight;
   GLint x, y;
   static GLint leveldif = 0;
   static GLuint lasttexobj = 0;
   GET_CONTEXT;
   CHECK_CONTEXT;

   if (CC->Texture.Unit[0].CurrentD[2]->Name!=lasttexobj) {
      lasttexobj = CC->Texture.Unit[0].CurrentD[2]->Name;
      leveldif = 0;
   }
  
   if ((format==GL_COLOR_INDEX) && (internalformat==1))
      internalformat = GL_COLOR_INDEX8_EXT;
  
   if (width>256 || height>256) {
      newpixels = malloc((width+4)*height*4);

      while (width>256 || height>256) {
         newwidth = width / 2;
         newheight = height / 2;
         leveldif++;
      
         fprintf(stderr,"Scaling: (%d) %dx%d -> %dx%d\n",internalformat,width,height,newwidth,newheight);
         fflush(stderr);
      
         for (y=0;y<newheight;y++) {
            for (x=0;x<newwidth;x++) {
               ((GLubyte *)newpixels)[(x+y*newwidth)*4+0]=((GLubyte *)pixels)[(x*2+y*width*2)*4+0];
               ((GLubyte *)newpixels)[(x+y*newwidth)*4+1]=((GLubyte *)pixels)[(x*2+y*width*2)*4+1];
               ((GLubyte *)newpixels)[(x+y*newwidth)*4+2]=((GLubyte *)pixels)[(x*2+y*width*2)*4+2];
               ((GLubyte *)newpixels)[(x+y*newwidth)*4+3]=((GLubyte *)pixels)[(x*2+y*width*2)*4+3];
            }
         }
         pixels = newpixels;
         width = newwidth;
         height = newheight;
      }
      level=0;
   }
   else {
     level -= leveldif;
   }

   teximage = gl_unpack_image( CC, width, height, format, type, pixels );
   (*CC->API.TexImage2D)( CC, target, level, internalformat,
                          width, height, border, format, type, teximage );

   if (newpixels)
      free(newpixels);

#else

   /*** all other systems ***/
a1036 2

#endif
@


3.18
log
@merge from experimental branch upto merge-1 tag
@
text
@d1 1
a1 1
/* $Id: api2.c,v 3.17 1999/06/08 01:23:54 brianp Exp $ */
d1044 2
a1045 2
   if (CC->Texture.Unit[0].Current2D->Name!=lasttexobj) {
      lasttexobj = CC->Texture.Unit[0].Current2D->Name;
@


3.17
log
@minor clean-up
@
text
@d1 1
a1 1
/* $Id: api2.c,v 3.16 1999/05/08 14:47:30 brianp Exp $ */
a661 70
/* KW:  We do this directly now without a second function call, and
 *      without the second copy in gl_Vertex*.  This code works for
 *      both compile and execute.  Any missing texcoords are tracked 
 *      by the flag array, and fixed up in transform_vb.
 *     
 *      If we get a mixture of sizes, smaller ones are padded out 
 *      in the same fixup step.
 *
 *      If we drop support for the SGI multitex extension, we get
 *      a faster implentation for these functions.
 */
#ifdef GL_SGIS_multitexture

/* Not enough bits in the flag uint to support size 1 texcoords.
 */
#define TEXCOORD1(s)				\
{						\
   GLuint count;				\
   GLfloat *tc;					\
   GLuint texSet;				\
   GET_IMMEDIATE;				\
   texSet = IM->CurrentTexSet;			\
   count = IM->Count;				\
   IM->Flag[count] |= IM->TF1[texSet];		\
   tc = IM->TexCoordPtr[texSet][count];		\
   ASSIGN_4V(tc, s,0,0,1);			\
}


#define TEXCOORD2(s,t)					\
{							\
   GLuint count;					\
   GLfloat *tc;						\
   GLuint texSet;					\
   GET_IMMEDIATE;					\
   texSet = IM->CurrentTexSet;				\
   count = IM->Count;					\
   IM->Flag[count] |= IM->TF2[texSet]; 	\
   tc = IM->TexCoordPtr[texSet][count];			\
   ASSIGN_4V(tc, s,t,0,1);				\
}

#define TEXCOORD3(s,t,u)				\
{							\
   GLuint count;					\
   GLfloat *tc;						\
   GLuint texSet;					\
   GET_IMMEDIATE;					\
   texSet = IM->CurrentTexSet;				\
   count = IM->Count;					\
   IM->Flag[count] |= IM->TF3[texSet]; 	\
   tc = IM->TexCoordPtr[texSet][count];			\
   ASSIGN_4V(tc, s,t,u,1);				\
}

#define TEXCOORD4(s,t,u,v)				\
{							\
   GLuint count;					\
   GLfloat *tc;						\
   GLuint texSet;					\
   GET_IMMEDIATE;					\
   texSet = IM->CurrentTexSet;				\
   count = IM->Count;					\
   IM->Flag[count] |= IM->TF4[texSet]; 	\
   tc = IM->TexCoordPtr[texSet][count];			\
   ASSIGN_4V(tc, s,t,u,v);				\
}

#else 

a705 1
#endif
d898 1
d906 1
d1434 1
d1441 1
a1441 1

@


3.16
log
@replaced a few APIENTRY tokens with GLAPIENTRY
@
text
@d1 1
a1 1
/* $Id: api2.c,v 3.15 1999/03/31 20:18:37 keithw Exp $ */
d54 2
a55 2
                       GLdouble bottom, GLdouble top,
                       GLdouble nearval, GLdouble farval )
d236 1
a236 1
                                    const GLclampf *priorities )
d321 1
a321 1
							   (GLfloat) z, (GLfloat) w );
a382 2
/*** 3 element vector ***/

d463 1
a463 1
		   GLenum format, GLenum type, GLvoid *pixels )
d970 1
a970 1
                                 const GLvoid *ptr )
d1084 2
a1085 2
                            GLsizei width, GLint border,
                            GLenum format, GLenum type, const GLvoid *pixels )
d1097 2
a1098 2
                            GLsizei width, GLsizei height, GLint border,
                            GLenum format, GLenum type, const GLvoid *pixels )
d1172 3
a1174 3
                            GLsizei width, GLsizei height, GLsizei depth,
                            GLint border, GLenum format, GLenum type,
                            const GLvoid *pixels )
d1248 4
a1251 4
                               GLint xoffset, GLint yoffset,
                               GLsizei width, GLsizei height,
                               GLenum format, GLenum type,
                               const GLvoid *pixels )
d1263 3
a1265 3
                               GLint yoffset, GLint zoffset, GLsizei width,
                               GLsizei height, GLsizei depth, GLenum format,
                               GLenum type, const GLvoid *pixels )
d1504 1
a1504 1
                               const GLvoid *ptr )
@


3.16.2.1
log
@some trial assembly, made newer code active by default
@
text
@d1 1
a1 1
/* $Id: api2.c,v 3.16 1999/05/08 14:47:30 brianp Exp $ */
a970 1
#if 0
a977 1
#endif
a1504 1
#if 0
d1511 1
a1511 1
#endif
@


3.16.2.2
log
@Removed SGIS multitexture, added FX/X86 assm directory
@
text
@d1 1
a1 1
/* $Id: api2.c,v 3.16.2.1 1999/06/06 22:35:53 keithw Exp $ */
d664 70
d778 1
@


3.15
log
@Compiled vertex arrays
@
text
@d1 1
a1 1
/* $Id: api2.c,v 3.14 1999/03/17 12:08:22 keithw Exp $ */
d780 1
a780 1
void APIENTRY glTexCoord1d( GLdouble s )
d786 1
a786 1
void APIENTRY glTexCoord1f( GLfloat s )
d792 1
a792 1
void APIENTRY glTexCoord1i( GLint s )
d798 1
a798 1
void APIENTRY glTexCoord1s( GLshort s )
d809 1
a809 1
void APIENTRY glTexCoord2f( GLfloat s, GLfloat t )
d820 1
a820 1
void APIENTRY glTexCoord2i( GLint s, GLint t )
d1328 1
a1328 1
void APIENTRY glVertex2d( GLdouble x, GLdouble y )
d1335 1
a1335 1
void APIENTRY glVertex2f( GLfloat x, GLfloat y )
d1349 1
a1349 1
void APIENTRY glVertex2i( GLint x, GLint y )
d1361 1
a1361 1
void APIENTRY glVertex3d( GLdouble x, GLdouble y, GLdouble z )
d1368 1
a1368 1
void APIENTRY glVertex3f( GLfloat x, GLfloat y, GLfloat z )
d1374 1
a1374 1
void APIENTRY glVertex3i( GLint x, GLint y, GLint z )
d1457 1
a1457 1
void APIENTRY glVertex3iv( const GLint *v )
@


3.14
log
@Removed CLIP_4D_BIT, added CLIP_CULLED_BIT.  Clipmask is now used
to drive culling in vertex transformation, allowing us to skip
both clipped and culled vertices with a single test.
@
text
@d1 1
a1 1
/* $Id: api2.c,v 3.13 1999/02/25 14:12:29 keithw Exp $ */
d669 2
a670 6
 *      The price for skipping the function call is that we have no
 *      idea of the state of the vb, so we save all 4 texcoords in
 *      each case, and the size flag too.  This is a pretty small
 *      price compared to what is saved, although could go back to
 *      cleaning columns 2 and 3 in reset_vb only if they become
 *      dirty.
d675 1
a675 2
#define SUPPORT_SGI_MULTITEX
#ifdef SUPPORT_SGI_MULTITEX
d677 13
a689 12
#define TEXCOORD1(s)					\
{							\
   GLuint count;					\
   GLfloat *tc;						\
   GLuint texSet;					\
   GET_IMMEDIATE;					\
   texSet = IM->CurrentTexSet;				\
   count = IM->Count;					\
   IM->LastTexCoord[texSet] = count;			\
   IM->Flag[count] |= (texSet+1); /* max 2 texsets */	\
   tc = IM->TexCoordPtr[texSet][count];			\
   ASSIGN_4V(tc, s,0,0,1);				\
d692 1
d701 1
a701 2
   IM->LastTexCoord[texSet] = count;			\
   IM->Flag[count] |= (texSet+1); /* max 2 texsets */	\
a712 1
   IM->TexCoordSize[texSet] |= 0x1;			\
d714 1
a714 2
   IM->LastTexCoord[texSet] = count;			\
   IM->Flag[count] |= (texSet+1); /* max 2 texsets */	\
a725 1
   IM->TexCoordSize[texSet] |= 0x2;			\
d727 1
a727 2
   IM->LastTexCoord[texSet] = count;			\
   IM->Flag[count] |= (texSet+1); /* max 2 texsets */	\
d740 1
a740 2
   IM->LastTexCoord[0] = count;			\
   IM->Flag[count] |= VERT_TEX0;		\
d742 1
a742 1
   ASSIGN_4V(tc, s,0,0,1);			\
d751 1
a751 2
   IM->LastTexCoord[0] = count;			\
   IM->Flag[count] |= VERT_TEX0;		\
d753 1
a753 1
   ASSIGN_4V(tc, s,t,0,1);			\
a760 1
   IM->TexCoordSize[0] |= 0x1;			\
d762 1
a762 2
   IM->LastTexCoord[0] = count;			\
   IM->Flag[count] |= VERT_TEX0;		\
a771 1
   IM->TexCoordSize[0] |= 0x2;			\
d773 1
a773 2
   IM->LastTexCoord[0] = count;			\
   IM->Flag[count] |= VERT_TEX0;		\
d780 1
a780 1
void GLAPIENTRY glTexCoord1d( GLdouble s )
d786 1
a786 1
void GLAPIENTRY glTexCoord1f( GLfloat s )
d792 1
a792 1
void GLAPIENTRY glTexCoord1i( GLint s )
d798 1
a798 1
void GLAPIENTRY glTexCoord1s( GLshort s )
d809 1
a809 1
void GLAPIENTRY glTexCoord2f( GLfloat s, GLfloat t )
d811 1
a811 1
   TEXCOORD2(s,t); 
d820 1
a820 1
void GLAPIENTRY glTexCoord2i( GLint s, GLint t )
d1294 2
a1295 8
/* KW: Face a choice of whether to do everything possible here, or
 *     to do nothing, and fix up any missing values later on.  Because
 *     the normal case is often for everything to be supplied, and
 *     this is tracked by the AndFlag member, choose the fixup
 *     option.
 *  
 * KW: Spent a little time paring these down to the minimum, including
 *     examination of the asm output from gcc 2.7.2.3 on i386 linux.
d1297 9
d1307 8
a1314 16
#define VERTEX2(IM, x,y)						\
{									\
   GLuint count = IM->Count++;						\
   ASSIGN_4V(IM->Obj[count], x, y, 0, 1);				\
   IM->AndFlag &= (VERT_PRESERVE | VERT_OBJ_2 | IM->Flag[count]);	\
   if (count == VB_MAX-1)						\
      IM->maybe_transform_vb( IM );					\
}

#define VERTEX3(IM,x,y,z)						\
{									\
   GLuint count = IM->Count++;						\
   ASSIGN_4V(IM->Obj[count], x, y, z, 1);				\
   IM->AndFlag &= (VERT_PRESERVE | VERT_OBJ_3 | IM->Flag[count]);	\
   if (count == VB_MAX-1)						\
      IM->maybe_transform_vb( IM );					\
d1317 8
a1324 7
#define VERTEX4(IM, x,y,z,w)				\
{							\
   GLuint count = IM->Count++;				\
   ASSIGN_4V(IM->Obj[count], x, y, z, w);		\
   IM->AndFlag &= (VERT_PRESERVE | IM->Flag[count]);	\
   if (count == VB_MAX-1)				\
      IM->maybe_transform_vb( IM );			\
d1328 1
a1328 1
void GLAPIENTRY glVertex2d( GLdouble x, GLdouble y )
d1335 1
a1335 1
void GLAPIENTRY glVertex2f( GLfloat x, GLfloat y )
d1338 1
a1338 1
   VERTEX2( IM, x, y );
d1349 1
a1349 1
void GLAPIENTRY glVertex2i( GLint x, GLint y )
d1361 1
a1361 1
void GLAPIENTRY glVertex3d( GLdouble x, GLdouble y, GLdouble z )
d1368 1
a1368 1
void GLAPIENTRY glVertex3f( GLfloat x, GLfloat y, GLfloat z )
d1371 1
a1371 1
   VERTEX3( IM, x, y, z ); 
d1374 1
a1374 1
void GLAPIENTRY glVertex3i( GLint x, GLint y, GLint z )
d1398 1
a1398 1
   VERTEX4( IM, x, y, z, w );
d1457 1
a1457 2

void GLAPIENTRY glVertex3iv( const GLint *v )
@


3.13
log
@Merged in kw3 patch
@
text
@d1 1
a1 1
/* $Id: api2.c,v 3.12 1999/02/24 22:48:04 jens Exp $ */
d1373 1
a1373 1
void APIENTRY glVertex2s( GLshort x, GLshort y )
@


3.12
log
@Added header file to get XMesa to compile standalone and inside XFree86
@
text
@d1 1
a1 1
/* $Id: api2.c,v 3.11 1999/02/14 03:46:34 brianp Exp $ */
a27 40
/*
 * $Log: api2.c,v $
 * Revision 3.11  1999/02/14 03:46:34  brianp
 * new copyright
 *
 * Revision 3.10  1999/01/03 03:28:39  brianp
 * now using GLAPIENTRY keyword (Ted Jump)
 *
 * Revision 3.9  1998/11/27 14:12:05  brianp
 * changed glTexImage3D() internalFormat from GLenum to GLint
 *
 * Revision 3.8  1998/11/27 13:59:26  brianp
 * fixed multi-texture typo in glTexImage2D
 *
 * Revision 3.7  1998/11/19 03:07:14  brianp
 * clean-up in glTexImage2D()
 *
 * Revision 3.6  1998/08/21 02:43:52  brianp
 * implemented true packing/unpacking of polygon stipples
 *
 * Revision 3.5  1998/07/26 02:32:43  brianp
 * removed unused variable
 *
 * Revision 3.4  1998/03/27 03:30:36  brianp
 * fixed G++ warnings
 *
 * Revision 3.3  1998/03/10 01:26:57  brianp
 * updated for David's v0.23 fxmesa driver
 *
 * Revision 3.2  1998/02/20 04:49:19  brianp
 * move extension functions into apiext.c
 *
 * Revision 3.1  1998/02/06 01:57:42  brianp
 * added GL 1.2 3-D texture enums and functions
 *
 * Revision 3.0  1998/01/31 20:43:12  brianp
 * initial rev
 *
 */

d664 129
d796 1
a796 2
   GET_CONTEXT;
   (*CC->API.TexCoord4f)( CC, (GLfloat) s, 0.0, 0.0, 1.0 );
d802 1
a802 2
   GET_CONTEXT;
   (*CC->API.TexCoord4f)( CC, s, 0.0, 0.0, 1.0 );
d808 1
a808 2
   GET_CONTEXT;
   (*CC->API.TexCoord4f)( CC, (GLfloat) s, 0.0, 0.0, 1.0 );
d814 1
a814 2
   GET_CONTEXT;
   (*CC->API.TexCoord4f)( CC, (GLfloat) s, 0.0, 0.0, 1.0 );
d820 1
a820 2
   GET_CONTEXT;
   (*CC->API.TexCoord2f)( CC, (GLfloat) s, (GLfloat) t );
a822 1

d825 1
a825 2
   GET_CONTEXT;
   (*CC->API.TexCoord2f)( CC, s, t );
d829 1
a829 1
void GLAPIENTRY glTexCoord2i( GLint s, GLint t )
d831 1
a831 2
   GET_CONTEXT;
   (*CC->API.TexCoord2f)( CC, (GLfloat) s, (GLfloat) t );
d834 1
a834 2

void GLAPIENTRY glTexCoord2s( GLshort s, GLshort t )
d836 1
a836 2
   GET_CONTEXT;
   (*CC->API.TexCoord2f)( CC, (GLfloat) s, (GLfloat) t );
d842 1
a842 2
   GET_CONTEXT;
   (*CC->API.TexCoord4f)( CC, (GLfloat) s, (GLfloat) t, (GLfloat) r, 1.0 );
d848 1
a848 2
   GET_CONTEXT;
   (*CC->API.TexCoord4f)( CC, s, t, r, 1.0 );
d854 1
a854 3
   GET_CONTEXT;
   (*CC->API.TexCoord4f)( CC, (GLfloat) s, (GLfloat) t,
                               (GLfloat) r, 1.0 );
d860 1
a860 3
   GET_CONTEXT;
   (*CC->API.TexCoord4f)( CC, (GLfloat) s, (GLfloat) t,
                               (GLfloat) r, 1.0 );
d866 1
a866 3
   GET_CONTEXT;
   (*CC->API.TexCoord4f)( CC, (GLfloat) s, (GLfloat) t,
                               (GLfloat) r, (GLfloat) q );
d872 1
a872 2
   GET_CONTEXT;
   (*CC->API.TexCoord4f)( CC, s, t, r, q );
d878 1
a878 3
   GET_CONTEXT;
   (*CC->API.TexCoord4f)( CC, (GLfloat) s, (GLfloat) t,
                               (GLfloat) r, (GLfloat) q );
d884 1
a884 3
   GET_CONTEXT;
   (*CC->API.TexCoord4f)( CC, (GLfloat) s, (GLfloat) t,
                               (GLfloat) r, (GLfloat) q );
d890 1
a890 2
   GET_CONTEXT;
   (*CC->API.TexCoord4f)( CC, (GLfloat) *v, 0.0, 0.0, 1.0 );
d896 1
a896 2
   GET_CONTEXT;
   (*CC->API.TexCoord4f)( CC, *v, 0.0, 0.0, 1.0 );
d902 1
a902 2
   GET_CONTEXT;
   (*CC->API.TexCoord4f)( CC, *v, 0.0, 0.0, 1.0 );
d908 1
a908 2
   GET_CONTEXT;
   (*CC->API.TexCoord4f)( CC, (GLfloat) *v, 0.0, 0.0, 1.0 );
d914 1
a914 2
   GET_CONTEXT;
   (*CC->API.TexCoord2f)( CC, (GLfloat) v[0], (GLfloat) v[1] );
d920 1
a920 2
   GET_CONTEXT;
   (*CC->API.TexCoord2f)( CC, v[0], v[1] );
d926 1
a926 2
   GET_CONTEXT;
   (*CC->API.TexCoord2f)( CC, (GLfloat) v[0], (GLfloat) v[1] );
d932 1
a932 2
   GET_CONTEXT;
   (*CC->API.TexCoord2f)( CC, (GLfloat) v[0], (GLfloat) v[1] );
d938 1
a938 3
   GET_CONTEXT;
   (*CC->API.TexCoord4f)( CC, (GLfloat) v[0], (GLfloat) v[1],
                               (GLfloat) v[2], 1.0 );
d944 1
a944 2
   GET_CONTEXT;
   (*CC->API.TexCoord4f)( CC, v[0], v[1], v[2], 1.0 );
d950 1
a950 3
   GET_CONTEXT;
   (*CC->API.TexCoord4f)( CC, (GLfloat) v[0], (GLfloat) v[1],
                          (GLfloat) v[2], 1.0 );
d956 1
a956 3
   GET_CONTEXT;
   (*CC->API.TexCoord4f)( CC, (GLfloat) v[0], (GLfloat) v[1],
                               (GLfloat) v[2], 1.0 );
d962 1
a962 3
   GET_CONTEXT;
   (*CC->API.TexCoord4f)( CC, (GLfloat) v[0], (GLfloat) v[1],
                               (GLfloat) v[2], (GLfloat) v[3] );
d968 2
a969 2
   GET_CONTEXT;
   (*CC->API.TexCoord4f)( CC, v[0], v[1], v[2], v[3] );
d975 1
a975 3
   GET_CONTEXT;
   (*CC->API.TexCoord4f)( CC, (GLfloat) v[0], (GLfloat) v[1],
                               (GLfloat) v[2], (GLfloat) v[3] );
d981 1
a981 3
   GET_CONTEXT;
   (*CC->API.TexCoord4f)( CC, (GLfloat) v[0], (GLfloat) v[1],
                               (GLfloat) v[2], (GLfloat) v[3] );
d1308 37
d1348 2
a1349 2
   GET_CONTEXT;
   (*CC->API.Vertex2f)( CC, (GLfloat) x, (GLfloat) y );
d1355 2
a1356 2
   GET_CONTEXT;
   (*CC->API.Vertex2f)( CC, x, y );
d1359 7
d1369 2
a1370 2
   GET_CONTEXT;
   (*CC->API.Vertex2f)( CC, (GLfloat) x, (GLfloat) y );
d1373 1
a1373 2

void GLAPIENTRY glVertex2s( GLshort x, GLshort y )
d1375 2
a1376 2
   GET_CONTEXT;
   (*CC->API.Vertex2f)( CC, (GLfloat) x, (GLfloat) y );
a1378 1

d1381 2
a1382 2
   GET_CONTEXT;
   (*CC->API.Vertex3f)( CC, (GLfloat) x, (GLfloat) y, (GLfloat) z );
d1388 2
a1389 2
   GET_CONTEXT;
   (*CC->API.Vertex3f)( CC, x, y, z );
a1391 1

d1394 2
a1395 2
   GET_CONTEXT;
   (*CC->API.Vertex3f)( CC, (GLfloat) x, (GLfloat) y, (GLfloat) z );
d1401 2
a1402 2
   GET_CONTEXT;
   (*CC->API.Vertex3f)( CC, (GLfloat) x, (GLfloat) y, (GLfloat) z );
d1408 2
a1409 3
   GET_CONTEXT;
   (*CC->API.Vertex4f)( CC, (GLfloat) x, (GLfloat) y,
                            (GLfloat) z, (GLfloat) w );
d1415 2
a1416 2
   GET_CONTEXT;
   (*CC->API.Vertex4f)( CC, x, y, z, w );
d1422 2
a1423 3
   GET_CONTEXT;
   (*CC->API.Vertex4f)( CC, (GLfloat) x, (GLfloat) y,
                            (GLfloat) z, (GLfloat) w );
d1429 2
a1430 3
   GET_CONTEXT;
   (*CC->API.Vertex4f)( CC, (GLfloat) x, (GLfloat) y,
                            (GLfloat) z, (GLfloat) w );
d1436 2
a1437 2
   GET_CONTEXT;
   (*CC->API.Vertex2f)( CC, (GLfloat) v[0], (GLfloat) v[1] );
d1443 2
a1444 2
   GET_CONTEXT;
   (*CC->API.Vertex2f)( CC, v[0], v[1] );
d1450 2
a1451 2
   GET_CONTEXT;
   (*CC->API.Vertex2f)( CC, (GLfloat) v[0], (GLfloat) v[1] );
d1457 2
a1458 2
   GET_CONTEXT;
   (*CC->API.Vertex2f)( CC, (GLfloat) v[0], (GLfloat) v[1] );
d1464 2
a1465 2
   GET_CONTEXT;
   (*CC->API.Vertex3f)( CC, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2] );
d1471 2
a1472 2
   GET_CONTEXT;
   (*CC->API.Vertex3fv)( CC, v );
d1478 2
a1479 2
   GET_CONTEXT;
   (*CC->API.Vertex3f)( CC, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2] );
d1485 2
a1486 2
   GET_CONTEXT;
   (*CC->API.Vertex3f)( CC, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2] );
d1492 4
a1495 3
   GET_CONTEXT;
   (*CC->API.Vertex4f)( CC, (GLfloat) v[0], (GLfloat) v[1],
                            (GLfloat) v[2], (GLfloat) v[3] );
d1501 2
a1502 2
   GET_CONTEXT;
   (*CC->API.Vertex4f)( CC, v[0], v[1], v[2], v[3] );
d1508 4
a1511 3
   GET_CONTEXT;
   (*CC->API.Vertex4f)( CC, (GLfloat) v[0], (GLfloat) v[1],
                            (GLfloat) v[2], (GLfloat) v[3] );
d1517 4
a1520 3
   GET_CONTEXT;
   (*CC->API.Vertex4f)( CC, (GLfloat) v[0], (GLfloat) v[1],
                            (GLfloat) v[2], (GLfloat) v[3] );
@


3.11
log
@new copyright
@
text
@d1 1
a1 1
/* $Id: api2.c,v 3.10 1999/01/03 03:28:39 brianp Exp brianp $ */
d30 3
d82 3
@


3.10
log
@now using GLAPIENTRY keyword (Ted Jump)
@
text
@d1 1
a1 1
/* $Id: api2.c,v 3.9 1998/11/27 14:12:05 brianp Exp brianp $ */
d6 19
a24 15
 * Copyright (C) 1995-1999  Brian Paul
 *
 * 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.
d30 3
@


3.9
log
@changed glTexImage3D() internalFormat from GLenum to GLint
@
text
@d1 1
a1 1
/* $Id: api2.c,v 3.8 1998/11/27 13:59:26 brianp Exp brianp $ */
d6 1
a6 1
 * Copyright (C) 1995-1998  Brian Paul
d26 3
d80 1
a80 1
void APIENTRY glOrtho( GLdouble left, GLdouble right,
d90 1
a90 1
void APIENTRY glPassThrough( GLfloat token )
d98 1
a98 1
void APIENTRY glPixelMapfv( GLenum map, GLint mapsize, const GLfloat *values )
d106 1
a106 1
void APIENTRY glPixelMapuiv( GLenum map, GLint mapsize, const GLuint *values )
d128 1
a128 1
void APIENTRY glPixelMapusv( GLenum map, GLint mapsize, const GLushort *values )
d149 1
a149 1
void APIENTRY glPixelStoref( GLenum pname, GLfloat param )
d157 1
a157 1
void APIENTRY glPixelStorei( GLenum pname, GLint param )
d165 1
a165 1
void APIENTRY glPixelTransferf( GLenum pname, GLfloat param )
d173 1
a173 1
void APIENTRY glPixelTransferi( GLenum pname, GLint param )
d181 1
a181 1
void APIENTRY glPixelZoom( GLfloat xfactor, GLfloat yfactor )
d189 1
a189 1
void APIENTRY glPointSize( GLfloat size )
d197 1
a197 1
void APIENTRY glPolygonMode( GLenum face, GLenum mode )
d205 1
a205 1
void APIENTRY glPolygonOffset( GLfloat factor, GLfloat units )
d214 1
a214 1
void APIENTRY glPolygonOffsetEXT( GLfloat factor, GLfloat bias )
d220 1
a220 1
void APIENTRY glPolygonStipple( const GLubyte *pattern )
d230 1
a230 1
void APIENTRY glPopAttrib( void )
d238 1
a238 1
void APIENTRY glPopClientAttrib( void )
d246 1
a246 1
void APIENTRY glPopMatrix( void )
d254 1
a254 1
void APIENTRY glPopName( void )
d262 1
a262 1
void APIENTRY glPrioritizeTextures( GLsizei n, const GLuint *textures,
d271 1
a271 1
void APIENTRY glPushMatrix( void )
d279 1
a279 1
void APIENTRY glRasterPos2d( GLdouble x, GLdouble y )
d287 1
a287 1
void APIENTRY glRasterPos2f( GLfloat x, GLfloat y )
d295 1
a295 1
void APIENTRY glRasterPos2i( GLint x, GLint y )
d303 1
a303 1
void APIENTRY glRasterPos2s( GLshort x, GLshort y )
d311 1
a311 1
void APIENTRY glRasterPos3d( GLdouble x, GLdouble y, GLdouble z )
d319 1
a319 1
void APIENTRY glRasterPos3f( GLfloat x, GLfloat y, GLfloat z )
d327 1
a327 1
void APIENTRY glRasterPos3i( GLint x, GLint y, GLint z )
d335 1
a335 1
void APIENTRY glRasterPos3s( GLshort x, GLshort y, GLshort z )
d343 1
a343 1
void APIENTRY glRasterPos4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w )
d352 1
a352 1
void APIENTRY glRasterPos4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w )
d360 1
a360 1
void APIENTRY glRasterPos4i( GLint x, GLint y, GLint z, GLint w )
d369 1
a369 1
void APIENTRY glRasterPos4s( GLshort x, GLshort y, GLshort z, GLshort w )
d378 1
a378 1
void APIENTRY glRasterPos2dv( const GLdouble *v )
d386 1
a386 1
void APIENTRY glRasterPos2fv( const GLfloat *v )
d394 1
a394 1
void APIENTRY glRasterPos2iv( const GLint *v )
d402 1
a402 1
void APIENTRY glRasterPos2sv( const GLshort *v )
d412 1
a412 1
void APIENTRY glRasterPos3dv( const GLdouble *v )
d421 1
a421 1
void APIENTRY glRasterPos3fv( const GLfloat *v )
d430 1
a430 1
void APIENTRY glRasterPos3iv( const GLint *v )
d439 1
a439 1
void APIENTRY glRasterPos3sv( const GLshort *v )
d448 1
a448 1
void APIENTRY glRasterPos4dv( const GLdouble *v )
d457 1
a457 1
void APIENTRY glRasterPos4fv( const GLfloat *v )
d465 1
a465 1
void APIENTRY glRasterPos4iv( const GLint *v )
d474 1
a474 1
void APIENTRY glRasterPos4sv( const GLshort *v )
d483 1
a483 1
void APIENTRY glReadBuffer( GLenum mode )
d491 1
a491 1
void APIENTRY glReadPixels( GLint x, GLint y, GLsizei width, GLsizei height,
d500 1
a500 1
void APIENTRY glRectd( GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2 )
d509 1
a509 1
void APIENTRY glRectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 )
d517 1
a517 1
void APIENTRY glRecti( GLint x1, GLint y1, GLint x2, GLint y2 )
d526 1
a526 1
void APIENTRY glRects( GLshort x1, GLshort y1, GLshort x2, GLshort y2 )
d535 1
a535 1
void APIENTRY glRectdv( const GLdouble *v1, const GLdouble *v2 )
d544 1
a544 1
void APIENTRY glRectfv( const GLfloat *v1, const GLfloat *v2 )
d552 1
a552 1
void APIENTRY glRectiv( const GLint *v1, const GLint *v2 )
d561 1
a561 1
void APIENTRY glRectsv( const GLshort *v1, const GLshort *v2 )
d570 1
a570 1
void APIENTRY glScissor( GLint x, GLint y, GLsizei width, GLsizei height)
d578 1
a578 1
GLboolean APIENTRY glIsEnabled( GLenum cap )
d587 1
a587 1
void APIENTRY glPushAttrib( GLbitfield mask )
d595 1
a595 1
void APIENTRY glPushClientAttrib( GLbitfield mask )
d603 1
a603 1
void APIENTRY glPushName( GLuint name )
d611 1
a611 1
GLint APIENTRY glRenderMode( GLenum mode )
d619 1
a619 1
void APIENTRY glRotated( GLdouble angle, GLdouble x, GLdouble y, GLdouble z )
d628 1
a628 1
void APIENTRY glRotatef( GLfloat angle, GLfloat x, GLfloat y, GLfloat z )
d636 1
a636 1
void APIENTRY glSelectBuffer( GLsizei size, GLuint *buffer )
d644 1
a644 1
void APIENTRY glScaled( GLdouble x, GLdouble y, GLdouble z )
d652 1
a652 1
void APIENTRY glScalef( GLfloat x, GLfloat y, GLfloat z )
d660 1
a660 1
void APIENTRY glShadeModel( GLenum mode )
d668 1
a668 1
void APIENTRY glStencilFunc( GLenum func, GLint ref, GLuint mask )
d676 1
a676 1
void APIENTRY glStencilMask( GLuint mask )
d684 1
a684 1
void APIENTRY glStencilOp( GLenum fail, GLenum zfail, GLenum zpass )
d692 1
a692 1
void APIENTRY glTexCoord1d( GLdouble s )
d699 1
a699 1
void APIENTRY glTexCoord1f( GLfloat s )
d706 1
a706 1
void APIENTRY glTexCoord1i( GLint s )
d713 1
a713 1
void APIENTRY glTexCoord1s( GLshort s )
d720 1
a720 1
void APIENTRY glTexCoord2d( GLdouble s, GLdouble t )
d727 1
a727 1
void APIENTRY glTexCoord2f( GLfloat s, GLfloat t )
d734 1
a734 1
void APIENTRY glTexCoord2i( GLint s, GLint t )
d741 1
a741 1
void APIENTRY glTexCoord2s( GLshort s, GLshort t )
d748 1
a748 1
void APIENTRY glTexCoord3d( GLdouble s, GLdouble t, GLdouble r )
d755 1
a755 1
void APIENTRY glTexCoord3f( GLfloat s, GLfloat t, GLfloat r )
d762 1
a762 1
void APIENTRY glTexCoord3i( GLint s, GLint t, GLint r )
d770 1
a770 1
void APIENTRY glTexCoord3s( GLshort s, GLshort t, GLshort r )
d778 1
a778 1
void APIENTRY glTexCoord4d( GLdouble s, GLdouble t, GLdouble r, GLdouble q )
d786 1
a786 1
void APIENTRY glTexCoord4f( GLfloat s, GLfloat t, GLfloat r, GLfloat q )
d793 1
a793 1
void APIENTRY glTexCoord4i( GLint s, GLint t, GLint r, GLint q )
d801 1
a801 1
void APIENTRY glTexCoord4s( GLshort s, GLshort t, GLshort r, GLshort q )
d809 1
a809 1
void APIENTRY glTexCoord1dv( const GLdouble *v )
d816 1
a816 1
void APIENTRY glTexCoord1fv( const GLfloat *v )
d823 1
a823 1
void APIENTRY glTexCoord1iv( const GLint *v )
d830 1
a830 1
void APIENTRY glTexCoord1sv( const GLshort *v )
d837 1
a837 1
void APIENTRY glTexCoord2dv( const GLdouble *v )
d844 1
a844 1
void APIENTRY glTexCoord2fv( const GLfloat *v )
d851 1
a851 1
void APIENTRY glTexCoord2iv( const GLint *v )
d858 1
a858 1
void APIENTRY glTexCoord2sv( const GLshort *v )
d865 1
a865 1
void APIENTRY glTexCoord3dv( const GLdouble *v )
d873 1
a873 1
void APIENTRY glTexCoord3fv( const GLfloat *v )
d880 1
a880 1
void APIENTRY glTexCoord3iv( const GLint *v )
d888 1
a888 1
void APIENTRY glTexCoord3sv( const GLshort *v )
d896 1
a896 1
void APIENTRY glTexCoord4dv( const GLdouble *v )
d904 1
a904 1
void APIENTRY glTexCoord4fv( const GLfloat *v )
d911 1
a911 1
void APIENTRY glTexCoord4iv( const GLint *v )
d919 1
a919 1
void APIENTRY glTexCoord4sv( const GLshort *v )
d927 1
a927 1
void APIENTRY glTexCoordPointer( GLint size, GLenum type, GLsizei stride,
d936 1
a936 1
void APIENTRY glTexGend( GLenum coord, GLenum pname, GLdouble param )
d945 1
a945 1
void APIENTRY glTexGenf( GLenum coord, GLenum pname, GLfloat param )
d953 1
a953 1
void APIENTRY glTexGeni( GLenum coord, GLenum pname, GLint param )
d962 1
a962 1
void APIENTRY glTexGendv( GLenum coord, GLenum pname, const GLdouble *params )
d975 1
a975 1
void APIENTRY glTexGeniv( GLenum coord, GLenum pname, const GLint *params )
d988 1
a988 1
void APIENTRY glTexGenfv( GLenum coord, GLenum pname, const GLfloat *params )
d998 1
a998 1
void APIENTRY glTexEnvf( GLenum target, GLenum pname, GLfloat param )
d1007 1
a1007 1
void APIENTRY glTexEnvi( GLenum target, GLenum pname, GLint param )
d1019 1
a1019 1
void APIENTRY glTexEnvfv( GLenum target, GLenum pname, const GLfloat *param )
d1028 1
a1028 1
void APIENTRY glTexEnviv( GLenum target, GLenum pname, const GLint *param )
d1041 1
a1041 1
void APIENTRY glTexImage1D( GLenum target, GLint level, GLint internalformat,
d1054 1
a1054 1
void APIENTRY glTexImage2D( GLenum target, GLint level, GLint internalformat,
d1129 1
a1129 1
void APIENTRY glTexImage3D( GLenum target, GLint level, GLint internalformat,
d1144 1
a1144 1
void APIENTRY glTexParameterf( GLenum target, GLenum pname, GLfloat param )
d1152 1
a1152 1
void APIENTRY glTexParameteri( GLenum target, GLenum pname, GLint param )
d1163 1
a1163 1
void APIENTRY glTexParameterfv( GLenum target, GLenum pname, const GLfloat *params )
d1171 1
a1171 1
void APIENTRY glTexParameteriv( GLenum target, GLenum pname, const GLint *params )
d1192 1
a1192 1
void APIENTRY glTexSubImage1D( GLenum target, GLint level, GLint xoffset,
d1205 1
a1205 1
void APIENTRY glTexSubImage2D( GLenum target, GLint level,
d1220 1
a1220 1
void APIENTRY glTexSubImage3D( GLenum target, GLint level, GLint xoffset,
d1235 1
a1235 1
void APIENTRY glTranslated( GLdouble x, GLdouble y, GLdouble z )
d1243 1
a1243 1
void APIENTRY glTranslatef( GLfloat x, GLfloat y, GLfloat z )
d1251 1
a1251 1
void APIENTRY glVertex2d( GLdouble x, GLdouble y )
d1258 1
a1258 1
void APIENTRY glVertex2f( GLfloat x, GLfloat y )
d1265 1
a1265 1
void APIENTRY glVertex2i( GLint x, GLint y )
d1272 1
a1272 1
void APIENTRY glVertex2s( GLshort x, GLshort y )
d1279 1
a1279 1
void APIENTRY glVertex3d( GLdouble x, GLdouble y, GLdouble z )
d1286 1
a1286 1
void APIENTRY glVertex3f( GLfloat x, GLfloat y, GLfloat z )
d1293 1
a1293 1
void APIENTRY glVertex3i( GLint x, GLint y, GLint z )
d1300 1
a1300 1
void APIENTRY glVertex3s( GLshort x, GLshort y, GLshort z )
d1307 1
a1307 1
void APIENTRY glVertex4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w )
d1315 1
a1315 1
void APIENTRY glVertex4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w )
d1322 1
a1322 1
void APIENTRY glVertex4i( GLint x, GLint y, GLint z, GLint w )
d1330 1
a1330 1
void APIENTRY glVertex4s( GLshort x, GLshort y, GLshort z, GLshort w )
d1338 1
a1338 1
void APIENTRY glVertex2dv( const GLdouble *v )
d1345 1
a1345 1
void APIENTRY glVertex2fv( const GLfloat *v )
d1352 1
a1352 1
void APIENTRY glVertex2iv( const GLint *v )
d1359 1
a1359 1
void APIENTRY glVertex2sv( const GLshort *v )
d1366 1
a1366 1
void APIENTRY glVertex3dv( const GLdouble *v )
d1373 1
a1373 1
void APIENTRY glVertex3fv( const GLfloat *v )
d1380 1
a1380 1
void APIENTRY glVertex3iv( const GLint *v )
d1387 1
a1387 1
void APIENTRY glVertex3sv( const GLshort *v )
d1394 1
a1394 1
void APIENTRY glVertex4dv( const GLdouble *v )
d1402 1
a1402 1
void APIENTRY glVertex4fv( const GLfloat *v )
d1409 1
a1409 1
void APIENTRY glVertex4iv( const GLint *v )
d1417 1
a1417 1
void APIENTRY glVertex4sv( const GLshort *v )
d1425 1
a1425 1
void APIENTRY glVertexPointer( GLint size, GLenum type, GLsizei stride,
d1433 1
a1433 1
void APIENTRY glViewport( GLint x, GLint y, GLsizei width, GLsizei height )
@


3.8
log
@fixed multi-texture typo in glTexImage2D
@
text
@d1 1
a1 1
/* $Id: api2.c,v 3.7 1998/11/19 03:07:14 brianp Exp brianp $ */
d26 3
d1126 1
a1126 1
void APIENTRY glTexImage3D( GLenum target, GLint level, GLenum internalformat,
@


3.7
log
@clean-up in glTexImage2D()
@
text
@d1 1
a1 1
/* $Id: api2.c,v 3.6 1998/08/21 02:43:52 brianp Exp brianp $ */
d26 3
d1065 2
a1066 2
   if (CC->Texture.Set[0].Current2D->Name!=lasttexobj) {
      lasttexobj = CC->Texture.Set[0].Current2D->Name;
@


3.6
log
@implemented true packing/unpacking of polygon stipples
@
text
@d1 1
a1 1
/* $Id: api2.c,v 3.5 1998/07/26 02:32:43 brianp Exp brianp $ */
d5 1
a5 1
 * Version:  3.0
d26 3
a1044 1

a1048 1
  struct gl_image *teximage;
a1049 8
  GLvoid *newpixels=NULL;
  GLsizei newwidth,newheight;
  GLint x,y;
  static GLint leveldif=0;
  static GLuint lasttexobj=0;
#endif
  GET_CONTEXT;
  CHECK_CONTEXT;
d1051 1
a1051 2
#if defined(FX) && defined(__WIN32__)
  newpixels=NULL;
d1053 13
a1065 6
  /* AN HACK for WinGLQuake*/
  
  if (CC->Texture.Set[0].Current2D->Name!=lasttexobj) {
    lasttexobj=CC->Texture.Set[0].Current2D->Name;
    leveldif=0;
  }
d1067 2
a1068 2
  if ((format==GL_COLOR_INDEX) && (internalformat==1))
    internalformat=GL_COLOR_INDEX8_EXT;
d1070 2
a1071 2
  if (width>256 || height>256) {
    newpixels=malloc((width+4)*height*4);
d1073 4
a1076 4
    while (width>256 || height>256) {
      newwidth=width/2;
      newheight=height/2;
      leveldif++;
d1078 2
a1079 2
      fprintf(stderr,"Scaling: (%d) %dx%d -> %dx%d\n",internalformat,width,height,newwidth,newheight);
      fflush(stderr);
d1081 33
a1113 19
      for(y=0;y<newheight;y++)
	for(x=0;x<newwidth;x++) {
	  ((GLubyte *)newpixels)[(x+y*newwidth)*4+0]=((GLubyte *)pixels)[(x*2+y*width*2)*4+0];
	  ((GLubyte *)newpixels)[(x+y*newwidth)*4+1]=((GLubyte *)pixels)[(x*2+y*width*2)*4+1];
	  ((GLubyte *)newpixels)[(x+y*newwidth)*4+2]=((GLubyte *)pixels)[(x*2+y*width*2)*4+2];
	  ((GLubyte *)newpixels)[(x+y*newwidth)*4+3]=((GLubyte *)pixels)[(x*2+y*width*2)*4+3];
	}

      pixels=newpixels;
      width=newwidth;
      height=newheight;
    }
    
    level=0;
  } else
    level-=leveldif;
#endif
  teximage = gl_unpack_image( CC, width, height, format, type, pixels );
  (*CC->API.TexImage2D)( CC, target, level, internalformat,
d1115 1
a1115 3
#if defined(FX) && defined(__WIN32__)
  if(newpixels)
    free(newpixels);
@


3.5
log
@removed unused variable
@
text
@d1 1
a1 1
/* $Id: api2.c,v 3.4 1998/03/27 03:30:36 brianp Exp brianp $ */
d26 3
d208 1
a208 1
void APIENTRY glPolygonStipple( const GLubyte *mask )
d210 1
d213 2
a214 1
   (*CC->API.PolygonStipple)(CC, mask);
@


3.4
log
@fixed G++ warnings
@
text
@d1 1
a1 1
/* $Id: api2.c,v 3.3 1998/03/10 01:26:57 brianp Exp brianp $ */
d26 3
d1046 1
a1046 1
  GLint x,y,z;
@


3.3
log
@updated for David's v0.23 fxmesa driver
@
text
@d1 1
a1 1
/* $Id: api2.c,v 3.2 1998/02/20 04:49:19 brianp Exp brianp $ */
d26 3
d91 1
a91 1
   GLuint i;
d113 1
a113 1
   GLuint i;
@


3.2
log
@move extension functions into apiext.c
@
text
@d1 1
a1 1
/* $Id: api2.c,v 3.1 1998/02/06 01:57:42 brianp Exp brianp $ */
d26 3
d1036 1
a1036 1
   struct gl_image *teximage;
d1038 5
a1042 5
   GLvoid *newpixels=NULL;
   GLsizei newwidth,newheight;
   GLint x,y;
   static GLint leveldif=0;
   static GLuint lasttexobj=0xffffff;
d1044 2
a1045 2
   GET_CONTEXT;
   CHECK_CONTEXT;
d1048 1
a1048 1
   newpixels=NULL;
d1050 1
a1050 1
   /* AN HACK for WinGLQuake*/
d1052 4
a1055 4
   if (CC->Texture.Current2D->Name!=lasttexobj) {
      lasttexobj=CC->Texture.Current2D->Name;
      leveldif=0;
   }
d1057 2
a1058 2
   if ((format==GL_COLOR_INDEX) && (internalformat==1))
      internalformat=GL_COLOR_INDEX8_EXT;
d1060 7
a1066 5
   if (width>256 || height >256) {
      while (width>256 || height >256) {
         newwidth=width/2;
         newheight=height/2;
         leveldif++;
d1068 2
a1069 1
         fprintf(stderr,"Scaling: %dx%d -> %dx%d\n",width,height,newwidth,newheight);
d1071 12
a1082 13
         newpixels=malloc((newwidth+4)*newheight*4);
      
         for(y=0;y<newheight;y++)
            for(x=0;x<newwidth;x++)
               ((GLubyte *)newpixels)[x+y*newwidth]=((GLubyte *)pixels)[x*2+y*width*2];
      
         if(newpixels)
            free((void*)pixels);
      
         pixels=newpixels;
         width=newwidth;
         height=newheight;
      }
d1084 3
a1086 4
      level=0;
   }
   else
      level-=leveldif;
d1088 3
a1090 3
   teximage = gl_unpack_image( CC, width, height, format, type, pixels );
   (*CC->API.TexImage2D)( CC, target, level, internalformat,
                          width, height, border, format, type, teximage );
d1092 2
a1093 2
   if(newpixels)
      free(newpixels);
@


3.1
log
@added GL 1.2 3-D texture enums and functions
@
text
@d1 1
a1 1
/* $Id: api2.c,v 3.0 1998/01/31 20:43:12 brianp Exp brianp $ */
d26 3
a40 1
#include "bitmap.h"
a41 1
#include "eval.h"
d51 4
d902 1
a902 1
                        const GLvoid *ptr )
d1094 15
d1185 15
a1401 401
}



/**
 ** Extensions
 **
 ** Some of these are incorporated into the 1.1 API.  They also remain as
 ** extensions for backward compatibility.  May be removed in the future.
 **/


/* GL_EXT_blend_minmax */

void APIENTRY glBlendEquationEXT( GLenum mode )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.BlendEquation)(CC, mode);
}


/* GL_EXT_blend_color */

void APIENTRY glBlendColorEXT( GLclampf red, GLclampf green,
                               GLclampf blue, GLclampf alpha )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.BlendColor)(CC, red, green, blue, alpha);
}


/* GL_EXT_vertex_array */

void APIENTRY glVertexPointerEXT( GLint size, GLenum type, GLsizei stride,
                                  GLsizei count, const GLvoid *ptr )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.VertexPointer)(CC, size, type, stride, ptr);
}


void APIENTRY glNormalPointerEXT( GLenum type, GLsizei stride, GLsizei count,
                                  const GLvoid *ptr )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.NormalPointer)(CC, type, stride, ptr);
}


void APIENTRY glColorPointerEXT( GLint size, GLenum type, GLsizei stride,
                                 GLsizei count, const GLvoid *ptr )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.ColorPointer)(CC, size, type, stride, ptr);
}


void APIENTRY glIndexPointerEXT( GLenum type, GLsizei stride,
                                 GLsizei count, const GLvoid *ptr )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.IndexPointer)(CC, type, stride, ptr);
}


void APIENTRY glTexCoordPointerEXT( GLint size, GLenum type, GLsizei stride,
                                    GLsizei count, const GLvoid *ptr )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.TexCoordPointer)(CC, size, type, stride, ptr);
}


void APIENTRY glEdgeFlagPointerEXT( GLsizei stride, GLsizei count,
                                    const GLboolean *ptr )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.EdgeFlagPointer)(CC, stride, ptr);
}


void APIENTRY glGetPointervEXT( GLenum pname, GLvoid **params )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.GetPointerv)(CC, pname, params);
}


void APIENTRY glArrayElementEXT( GLint i )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.ArrayElement)(CC, i);
}


void APIENTRY glDrawArraysEXT( GLenum mode, GLint first, GLsizei count )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.DrawArrays)(CC, mode, first, count);
}


/* GL_EXT_texture_object */

GLboolean APIENTRY glAreTexturesResidentEXT( GLsizei n, const GLuint *textures,
                                             GLboolean *residences )
{
   return glAreTexturesResident( n, textures, residences );
}


void APIENTRY glBindTextureEXT( GLenum target, GLuint texture )
{
   glBindTexture( target, texture );
}


void APIENTRY glDeleteTexturesEXT( GLsizei n, const GLuint *textures)
{
   glDeleteTextures( n, textures );
}


void APIENTRY glGenTexturesEXT( GLsizei n, GLuint *textures )
{
   glGenTextures( n, textures );
}


GLboolean APIENTRY glIsTextureEXT( GLuint texture )
{
   return glIsTexture( texture );
}


void APIENTRY glPrioritizeTexturesEXT( GLsizei n, const GLuint *textures,
                                       const GLclampf *priorities )
{
   glPrioritizeTextures( n, textures, priorities );
}



/* GL_EXT_texture3D */

void APIENTRY glCopyTexSubImage3DEXT( GLenum target, GLint level, GLint xoffset,
                                      GLint yoffset, GLint zoffset,
                                      GLint x, GLint y, GLsizei width,
                                      GLsizei height )
{
   glCopyTexSubImage3D(target, level, xoffset, yoffset, zoffset,
                       x, y, width, height);
}



void APIENTRY glTexImage3DEXT( GLenum target, GLint level, GLenum internalformat,
                               GLsizei width, GLsizei height, GLsizei depth,
                               GLint border, GLenum format, GLenum type,
                               const GLvoid *pixels )
{
   glTexImage3D(target, level, internalformat, width, height, depth,
                border, format, type, pixels);
}


void APIENTRY glTexSubImage3DEXT( GLenum target, GLint level, GLint xoffset,
                                  GLint yoffset, GLint zoffset, GLsizei width,
                                  GLsizei height, GLsizei depth, GLenum format,
                                  GLenum type, const GLvoid *pixels )
{
   glTexSubImage3D(target, level, xoffset, yoffset, zoffset,
                   width, height, depth, format, type, pixels);
}


/* 1.2 */
void APIENTRY glCopyTexSubImage3D( GLenum target, GLint level, GLint xoffset,
                                   GLint yoffset, GLint zoffset,
                                   GLint x, GLint y, GLsizei width,
                                   GLsizei height )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.CopyTexSubImage3DEXT)( CC, target, level, xoffset, yoffset,
                                    zoffset, x, y, width, height );
}



void APIENTRY glTexImage3D( GLenum target, GLint level, GLenum internalformat,
                            GLsizei width, GLsizei height, GLsizei depth,
                            GLint border, GLenum format, GLenum type,
                            const GLvoid *pixels )
{
   struct gl_image *teximage;
   GET_CONTEXT;
   CHECK_CONTEXT;
   teximage = gl_unpack_image3D( CC, width, height, depth, format, type, pixels);
   (*CC->API.TexImage3DEXT)( CC, target, level, internalformat,
                             width, height, depth, border, format, type, 
                             teximage );
}


void APIENTRY glTexSubImage3D( GLenum target, GLint level, GLint xoffset,
                               GLint yoffset, GLint zoffset, GLsizei width,
                               GLsizei height, GLsizei depth, GLenum format,
                               GLenum type, const GLvoid *pixels )
{
   struct gl_image *image;
   GET_CONTEXT;
   CHECK_CONTEXT;
   image = gl_unpack_texsubimage3D( CC, width, height, depth, format, type,
                                    pixels );
   (*CC->API.TexSubImage3DEXT)( CC, target, level, xoffset, yoffset, zoffset,
                                width, height, depth, format, type, image );
}



/* GL_EXT_point_parameters */

void APIENTRY glPointParameterfEXT( GLenum pname, GLfloat param )
{
   GLfloat params[3];
   GET_CONTEXT;
   CHECK_CONTEXT;
   params[0] = param;
   params[1] = 0.0;
   params[2] = 0.0;
   (*CC->API.PointParameterfvEXT)(CC, pname, params);
}


void APIENTRY glPointParameterfvEXT( GLenum pname, const GLfloat *params )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.PointParameterfvEXT)(CC, pname, params);
}



#ifdef GL_MESA_window_pos
/*
 * Mesa implementation of glWindowPos*MESA()
 */
void APIENTRY glWindowPos4fMESA( GLfloat x, GLfloat y, GLfloat z, GLfloat w )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.WindowPos4fMESA)( CC, x, y, z, w );
}
#else
/* Implementation in winpos.c is used */
#endif


void APIENTRY glWindowPos2iMESA( GLint x, GLint y )
{
   glWindowPos4fMESA( (GLfloat) x, (GLfloat) y, 0.0F, 1.0F );
}

void APIENTRY glWindowPos2sMESA( GLshort x, GLshort y )
{
   glWindowPos4fMESA( (GLfloat) x, (GLfloat) y, 0.0F, 1.0F );
}

void APIENTRY glWindowPos2fMESA( GLfloat x, GLfloat y )
{
   glWindowPos4fMESA( x, y, 0.0F, 1.0F );
}

void APIENTRY glWindowPos2dMESA( GLdouble x, GLdouble y )
{
   glWindowPos4fMESA( (GLfloat) x, (GLfloat) y, 0.0F, 1.0F );
}

void APIENTRY glWindowPos2ivMESA( const GLint *p )
{
   glWindowPos4fMESA( (GLfloat) p[0], (GLfloat) p[1], 0.0F, 1.0F );
}

void APIENTRY glWindowPos2svMESA( const GLshort *p )
{
   glWindowPos4fMESA( (GLfloat) p[0], (GLfloat) p[1], 0.0F, 1.0F );
}

void APIENTRY glWindowPos2fvMESA( const GLfloat *p )
{
   glWindowPos4fMESA( p[0], p[1], 0.0F, 1.0F );
}

void APIENTRY glWindowPos2dvMESA( const GLdouble *p )
{
   glWindowPos4fMESA( (GLfloat) p[0], (GLfloat) p[1], 0.0F, 1.0F );
}

void APIENTRY glWindowPos3iMESA( GLint x, GLint y, GLint z )
{
   glWindowPos4fMESA( (GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F );
}

void APIENTRY glWindowPos3sMESA( GLshort x, GLshort y, GLshort z )
{
   glWindowPos4fMESA( (GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F );
}

void APIENTRY glWindowPos3fMESA( GLfloat x, GLfloat y, GLfloat z )
{
   glWindowPos4fMESA( x, y, z, 1.0F );
}

void APIENTRY glWindowPos3dMESA( GLdouble x, GLdouble y, GLdouble z )
{
   glWindowPos4fMESA( (GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F );
}

void APIENTRY glWindowPos3ivMESA( const GLint *p )
{
   glWindowPos4fMESA( (GLfloat) p[0], (GLfloat) p[1], (GLfloat) p[2], 1.0F );
}

void APIENTRY glWindowPos3svMESA( const GLshort *p )
{
   glWindowPos4fMESA( (GLfloat) p[0], (GLfloat) p[1], (GLfloat) p[2], 1.0F );
}

void APIENTRY glWindowPos3fvMESA( const GLfloat *p )
{
   glWindowPos4fMESA( p[0], p[1], p[2], 1.0F );
}

void APIENTRY glWindowPos3dvMESA( const GLdouble *p )
{
   glWindowPos4fMESA( (GLfloat) p[0], (GLfloat) p[1], (GLfloat) p[2], 1.0F );
}

void APIENTRY glWindowPos4iMESA( GLint x, GLint y, GLint z, GLint w )
{
   glWindowPos4fMESA( (GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w );
}

void APIENTRY glWindowPos4sMESA( GLshort x, GLshort y, GLshort z, GLshort w )
{
   glWindowPos4fMESA( (GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w );
}

void APIENTRY glWindowPos4dMESA( GLdouble x, GLdouble y, GLdouble z, GLdouble w )
{
   glWindowPos4fMESA( (GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w );
}


void APIENTRY glWindowPos4ivMESA( const GLint *p )
{
   glWindowPos4fMESA( (GLfloat) p[0], (GLfloat) p[1],
                      (GLfloat) p[2], (GLfloat) p[3] );
}

void APIENTRY glWindowPos4svMESA( const GLshort *p )
{
   glWindowPos4fMESA( (GLfloat) p[0], (GLfloat) p[1],
                      (GLfloat) p[2], (GLfloat) p[3] );
}

void APIENTRY glWindowPos4fvMESA( const GLfloat *p )
{
   glWindowPos4fMESA( p[0], p[1], p[2], p[3] );
}

void APIENTRY glWindowPos4dvMESA( const GLdouble *p )
{
   glWindowPos4fMESA( (GLfloat) p[0], (GLfloat) p[1],
                      (GLfloat) p[2], (GLfloat) p[3] );
}



/* GL_MESA_resize_buffers */

/*
 * Called by user application when window has been resized.
 */
void APIENTRY glResizeBuffersMESA( void )
{
   GET_CONTEXT;
   CHECK_CONTEXT;
   (*CC->API.ResizeBuffersMESA)( CC );
@


3.0
log
@initial rev
@
text
@d1 1
a1 1
/* $Id$ */
d25 4
a28 1
 * $Log$
d184 1
a184 1
#ifdef GL_EXT_polygon_offset
a188 1
#endif
d1528 32
d1568 4
a1571 4
void APIENTRY glTexImage3DEXT( GLenum target, GLint level, GLenum internalformat,
                               GLsizei width, GLsizei height, GLsizei depth,
                               GLint border, GLenum format, GLenum type,
                               const GLvoid *pixels )
d1583 4
a1586 4
void APIENTRY glTexSubImage3DEXT( GLenum target, GLint level, GLint xoffset,
                                  GLint yoffset, GLint zoffset, GLsizei width,
                                  GLsizei height, GLsizei depth, GLenum format,
                                  GLenum type, const GLvoid *pixels )
@
