/* Generated by call-gen.pl from /usr/local/include/GL/gl.h */

void OSMesaDriver::nfglClearIndex(GLfloat c )
{
	D(bug("nfosmesa: glClearIndex"));
	fn.glClearIndex(  c );
}

void OSMesaDriver::nfglClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha )
{
	D(bug("nfosmesa: glClearColor(%.3f,%.3f,%.3f,%.3f)",red,green,blue,alpha));
	fn.glClearColor(  red,  green,  blue,  alpha );
}

void OSMesaDriver::nfglClear(GLbitfield mask )
{
	D(bug("nfosmesa: glClear"));
	fn.glClear(  mask );
}

void OSMesaDriver::nfglIndexMask(GLuint mask )
{
	D(bug("nfosmesa: glIndexMask"));
	fn.glIndexMask(  mask );
}

void OSMesaDriver::nfglColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha )
{
	D(bug("nfosmesa: glColorMask"));
	fn.glColorMask(  red,  green,  blue,  alpha );
}

void OSMesaDriver::nfglAlphaFunc(GLenum func, GLclampf ref )
{
	D(bug("nfosmesa: glAlphaFunc"));
	fn.glAlphaFunc(  func,  ref );
}

void OSMesaDriver::nfglBlendFunc(GLenum sfactor, GLenum dfactor )
{
	D(bug("nfosmesa: glBlendFunc"));
	fn.glBlendFunc(  sfactor,  dfactor );
}

void OSMesaDriver::nfglLogicOp(GLenum opcode )
{
	D(bug("nfosmesa: glLogicOp"));
	fn.glLogicOp(  opcode );
}

void OSMesaDriver::nfglCullFace(GLenum mode )
{
	D(bug("nfosmesa: glCullFace"));
	fn.glCullFace(  mode );
}

void OSMesaDriver::nfglFrontFace(GLenum mode )
{
	D(bug("nfosmesa: glFrontFace"));
	fn.glFrontFace(  mode );
}

void OSMesaDriver::nfglPointSize(GLfloat size )
{
	D(bug("nfosmesa: glPointSize"));
	fn.glPointSize(  size );
}

void OSMesaDriver::nfglLineWidth(GLfloat width )
{
	D(bug("nfosmesa: glLineWidth"));
	fn.glLineWidth(  width );
}

void OSMesaDriver::nfglLineStipple(GLint factor, GLushort pattern )
{
	D(bug("nfosmesa: glLineStipple"));
	fn.glLineStipple(  factor,  pattern );
}

void OSMesaDriver::nfglPolygonMode(GLenum face, GLenum mode )
{
	D(bug("nfosmesa: glPolygonMode"));
	fn.glPolygonMode(  face,  mode );
}

void OSMesaDriver::nfglPolygonOffset(GLfloat factor, GLfloat units )
{
	D(bug("nfosmesa: glPolygonOffset"));
	fn.glPolygonOffset(  factor,  units );
}

void OSMesaDriver::nfglPolygonStipple(const GLubyte *mask )
{
	D(bug("nfosmesa: glPolygonStipple"));
	fn.glPolygonStipple(  mask );
}

void OSMesaDriver::nfglGetPolygonStipple(GLubyte *mask )
{
	D(bug("nfosmesa: glGetPolygonStipple"));
	fn.glGetPolygonStipple(  mask );
}

void OSMesaDriver::nfglEdgeFlag(GLboolean flag )
{
	D(bug("nfosmesa: glEdgeFlag"));
	fn.glEdgeFlag(  flag );
}

void OSMesaDriver::nfglEdgeFlagv(const GLboolean *flag )
{
	D(bug("nfosmesa: glEdgeFlagv"));
	fn.glEdgeFlagv(  flag );
}

void OSMesaDriver::nfglScissor(GLint x, GLint y, GLsizei width, GLsizei height)
{
	D(bug("nfosmesa: glScissor"));
	fn.glScissor(  x,  y,  width,  height);
}

void OSMesaDriver::nfglClipPlane(GLenum plane, const GLdouble *equation )
{
	GLdouble tmp[4];

	D(bug("nfosmesa: glClipPlane"));
	Atari2HostDoublePtr(4, (Uint32 *)equation, tmp);
	fn.glClipPlane(  plane,  tmp );
}

void OSMesaDriver::nfglGetClipPlane(GLenum plane, GLdouble *equation )
{
	D(bug("nfosmesa: glGetClipPlane"));
	fn.glGetClipPlane(  plane,  equation );
}

void OSMesaDriver::nfglDrawBuffer(GLenum mode )
{
	D(bug("nfosmesa: glDrawBuffer"));
	fn.glDrawBuffer(  mode );
}

void OSMesaDriver::nfglReadBuffer(GLenum mode )
{
	D(bug("nfosmesa: glReadBuffer"));
	fn.glReadBuffer(  mode );
}

void OSMesaDriver::nfglEnable(GLenum cap )
{
	D(bug("nfosmesa: glEnable"));
	fn.glEnable(  cap );
}

void OSMesaDriver::nfglDisable(GLenum cap )
{
	D(bug("nfosmesa: glDisable"));
	fn.glDisable(  cap );
}

GLboolean OSMesaDriver::nfglIsEnabled(GLenum cap )
{
	D(bug("nfosmesa: glIsEnabled"));
	return fn.glIsEnabled(  cap );
}

void OSMesaDriver::nfglEnableClientState(GLenum cap )
{
	D(bug("nfosmesa: glEnableClientState"));

#if SDL_BYTEORDER == SDL_LIL_ENDIAN
	switch(cap) {
		case GL_VERTEX_ARRAY:
			contexts[cur_context].enabled_arrays |= NFOSMESA_VERTEX_ARRAY;
			break;
		case GL_NORMAL_ARRAY:
			contexts[cur_context].enabled_arrays |= NFOSMESA_NORMAL_ARRAY;
			break;
		case GL_COLOR_ARRAY:
			contexts[cur_context].enabled_arrays |= NFOSMESA_COLOR_ARRAY;
			break;
		case GL_INDEX_ARRAY:
			contexts[cur_context].enabled_arrays |= NFOSMESA_INDEX_ARRAY;
			break;
		case GL_EDGE_FLAG_ARRAY:
			contexts[cur_context].enabled_arrays |= NFOSMESA_EDGEFLAG_ARRAY;
			break;
		case GL_TEXTURE_COORD_ARRAY:
			contexts[cur_context].enabled_arrays |= NFOSMESA_TEXCOORD_ARRAY;
			break;
	}
#endif
	fn.glEnableClientState(  cap );
}

void OSMesaDriver::nfglDisableClientState(GLenum cap )
{
	D(bug("nfosmesa: glDisableClientState"));

#if SDL_BYTEORDER == SDL_LIL_ENDIAN
	switch(cap) {
		case GL_VERTEX_ARRAY:
			contexts[cur_context].enabled_arrays &= ~NFOSMESA_VERTEX_ARRAY;
			break;
		case GL_NORMAL_ARRAY:
			contexts[cur_context].enabled_arrays &= ~NFOSMESA_NORMAL_ARRAY;
			break;
		case GL_COLOR_ARRAY:
			contexts[cur_context].enabled_arrays &= ~NFOSMESA_COLOR_ARRAY;
			break;
		case GL_INDEX_ARRAY:
			contexts[cur_context].enabled_arrays &= ~NFOSMESA_INDEX_ARRAY;
			break;
		case GL_EDGE_FLAG_ARRAY:
			contexts[cur_context].enabled_arrays &= ~NFOSMESA_EDGEFLAG_ARRAY;
			break;
		case GL_TEXTURE_COORD_ARRAY:
			contexts[cur_context].enabled_arrays &= ~NFOSMESA_TEXCOORD_ARRAY;
			break;
	}
#endif
	fn.glDisableClientState(  cap );
}

void OSMesaDriver::nfglGetBooleanv(GLenum pname, GLboolean *params )
{
	GLboolean tmp;

	D(bug("nfosmesa: glGetBooleanv"));
	fn.glGetBooleanv(  pname,  &tmp );
	*params = SDL_SwapBE32(tmp);
}

void OSMesaDriver::nfglGetDoublev(GLenum pname, GLdouble *params )
{
	D(bug("nfosmesa: glGetDoublev"));
	fn.glGetDoublev(  pname,  params );
}

void OSMesaDriver::nfglGetFloatv(GLenum pname, GLfloat *params )
{
	GLfloat tmp;

	D(bug("nfosmesa: glGetFloatv"));
	fn.glGetFloatv(  pname,  &tmp );
	*params = (GLfloat)SDL_SwapBE32((Uint32)tmp);
}

void OSMesaDriver::nfglGetIntegerv(GLenum pname, GLint *params )
{
	GLint tmp;

	D(bug("nfosmesa: glGetIntegerv"));
	fn.glGetIntegerv(  pname,  &tmp );
	*params = SDL_SwapBE32(tmp);
}

void OSMesaDriver::nfglPushAttrib(GLbitfield mask )
{
	D(bug("nfosmesa: glPushAttrib"));
	fn.glPushAttrib(  mask );
}

void OSMesaDriver::nfglPopAttrib(void)
{
	D(bug("nfosmesa: glPopAttrib"));
	fn.glPopAttrib(  );
}

void OSMesaDriver::nfglPushClientAttrib(GLbitfield mask )
{
	D(bug("nfosmesa: glPushClientAttrib"));
	fn.glPushClientAttrib(  mask );
}

void OSMesaDriver::nfglPopClientAttrib(void)
{
	D(bug("nfosmesa: glPopClientAttrib"));
	fn.glPopClientAttrib(  );
}

GLint OSMesaDriver::nfglRenderMode(GLenum mode )
{
	D(bug("nfosmesa: glRenderMode"));
	return fn.glRenderMode(  mode );
}

GLenum OSMesaDriver::nfglGetError(void)
{
	D(bug("nfosmesa: glGetError"));
	return fn.glGetError(  );
}

const GLubyte* OSMesaDriver::nfglGetString(GLenum name )
{
	D(bug("nfosmesa: glGetString"));
	return fn.glGetString(  name );
}

void OSMesaDriver::nfglFinish(void)
{
	D(bug("nfosmesa: glFinish"));
	fn.glFinish(  );
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
	ConvertContext(cur_context);
#endif
}

void OSMesaDriver::nfglFlush(void)
{
	D(bug("nfosmesa: glFlush"));
	fn.glFlush(  );
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
	ConvertContext(cur_context);
#endif
}

void OSMesaDriver::nfglHint(GLenum target, GLenum mode )
{
	D(bug("nfosmesa: glHint"));
	fn.glHint(  target,  mode );
}

void OSMesaDriver::nfglClearDepth(GLclampd depth )
{
	D(bug("nfosmesa: glClearDepth"));
	fn.glClearDepth(  depth );
}

void OSMesaDriver::nfglDepthFunc(GLenum func )
{
	D(bug("nfosmesa: glDepthFunc"));
	fn.glDepthFunc(  func );
}

void OSMesaDriver::nfglDepthMask(GLboolean flag )
{
	D(bug("nfosmesa: glDepthMask"));
	fn.glDepthMask(  flag );
}

void OSMesaDriver::nfglDepthRange(GLclampd near_val, GLclampd far_val )
{
	D(bug("nfosmesa: glDepthRange"));
	fn.glDepthRange(  near_val,  far_val );
}

void OSMesaDriver::nfglClearAccum(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha )
{
	D(bug("nfosmesa: glClearAccum"));
	fn.glClearAccum(  red,  green,  blue,  alpha );
}

void OSMesaDriver::nfglAccum(GLenum op, GLfloat value )
{
	D(bug("nfosmesa: glAccum"));
	fn.glAccum(  op,  value );
}

void OSMesaDriver::nfglMatrixMode(GLenum mode )
{
	D(bug("nfosmesa: glMatrixMode(%d)",mode));
	fn.glMatrixMode(  mode );
}

void OSMesaDriver::nfglOrtho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near_val, GLdouble far_val )
{
	D(bug("nfosmesa: glOrtho(%.3f,%.3f, %.3f,%.3f, %.3f,%.3f)",left,right,bottom,top,near_val,far_val));
	fn.glOrtho(  left,  right,  bottom,  top,  near_val,  far_val );
}

void OSMesaDriver::nfglFrustum(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near_val, GLdouble far_val )
{
	D(bug("nfosmesa: glFrustum"));
	fn.glFrustum(  left,  right,  bottom,  top,  near_val,  far_val );
}

void OSMesaDriver::nfglViewport(GLint x, GLint y, GLsizei width, GLsizei height )
{
	D(bug("nfosmesa: glViewport(%d,%d,%d,%d)",x,y,width,height));
	fn.glViewport(  x,  y,  width,  height );
}

void OSMesaDriver::nfglPushMatrix(void)
{
	D(bug("nfosmesa: glPushMatrix"));
	fn.glPushMatrix(  );
}

void OSMesaDriver::nfglPopMatrix(void)
{
	D(bug("nfosmesa: glPopMatrix"));
	fn.glPopMatrix(  );
}

void OSMesaDriver::nfglLoadIdentity(void)
{
	D(bug("nfosmesa: glLoadIdentity"));
	fn.glLoadIdentity(  );
}

void OSMesaDriver::nfglLoadMatrixd(const GLdouble *m )
{
	GLdouble tmp[16];

	D(bug("nfosmesa: glLoadMatrixd"));
	Atari2HostDoublePtr(16, (Uint32 *)m, tmp);
	fn.glLoadMatrixd(  tmp );
}

void OSMesaDriver::nfglLoadMatrixf(const GLfloat *m )
{
	GLfloat tmp[16];

	D(bug("nfosmesa: glLoadMatrixf"));
	Atari2HostFloatPtr(16, (Uint32 *)m, tmp);
	fn.glLoadMatrixf(tmp);
}

void OSMesaDriver::nfglMultMatrixd(const GLdouble *m )
{
	GLdouble tmp[16];

	D(bug("nfosmesa: glMultMatrixd"));
	Atari2HostDoublePtr(16, (Uint32 *)m, tmp);
	fn.glMultMatrixd( tmp );
}

void OSMesaDriver::nfglMultMatrixf(const GLfloat *m )
{
	GLfloat tmp[16];

	D(bug("nfosmesa: glMultMatrixf"));
	Atari2HostFloatPtr(16, (Uint32 *)m, tmp);
	fn.glMultMatrixf(tmp);
}

void OSMesaDriver::nfglRotated(GLdouble angle, GLdouble x, GLdouble y, GLdouble z )
{
	D(bug("nfosmesa: glRotated"));
	fn.glRotated(  angle,  x,  y,  z );
}

void OSMesaDriver::nfglRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z )
{
	D(bug("nfosmesa: glRotatef"));
	fn.glRotatef(  angle,  x,  y,  z );
}

void OSMesaDriver::nfglScaled(GLdouble x, GLdouble y, GLdouble z )
{
	D(bug("nfosmesa: glScaled"));
	fn.glScaled(  x,  y,  z );
}

void OSMesaDriver::nfglScalef(GLfloat x, GLfloat y, GLfloat z )
{
	D(bug("nfosmesa: glScalef"));
	fn.glScalef(  x,  y,  z );
}

void OSMesaDriver::nfglTranslated(GLdouble x, GLdouble y, GLdouble z )
{
	D(bug("nfosmesa: glTranslated"));
	fn.glTranslated(  x,  y,  z );
}

void OSMesaDriver::nfglTranslatef(GLfloat x, GLfloat y, GLfloat z )
{
	D(bug("nfosmesa: glTranslatef"));
	fn.glTranslatef(  x,  y,  z );
}

GLboolean OSMesaDriver::nfglIsList(GLuint list )
{
	D(bug("nfosmesa: glIsList"));
	return fn.glIsList(  list );
}

void OSMesaDriver::nfglDeleteLists(GLuint list, GLsizei range )
{
	D(bug("nfosmesa: glDeleteLists"));
	fn.glDeleteLists(  list,  range );
}

GLuint OSMesaDriver::nfglGenLists(GLsizei range )
{
	D(bug("nfosmesa: glGenLists"));
	return fn.glGenLists(  range );
}

void OSMesaDriver::nfglNewList(GLuint list, GLenum mode )
{
	D(bug("nfosmesa: glNewList"));
	fn.glNewList(  list,  mode );
}

void OSMesaDriver::nfglEndList(void)
{
	D(bug("nfosmesa: glEndList"));
	fn.glEndList(  );
}

void OSMesaDriver::nfglCallList(GLuint list )
{
	D(bug("nfosmesa: glCallList"));
	fn.glCallList(  list );
}

void OSMesaDriver::nfglCallLists(GLsizei n, GLenum type, const GLvoid *lists )
{
	void *tmp;
	int i;
	GLshort *src16,*dst16;
	GLint *src32,*dst32;

	D(bug("nfosmesa: glCallLists"));
	if (n<=0) {
		return;
	}
	switch(type) {
		case GL_BYTE:
		case GL_UNSIGNED_BYTE:
			tmp = malloc(n);
			if (!tmp) {
				return;
			}
			memcpy(tmp,lists,n);
			break;
		case GL_SHORT:
		case GL_UNSIGNED_SHORT:
			tmp = malloc(n*sizeof(GLshort));
			if (!tmp) {
				return;
			}
			dst16 = (GLshort *)tmp;
			src16 = (GLshort *)lists;
			for (i=0;i<n;i++) {
				*dst16++ = SDL_SwapBE16((Uint16)(*src16++));
			}
			break;
		case GL_INT:
		case GL_UNSIGNED_INT:
		case GL_FLOAT:
			tmp = malloc(n*sizeof(GLint));
			if (!tmp) {
				return;
			}
			dst32 = (GLint *)tmp;
			src32 = (GLint *)lists;
			for (i=0;i<n;i++) {
				*dst32++ = SDL_SwapBE32((Uint32)(*src32++));
			}
			break;
		default:
			/* FIXME: GL_n_BYTES */
			return;
	}
	fn.glCallLists(  n,  type,  tmp );
	if (tmp) {
		free(tmp);
	}
}

void OSMesaDriver::nfglListBase(GLuint base )
{
	D(bug("nfosmesa: glListBase"));
	fn.glListBase(  base );
}

void OSMesaDriver::nfglBegin(GLenum mode )
{
	D(bug("nfosmesa: glBegin"));
	fn.glBegin(  mode );
}

void OSMesaDriver::nfglEnd(void)
{
	D(bug("nfosmesa: glEnd"));
	fn.glEnd(  );
}

void OSMesaDriver::nfglVertex2d(GLdouble x, GLdouble y )
{
	D(bug("nfosmesa: glVertex2d"));
	fn.glVertex2d(  x,  y );
}

void OSMesaDriver::nfglVertex2f(GLfloat x, GLfloat y )
{
	D(bug("nfosmesa: glVertex2f"));
	fn.glVertex2f(  x,  y );
}

void OSMesaDriver::nfglVertex2i(GLint x, GLint y )
{
	D(bug("nfosmesa: glVertex2i"));
	fn.glVertex2i(  x,  y );
}

void OSMesaDriver::nfglVertex2s(GLshort x, GLshort y )
{
	D(bug("nfosmesa: glVertex2s"));
	fn.glVertex2s(  x,  y );
}

void OSMesaDriver::nfglVertex3d(GLdouble x, GLdouble y, GLdouble z )
{
	D(bug("nfosmesa: glVertex3d"));
	fn.glVertex3d(  x,  y,  z );
}

void OSMesaDriver::nfglVertex3f(GLfloat x, GLfloat y, GLfloat z )
{
	D(bug("nfosmesa: glVertex3f(%.3f,%.3f,%.3f)",x,y,z));
	fn.glVertex3f(  x,  y,  z );
}

void OSMesaDriver::nfglVertex3i(GLint x, GLint y, GLint z )
{
	D(bug("nfosmesa: glVertex3i"));
	fn.glVertex3i(  x,  y,  z );
}

void OSMesaDriver::nfglVertex3s(GLshort x, GLshort y, GLshort z )
{
	D(bug("nfosmesa: glVertex3s"));
	fn.glVertex3s(  x,  y,  z );
}

void OSMesaDriver::nfglVertex4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w )
{
	D(bug("nfosmesa: glVertex4d"));
	fn.glVertex4d(  x,  y,  z,  w );
}

void OSMesaDriver::nfglVertex4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w )
{
	D(bug("nfosmesa: glVertex4f"));
	fn.glVertex4f(  x,  y,  z,  w );
}

void OSMesaDriver::nfglVertex4i(GLint x, GLint y, GLint z, GLint w )
{
	D(bug("nfosmesa: glVertex4i"));
	fn.glVertex4i(  x,  y,  z,  w );
}

void OSMesaDriver::nfglVertex4s(GLshort x, GLshort y, GLshort z, GLshort w )
{
	D(bug("nfosmesa: glVertex4s"));
	fn.glVertex4s(  x,  y,  z,  w );
}

void OSMesaDriver::nfglVertex2dv(const GLdouble *v )
{
	GLdouble tmp[2];

	D(bug("nfosmesa: glVertex2dv"));
	Atari2HostDoublePtr(2, (Uint32 *)v, tmp);
	fn.glVertex2dv(  tmp );
}

void OSMesaDriver::nfglVertex2fv(const GLfloat *v )
{
	GLfloat tmp[2];

	D(bug("nfosmesa: glVertex2fv"));
	Atari2HostFloatPtr(2, (Uint32 *)v, tmp);
	fn.glVertex2fv(  tmp);
}

void OSMesaDriver::nfglVertex2iv(const GLint *v )
{
	GLint tmp[2];

	D(bug("nfosmesa: glVertex2iv"));
	Atari2HostIntPtr(2, (Uint32 *)v, tmp);
	fn.glVertex2iv( tmp );
}

void OSMesaDriver::nfglVertex2sv(const GLshort *v )
{
	GLshort tmp[2];

	D(bug("nfosmesa: glVertex2sv"));
	Atari2HostShortPtr(2, (Uint16 *)v, tmp);
	fn.glVertex2sv( tmp );
}

void OSMesaDriver::nfglVertex3dv(const GLdouble *v )
{
	GLdouble tmp[3];

	D(bug("nfosmesa: glVertex3dv"));
	Atari2HostDoublePtr(3, (Uint32 *)v, tmp);
	fn.glVertex3dv(tmp );
}

void OSMesaDriver::nfglVertex3fv(const GLfloat *v )
{
	GLfloat tmp[3];

	D(bug("nfosmesa: glVertex3fv"));
	Atari2HostFloatPtr(3, (Uint32 *)v, tmp);
	fn.glVertex3fv(tmp);
}

void OSMesaDriver::nfglVertex3iv(const GLint *v )
{
	GLint tmp[3];

	D(bug("nfosmesa: glVertex3iv"));
	Atari2HostIntPtr(3, (Uint32 *)v, tmp);
	fn.glVertex3iv(tmp);
}

void OSMesaDriver::nfglVertex3sv(const GLshort *v )
{
	GLshort tmp[3];

	D(bug("nfosmesa: glVertex3sv"));
	Atari2HostShortPtr(3, (Uint16 *)v, tmp);
	fn.glVertex3sv( tmp);
}

void OSMesaDriver::nfglVertex4dv(const GLdouble *v )
{
	GLdouble tmp[4];

	D(bug("nfosmesa: glVertex4dv"));
	Atari2HostDoublePtr(4, (Uint32 *)v, tmp);
	fn.glVertex4dv( tmp );
}

void OSMesaDriver::nfglVertex4fv(const GLfloat *v )
{
	GLfloat tmp[4];

	D(bug("nfosmesa: glVertex4fv"));
	Atari2HostFloatPtr(4, (Uint32 *)v, tmp);
	fn.glVertex4fv(tmp );
}

void OSMesaDriver::nfglVertex4iv(const GLint *v )
{
	GLint tmp[4];

	D(bug("nfosmesa: glVertex4iv"));
	Atari2HostIntPtr(4, (Uint32 *)v, tmp);
	fn.glVertex4iv( tmp );
}

void OSMesaDriver::nfglVertex4sv(const GLshort *v )
{
	GLshort tmp[4];

	D(bug("nfosmesa: glVertex4sv"));
	Atari2HostShortPtr(4, (Uint16 *)v, tmp);
	fn.glVertex4sv( tmp );
}

void OSMesaDriver::nfglNormal3b(GLbyte nx, GLbyte ny, GLbyte nz )
{
	D(bug("nfosmesa: glNormal3b"));
	fn.glNormal3b(  nx,  ny,  nz );
}

void OSMesaDriver::nfglNormal3d(GLdouble nx, GLdouble ny, GLdouble nz )
{
	D(bug("nfosmesa: glNormal3d"));
	fn.glNormal3d(  nx,  ny,  nz );
}

void OSMesaDriver::nfglNormal3f(GLfloat nx, GLfloat ny, GLfloat nz )
{
	D(bug("nfosmesa: glNormal3f"));
	fn.glNormal3f(  nx,  ny,  nz );
}

void OSMesaDriver::nfglNormal3i(GLint nx, GLint ny, GLint nz )
{
	D(bug("nfosmesa: glNormal3i"));
	fn.glNormal3i(  nx,  ny,  nz );
}

void OSMesaDriver::nfglNormal3s(GLshort nx, GLshort ny, GLshort nz )
{
	D(bug("nfosmesa: glNormal3s"));
	fn.glNormal3s(  nx,  ny,  nz );
}

void OSMesaDriver::nfglNormal3bv(const GLbyte *v )
{
	D(bug("nfosmesa: glNormal3bv"));
	fn.glNormal3bv(  v );
}

void OSMesaDriver::nfglNormal3dv(const GLdouble *v )
{
	GLdouble tmp[3];

	D(bug("nfosmesa: glNormal3dv"));
	Atari2HostDoublePtr(3, (Uint32 *)v, tmp);
	fn.glNormal3dv( tmp );
}

void OSMesaDriver::nfglNormal3fv(const GLfloat *v )
{
	GLfloat tmp[3];

	D(bug("nfosmesa: glNormal3fv"));
	Atari2HostFloatPtr(3, (Uint32 *)v, tmp);
	fn.glNormal3fv( tmp);
}

void OSMesaDriver::nfglNormal3iv(const GLint *v )
{
	GLint tmp[3];

	D(bug("nfosmesa: glNormal3iv"));
	Atari2HostIntPtr(3, (Uint32 *)v, tmp);
	fn.glNormal3iv(tmp );
}

void OSMesaDriver::nfglNormal3sv(const GLshort *v )
{
	GLshort tmp[3];

	D(bug("nfosmesa: glNormal3sv"));
	Atari2HostShortPtr(3, (Uint16 *)v, tmp);
	fn.glNormal3sv(tmp );
}

void OSMesaDriver::nfglIndexd(GLdouble c )
{
	D(bug("nfosmesa: glIndexd"));
	fn.glIndexd(  c );
}

void OSMesaDriver::nfglIndexf(GLfloat c )
{
	D(bug("nfosmesa: glIndexf"));
	fn.glIndexf(  c );
}

void OSMesaDriver::nfglIndexi(GLint c )
{
	D(bug("nfosmesa: glIndexi"));
	fn.glIndexi(  c );
}

void OSMesaDriver::nfglIndexs(GLshort c )
{
	D(bug("nfosmesa: glIndexs"));
	fn.glIndexs(  c );
}

void OSMesaDriver::nfglIndexub(GLubyte c )
{
	D(bug("nfosmesa: glIndexub"));
	fn.glIndexub(  c );
}

void OSMesaDriver::nfglIndexdv(const GLdouble *c )
{
	GLdouble tmp[1];

	D(bug("nfosmesa: glIndexdv"));
	Atari2HostDoublePtr(1, (Uint32 *)c, tmp);
	fn.glIndexdv( tmp);
}

void OSMesaDriver::nfglIndexfv(const GLfloat *c )
{
	GLfloat tmp[1];

	D(bug("nfosmesa: glIndexfv"));
	Atari2HostFloatPtr(1, (Uint32 *)c, tmp);
	fn.glIndexfv( tmp );
}

void OSMesaDriver::nfglIndexiv(const GLint *c )
{
	GLint tmp[1];

	D(bug("nfosmesa: glIndexiv"));
	Atari2HostIntPtr(1, (Uint32 *)c, tmp);
	fn.glIndexiv( tmp );
}

void OSMesaDriver::nfglIndexsv(const GLshort *c )
{
	GLshort tmp[1];

	D(bug("nfosmesa: glIndexsv"));
	Atari2HostShortPtr(1, (Uint16 *)c, tmp);
	fn.glIndexsv( tmp );
}

void OSMesaDriver::nfglIndexubv(const GLubyte *c )
{
	D(bug("nfosmesa: glIndexubv"));
	fn.glIndexubv(  c );
}

void OSMesaDriver::nfglColor3b(GLbyte red, GLbyte green, GLbyte blue )
{
	D(bug("nfosmesa: glColor3b"));
	fn.glColor3b(  red,  green,  blue );
}

void OSMesaDriver::nfglColor3d(GLdouble red, GLdouble green, GLdouble blue )
{
	D(bug("nfosmesa: glColor3d"));
	fn.glColor3d(  red,  green,  blue );
}

void OSMesaDriver::nfglColor3f(GLfloat red, GLfloat green, GLfloat blue )
{
	D(bug("nfosmesa: glColor3f(%.3f,%.3f,%.3f)",red,green,blue));
	fn.glColor3f(  red,  green,  blue );
}

void OSMesaDriver::nfglColor3i(GLint red, GLint green, GLint blue )
{
	D(bug("nfosmesa: glColor3i"));
	fn.glColor3i(  red,  green,  blue );
}

void OSMesaDriver::nfglColor3s(GLshort red, GLshort green, GLshort blue )
{
	D(bug("nfosmesa: glColor3s"));
	fn.glColor3s(  red,  green,  blue );
}

void OSMesaDriver::nfglColor3ub(GLubyte red, GLubyte green, GLubyte blue )
{
	D(bug("nfosmesa: glColor3ub"));
	fn.glColor3ub(  red,  green,  blue );
}

void OSMesaDriver::nfglColor3ui(GLuint red, GLuint green, GLuint blue )
{
	D(bug("nfosmesa: glColor3ui"));
	fn.glColor3ui(  red,  green,  blue );
}

void OSMesaDriver::nfglColor3us(GLushort red, GLushort green, GLushort blue )
{
	D(bug("nfosmesa: glColor3us"));
	fn.glColor3us(  red,  green,  blue );
}

void OSMesaDriver::nfglColor4b(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha )
{
	D(bug("nfosmesa: glColor4b"));
	fn.glColor4b(  red,  green,  blue,  alpha );
}

void OSMesaDriver::nfglColor4d(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha )
{
	D(bug("nfosmesa: glColor4d"));
	fn.glColor4d(  red,  green,  blue,  alpha );
}

void OSMesaDriver::nfglColor4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha )
{
	D(bug("nfosmesa: glColor4f"));
	fn.glColor4f(  red,  green,  blue,  alpha );
}

void OSMesaDriver::nfglColor4i(GLint red, GLint green, GLint blue, GLint alpha )
{
	D(bug("nfosmesa: glColor4i"));
	fn.glColor4i(  red,  green,  blue,  alpha );
}

void OSMesaDriver::nfglColor4s(GLshort red, GLshort green, GLshort blue, GLshort alpha )
{
	D(bug("nfosmesa: glColor4s"));
	fn.glColor4s(  red,  green,  blue,  alpha );
}

void OSMesaDriver::nfglColor4ub(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha )
{
	D(bug("nfosmesa: glColor4ub"));
	fn.glColor4ub(  red,  green,  blue,  alpha );
}

void OSMesaDriver::nfglColor4ui(GLuint red, GLuint green, GLuint blue, GLuint alpha )
{
	D(bug("nfosmesa: glColor4ui"));
	fn.glColor4ui(  red,  green,  blue,  alpha );
}

void OSMesaDriver::nfglColor4us(GLushort red, GLushort green, GLushort blue, GLushort alpha )
{
	D(bug("nfosmesa: glColor4us"));
	fn.glColor4us(  red,  green,  blue,  alpha );
}

void OSMesaDriver::nfglColor3bv(const GLbyte *v )
{
	D(bug("nfosmesa: glColor3bv"));
	fn.glColor3bv(  v );
}

void OSMesaDriver::nfglColor3dv(const GLdouble *v )
{
	GLdouble tmp[3];

	D(bug("nfosmesa: glColor3dv"));
	Atari2HostDoublePtr(3, (Uint32 *)v, tmp);
	fn.glColor3dv( tmp );
}

void OSMesaDriver::nfglColor3fv(const GLfloat *v )
{
	GLfloat tmp[3];

	D(bug("nfosmesa: glColor3fv"));
	Atari2HostFloatPtr(3, (Uint32 *)v, tmp);
	fn.glColor3fv( tmp );
}

void OSMesaDriver::nfglColor3iv(const GLint *v )
{
	GLint tmp[3];

	D(bug("nfosmesa: glColor3iv"));
	Atari2HostIntPtr(3, (Uint32 *)v, tmp);
	fn.glColor3iv(  tmp);
}

void OSMesaDriver::nfglColor3sv(const GLshort *v )
{
	GLshort tmp[3];

	D(bug("nfosmesa: glColor3sv"));
	Atari2HostShortPtr(3, (Uint16 *)v, tmp);
	fn.glColor3sv(tmp );
}

void OSMesaDriver::nfglColor3ubv(const GLubyte *v )
{
	D(bug("nfosmesa: glColor3ubv"));
	fn.glColor3ubv(  v );
}

void OSMesaDriver::nfglColor3uiv(const GLuint *v )
{
	GLuint tmp[3];

	D(bug("nfosmesa: glColor3uiv"));
	Atari2HostIntPtr(3, (Uint32 *)v, (GLint *)tmp);
	fn.glColor3uiv( tmp );
}

void OSMesaDriver::nfglColor3usv(const GLushort *v )
{
	GLushort tmp[3];

	D(bug("nfosmesa: glColor3usv"));
	Atari2HostShortPtr(3, (Uint16 *)v, (GLshort *)tmp);
	fn.glColor3usv( tmp );
}

void OSMesaDriver::nfglColor4bv(const GLbyte *v )
{
	D(bug("nfosmesa: glColor4bv"));
	fn.glColor4bv(  v );
}

void OSMesaDriver::nfglColor4dv(const GLdouble *v )
{
	GLdouble tmp[4];

	D(bug("nfosmesa: glColor4dv"));
	Atari2HostDoublePtr(4, (Uint32 *)v, tmp);
	fn.glColor4dv( tmp );
}

void OSMesaDriver::nfglColor4fv(const GLfloat *v )
{
	GLfloat tmp[4];

	D(bug("nfosmesa: glColor4fv"));
	Atari2HostFloatPtr(4, (Uint32 *)v, tmp);
	fn.glColor4fv(tmp);
}

void OSMesaDriver::nfglColor4iv(const GLint *v )
{
	GLint tmp[4];

	D(bug("nfosmesa: glColor4iv"));
	Atari2HostIntPtr(4, (Uint32 *)v, tmp);
	fn.glColor4iv( tmp );
}

void OSMesaDriver::nfglColor4sv(const GLshort *v )
{
	GLshort tmp[4];

	D(bug("nfosmesa: glColor4sv"));
	Atari2HostShortPtr(4, (Uint16 *)v, tmp);
	fn.glColor4sv( tmp );
}

void OSMesaDriver::nfglColor4ubv(const GLubyte *v )
{
	D(bug("nfosmesa: glColor4ubv"));
	fn.glColor4ubv(  v );
}

void OSMesaDriver::nfglColor4uiv(const GLuint *v )
{
	GLuint tmp[4];

	D(bug("nfosmesa: glColor4uiv"));
	Atari2HostIntPtr(4, (Uint32 *)v, (GLint *)tmp);
	fn.glColor4uiv( tmp );
}

void OSMesaDriver::nfglColor4usv(const GLushort *v )
{
	GLushort tmp[4];

	D(bug("nfosmesa: glColor4usv"));
	Atari2HostShortPtr(4, (Uint16 *)v, (GLshort *)tmp);
	fn.glColor4usv( tmp );
}

void OSMesaDriver::nfglTexCoord1d(GLdouble s )
{
	D(bug("nfosmesa: glTexCoord1d"));
	fn.glTexCoord1d(  s );
}

void OSMesaDriver::nfglTexCoord1f(GLfloat s )
{
	D(bug("nfosmesa: glTexCoord1f"));
	fn.glTexCoord1f(  s );
}

void OSMesaDriver::nfglTexCoord1i(GLint s )
{
	D(bug("nfosmesa: glTexCoord1i"));
	fn.glTexCoord1i(  s );
}

void OSMesaDriver::nfglTexCoord1s(GLshort s )
{
	D(bug("nfosmesa: glTexCoord1s"));
	fn.glTexCoord1s(  s );
}

void OSMesaDriver::nfglTexCoord2d(GLdouble s, GLdouble t )
{
	D(bug("nfosmesa: glTexCoord2d"));
	fn.glTexCoord2d(  s,  t );
}

void OSMesaDriver::nfglTexCoord2f(GLfloat s, GLfloat t )
{
	D(bug("nfosmesa: glTexCoord2f"));
	fn.glTexCoord2f(  s,  t );
}

void OSMesaDriver::nfglTexCoord2i(GLint s, GLint t )
{
	D(bug("nfosmesa: glTexCoord2i"));
	fn.glTexCoord2i(  s,  t );
}

void OSMesaDriver::nfglTexCoord2s(GLshort s, GLshort t )
{
	D(bug("nfosmesa: glTexCoord2s"));
	fn.glTexCoord2s(  s,  t );
}

void OSMesaDriver::nfglTexCoord3d(GLdouble s, GLdouble t, GLdouble r )
{
	D(bug("nfosmesa: glTexCoord3d"));
	fn.glTexCoord3d(  s,  t,  r );
}

void OSMesaDriver::nfglTexCoord3f(GLfloat s, GLfloat t, GLfloat r )
{
	D(bug("nfosmesa: glTexCoord3f"));
	fn.glTexCoord3f(  s,  t,  r );
}

void OSMesaDriver::nfglTexCoord3i(GLint s, GLint t, GLint r )
{
	D(bug("nfosmesa: glTexCoord3i"));
	fn.glTexCoord3i(  s,  t,  r );
}

void OSMesaDriver::nfglTexCoord3s(GLshort s, GLshort t, GLshort r )
{
	D(bug("nfosmesa: glTexCoord3s"));
	fn.glTexCoord3s(  s,  t,  r );
}

void OSMesaDriver::nfglTexCoord4d(GLdouble s, GLdouble t, GLdouble r, GLdouble q )
{
	D(bug("nfosmesa: glTexCoord4d"));
	fn.glTexCoord4d(  s,  t,  r,  q );
}

void OSMesaDriver::nfglTexCoord4f(GLfloat s, GLfloat t, GLfloat r, GLfloat q )
{
	D(bug("nfosmesa: glTexCoord4f"));
	fn.glTexCoord4f(  s,  t,  r,  q );
}

void OSMesaDriver::nfglTexCoord4i(GLint s, GLint t, GLint r, GLint q )
{
	D(bug("nfosmesa: glTexCoord4i"));
	fn.glTexCoord4i(  s,  t,  r,  q );
}

void OSMesaDriver::nfglTexCoord4s(GLshort s, GLshort t, GLshort r, GLshort q )
{
	D(bug("nfosmesa: glTexCoord4s"));
	fn.glTexCoord4s(  s,  t,  r,  q );
}

void OSMesaDriver::nfglTexCoord1dv(const GLdouble *v )
{
	GLdouble tmp[1];

	D(bug("nfosmesa: glTexCoord1dv"));
	Atari2HostDoublePtr(1, (Uint32 *)v, tmp);
	fn.glTexCoord1dv(tmp);
}

void OSMesaDriver::nfglTexCoord1fv(const GLfloat *v )
{
	GLfloat tmp[1];

	D(bug("nfosmesa: glTexCoord1fv"));
	Atari2HostFloatPtr(1, (Uint32 *)v, tmp);
	fn.glTexCoord1fv(tmp);
}

void OSMesaDriver::nfglTexCoord1iv(const GLint *v )
{
	GLint tmp[1];

	D(bug("nfosmesa: glTexCoord1iv"));
	Atari2HostIntPtr(1, (Uint32 *)v, tmp);
	fn.glTexCoord1iv( tmp );
}

void OSMesaDriver::nfglTexCoord1sv(const GLshort *v )
{
	GLshort tmp[1];

	D(bug("nfosmesa: glTexCoord1sv"));
	Atari2HostShortPtr(1, (Uint16 *)v, tmp);
	fn.glTexCoord1sv( tmp );
}

void OSMesaDriver::nfglTexCoord2dv(const GLdouble *v )
{
	GLdouble tmp[2];

	D(bug("nfosmesa: glTexCoord2dv"));
	Atari2HostDoublePtr(2, (Uint32 *)v, tmp);
	fn.glTexCoord2dv( tmp );
}

void OSMesaDriver::nfglTexCoord2fv(const GLfloat *v )
{
	GLfloat tmp[2];

	D(bug("nfosmesa: glTexCoord2fv"));
	Atari2HostFloatPtr(2, (Uint32 *)v, tmp);
	fn.glTexCoord2fv( tmp );
}

void OSMesaDriver::nfglTexCoord2iv(const GLint *v )
{
	GLint tmp[2];

	D(bug("nfosmesa: glTexCoord2iv"));
	Atari2HostIntPtr(2, (Uint32 *)v, tmp);
	fn.glTexCoord2iv( tmp );
}

void OSMesaDriver::nfglTexCoord2sv(const GLshort *v )
{
	GLshort tmp[2];

	D(bug("nfosmesa: glTexCoord2sv"));
	Atari2HostShortPtr(2, (Uint16 *)v, tmp);
	fn.glTexCoord2sv( tmp );
}

void OSMesaDriver::nfglTexCoord3dv(const GLdouble *v )
{
	GLdouble tmp[3];

	D(bug("nfosmesa: glTexCoord3dv"));
	Atari2HostDoublePtr(3, (Uint32 *)v, tmp);
	fn.glTexCoord3dv( tmp );
}

void OSMesaDriver::nfglTexCoord3fv(const GLfloat *v )
{
	GLfloat tmp[3];

	D(bug("nfosmesa: glTexCoord3fv"));
	Atari2HostFloatPtr(3, (Uint32 *)v, tmp);
	fn.glTexCoord3fv( tmp );
}

void OSMesaDriver::nfglTexCoord3iv(const GLint *v )
{
	GLint tmp[3];

	D(bug("nfosmesa: glTexCoord3iv"));
	Atari2HostIntPtr(3, (Uint32 *)v, tmp);
	fn.glTexCoord3iv(  tmp );
}

void OSMesaDriver::nfglTexCoord3sv(const GLshort *v )
{
	GLshort tmp[3];

	D(bug("nfosmesa: glTexCoord3sv"));
	Atari2HostShortPtr(3, (Uint16 *)v, tmp);
	fn.glTexCoord3sv( tmp );
}

void OSMesaDriver::nfglTexCoord4dv(const GLdouble *v )
{
	GLdouble tmp[4];

	D(bug("nfosmesa: glTexCoord4dv"));
	Atari2HostDoublePtr(4, (Uint32 *)v, tmp);
	fn.glTexCoord4dv( tmp );
}

void OSMesaDriver::nfglTexCoord4fv(const GLfloat *v )
{
	GLfloat tmp[4];

	D(bug("nfosmesa: glTexCoord4fv"));
	Atari2HostFloatPtr(4, (Uint32 *)v, tmp);
	fn.glTexCoord4fv( tmp );
}

void OSMesaDriver::nfglTexCoord4iv(const GLint *v )
{
	GLint tmp[4];

	D(bug("nfosmesa: glTexCoord4iv"));
	Atari2HostIntPtr(4, (Uint32 *)v, tmp);
	fn.glTexCoord4iv( tmp );
}

void OSMesaDriver::nfglTexCoord4sv(const GLshort *v )
{
	GLshort tmp[4];

	D(bug("nfosmesa: glTexCoord4sv"));
	Atari2HostShortPtr(4, (Uint16 *)v, tmp);
	fn.glTexCoord4sv( tmp );
}

void OSMesaDriver::nfglRasterPos2d(GLdouble x, GLdouble y )
{
	D(bug("nfosmesa: glRasterPos2d"));
	fn.glRasterPos2d(  x,  y );
}

void OSMesaDriver::nfglRasterPos2f(GLfloat x, GLfloat y )
{
	D(bug("nfosmesa: glRasterPos2f"));
	fn.glRasterPos2f(  x,  y );
}

void OSMesaDriver::nfglRasterPos2i(GLint x, GLint y )
{
	D(bug("nfosmesa: glRasterPos2i"));
	fn.glRasterPos2i(  x,  y );
}

void OSMesaDriver::nfglRasterPos2s(GLshort x, GLshort y )
{
	D(bug("nfosmesa: glRasterPos2s"));
	fn.glRasterPos2s(  x,  y );
}

void OSMesaDriver::nfglRasterPos3d(GLdouble x, GLdouble y, GLdouble z )
{
	D(bug("nfosmesa: glRasterPos3d"));
	fn.glRasterPos3d(  x,  y,  z );
}

void OSMesaDriver::nfglRasterPos3f(GLfloat x, GLfloat y, GLfloat z )
{
	D(bug("nfosmesa: glRasterPos3f"));
	fn.glRasterPos3f(  x,  y,  z );
}

void OSMesaDriver::nfglRasterPos3i(GLint x, GLint y, GLint z )
{
	D(bug("nfosmesa: glRasterPos3i"));
	fn.glRasterPos3i(  x,  y,  z );
}

void OSMesaDriver::nfglRasterPos3s(GLshort x, GLshort y, GLshort z )
{
	D(bug("nfosmesa: glRasterPos3s"));
	fn.glRasterPos3s(  x,  y,  z );
}

void OSMesaDriver::nfglRasterPos4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w )
{
	D(bug("nfosmesa: glRasterPos4d"));
	fn.glRasterPos4d(  x,  y,  z,  w );
}

void OSMesaDriver::nfglRasterPos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w )
{
	D(bug("nfosmesa: glRasterPos4f"));
	fn.glRasterPos4f(  x,  y,  z,  w );
}

void OSMesaDriver::nfglRasterPos4i(GLint x, GLint y, GLint z, GLint w )
{
	D(bug("nfosmesa: glRasterPos4i"));
	fn.glRasterPos4i(  x,  y,  z,  w );
}

void OSMesaDriver::nfglRasterPos4s(GLshort x, GLshort y, GLshort z, GLshort w )
{
	D(bug("nfosmesa: glRasterPos4s"));
	fn.glRasterPos4s(  x,  y,  z,  w );
}

void OSMesaDriver::nfglRasterPos2dv(const GLdouble *v )
{
	GLdouble tmp[2];

	D(bug("nfosmesa: glRasterPos2dv"));
	Atari2HostDoublePtr(2, (Uint32 *)v, tmp);
	fn.glRasterPos2dv( tmp );
}

void OSMesaDriver::nfglRasterPos2fv(const GLfloat *v )
{
	GLfloat tmp[2];

	D(bug("nfosmesa: glRasterPos2fv"));
	Atari2HostFloatPtr(2, (Uint32 *)v, tmp);
	fn.glRasterPos2fv( tmp );
}

void OSMesaDriver::nfglRasterPos2iv(const GLint *v )
{
	GLint tmp[2];

	D(bug("nfosmesa: glRasterPos2iv"));
	Atari2HostIntPtr(2, (Uint32 *)v, tmp);
	fn.glRasterPos2iv( tmp );
}

void OSMesaDriver::nfglRasterPos2sv(const GLshort *v )
{
	GLshort tmp[2];

	D(bug("nfosmesa: glRasterPos2sv"));
	Atari2HostShortPtr(2, (Uint16 *)v, tmp);
	fn.glRasterPos2sv( tmp );
}

void OSMesaDriver::nfglRasterPos3dv(const GLdouble *v )
{
	GLdouble tmp[3];

	D(bug("nfosmesa: glRasterPos3dv"));
	Atari2HostDoublePtr(3, (Uint32 *)v, tmp);
	fn.glRasterPos3dv( tmp );
}

void OSMesaDriver::nfglRasterPos3fv(const GLfloat *v )
{
	GLfloat tmp[3];

	D(bug("nfosmesa: glRasterPos3fv"));
	Atari2HostFloatPtr(3, (Uint32 *)v, tmp);
	fn.glRasterPos3fv(tmp);
}

void OSMesaDriver::nfglRasterPos3iv(const GLint *v )
{
	GLint tmp[3];

	D(bug("nfosmesa: glRasterPos3iv"));
	Atari2HostIntPtr(3, (Uint32 *)v, tmp);
	fn.glRasterPos3iv( tmp );
}

void OSMesaDriver::nfglRasterPos3sv(const GLshort *v )
{
	GLshort tmp[3];

	D(bug("nfosmesa: glRasterPos3sv"));
	Atari2HostShortPtr(3, (Uint16 *)v, tmp);
	fn.glRasterPos3sv( tmp );
}

void OSMesaDriver::nfglRasterPos4dv(const GLdouble *v )
{
	GLdouble tmp[4];

	D(bug("nfosmesa: glRasterPos4dv"));
	Atari2HostDoublePtr(4, (Uint32 *)v, tmp);
	fn.glRasterPos4dv( tmp );
}

void OSMesaDriver::nfglRasterPos4fv(const GLfloat *v )
{
	GLfloat tmp[4];

	D(bug("nfosmesa: glRasterPos4fv"));
	Atari2HostFloatPtr(4, (Uint32 *)v, tmp);
	fn.glRasterPos4fv( tmp );
}

void OSMesaDriver::nfglRasterPos4iv(const GLint *v )
{
	GLint tmp[4];

	D(bug("nfosmesa: glRasterPos4iv"));
	Atari2HostIntPtr(4, (Uint32 *)v, tmp);
	fn.glRasterPos4iv( tmp );
}

void OSMesaDriver::nfglRasterPos4sv(const GLshort *v )
{
	GLshort tmp[4];

	D(bug("nfosmesa: glRasterPos4sv"));
	Atari2HostShortPtr(4, (Uint16 *)v, tmp);
	fn.glRasterPos4sv( tmp );
}

void OSMesaDriver::nfglRectd(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2 )
{
	D(bug("nfosmesa: glRectd"));
	fn.glRectd(  x1,  y1,  x2,  y2 );
}

void OSMesaDriver::nfglRectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 )
{
	D(bug("nfosmesa: glRectf"));
	fn.glRectf(  x1,  y1,  x2,  y2 );
}

void OSMesaDriver::nfglRecti(GLint x1, GLint y1, GLint x2, GLint y2 )
{
	D(bug("nfosmesa: glRecti"));
	fn.glRecti(  x1,  y1,  x2,  y2 );
}

void OSMesaDriver::nfglRects(GLshort x1, GLshort y1, GLshort x2, GLshort y2 )
{
	D(bug("nfosmesa: glRects"));
	fn.glRects(  x1,  y1,  x2,  y2 );
}

void OSMesaDriver::nfglRectdv(const GLdouble *v1, const GLdouble *v2 )
{
	GLdouble tmp1[4],tmp2[4];

	D(bug("nfosmesa: glRectdv"));
	Atari2HostDoublePtr(4, (Uint32 *)v1, tmp1);
	Atari2HostDoublePtr(4, (Uint32 *)v2, tmp2);
	fn.glRectdv(  tmp1,  tmp2 );
}

void OSMesaDriver::nfglRectfv(const GLfloat *v1, const GLfloat *v2 )
{
	GLfloat tmp1[4],tmp2[4];

	D(bug("nfosmesa: glRectfv"));
	Atari2HostFloatPtr(4, (Uint32 *)v1, tmp1);
	Atari2HostFloatPtr(4, (Uint32 *)v2, tmp2);
	fn.glRectfv( tmp1, tmp2 );
}

void OSMesaDriver::nfglRectiv(const GLint *v1, const GLint *v2 )
{
	GLint tmp1[4],tmp2[4];

	D(bug("nfosmesa: glRectiv"));
	Atari2HostIntPtr(4, (Uint32 *)v1, tmp1);
	Atari2HostIntPtr(4, (Uint32 *)v2, tmp2);
	fn.glRectiv(  tmp1, tmp2 );
}

void OSMesaDriver::nfglRectsv(const GLshort *v1, const GLshort *v2 )
{
	GLshort tmp1[4],tmp2[4];

	D(bug("nfosmesa: glRectsv"));
	Atari2HostShortPtr(4, (Uint16 *)v1, tmp1);
	Atari2HostShortPtr(4, (Uint16 *)v2, tmp2);
	fn.glRectsv(  tmp1,  tmp2 );
}

void OSMesaDriver::nfglVertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr )
{
	D(bug("nfosmesa: glVertexPointer"));
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
	contexts[cur_context].vertex.size = size;
	contexts[cur_context].vertex.type = type;
	contexts[cur_context].vertex.stride = stride;
	contexts[cur_context].vertex.ptr = (GLvoid *)ptr;
#endif
	fn.glVertexPointer(  size,  type,  stride,  ptr );
}

void OSMesaDriver::nfglNormalPointer(GLenum type, GLsizei stride, const GLvoid *ptr )
{
	D(bug("nfosmesa: glNormalPointer"));
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
	contexts[cur_context].normal.size = 3;
	contexts[cur_context].normal.type = type;
	contexts[cur_context].normal.stride = stride;
	contexts[cur_context].normal.ptr = (GLvoid *)ptr;
#endif
	fn.glNormalPointer(  type,  stride,  ptr );
}

void OSMesaDriver::nfglColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr )
{
	D(bug("nfosmesa: glColorPointer"));
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
	contexts[cur_context].color.size = size;
	contexts[cur_context].color.type = type;
	contexts[cur_context].color.stride = stride;
	contexts[cur_context].color.ptr = (GLvoid *)ptr;
#endif
	fn.glColorPointer(  size,  type,  stride,  ptr );
}

void OSMesaDriver::nfglIndexPointer(GLenum type, GLsizei stride, const GLvoid *ptr )
{
	D(bug("nfosmesa: glIndexPointer"));
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
	contexts[cur_context].index.size = 1;
	contexts[cur_context].index.type = type;
	contexts[cur_context].index.stride = stride;
	contexts[cur_context].index.ptr = (GLvoid *)ptr;
#endif
	fn.glIndexPointer(  type,  stride,  ptr );
}

void OSMesaDriver::nfglTexCoordPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr )
{
	D(bug("nfosmesa: glTexCoordPointer"));
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
	contexts[cur_context].texcoord.size = size;
	contexts[cur_context].texcoord.type = type;
	contexts[cur_context].texcoord.stride = stride;
	contexts[cur_context].texcoord.ptr = (GLvoid *)ptr;
#endif
	fn.glTexCoordPointer(  size,  type,  stride,  ptr );
}

void OSMesaDriver::nfglEdgeFlagPointer(GLsizei stride, const GLvoid *ptr )
{
	D(bug("nfosmesa: glEdgeFlagPointer"));
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
	contexts[cur_context].edgeflag.size = 1;
	contexts[cur_context].edgeflag.type = GL_UNSIGNED_BYTE;
	contexts[cur_context].edgeflag.stride = stride;
	contexts[cur_context].edgeflag.ptr = (GLvoid *)ptr;
#endif
	fn.glEdgeFlagPointer(  stride,  ptr );
}

void OSMesaDriver::nfglGetPointerv(GLenum pname, GLvoid **params )
{
	D(bug("nfosmesa: glGetPointerv"));
	fn.glGetPointerv(  pname,  params );
}

void OSMesaDriver::nfglArrayElement(GLint i )
{
	D(bug("nfosmesa: glArrayElement"));
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
	{
		int stride;
		GLubyte *ptr;

		if (contexts[cur_context].enabled_arrays & NFOSMESA_NORMAL_ARRAY) {
			stride=contexts[cur_context].vertex.stride;
			ptr=(GLubyte *)contexts[cur_context].vertex.ptr;
			if (stride==0) {
				stride = contexts[cur_context].vertex.size;
				switch(contexts[cur_context].vertex.type) {
					case GL_SHORT:
						stride *= sizeof(GLshort);
						break;
					case GL_INT:
						stride *= sizeof(GLint);
						break;
					case GL_FLOAT:
						stride *= sizeof(GLfloat);
						break;
					case GL_DOUBLE:
						stride *= sizeof(GLdouble);
						break;
				}
			}
			ptr += i*stride;
			switch(contexts[cur_context].vertex.type) {
				case GL_BYTE:
					nfglNormal3bv((GLbyte *)ptr);
					break;
				case GL_SHORT:
					nfglNormal3sv((GLshort *)ptr);
					break;
				case GL_INT:
					nfglNormal3iv((GLint *)ptr);
					break;
				case GL_FLOAT:
					nfglNormal3fv((GLfloat *)ptr);
					break;
				case GL_DOUBLE:
					nfglNormal3dv((GLdouble *)ptr);
					break;
			}
		}

		if (contexts[cur_context].enabled_arrays & NFOSMESA_INDEX_ARRAY) {
			stride=contexts[cur_context].vertex.stride;
			ptr=(GLubyte *)contexts[cur_context].vertex.ptr;
			if (stride==0) {
				stride = contexts[cur_context].vertex.size;
				switch(contexts[cur_context].vertex.type) {
					case GL_SHORT:
						stride *= sizeof(GLshort);
						break;
					case GL_INT:
						stride *= sizeof(GLint);
						break;
					case GL_FLOAT:
						stride *= sizeof(GLfloat);
						break;
					case GL_DOUBLE:
						stride *= sizeof(GLdouble);
						break;
				}
			}
			ptr += i*stride;
			switch(contexts[cur_context].vertex.type) {
				case GL_UNSIGNED_BYTE:
					nfglIndexubv((GLubyte *)ptr);
					break;
				case GL_SHORT:
					nfglIndexsv((GLshort *)ptr);
					break;
				case GL_INT:
					nfglIndexiv((GLint *)ptr);
					break;
				case GL_FLOAT:
					nfglIndexfv((GLfloat *)ptr);
					break;
				case GL_DOUBLE:
					nfglIndexdv((GLdouble *)ptr);
					break;
			}
		}

		if (contexts[cur_context].enabled_arrays & NFOSMESA_COLOR_ARRAY) {
			stride=contexts[cur_context].vertex.stride;
			ptr=(GLubyte *)contexts[cur_context].vertex.ptr;
			if (stride==0) {
				stride = contexts[cur_context].vertex.size;
				switch(contexts[cur_context].vertex.type) {
					case GL_SHORT:
					case GL_UNSIGNED_SHORT:
						stride *= sizeof(GLshort);
						break;
					case GL_INT:
					case GL_UNSIGNED_INT:
						stride *= sizeof(GLint);
						break;
					case GL_FLOAT:
						stride *= sizeof(GLfloat);
						break;
					case GL_DOUBLE:
						stride *= sizeof(GLdouble);
						break;
				}
			}
			ptr += i*stride;
			switch(contexts[cur_context].vertex.type) {
				case GL_BYTE:
					switch(contexts[cur_context].vertex.size) {
						case 3:
							nfglColor3bv((GLbyte *)ptr);
							break;
						case 4:
							nfglColor4bv((GLbyte *)ptr);
							break;
					}
					break;
				case GL_UNSIGNED_BYTE:
					switch(contexts[cur_context].vertex.size) {
						case 3:
							nfglColor3ubv((GLubyte *)ptr);
							break;
						case 4:
							nfglColor4ubv((GLubyte *)ptr);
							break;
					}
					break;
				case GL_SHORT:
					switch(contexts[cur_context].vertex.size) {
						case 3:
							nfglColor3sv((GLshort *)ptr);
							break;
						case 4:
							nfglColor4sv((GLshort *)ptr);
							break;
					}
					break;
				case GL_UNSIGNED_SHORT:
					switch(contexts[cur_context].vertex.size) {
						case 3:
							nfglColor3usv((GLushort *)ptr);
							break;
						case 4:
							nfglColor4usv((GLushort *)ptr);
							break;
					}
					break;
				case GL_INT:
					switch(contexts[cur_context].vertex.size) {
						case 3:
							nfglColor3iv((GLint *)ptr);
							break;
						case 4:
							nfglColor4iv((GLint *)ptr);
							break;
					}
					break;
				case GL_UNSIGNED_INT:
					switch(contexts[cur_context].vertex.size) {
						case 3:
							nfglColor3uiv((GLuint *)ptr);
							break;
						case 4:
							nfglColor4uiv((GLuint *)ptr);
							break;
					}
					break;
				case GL_FLOAT:
					switch(contexts[cur_context].vertex.size) {
						case 3:
							nfglColor3fv((GLfloat *)ptr);
							break;
						case 4:
							nfglColor4fv((GLfloat *)ptr);
							break;
					}
					break;
				case GL_DOUBLE:
					switch(contexts[cur_context].vertex.size) {
						case 3:
							nfglColor3dv((GLdouble *)ptr);
							break;
						case 4:
							nfglColor4dv((GLdouble *)ptr);
							break;
					}
					break;
			}
		}

		if (contexts[cur_context].enabled_arrays & NFOSMESA_EDGEFLAG_ARRAY) {
			stride=contexts[cur_context].vertex.stride;
			ptr=(GLubyte *)contexts[cur_context].vertex.ptr;
			if (stride==0) {
				stride = contexts[cur_context].vertex.size;
			}
			ptr += i*stride;
			nfglEdgeFlagv((GLboolean *)ptr);
		}

		if (contexts[cur_context].enabled_arrays & NFOSMESA_TEXCOORD_ARRAY) {
			stride=contexts[cur_context].vertex.stride;
			ptr=(GLubyte *)contexts[cur_context].vertex.ptr;
			if (stride==0) {
				stride = contexts[cur_context].vertex.size;
				switch(contexts[cur_context].vertex.type) {
					case GL_SHORT:
						stride *= sizeof(GLshort);
						break;
					case GL_INT:
						stride *= sizeof(GLint);
						break;
					case GL_FLOAT:
						stride *= sizeof(GLfloat);
						break;
					case GL_DOUBLE:
						stride *= sizeof(GLdouble);
						break;
				}
			}
			ptr += i*stride;
			switch(contexts[cur_context].vertex.type) {
				case GL_SHORT:
					switch(contexts[cur_context].vertex.size) {
						case 1:
							nfglTexCoord1sv((GLshort *)ptr);
							break;
						case 2:
							nfglTexCoord2sv((GLshort *)ptr);
							break;
						case 3:
							nfglTexCoord3sv((GLshort *)ptr);
							break;
						case 4:
							nfglTexCoord4sv((GLshort *)ptr);
							break;
					}
					break;
				case GL_INT:
					switch(contexts[cur_context].vertex.size) {
						case 1:
							nfglTexCoord1iv((GLint *)ptr);
							break;
						case 2:
							nfglTexCoord2iv((GLint *)ptr);
							break;
						case 3:
							nfglTexCoord3iv((GLint *)ptr);
							break;
						case 4:
							nfglTexCoord4iv((GLint *)ptr);
							break;
					}
					break;
				case GL_FLOAT:
					switch(contexts[cur_context].vertex.size) {
						case 1:
							nfglTexCoord1fv((GLfloat *)ptr);
							break;
						case 2:
							nfglTexCoord2fv((GLfloat *)ptr);
							break;
						case 3:
							nfglTexCoord3fv((GLfloat *)ptr);
							break;
						case 4:
							nfglTexCoord4fv((GLfloat *)ptr);
							break;
					}
					break;
				case GL_DOUBLE:
					switch(contexts[cur_context].vertex.size) {
						case 1:
							nfglTexCoord1dv((GLdouble *)ptr);
							break;
						case 2:
							nfglTexCoord2dv((GLdouble *)ptr);
							break;
						case 3:
							nfglTexCoord3dv((GLdouble *)ptr);
							break;
						case 4:
							nfglTexCoord4dv((GLdouble *)ptr);
							break;
					}
					break;
			}
		}

		if (contexts[cur_context].enabled_arrays & NFOSMESA_VERTEX_ARRAY) {
			stride=contexts[cur_context].vertex.stride;
			ptr=(GLubyte *)contexts[cur_context].vertex.ptr;
			if (stride==0) {
				stride = contexts[cur_context].vertex.size;
				switch(contexts[cur_context].vertex.type) {
					case GL_SHORT:
						stride *= sizeof(GLshort);
						break;
					case GL_INT:
						stride *= sizeof(GLint);
						break;
					case GL_FLOAT:
						stride *= sizeof(GLfloat);
						break;
					case GL_DOUBLE:
						stride *= sizeof(GLdouble);
						break;
				}
			}
			ptr += i*stride;
			switch(contexts[cur_context].vertex.type) {
				case GL_SHORT:
					switch(contexts[cur_context].vertex.size) {
						case 2:
							nfglVertex2sv((GLshort *)ptr);
							break;
						case 3:
							nfglVertex3sv((GLshort *)ptr);
							break;
						case 4:
							nfglVertex4sv((GLshort *)ptr);
							break;
					}
					break;
				case GL_INT:
					switch(contexts[cur_context].vertex.size) {
						case 2:
							nfglVertex2iv((GLint *)ptr);
							break;
						case 3:
							nfglVertex3iv((GLint *)ptr);
							break;
						case 4:
							nfglVertex4iv((GLint *)ptr);
							break;
					}
					break;
				case GL_FLOAT:
					switch(contexts[cur_context].vertex.size) {
						case 2:
							nfglVertex2fv((GLfloat *)ptr);
							break;
						case 3:
							nfglVertex3fv((GLfloat *)ptr);
							break;
						case 4:
							nfglVertex4fv((GLfloat *)ptr);
							break;
					}
					break;
				case GL_DOUBLE:
					switch(contexts[cur_context].vertex.size) {
						case 2:
							nfglVertex2dv((GLdouble *)ptr);
							break;
						case 3:
							nfglVertex3dv((GLdouble *)ptr);
							break;
						case 4:
							nfglVertex4dv((GLdouble *)ptr);
							break;
					}
					break;
			}
		}
	}
#else
	fn.glArrayElement(  i );
#endif
}

void OSMesaDriver::nfglDrawArrays(GLenum mode, GLint first, GLsizei count )
{
	D(bug("nfosmesa: glDrawArrays"));
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
	{
		int i;

		fn.glBegin(	mode);
		for (i=0;i<count;i++) {
			nfglArrayElement(first+i);
		}
		fn.glEnd();
	}
#else
	fn.glDrawArrays(  mode,  first,  count );
#endif
}

void OSMesaDriver::nfglDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices )
{
	D(bug("nfosmesa: glDrawElements"));
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
	{
		int i;
		Uint32 *ptr32;
		Uint16 *ptr16;
		Uint8 *ptr8;

		ptr32 = (Uint32 *)indices;
		ptr16 = (Uint16 *)indices;
		ptr8 = (Uint8 *)indices;
		fn.glBegin(	mode);
		for (i=0;i<count;i++) {
			switch(type) {
				case GL_UNSIGNED_BYTE:
					nfglArrayElement(ptr8[i]);
					break;
				case GL_UNSIGNED_SHORT:
					nfglArrayElement(SDL_SwapBE16(ptr16[i]));
					break;
				case GL_UNSIGNED_INT:
					nfglArrayElement(SDL_SwapBE32(ptr32[i]));
					break;
			}
		}
		fn.glEnd();
	}
#else
	fn.glDrawElements(  mode,  count,  type,  indices );
#endif
}

void OSMesaDriver::nfglInterleavedArrays(GLenum format, GLsizei stride, const GLvoid *pointer )
{
	D(bug("nfosmesa: glInterleavedArrays"));
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
	{
		SDL_bool enable_texcoord, enable_normal, enable_color;
		int texcoord_size, color_size, vertex_size;
		int texcoord_stride, color_stride, vertex_stride, normal_stride;
		GLubyte *texcoord_ptr,*normal_ptr,*color_ptr,*vertex_ptr;
		GLenum color_type;

		enable_texcoord=SDL_FALSE;
		enable_normal=SDL_FALSE;
		enable_color=SDL_FALSE;
		texcoord_size=color_size=vertex_size=0;
		texcoord_stride=color_stride=vertex_stride=normal_stride=stride;
		texcoord_ptr=normal_ptr=color_ptr=vertex_ptr=(GLubyte *)pointer;
		color_type = GL_FLOAT;
		switch(format) {
			case GL_V2F:
				vertex_size=2;
				break;
			case GL_V3F:
				vertex_size=3;
				break;
			case GL_C4UB_V2F:
				vertex_size=2;
				color_size=4;
				enable_color=SDL_TRUE;
				vertex_ptr += color_size*sizeof(GLubyte);
				color_type = GL_UNSIGNED_BYTE;
				if (stride==0) {
					color_stride = vertex_stride =
						(color_size*sizeof(GLubyte))+(vertex_size*sizeof(GLfloat));
				}
				break;
			case GL_C4UB_V3F:
				vertex_size=3;
				color_size=4;
				enable_color=SDL_TRUE;
				vertex_ptr += color_size*sizeof(GLubyte);
				color_type = GL_UNSIGNED_BYTE;
				if (stride==0) {
					color_stride = vertex_stride =
						(color_size*sizeof(GLubyte))+(vertex_size*sizeof(GLfloat));
				}
				break;
			case GL_C3F_V3F:
				vertex_size=3;
				color_size=3;
				enable_color=SDL_TRUE;
				vertex_ptr += color_size*sizeof(GLfloat);
				if (stride==0) {
					color_stride = vertex_stride =
						(color_size+vertex_size)*sizeof(GLfloat);
				}
				break;
			case GL_N3F_V3F:
				vertex_size=3;
				enable_normal=SDL_TRUE;
				vertex_ptr += 3*sizeof(GLfloat);
				if (stride==0) {
					normal_stride = vertex_stride =
						(vertex_size+3)*sizeof(GLfloat);
				}
				break;
			case GL_C4F_N3F_V3F:
				vertex_size=3;
				color_size=4;
				enable_color=SDL_TRUE;
				enable_normal=SDL_TRUE;
				vertex_ptr += (color_size+3)*sizeof(GLfloat);
				normal_ptr += color_size*sizeof(GLfloat);
				if (stride==0) {
					normal_stride = vertex_stride = color_stride =
						(color_size+vertex_size+3)*sizeof(GLfloat);
				}
				break;
			case GL_T2F_V3F:
				vertex_size=3;
				texcoord_size=2;
				enable_texcoord=SDL_TRUE;
				vertex_ptr += texcoord_size*sizeof(GLfloat);
				if (stride==0) {
					texcoord_stride = vertex_stride =
						(texcoord_size+vertex_size)*sizeof(GLfloat);
				}
				break;
			case GL_T4F_V4F:
				vertex_size=4;
				texcoord_size=4;
				enable_texcoord=SDL_TRUE;
				vertex_ptr += texcoord_size*sizeof(GLfloat);
				if (stride==0) {
					texcoord_stride = vertex_stride =
						(texcoord_size+vertex_size)*sizeof(GLfloat);
				}
				break;
			case GL_T2F_C4UB_V3F:
				vertex_size=3;
				texcoord_size=2;
				color_size=4;
				enable_texcoord=SDL_TRUE;
				enable_color=SDL_TRUE;
				vertex_ptr += texcoord_size*sizeof(GLfloat);
				vertex_ptr += color_size*sizeof(GLubyte);
				color_ptr += texcoord_size*sizeof(GLfloat);
				color_type = GL_UNSIGNED_BYTE;
				if (stride==0) {
					texcoord_stride = vertex_stride = color_stride =
						((texcoord_size+vertex_size)*sizeof(GLfloat))+(color_size*sizeof(GLubyte));
				}
				break;
			case GL_T2F_C3F_V3F:
				vertex_size=3;
				texcoord_size=2;
				color_size=3;
				enable_texcoord=SDL_TRUE;
				enable_color=SDL_TRUE;
				vertex_ptr += (texcoord_size+color_size)*sizeof(GLfloat);
				color_ptr += texcoord_size*sizeof(GLfloat);
				if (stride==0) {
					texcoord_stride = vertex_stride = color_stride =
						(texcoord_size+vertex_size+color_size)*sizeof(GLfloat);
				}
				break;
			case GL_T2F_N3F_V3F:
				vertex_size=3;
				texcoord_size=2;
				enable_normal=SDL_TRUE;
				enable_texcoord=SDL_TRUE;
				vertex_ptr += (texcoord_size+3)*sizeof(GLfloat);
				normal_ptr += texcoord_size*sizeof(GLfloat);
				if (stride==0) {
					texcoord_stride = vertex_stride = normal_stride =
						(texcoord_size+vertex_size+3)*sizeof(GLfloat);
				}
				break;
			case GL_T2F_C4F_N3F_V3F:
				vertex_size=3;
				texcoord_size=2;
				color_size=4;
				enable_normal=SDL_TRUE;
				enable_texcoord=SDL_TRUE;
				enable_color=SDL_TRUE;
				vertex_ptr += (texcoord_size+color_size+3)*sizeof(GLfloat);
				normal_ptr += (texcoord_size+color_size)*sizeof(GLfloat);
				color_ptr += texcoord_size*sizeof(GLfloat);
				if (stride==0) {
					texcoord_stride = vertex_stride = color_stride = normal_stride =
						(texcoord_size+vertex_size+color_size+3)*sizeof(GLfloat);
				}
				break;
			case GL_T4F_C4F_N3F_V4F:
				vertex_size=4;
				texcoord_size=4;
				color_size=4;
				enable_normal=SDL_TRUE;
				enable_texcoord=SDL_TRUE;
				enable_color=SDL_TRUE;
				vertex_ptr += (texcoord_size+color_size+3)*sizeof(GLfloat);
				normal_ptr += (texcoord_size+color_size)*sizeof(GLfloat);
				color_ptr += texcoord_size*sizeof(GLfloat);
				if (stride==0) {
					texcoord_stride = vertex_stride = color_stride = normal_stride =
						(texcoord_size+vertex_size+color_size+3)*sizeof(GLfloat);
				}
				break;
		}

		nfglDisableClientState(GL_EDGE_FLAG_ARRAY);
		nfglDisableClientState(GL_INDEX_ARRAY);

		if (enable_normal) {
			nfglEnableClientState(GL_NORMAL_ARRAY);
			nfglNormalPointer(GL_FLOAT, normal_stride, (GLfloat *)normal_ptr);
		} else {
			nfglDisableClientState(GL_NORMAL_ARRAY);
		}

		if (enable_color) {
			nfglEnableClientState(GL_COLOR_ARRAY);
			if (color_type == GL_FLOAT) {
				nfglColorPointer(color_size, GL_FLOAT, color_stride, (GLfloat *)color_ptr);
			} else {
				nfglColorPointer(color_size, GL_UNSIGNED_BYTE, color_stride, (GLubyte *)color_ptr);
			}
		} else {
			nfglDisableClientState(GL_COLOR_ARRAY);
		}

		if (enable_texcoord) {
			nfglEnableClientState(GL_TEXTURE_COORD_ARRAY);
			nfglTexCoordPointer(texcoord_size, GL_FLOAT, texcoord_stride, (GLfloat *)texcoord_ptr);
		} else {
			nfglDisableClientState(GL_TEXTURE_COORD_ARRAY);
		}

		nfglEnableClientState(GL_VERTEX_ARRAY);
		nfglVertexPointer(vertex_size, GL_FLOAT, vertex_stride, (GLfloat *)vertex_ptr);
	}
#else
	fn.glInterleavedArrays(  format,  stride,  pointer );
#endif
}

void OSMesaDriver::nfglShadeModel(GLenum mode )
{
	D(bug("nfosmesa: glShadeModel"));
	fn.glShadeModel(  mode );
}

void OSMesaDriver::nfglLightf(GLenum light, GLenum pname, GLfloat param )
{
	D(bug("nfosmesa: glLightf"));
	fn.glLightf(  light,  pname,  param );
}

void OSMesaDriver::nfglLighti(GLenum light, GLenum pname, GLint param )
{
	D(bug("nfosmesa: glLighti"));
	fn.glLighti(  light,  pname,  param );
}

void OSMesaDriver::nfglLightfv(GLenum light, GLenum pname, const GLfloat *params )
{
	GLfloat tmp[4];

	D(bug("nfosmesa: glLightfv"));
	Atari2HostFloatPtr(4, (Uint32 *)params,tmp);
	fn.glLightfv(  light,  pname,  tmp );
}

void OSMesaDriver::nfglLightiv(GLenum light, GLenum pname, const GLint *params )
{
	GLint tmp[4];

	D(bug("nfosmesa: glLightiv"));
	Atari2HostIntPtr(4, (Uint32 *)params, tmp);
	fn.glLightiv(  light,  pname,  tmp );
}

void OSMesaDriver::nfglGetLightfv(GLenum light, GLenum pname, GLfloat *params )
{
	D(bug("nfosmesa: glGetLightfv"));
	fn.glGetLightfv(  light,  pname,  params );
}

void OSMesaDriver::nfglGetLightiv(GLenum light, GLenum pname, GLint *params )
{
	D(bug("nfosmesa: glGetLightiv"));
	fn.glGetLightiv(  light,  pname,  params );
}

void OSMesaDriver::nfglLightModelf(GLenum pname, GLfloat param )
{
	D(bug("nfosmesa: glLightModelf"));
	fn.glLightModelf(  pname,  param );
}

void OSMesaDriver::nfglLightModeli(GLenum pname, GLint param )
{
	D(bug("nfosmesa: glLightModeli"));
	fn.glLightModeli(  pname,  param );
}

void OSMesaDriver::nfglLightModelfv(GLenum pname, const GLfloat *params )
{
	GLfloat tmp[4];
	int size;

	D(bug("nfosmesa: glLightModelfv"));
	switch(pname) {
		case GL_LIGHT_MODEL_AMBIENT:
			size=4;
			break;
		default:
			size=1;
			break;
	}
	Atari2HostFloatPtr(size, (Uint32 *)params,tmp);
	fn.glLightModelfv(  pname, tmp );
}

void OSMesaDriver::nfglLightModeliv(GLenum pname, const GLint *params )
{
	GLint tmp[4];
	int size;

	D(bug("nfosmesa: glLightModeliv"));
	switch(pname) {
		case GL_LIGHT_MODEL_AMBIENT:
			size=4;
			break;
		default:
			size=1;
			break;
	}
	Atari2HostIntPtr(size, (Uint32 *)params, tmp);
	fn.glLightModeliv(  pname,  tmp );
}

void OSMesaDriver::nfglMaterialf(GLenum face, GLenum pname, GLfloat param )
{
	D(bug("nfosmesa: glMaterialf"));
	fn.glMaterialf(  face,  pname,  param );
}

void OSMesaDriver::nfglMateriali(GLenum face, GLenum pname, GLint param )
{
	D(bug("nfosmesa: glMateriali"));
	fn.glMateriali(  face,  pname,  param );
}

void OSMesaDriver::nfglMaterialfv(GLenum face, GLenum pname, const GLfloat *params )
{
	GLfloat tmp[4];
	int size;

	D(bug("nfosmesa: glMaterialfv"));
	switch(pname) {
		case GL_SHININESS:
			size=1;
			break;
		case GL_COLOR_INDEXES:
			size=3;
			break;
		default:
			size=4;
			break;
	}
	Atari2HostFloatPtr(size, (Uint32 *)params,tmp);
	fn.glMaterialfv(  face,  pname,  tmp );
}

void OSMesaDriver::nfglMaterialiv(GLenum face, GLenum pname, const GLint *params )
{
	GLint tmp[4];
	int size;

	D(bug("nfosmesa: glMaterialiv"));
	switch(pname) {
		case GL_SHININESS:
			size=1;
			break;
		case GL_COLOR_INDEXES:
			size=3;
			break;
		default:
			size=4;
			break;
	}
	Atari2HostIntPtr(size, (Uint32 *)params,tmp);
	fn.glMaterialiv(  face,  pname,  tmp );
}

void OSMesaDriver::nfglGetMaterialfv(GLenum face, GLenum pname, GLfloat *params )
{
	D(bug("nfosmesa: glGetMaterialfv"));
	fn.glGetMaterialfv(  face,  pname,  params );
}

void OSMesaDriver::nfglGetMaterialiv(GLenum face, GLenum pname, GLint *params )
{
	D(bug("nfosmesa: glGetMaterialiv"));
	fn.glGetMaterialiv(  face,  pname,  params );
}

void OSMesaDriver::nfglColorMaterial(GLenum face, GLenum mode )
{
	D(bug("nfosmesa: glColorMaterial"));
	fn.glColorMaterial(  face,  mode );
}

void OSMesaDriver::nfglPixelZoom(GLfloat xfactor, GLfloat yfactor )
{
	D(bug("nfosmesa: glPixelZoom"));
	fn.glPixelZoom(  xfactor,  yfactor );
}

void OSMesaDriver::nfglPixelStoref(GLenum pname, GLfloat param )
{
	D(bug("nfosmesa: glPixelStoref"));
	fn.glPixelStoref(  pname,  param );
}

void OSMesaDriver::nfglPixelStorei(GLenum pname, GLint param )
{
	D(bug("nfosmesa: glPixelStorei"));
	fn.glPixelStorei(  pname,  param );
}

void OSMesaDriver::nfglPixelTransferf(GLenum pname, GLfloat param )
{
	D(bug("nfosmesa: glPixelTransferf"));
	fn.glPixelTransferf(  pname,  param );
}

void OSMesaDriver::nfglPixelTransferi(GLenum pname, GLint param )
{
	D(bug("nfosmesa: glPixelTransferi"));
	fn.glPixelTransferi(  pname,  param );
}

void OSMesaDriver::nfglPixelMapfv(GLenum map, GLsizei mapsize, const GLfloat *values )
{
	GLfloat *tmp;

	D(bug("nfosmesa: glPixelMapfv"));
	tmp=(GLfloat *)malloc(mapsize*sizeof(GLfloat));
	if (tmp) {
			Atari2HostFloatPtr(mapsize, (Uint32 *)values, tmp);
		fn.glPixelMapfv(  map,  mapsize,  tmp );
		free(tmp);
	}
}

void OSMesaDriver::nfglPixelMapuiv(GLenum map, GLsizei mapsize, const GLuint *values )
{
	GLuint *tmp;

	D(bug("nfosmesa: glPixelMapuiv"));
	tmp=(GLuint *)malloc(mapsize*sizeof(GLuint));
	if (tmp) {
			Atari2HostIntPtr(mapsize, (Uint32 *)values, (GLint *)tmp);
		fn.glPixelMapuiv(  map,  mapsize,  tmp );
		free(tmp);
	}
}

void OSMesaDriver::nfglPixelMapusv(GLenum map, GLsizei mapsize, const GLushort *values )
{
	GLushort *tmp;

	D(bug("nfosmesa: glPixelMapusv"));
	tmp=(GLushort *)malloc(mapsize*sizeof(GLushort));
	if (tmp) {
			Atari2HostShortPtr(mapsize, (Uint16 *)values, (GLshort *)tmp);
		fn.glPixelMapusv(  map,  mapsize,  tmp );
		free(tmp);
	}
}

void OSMesaDriver::nfglGetPixelMapfv(GLenum map, GLfloat *values )
{
	D(bug("nfosmesa: glGetPixelMapfv"));
	fn.glGetPixelMapfv(  map,  values );
}

void OSMesaDriver::nfglGetPixelMapuiv(GLenum map, GLuint *values )
{
	D(bug("nfosmesa: glGetPixelMapuiv"));
	fn.glGetPixelMapuiv(  map,  values );
}

void OSMesaDriver::nfglGetPixelMapusv(GLenum map, GLushort *values )
{
	D(bug("nfosmesa: glGetPixelMapusv"));
	fn.glGetPixelMapusv(  map,  values );
}

void OSMesaDriver::nfglBitmap(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap )
{
	D(bug("nfosmesa: glBitmap"));
	fn.glBitmap(  width,  height,  xorig,  yorig,  xmove,  ymove,  bitmap );
}

void OSMesaDriver::nfglReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels )
{
	D(bug("nfosmesa: glReadPixels"));
	fn.glReadPixels(  x,  y,  width,  height,  format,  type,  pixels );
}

void OSMesaDriver::nfglDrawPixels(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels )
{
	D(bug("nfosmesa: glDrawPixels"));
	fn.glDrawPixels(  width,  height,  format,  type,  pixels );
}

void OSMesaDriver::nfglCopyPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type )
{
	D(bug("nfosmesa: glCopyPixels"));
	fn.glCopyPixels(  x,  y,  width,  height,  type );
}

void OSMesaDriver::nfglStencilFunc(GLenum func, GLint ref, GLuint mask )
{
	D(bug("nfosmesa: glStencilFunc"));
	fn.glStencilFunc(  func,  ref,  mask );
}

void OSMesaDriver::nfglStencilMask(GLuint mask )
{
	D(bug("nfosmesa: glStencilMask"));
	fn.glStencilMask(  mask );
}

void OSMesaDriver::nfglStencilOp(GLenum fail, GLenum zfail, GLenum zpass )
{
	D(bug("nfosmesa: glStencilOp"));
	fn.glStencilOp(  fail,  zfail,  zpass );
}

void OSMesaDriver::nfglClearStencil(GLint s )
{
	D(bug("nfosmesa: glClearStencil"));
	fn.glClearStencil(  s );
}

void OSMesaDriver::nfglTexGend(GLenum coord, GLenum pname, GLdouble param )
{
	D(bug("nfosmesa: glTexGend"));
	fn.glTexGend(  coord,  pname,  param );
}

void OSMesaDriver::nfglTexGenf(GLenum coord, GLenum pname, GLfloat param )
{
	D(bug("nfosmesa: glTexGenf"));
	fn.glTexGenf(  coord,  pname,  param );
}

void OSMesaDriver::nfglTexGeni(GLenum coord, GLenum pname, GLint param )
{
	D(bug("nfosmesa: glTexGeni"));
	fn.glTexGeni(  coord,  pname,  param );
}

void OSMesaDriver::nfglTexGendv(GLenum coord, GLenum pname, const GLdouble *params )
{
	GLdouble tmp[4];

	D(bug("nfosmesa: glTexGendv"));
	Atari2HostDoublePtr(4, (Uint32 *)params, tmp);
	fn.glTexGendv(  coord,  pname,  tmp);
}

void OSMesaDriver::nfglTexGenfv(GLenum coord, GLenum pname, const GLfloat *params )
{
	GLfloat tmp[4];
	
	D(bug("nfosmesa: glTexGenfv"));
	Atari2HostFloatPtr(4, (Uint32 *)params, tmp);
	fn.glTexGenfv(  coord,  pname,  tmp );
}

void OSMesaDriver::nfglTexGeniv(GLenum coord, GLenum pname, const GLint *params )
{
	GLint tmp[4];

	D(bug("nfosmesa: glTexGeniv"));
	Atari2HostIntPtr(4, (Uint32 *)params, tmp);
	fn.glTexGeniv(  coord,  pname,  tmp );
}

void OSMesaDriver::nfglGetTexGendv(GLenum coord, GLenum pname, GLdouble *params )
{
	D(bug("nfosmesa: glGetTexGendv"));
	fn.glGetTexGendv(  coord,  pname,  params );
}

void OSMesaDriver::nfglGetTexGenfv(GLenum coord, GLenum pname, GLfloat *params )
{
	D(bug("nfosmesa: glGetTexGenfv"));
	fn.glGetTexGenfv(  coord,  pname,  params );
}

void OSMesaDriver::nfglGetTexGeniv(GLenum coord, GLenum pname, GLint *params )
{
	D(bug("nfosmesa: glGetTexGeniv"));
	fn.glGetTexGeniv(  coord,  pname,  params );
}

void OSMesaDriver::nfglTexEnvf(GLenum target, GLenum pname, GLfloat param )
{
	D(bug("nfosmesa: glTexEnvf"));
	fn.glTexEnvf(  target,  pname,  param );
}

void OSMesaDriver::nfglTexEnvi(GLenum target, GLenum pname, GLint param )
{
	D(bug("nfosmesa: glTexEnvi"));
	fn.glTexEnvi(  target,  pname,  param );
}

void OSMesaDriver::nfglTexEnvfv(GLenum target, GLenum pname, const GLfloat *params )
{
	GLfloat tmp[4];

	D(bug("nfosmesa: glTexEnvfv"));
	if (pname==GL_BLEND) {
		Atari2HostFloatPtr(4, (Uint32 *)params, tmp);
		fn.glTexEnvfv(  target,  pname,  tmp );
	} else {
		fn.glTexEnvfv(  target,  pname,  params );
	}
}

void OSMesaDriver::nfglTexEnviv(GLenum target, GLenum pname, const GLint *params )
{
	GLint tmp[4];

	D(bug("nfosmesa: glTexEnviv"));
	if (pname==GL_BLEND) {
		Atari2HostIntPtr(4, (Uint32 *)params, tmp);
		fn.glTexEnviv(  target,  pname,  tmp );
	} else {
		fn.glTexEnviv(  target,  pname,  params );
	}
}

void OSMesaDriver::nfglGetTexEnvfv(GLenum target, GLenum pname, GLfloat *params )
{
	D(bug("nfosmesa: glGetTexEnvfv"));
	fn.glGetTexEnvfv(  target,  pname,  params );
}

void OSMesaDriver::nfglGetTexEnviv(GLenum target, GLenum pname, GLint *params )
{
	D(bug("nfosmesa: glGetTexEnviv"));
	fn.glGetTexEnviv(  target,  pname,  params );
}

void OSMesaDriver::nfglTexParameterf(GLenum target, GLenum pname, GLfloat param )
{
	D(bug("nfosmesa: glTexParameterf"));
	fn.glTexParameterf(  target,  pname,  param );
}

void OSMesaDriver::nfglTexParameteri(GLenum target, GLenum pname, GLint param )
{
	D(bug("nfosmesa: glTexParameteri"));
	fn.glTexParameteri(  target,  pname,  param );
}

void OSMesaDriver::nfglTexParameterfv(GLenum target, GLenum pname, const GLfloat *params )
{
	GLfloat tmp[4];
	int size;

	D(bug("nfosmesa: glTexParameterfv"));
	size=1;
	if (pname==GL_TEXTURE_BORDER_COLOR) {
		size=4;
	}	
	Atari2HostFloatPtr(size, (Uint32 *)params, tmp);
	fn.glTexParameterfv(  target,  pname, tmp );
}

void OSMesaDriver::nfglTexParameteriv(GLenum target, GLenum pname, const GLint *params )
{
	GLint tmp[4];
	int size;

	D(bug("nfosmesa: glTexParameteriv"));
	size=1;
	if (pname==GL_TEXTURE_BORDER_COLOR) {
		size=4;
	}	
	Atari2HostIntPtr(size, (Uint32 *)params, tmp);
	fn.glTexParameteriv(  target,  pname,  tmp );
}

void OSMesaDriver::nfglGetTexParameterfv(GLenum target, GLenum pname, GLfloat *params)
{
	D(bug("nfosmesa: glGetTexParameterfv"));
	fn.glGetTexParameterfv(  target,  pname,  params);
}

void OSMesaDriver::nfglGetTexParameteriv(GLenum target, GLenum pname, GLint *params )
{
	D(bug("nfosmesa: glGetTexParameteriv"));
	fn.glGetTexParameteriv(  target,  pname,  params );
}

void OSMesaDriver::nfglGetTexLevelParameterfv(GLenum target, GLint level, GLenum pname, GLfloat *params )
{
	D(bug("nfosmesa: glGetTexLevelParameterfv"));
	fn.glGetTexLevelParameterfv(  target,  level,  pname,  params );
}

void OSMesaDriver::nfglGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint *params )
{
	D(bug("nfosmesa: glGetTexLevelParameteriv"));
	fn.glGetTexLevelParameteriv(  target,  level,  pname,  params );
}

void OSMesaDriver::nfglTexImage1D(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels )
{
	D(bug("nfosmesa: glTexImage1D"));
	fn.glTexImage1D(  target,  level,  internalFormat,  width,  border,  format,  type,  pixels );
}

void OSMesaDriver::nfglTexImage2D(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels )
{
	D(bug("nfosmesa: glTexImage2D"));
	fn.glTexImage2D(  target,  level,  internalFormat,  width,  height,  border,  format,  type,  pixels );
}

void OSMesaDriver::nfglGetTexImage(GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels )
{
	D(bug("nfosmesa: glGetTexImage"));
	fn.glGetTexImage(  target,  level,  format,  type,  pixels );
}

void OSMesaDriver::nfglGenTextures(GLsizei n, GLuint *textures )
{
	int i;

	D(bug("nfosmesa: glGenTextures"));
	fn.glGenTextures(  n,  textures );
	for (i=0;i<n;i++) {
		GLuint numtex;
		
		numtex=textures[i];
		textures[i]=SDL_SwapBE32(numtex);
	}	
}

void OSMesaDriver::nfglDeleteTextures(GLsizei n, const GLuint *textures)
{
	GLuint *tmp;

	D(bug("nfosmesa: glDeleteTextures"));
	if (n<=0) {
		return;
	}
	tmp=(GLuint *)malloc(n*sizeof(GLuint));
	if (tmp) {
		Atari2HostIntPtr(n, (Uint32 *)textures, (GLint *)tmp);
			fn.glDeleteTextures(  n,  tmp);
		free(tmp);
	}
}

void OSMesaDriver::nfglBindTexture(GLenum target, GLuint texture )
{
	D(bug("nfosmesa: glBindTexture"));
	fn.glBindTexture(  target,  texture );
}

void OSMesaDriver::nfglPrioritizeTextures(GLsizei n, const GLuint *textures, const GLclampf *priorities )
{
	GLuint *tmp;
	GLclampf *tmp2;

	D(bug("nfosmesa: glPrioritizeTextures"));
	if (n<=0) {
		return;
	}
	tmp=(GLuint *)malloc(n*sizeof(GLuint));
	if (tmp) {
		tmp2=(GLclampf *)malloc(n*sizeof(GLclampf));
		if (tmp2) {
			Atari2HostIntPtr(n,(Uint32 *)textures, (GLint *)tmp);
			Atari2HostFloatPtr(n,(Uint32 *)priorities, tmp2);
					fn.glPrioritizeTextures(  n,  tmp,  tmp2 );
			free(tmp2);
		}
		free(tmp);
	}
}

GLboolean OSMesaDriver::nfglAreTexturesResident(GLsizei n, const GLuint *textures, GLboolean *residences )
{
	GLuint *tmp;
	GLboolean result=GL_FALSE;

	D(bug("nfosmesa: glAreTexturesResident"));
	if (n<=0) {
		return result;
	}
	tmp=(GLuint *)malloc(n*sizeof(GLuint));
	if (tmp) {
		Atari2HostIntPtr(n, (Uint32 *)textures, (GLint *)tmp);
			result=fn.glAreTexturesResident(  n,  tmp,  residences );
		free(tmp);
	}
	return result;
}

GLboolean OSMesaDriver::nfglIsTexture(GLuint texture )
{
	D(bug("nfosmesa: glIsTexture"));
	return fn.glIsTexture(  texture );
}

void OSMesaDriver::nfglTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels )
{
	D(bug("nfosmesa: glTexSubImage1D"));
	fn.glTexSubImage1D(  target,  level,  xoffset,  width,  format,  type,  pixels );
}

void OSMesaDriver::nfglTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels )
{
	D(bug("nfosmesa: glTexSubImage2D"));
	fn.glTexSubImage2D(  target,  level,  xoffset,  yoffset,  width,  height,  format,  type,  pixels );
}

void OSMesaDriver::nfglCopyTexImage1D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border )
{
	D(bug("nfosmesa: glCopyTexImage1D"));
	fn.glCopyTexImage1D(  target,  level,  internalformat,  x,  y,  width,  border );
}

void OSMesaDriver::nfglCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border )
{
	D(bug("nfosmesa: glCopyTexImage2D"));
	fn.glCopyTexImage2D(  target,  level,  internalformat,  x,  y,  width,  height,  border );
}

void OSMesaDriver::nfglCopyTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width )
{
	D(bug("nfosmesa: glCopyTexSubImage1D"));
	fn.glCopyTexSubImage1D(  target,  level,  xoffset,  x,  y,  width );
}

void OSMesaDriver::nfglCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height )
{
	D(bug("nfosmesa: glCopyTexSubImage2D"));
	fn.glCopyTexSubImage2D(  target,  level,  xoffset,  yoffset,  x,  y,  width,  height );
}

void OSMesaDriver::nfglMap1d(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points )
{
	D(bug("nfosmesa: glMap1d"));
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
	{
		GLdouble *tmp;
		GLubyte *ptr;
		int size, i,j;
		
		switch(target) {
			case GL_MAP1_INDEX:
			case GL_MAP1_TEXTURE_COORD_1:
				size=1;
				break;
			case GL_MAP1_TEXTURE_COORD_2:
				size=2;
				break;
			case GL_MAP1_VERTEX_3:
			case GL_MAP1_NORMAL:
			case GL_MAP1_TEXTURE_COORD_3:
				size=3;
				break;
			default:
				size=4;
				break;
		}

		tmp=(GLdouble *)malloc(size*order*sizeof(GLdouble));
		if (tmp) {
			ptr =(GLubyte *)points;
			for (i=0;i<order;i++) {
				for (j=0;j<size;j++) {
					Atari2HostDoublePtr(1, (Uint32 *)&ptr[j], &tmp[i*size+j]);
				}
				ptr += stride*sizeof(GLdouble);
			}
			fn.glMap1d(  target,  u1,  u2,  size,  order,  tmp );
			free(tmp);
		}
	}
#else
	fn.glMap1d(  target,  u1,  u2,  stride,  order,  points );
#endif
}

void OSMesaDriver::nfglMap1f(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points )
{
	D(bug("nfosmesa: glMap1f"));
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
	{
		GLfloat *tmp;
		GLubyte *ptr;
		int size, i,j;
		
		switch(target) {
			case GL_MAP1_INDEX:
			case GL_MAP1_TEXTURE_COORD_1:
				size=1;
				break;
			case GL_MAP1_TEXTURE_COORD_2:
				size=2;
				break;
			case GL_MAP1_VERTEX_3:
			case GL_MAP1_NORMAL:
			case GL_MAP1_TEXTURE_COORD_3:
				size=3;
				break;
			default:
				size=4;
				break;
		}

		tmp=(GLfloat *)malloc(size*order*sizeof(GLfloat));
		if (tmp) {
			ptr =(GLubyte *)points;
			for (i=0;i<order;i++) {
				for (j=0;j<size;j++) {
					Atari2HostFloatPtr(1, (Uint32 *)&ptr[j], &tmp[i*size+j]);
				}
				ptr += stride*sizeof(GLfloat);
			}
			fn.glMap1f(  target,  u1,  u2,  size,  order,  tmp );
			free(tmp);
		}
	}
#else
	fn.glMap1f(  target,  u1,  u2,  stride,  order,  points );
#endif
}

void OSMesaDriver::nfglMap2d(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points )
{
	D(bug("nfosmesa: glMap2d"));
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
	{
		GLdouble *tmp1,*tmp2;
		GLubyte *ptr1,*ptr2;
		int size, i,j;
		
		switch(target) {
			case GL_MAP2_INDEX:
			case GL_MAP2_TEXTURE_COORD_1:
				size=1;
				break;
			case GL_MAP2_TEXTURE_COORD_2:
				size=2;
				break;
			case GL_MAP2_VERTEX_3:
			case GL_MAP2_NORMAL:
			case GL_MAP2_TEXTURE_COORD_3:
				size=3;
				break;
			default:
				size=4;
				break;
		}

		tmp1=(GLdouble *)malloc(size*(uorder+vorder)*sizeof(GLdouble));
		if (tmp1) {
			ptr1 =(GLubyte *)points;
			for (i=0;i<uorder;i++) {
				for (j=0;j<size;j++) {
					Atari2HostDoublePtr(1, (Uint32 *)&ptr1[j], &tmp1[i*size+j]);
				}
				ptr1 += ustride*sizeof(GLdouble);
			}

			tmp2=&tmp1[uorder*size];

			ptr2 =(GLubyte *)points;
			for (i=0;i<vorder;i++) {
				for (j=0;j<size;j++) {
					Atari2HostDoublePtr(1, (Uint32 *)&ptr2[j], &tmp2[i*size+j]);
				}
				ptr2 += vstride*sizeof(GLdouble);
			}

			fn.glMap2d(  target,
				u1,  u2,  size,  uorder,
				v1,  v2,  size*uorder,  vorder, tmp1
			);

			free(tmp1);
		}
	}
#else
	fn.glMap2d(  target,  u1,  u2,  ustride,  uorder,  v1,  v2,  vstride,  vorder,  points );
#endif
}

void OSMesaDriver::nfglMap2f(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points )
{
	D(bug("nfosmesa: glMap2f"));
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
	{
		GLfloat *tmp1,*tmp2;
		GLubyte *ptr1,*ptr2;
		int size, i,j;
		
		switch(target) {
			case GL_MAP2_INDEX:
			case GL_MAP2_TEXTURE_COORD_1:
				size=1;
				break;
			case GL_MAP2_TEXTURE_COORD_2:
				size=2;
				break;
			case GL_MAP2_VERTEX_3:
			case GL_MAP2_NORMAL:
			case GL_MAP2_TEXTURE_COORD_3:
				size=3;
				break;
			default:
				size=4;
				break;
		}

		tmp1=(GLfloat *)malloc(size*(uorder+vorder)*sizeof(GLfloat));
		if (tmp1) {
			ptr1 =(GLubyte *)points;
			for (i=0;i<uorder;i++) {
				for (j=0;j<size;j++) {
					Atari2HostFloatPtr(1, (Uint32 *)&ptr1[j], &tmp1[i*size+j]);
				}
				ptr1 += ustride*sizeof(GLfloat);
			}

			tmp2= &tmp1[uorder*size];

			ptr2 =(GLubyte *)points;
			for (i=0;i<vorder;i++) {
				for (j=0;j<size;j++) {
					Atari2HostFloatPtr(1, (Uint32 *)&ptr2[j], &tmp2[i*size+j]);
				}
				ptr2 += vstride*sizeof(GLfloat);
			}

			fn.glMap2f(  target,
				u1,  u2,  size,  uorder,
				v1,  v2,  size*uorder,  vorder,  tmp1
			);

			free(tmp1);
		}
	}
#else
	fn.glMap2f(  target,  u1,  u2,  ustride,  uorder,  v1,  v2,  vstride,  vorder,  points );
#endif
}

void OSMesaDriver::nfglGetMapdv(GLenum target, GLenum query, GLdouble *v )
{
	D(bug("nfosmesa: glGetMapdv"));
	fn.glGetMapdv(  target,  query,  v );
}

void OSMesaDriver::nfglGetMapfv(GLenum target, GLenum query, GLfloat *v )
{
	D(bug("nfosmesa: glGetMapfv"));
	fn.glGetMapfv(  target,  query,  v );
}

void OSMesaDriver::nfglGetMapiv(GLenum target, GLenum query, GLint *v )
{
	D(bug("nfosmesa: glGetMapiv"));
	fn.glGetMapiv(  target,  query,  v );
}

void OSMesaDriver::nfglEvalCoord1d(GLdouble u )
{
	D(bug("nfosmesa: glEvalCoord1d"));
	fn.glEvalCoord1d(  u );
}

void OSMesaDriver::nfglEvalCoord1f(GLfloat u )
{
	D(bug("nfosmesa: glEvalCoord1f"));
	fn.glEvalCoord1f(  u );
}

void OSMesaDriver::nfglEvalCoord1dv(const GLdouble *u )
{
	GLdouble tmp[1];

	D(bug("nfosmesa: glEvalCoord1dv"));
	Atari2HostDoublePtr(1, (Uint32 *)u, tmp);
	fn.glEvalCoord1dv( tmp );
}

void OSMesaDriver::nfglEvalCoord1fv(const GLfloat *u )
{
	GLfloat tmp[1];

	D(bug("nfosmesa: glEvalCoord1fv"));
	Atari2HostFloatPtr(1, (Uint32 *)u, tmp);
	fn.glEvalCoord1fv( tmp );
}

void OSMesaDriver::nfglEvalCoord2d(GLdouble u, GLdouble v )
{
	D(bug("nfosmesa: glEvalCoord2d"));
	fn.glEvalCoord2d(  u,  v );
}

void OSMesaDriver::nfglEvalCoord2f(GLfloat u, GLfloat v )
{
	D(bug("nfosmesa: glEvalCoord2f"));
	fn.glEvalCoord2f(  u,  v );
}

void OSMesaDriver::nfglEvalCoord2dv(const GLdouble *u )
{
	GLdouble tmp[2];

	D(bug("nfosmesa: glEvalCoord2dv"));
	Atari2HostDoublePtr(2, (Uint32 *)u, tmp);
	fn.glEvalCoord2dv( tmp );
}

void OSMesaDriver::nfglEvalCoord2fv(const GLfloat *u )
{
	GLfloat tmp[2];

	D(bug("nfosmesa: glEvalCoord2fv"));
	Atari2HostFloatPtr(2, (Uint32 *)u, tmp);
	fn.glEvalCoord2fv( tmp );
}

void OSMesaDriver::nfglMapGrid1d(GLint un, GLdouble u1, GLdouble u2 )
{
	D(bug("nfosmesa: glMapGrid1d"));
	fn.glMapGrid1d(  un,  u1,  u2 );
}

void OSMesaDriver::nfglMapGrid1f(GLint un, GLfloat u1, GLfloat u2 )
{
	D(bug("nfosmesa: glMapGrid1f"));
	fn.glMapGrid1f(  un,  u1,  u2 );
}

void OSMesaDriver::nfglMapGrid2d(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2 )
{
	D(bug("nfosmesa: glMapGrid2d"));
	fn.glMapGrid2d(  un,  u1,  u2,  vn,  v1,  v2 );
}

void OSMesaDriver::nfglMapGrid2f(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2 )
{
	D(bug("nfosmesa: glMapGrid2f"));
	fn.glMapGrid2f(  un,  u1,  u2,  vn,  v1,  v2 );
}

void OSMesaDriver::nfglEvalPoint1(GLint i )
{
	D(bug("nfosmesa: glEvalPoint1"));
	fn.glEvalPoint1(  i );
}

void OSMesaDriver::nfglEvalPoint2(GLint i, GLint j )
{
	D(bug("nfosmesa: glEvalPoint2"));
	fn.glEvalPoint2(  i,  j );
}

void OSMesaDriver::nfglEvalMesh1(GLenum mode, GLint i1, GLint i2 )
{
	D(bug("nfosmesa: glEvalMesh1"));
	fn.glEvalMesh1(  mode,  i1,  i2 );
}

void OSMesaDriver::nfglEvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 )
{
	D(bug("nfosmesa: glEvalMesh2"));
	fn.glEvalMesh2(  mode,  i1,  i2,  j1,  j2 );
}

void OSMesaDriver::nfglFogf(GLenum pname, GLfloat param )
{
	D(bug("nfosmesa: glFogf"));
	fn.glFogf(  pname,  param );
}

void OSMesaDriver::nfglFogi(GLenum pname, GLint param )
{
	D(bug("nfosmesa: glFogi"));
	fn.glFogi(  pname,  param );
}

void OSMesaDriver::nfglFogfv(GLenum pname, const GLfloat *params )
{
	GLfloat tmp[4];
	int size;

	D(bug("nfosmesa: glFogfv"));
	switch(pname) {
		case GL_FOG_COLOR:
			size=4;
			break;
		default:
			size=1;
			break;
	}
	Atari2HostFloatPtr(size, (Uint32 *)params, tmp);
	fn.glFogfv(  pname,  tmp );
}

void OSMesaDriver::nfglFogiv(GLenum pname, const GLint *params )
{
	GLint tmp[4];
	int size;

	D(bug("nfosmesa: glFogiv"));
	switch(pname) {
		case GL_FOG_COLOR:
			size=4;
			break;
		default:
			size=1;
			break;
	}
	Atari2HostIntPtr(size, (Uint32 *)params, tmp);
	fn.glFogiv(  pname,  tmp );
}

void OSMesaDriver::nfglFeedbackBuffer(GLsizei size, GLenum type, GLfloat *buffer )
{
	D(bug("nfosmesa: glFeedbackBuffer"));
	fn.glFeedbackBuffer(  size,  type,  buffer );
}

void OSMesaDriver::nfglPassThrough(GLfloat token )
{
	D(bug("nfosmesa: glPassThrough"));
	fn.glPassThrough(  token );
}

void OSMesaDriver::nfglSelectBuffer(GLsizei size, GLuint *buffer )
{
	D(bug("nfosmesa: glSelectBuffer"));
	fn.glSelectBuffer(  size,  buffer );
}

void OSMesaDriver::nfglInitNames(void)
{
	D(bug("nfosmesa: glInitNames"));
	fn.glInitNames(  );
}

void OSMesaDriver::nfglLoadName(GLuint name )
{
	D(bug("nfosmesa: glLoadName"));
	fn.glLoadName(  name );
}

void OSMesaDriver::nfglPushName(GLuint name )
{
	D(bug("nfosmesa: glPushName"));
	fn.glPushName(  name );
}

void OSMesaDriver::nfglPopName(void)
{
	D(bug("nfosmesa: glPopName"));
	fn.glPopName(  );
}

/*
void OSMesaDriver::nfglDrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices )
{
	D(bug("nfosmesa: glDrawRangeElements"));
	fn.glDrawRangeElements(  mode,  start,  end,  count,  type,  indices );
}

void OSMesaDriver::nfglTexImage3D(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels )
{
	D(bug("nfosmesa: glTexImage3D"));
	fn.glTexImage3D(  target,  level,  internalFormat,  width,  height,  depth,  border,  format,  type,  pixels );
}

void OSMesaDriver::nfglTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels)
{
	D(bug("nfosmesa: glTexSubImage3D"));
	fn.glTexSubImage3D(  target,  level,  xoffset,  yoffset,  zoffset,  width,  height,  depth,  format,  type,  pixels);
}

void OSMesaDriver::nfglCopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height )
{
	D(bug("nfosmesa: glCopyTexSubImage3D"));
	fn.glCopyTexSubImage3D(  target,  level,  xoffset,  yoffset,  zoffset,  x,  y,  width,  height );
}

void OSMesaDriver::nfglColorTable(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table )
{
	D(bug("nfosmesa: glColorTable"));
	fn.glColorTable(  target,  internalformat,  width,  format,  type,  table );
}

void OSMesaDriver::nfglColorSubTable(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data )
{
	D(bug("nfosmesa: glColorSubTable"));
	fn.glColorSubTable(  target,  start,  count,  format,  type,  data );
}

void OSMesaDriver::nfglColorTableParameteriv(void,GLenum target, GLenum pname, const GLint *params)
{
	D(bug("nfosmesa: glColorTableParameteriv"));
	fn.glColorTableParameteriv( target,  pname,  params);
}

void OSMesaDriver::nfglColorTableParameterfv(void,GLenum target, GLenum pname, const GLfloat *params)
{
	D(bug("nfosmesa: glColorTableParameterfv"));
	fn.glColorTableParameterfv( target,  pname,  params);
}

void OSMesaDriver::nfglCopyColorSubTable(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width )
{
	D(bug("nfosmesa: glCopyColorSubTable"));
	fn.glCopyColorSubTable(  target,  start,  x,  y,  width );
}

void OSMesaDriver::nfglCopyColorTable(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width )
{
	D(bug("nfosmesa: glCopyColorTable"));
	fn.glCopyColorTable(  target,  internalformat,  x,  y,  width );
}

void OSMesaDriver::nfglGetColorTable(GLenum target, GLenum format, GLenum type, GLvoid *table )
{
	D(bug("nfosmesa: glGetColorTable"));
	fn.glGetColorTable(  target,  format,  type,  table );
}

void OSMesaDriver::nfglGetColorTableParameterfv(GLenum target, GLenum pname, GLfloat *params )
{
	D(bug("nfosmesa: glGetColorTableParameterfv"));
	fn.glGetColorTableParameterfv(  target,  pname,  params );
}

void OSMesaDriver::nfglGetColorTableParameteriv(GLenum target, GLenum pname, GLint *params )
{
	D(bug("nfosmesa: glGetColorTableParameteriv"));
	fn.glGetColorTableParameteriv(  target,  pname,  params );
}

void OSMesaDriver::nfglBlendEquation(GLenum mode )
{
	D(bug("nfosmesa: glBlendEquation"));
	fn.glBlendEquation(  mode );
}

void OSMesaDriver::nfglBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha )
{
	D(bug("nfosmesa: glBlendColor"));
	fn.glBlendColor(  red,  green,  blue,  alpha );
}

void OSMesaDriver::nfglHistogram(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink )
{
	D(bug("nfosmesa: glHistogram"));
	fn.glHistogram(  target,  width,  internalformat,  sink );
}

void OSMesaDriver::nfglResetHistogram(GLenum target )
{
	D(bug("nfosmesa: glResetHistogram"));
	fn.glResetHistogram(  target );
}

void OSMesaDriver::nfglGetHistogram(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values )
{
	D(bug("nfosmesa: glGetHistogram"));
	fn.glGetHistogram(  target,  reset,  format,  type,  values );
}

void OSMesaDriver::nfglGetHistogramParameterfv(GLenum target, GLenum pname, GLfloat *params )
{
	D(bug("nfosmesa: glGetHistogramParameterfv"));
	fn.glGetHistogramParameterfv(  target,  pname,  params );
}

void OSMesaDriver::nfglGetHistogramParameteriv(GLenum target, GLenum pname, GLint *params )
{
	D(bug("nfosmesa: glGetHistogramParameteriv"));
	fn.glGetHistogramParameteriv(  target,  pname,  params );
}

void OSMesaDriver::nfglMinmax(GLenum target, GLenum internalformat, GLboolean sink )
{
	D(bug("nfosmesa: glMinmax"));
	fn.glMinmax(  target,  internalformat,  sink );
}

void OSMesaDriver::nfglResetMinmax(GLenum target )
{
	D(bug("nfosmesa: glResetMinmax"));
	fn.glResetMinmax(  target );
}

void OSMesaDriver::nfglGetMinmax(GLenum target, GLboolean reset, GLenum format, GLenum types, GLvoid *values )
{
	D(bug("nfosmesa: glGetMinmax"));
	fn.glGetMinmax(  target,  reset,  format,  types,  values );
}

void OSMesaDriver::nfglGetMinmaxParameterfv(GLenum target, GLenum pname, GLfloat *params )
{
	D(bug("nfosmesa: glGetMinmaxParameterfv"));
	fn.glGetMinmaxParameterfv(  target,  pname,  params );
}

void OSMesaDriver::nfglGetMinmaxParameteriv(GLenum target, GLenum pname, GLint *params )
{
	D(bug("nfosmesa: glGetMinmaxParameteriv"));
	fn.glGetMinmaxParameteriv(  target,  pname,  params );
}

void OSMesaDriver::nfglConvolutionFilter1D(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image )
{
	D(bug("nfosmesa: glConvolutionFilter1D"));
	fn.glConvolutionFilter1D(  target,  internalformat,  width,  format,  type,  image );
}

void OSMesaDriver::nfglConvolutionFilter2D(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image )
{
	D(bug("nfosmesa: glConvolutionFilter2D"));
	fn.glConvolutionFilter2D(  target,  internalformat,  width,  height,  format,  type,  image );
}

void OSMesaDriver::nfglConvolutionParameterf(GLenum target, GLenum pname, GLfloat params )
{
	D(bug("nfosmesa: glConvolutionParameterf"));
	fn.glConvolutionParameterf(  target,  pname,  params );
}

void OSMesaDriver::nfglConvolutionParameterfv(GLenum target, GLenum pname, const GLfloat *params )
{
	D(bug("nfosmesa: glConvolutionParameterfv"));
	fn.glConvolutionParameterfv(  target,  pname,  params );
}

void OSMesaDriver::nfglConvolutionParameteri(GLenum target, GLenum pname, GLint params )
{
	D(bug("nfosmesa: glConvolutionParameteri"));
	fn.glConvolutionParameteri(  target,  pname,  params );
}

void OSMesaDriver::nfglConvolutionParameteriv(GLenum target, GLenum pname, const GLint *params )
{
	D(bug("nfosmesa: glConvolutionParameteriv"));
	fn.glConvolutionParameteriv(  target,  pname,  params );
}

void OSMesaDriver::nfglCopyConvolutionFilter1D(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width )
{
	D(bug("nfosmesa: glCopyConvolutionFilter1D"));
	fn.glCopyConvolutionFilter1D(  target,  internalformat,  x,  y,  width );
}

void OSMesaDriver::nfglCopyConvolutionFilter2D(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height)
{
	D(bug("nfosmesa: glCopyConvolutionFilter2D"));
	fn.glCopyConvolutionFilter2D(  target,  internalformat,  x,  y,  width,  height);
}

void OSMesaDriver::nfglGetConvolutionFilter(GLenum target, GLenum format, GLenum type, GLvoid *image )
{
	D(bug("nfosmesa: glGetConvolutionFilter"));
	fn.glGetConvolutionFilter(  target,  format,  type,  image );
}

void OSMesaDriver::nfglGetConvolutionParameterfv(GLenum target, GLenum pname, GLfloat *params )
{
	D(bug("nfosmesa: glGetConvolutionParameterfv"));
	fn.glGetConvolutionParameterfv(  target,  pname,  params );
}

void OSMesaDriver::nfglGetConvolutionParameteriv(GLenum target, GLenum pname, GLint *params )
{
	D(bug("nfosmesa: glGetConvolutionParameteriv"));
	fn.glGetConvolutionParameteriv(  target,  pname,  params );
}

void OSMesaDriver::nfglSeparableFilter2D(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column )
{
	D(bug("nfosmesa: glSeparableFilter2D"));
	fn.glSeparableFilter2D(  target,  internalformat,  width,  height,  format,  type,  row,  column );
}

void OSMesaDriver::nfglGetSeparableFilter(GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span )
{
	D(bug("nfosmesa: glGetSeparableFilter"));
	fn.glGetSeparableFilter(  target,  format,  type,  row,  column,  span );
}

void OSMesaDriver::nfglActiveTexture(GLenum texture )
{
	D(bug("nfosmesa: glActiveTexture"));
	fn.glActiveTexture(  texture );
}

void OSMesaDriver::nfglClientActiveTexture(GLenum texture )
{
	D(bug("nfosmesa: glClientActiveTexture"));
	fn.glClientActiveTexture(  texture );
}

void OSMesaDriver::nfglCompressedTexImage1D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data )
{
	D(bug("nfosmesa: glCompressedTexImage1D"));
	fn.glCompressedTexImage1D(  target,  level,  internalformat,  width,  border,  imageSize,  data );
}

void OSMesaDriver::nfglCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data )
{
	D(bug("nfosmesa: glCompressedTexImage2D"));
	fn.glCompressedTexImage2D(  target,  level,  internalformat,  width,  height,  border,  imageSize,  data );
}

void OSMesaDriver::nfglCompressedTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data )
{
	D(bug("nfosmesa: glCompressedTexImage3D"));
	fn.glCompressedTexImage3D(  target,  level,  internalformat,  width,  height,  depth,  border,  imageSize,  data );
}

void OSMesaDriver::nfglCompressedTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data )
{
	D(bug("nfosmesa: glCompressedTexSubImage1D"));
	fn.glCompressedTexSubImage1D(  target,  level,  xoffset,  width,  format,  imageSize,  data );
}

void OSMesaDriver::nfglCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data )
{
	D(bug("nfosmesa: glCompressedTexSubImage2D"));
	fn.glCompressedTexSubImage2D(  target,  level,  xoffset,  yoffset,  width,  height,  format,  imageSize,  data );
}

void OSMesaDriver::nfglCompressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data )
{
	D(bug("nfosmesa: glCompressedTexSubImage3D"));
	fn.glCompressedTexSubImage3D(  target,  level,  xoffset,  yoffset,  zoffset,  width,  height,  depth,  format,  imageSize,  data );
}

void OSMesaDriver::nfglGetCompressedTexImage(GLenum target, GLint lod, GLvoid *img )
{
	D(bug("nfosmesa: glGetCompressedTexImage"));
	fn.glGetCompressedTexImage(  target,  lod,  img );
}

void OSMesaDriver::nfglMultiTexCoord1d(GLenum target, GLdouble s )
{
	D(bug("nfosmesa: glMultiTexCoord1d"));
	fn.glMultiTexCoord1d(  target,  s );
}

void OSMesaDriver::nfglMultiTexCoord1dv(GLenum target, const GLdouble *v )
{
	D(bug("nfosmesa: glMultiTexCoord1dv"));
	fn.glMultiTexCoord1dv(  target,  v );
}

void OSMesaDriver::nfglMultiTexCoord1f(GLenum target, GLfloat s )
{
	D(bug("nfosmesa: glMultiTexCoord1f"));
	fn.glMultiTexCoord1f(  target,  s );
}

void OSMesaDriver::nfglMultiTexCoord1fv(GLenum target, const GLfloat *v )
{
	D(bug("nfosmesa: glMultiTexCoord1fv"));
	fn.glMultiTexCoord1fv(  target,  v );
}

void OSMesaDriver::nfglMultiTexCoord1i(GLenum target, GLint s )
{
	D(bug("nfosmesa: glMultiTexCoord1i"));
	fn.glMultiTexCoord1i(  target,  s );
}

void OSMesaDriver::nfglMultiTexCoord1iv(GLenum target, const GLint *v )
{
	D(bug("nfosmesa: glMultiTexCoord1iv"));
	fn.glMultiTexCoord1iv(  target,  v );
}

void OSMesaDriver::nfglMultiTexCoord1s(GLenum target, GLshort s )
{
	D(bug("nfosmesa: glMultiTexCoord1s"));
	fn.glMultiTexCoord1s(  target,  s );
}

void OSMesaDriver::nfglMultiTexCoord1sv(GLenum target, const GLshort *v )
{
	D(bug("nfosmesa: glMultiTexCoord1sv"));
	fn.glMultiTexCoord1sv(  target,  v );
}

void OSMesaDriver::nfglMultiTexCoord2d(GLenum target, GLdouble s, GLdouble t )
{
	D(bug("nfosmesa: glMultiTexCoord2d"));
	fn.glMultiTexCoord2d(  target,  s,  t );
}

void OSMesaDriver::nfglMultiTexCoord2dv(GLenum target, const GLdouble *v )
{
	D(bug("nfosmesa: glMultiTexCoord2dv"));
	fn.glMultiTexCoord2dv(  target,  v );
}

void OSMesaDriver::nfglMultiTexCoord2f(GLenum target, GLfloat s, GLfloat t )
{
	D(bug("nfosmesa: glMultiTexCoord2f"));
	fn.glMultiTexCoord2f(  target,  s,  t );
}

void OSMesaDriver::nfglMultiTexCoord2fv(GLenum target, const GLfloat *v )
{
	D(bug("nfosmesa: glMultiTexCoord2fv"));
	fn.glMultiTexCoord2fv(  target,  v );
}

void OSMesaDriver::nfglMultiTexCoord2i(GLenum target, GLint s, GLint t )
{
	D(bug("nfosmesa: glMultiTexCoord2i"));
	fn.glMultiTexCoord2i(  target,  s,  t );
}

void OSMesaDriver::nfglMultiTexCoord2iv(GLenum target, const GLint *v )
{
	D(bug("nfosmesa: glMultiTexCoord2iv"));
	fn.glMultiTexCoord2iv(  target,  v );
}

void OSMesaDriver::nfglMultiTexCoord2s(GLenum target, GLshort s, GLshort t )
{
	D(bug("nfosmesa: glMultiTexCoord2s"));
	fn.glMultiTexCoord2s(  target,  s,  t );
}

void OSMesaDriver::nfglMultiTexCoord2sv(GLenum target, const GLshort *v )
{
	D(bug("nfosmesa: glMultiTexCoord2sv"));
	fn.glMultiTexCoord2sv(  target,  v );
}

void OSMesaDriver::nfglMultiTexCoord3d(GLenum target, GLdouble s, GLdouble t, GLdouble r )
{
	D(bug("nfosmesa: glMultiTexCoord3d"));
	fn.glMultiTexCoord3d(  target,  s,  t,  r );
}

void OSMesaDriver::nfglMultiTexCoord3dv(GLenum target, const GLdouble *v )
{
	D(bug("nfosmesa: glMultiTexCoord3dv"));
	fn.glMultiTexCoord3dv(  target,  v );
}

void OSMesaDriver::nfglMultiTexCoord3f(GLenum target, GLfloat s, GLfloat t, GLfloat r )
{
	D(bug("nfosmesa: glMultiTexCoord3f"));
	fn.glMultiTexCoord3f(  target,  s,  t,  r );
}

void OSMesaDriver::nfglMultiTexCoord3fv(GLenum target, const GLfloat *v )
{
	D(bug("nfosmesa: glMultiTexCoord3fv"));
	fn.glMultiTexCoord3fv(  target,  v );
}

void OSMesaDriver::nfglMultiTexCoord3i(GLenum target, GLint s, GLint t, GLint r )
{
	D(bug("nfosmesa: glMultiTexCoord3i"));
	fn.glMultiTexCoord3i(  target,  s,  t,  r );
}

void OSMesaDriver::nfglMultiTexCoord3iv(GLenum target, const GLint *v )
{
	D(bug("nfosmesa: glMultiTexCoord3iv"));
	fn.glMultiTexCoord3iv(  target,  v );
}

void OSMesaDriver::nfglMultiTexCoord3s(GLenum target, GLshort s, GLshort t, GLshort r )
{
	D(bug("nfosmesa: glMultiTexCoord3s"));
	fn.glMultiTexCoord3s(  target,  s,  t,  r );
}

void OSMesaDriver::nfglMultiTexCoord3sv(GLenum target, const GLshort *v )
{
	D(bug("nfosmesa: glMultiTexCoord3sv"));
	fn.glMultiTexCoord3sv(  target,  v );
}

void OSMesaDriver::nfglMultiTexCoord4d(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q )
{
	D(bug("nfosmesa: glMultiTexCoord4d"));
	fn.glMultiTexCoord4d(  target,  s,  t,  r,  q );
}

void OSMesaDriver::nfglMultiTexCoord4dv(GLenum target, const GLdouble *v )
{
	D(bug("nfosmesa: glMultiTexCoord4dv"));
	fn.glMultiTexCoord4dv(  target,  v );
}

void OSMesaDriver::nfglMultiTexCoord4f(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q )
{
	D(bug("nfosmesa: glMultiTexCoord4f"));
	fn.glMultiTexCoord4f(  target,  s,  t,  r,  q );
}

void OSMesaDriver::nfglMultiTexCoord4fv(GLenum target, const GLfloat *v )
{
	D(bug("nfosmesa: glMultiTexCoord4fv"));
	fn.glMultiTexCoord4fv(  target,  v );
}

void OSMesaDriver::nfglMultiTexCoord4i(GLenum target, GLint s, GLint t, GLint r, GLint q )
{
	D(bug("nfosmesa: glMultiTexCoord4i"));
	fn.glMultiTexCoord4i(  target,  s,  t,  r,  q );
}

void OSMesaDriver::nfglMultiTexCoord4iv(GLenum target, const GLint *v )
{
	D(bug("nfosmesa: glMultiTexCoord4iv"));
	fn.glMultiTexCoord4iv(  target,  v );
}

void OSMesaDriver::nfglMultiTexCoord4s(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q )
{
	D(bug("nfosmesa: glMultiTexCoord4s"));
	fn.glMultiTexCoord4s(  target,  s,  t,  r,  q );
}

void OSMesaDriver::nfglMultiTexCoord4sv(GLenum target, const GLshort *v )
{
	D(bug("nfosmesa: glMultiTexCoord4sv"));
	fn.glMultiTexCoord4sv(  target,  v );
}

void OSMesaDriver::nfglLoadTransposeMatrixd(const GLdouble m[16] )
{
	D(bug("nfosmesa: glLoadTransposeMatrixd"));
	fn.glLoadTransposeMatrixd( const GLdouble m[16] );
}

void OSMesaDriver::nfglLoadTransposeMatrixf(const GLfloat m[16] )
{
	D(bug("nfosmesa: glLoadTransposeMatrixf"));
	fn.glLoadTransposeMatrixf( const GLfloat m[16] );
}

void OSMesaDriver::nfglMultTransposeMatrixd(const GLdouble m[16] )
{
	D(bug("nfosmesa: glMultTransposeMatrixd"));
	fn.glMultTransposeMatrixd( const GLdouble m[16] );
}

void OSMesaDriver::nfglMultTransposeMatrixf(const GLfloat m[16] )
{
	D(bug("nfosmesa: glMultTransposeMatrixf"));
	fn.glMultTransposeMatrixf( const GLfloat m[16] );
}

void OSMesaDriver::nfglSampleCoverage(GLclampf value, GLboolean invert )
{
	D(bug("nfosmesa: glSampleCoverage"));
	fn.glSampleCoverage(  value,  invert );
}

void OSMesaDriver::nfglActiveTextureARB(void,GLenum texture)
{
	D(bug("nfosmesa: glActiveTextureARB"));
	fn.glActiveTextureARB( texture);
}

void OSMesaDriver::nfglClientActiveTextureARB(void,GLenum texture)
{
	D(bug("nfosmesa: glClientActiveTextureARB"));
	fn.glClientActiveTextureARB( texture);
}

void OSMesaDriver::nfglMultiTexCoord1dARB(void,GLenum target, GLdouble s)
{
	D(bug("nfosmesa: glMultiTexCoord1dARB"));
	fn.glMultiTexCoord1dARB( target,  s);
}

void OSMesaDriver::nfglMultiTexCoord1dvARB(void,GLenum target, const GLdouble *v)
{
	D(bug("nfosmesa: glMultiTexCoord1dvARB"));
	fn.glMultiTexCoord1dvARB( target,  v);
}

void OSMesaDriver::nfglMultiTexCoord1fARB(void,GLenum target, GLfloat s)
{
	D(bug("nfosmesa: glMultiTexCoord1fARB"));
	fn.glMultiTexCoord1fARB( target,  s);
}

void OSMesaDriver::nfglMultiTexCoord1fvARB(void,GLenum target, const GLfloat *v)
{
	D(bug("nfosmesa: glMultiTexCoord1fvARB"));
	fn.glMultiTexCoord1fvARB( target,  v);
}

void OSMesaDriver::nfglMultiTexCoord1iARB(void,GLenum target, GLint s)
{
	D(bug("nfosmesa: glMultiTexCoord1iARB"));
	fn.glMultiTexCoord1iARB( target,  s);
}

void OSMesaDriver::nfglMultiTexCoord1ivARB(void,GLenum target, const GLint *v)
{
	D(bug("nfosmesa: glMultiTexCoord1ivARB"));
	fn.glMultiTexCoord1ivARB( target,  v);
}

void OSMesaDriver::nfglMultiTexCoord1sARB(void,GLenum target, GLshort s)
{
	D(bug("nfosmesa: glMultiTexCoord1sARB"));
	fn.glMultiTexCoord1sARB( target,  s);
}

void OSMesaDriver::nfglMultiTexCoord1svARB(void,GLenum target, const GLshort *v)
{
	D(bug("nfosmesa: glMultiTexCoord1svARB"));
	fn.glMultiTexCoord1svARB( target,  v);
}

void OSMesaDriver::nfglMultiTexCoord2dARB(void,GLenum target, GLdouble s, GLdouble t)
{
	D(bug("nfosmesa: glMultiTexCoord2dARB"));
	fn.glMultiTexCoord2dARB( target,  s,  t);
}

void OSMesaDriver::nfglMultiTexCoord2dvARB(void,GLenum target, const GLdouble *v)
{
	D(bug("nfosmesa: glMultiTexCoord2dvARB"));
	fn.glMultiTexCoord2dvARB( target,  v);
}

void OSMesaDriver::nfglMultiTexCoord2fARB(void,GLenum target, GLfloat s, GLfloat t)
{
	D(bug("nfosmesa: glMultiTexCoord2fARB"));
	fn.glMultiTexCoord2fARB( target,  s,  t);
}

void OSMesaDriver::nfglMultiTexCoord2fvARB(void,GLenum target, const GLfloat *v)
{
	D(bug("nfosmesa: glMultiTexCoord2fvARB"));
	fn.glMultiTexCoord2fvARB( target,  v);
}

void OSMesaDriver::nfglMultiTexCoord2iARB(void,GLenum target, GLint s, GLint t)
{
	D(bug("nfosmesa: glMultiTexCoord2iARB"));
	fn.glMultiTexCoord2iARB( target,  s,  t);
}

void OSMesaDriver::nfglMultiTexCoord2ivARB(void,GLenum target, const GLint *v)
{
	D(bug("nfosmesa: glMultiTexCoord2ivARB"));
	fn.glMultiTexCoord2ivARB( target,  v);
}

void OSMesaDriver::nfglMultiTexCoord2sARB(void,GLenum target, GLshort s, GLshort t)
{
	D(bug("nfosmesa: glMultiTexCoord2sARB"));
	fn.glMultiTexCoord2sARB( target,  s,  t);
}

void OSMesaDriver::nfglMultiTexCoord2svARB(void,GLenum target, const GLshort *v)
{
	D(bug("nfosmesa: glMultiTexCoord2svARB"));
	fn.glMultiTexCoord2svARB( target,  v);
}

void OSMesaDriver::nfglMultiTexCoord3dARB(void,GLenum target, GLdouble s, GLdouble t, GLdouble r)
{
	D(bug("nfosmesa: glMultiTexCoord3dARB"));
	fn.glMultiTexCoord3dARB( target,  s,  t,  r);
}

void OSMesaDriver::nfglMultiTexCoord3dvARB(void,GLenum target, const GLdouble *v)
{
	D(bug("nfosmesa: glMultiTexCoord3dvARB"));
	fn.glMultiTexCoord3dvARB( target,  v);
}

void OSMesaDriver::nfglMultiTexCoord3fARB(void,GLenum target, GLfloat s, GLfloat t, GLfloat r)
{
	D(bug("nfosmesa: glMultiTexCoord3fARB"));
	fn.glMultiTexCoord3fARB( target,  s,  t,  r);
}

void OSMesaDriver::nfglMultiTexCoord3fvARB(void,GLenum target, const GLfloat *v)
{
	D(bug("nfosmesa: glMultiTexCoord3fvARB"));
	fn.glMultiTexCoord3fvARB( target,  v);
}

void OSMesaDriver::nfglMultiTexCoord3iARB(void,GLenum target, GLint s, GLint t, GLint r)
{
	D(bug("nfosmesa: glMultiTexCoord3iARB"));
	fn.glMultiTexCoord3iARB( target,  s,  t,  r);
}

void OSMesaDriver::nfglMultiTexCoord3ivARB(void,GLenum target, const GLint *v)
{
	D(bug("nfosmesa: glMultiTexCoord3ivARB"));
	fn.glMultiTexCoord3ivARB( target,  v);
}

void OSMesaDriver::nfglMultiTexCoord3sARB(void,GLenum target, GLshort s, GLshort t, GLshort r)
{
	D(bug("nfosmesa: glMultiTexCoord3sARB"));
	fn.glMultiTexCoord3sARB( target,  s,  t,  r);
}

void OSMesaDriver::nfglMultiTexCoord3svARB(void,GLenum target, const GLshort *v)
{
	D(bug("nfosmesa: glMultiTexCoord3svARB"));
	fn.glMultiTexCoord3svARB( target,  v);
}

void OSMesaDriver::nfglMultiTexCoord4dARB(void,GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q)
{
	D(bug("nfosmesa: glMultiTexCoord4dARB"));
	fn.glMultiTexCoord4dARB( target,  s,  t,  r,  q);
}

void OSMesaDriver::nfglMultiTexCoord4dvARB(void,GLenum target, const GLdouble *v)
{
	D(bug("nfosmesa: glMultiTexCoord4dvARB"));
	fn.glMultiTexCoord4dvARB( target,  v);
}

void OSMesaDriver::nfglMultiTexCoord4fARB(void,GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q)
{
	D(bug("nfosmesa: glMultiTexCoord4fARB"));
	fn.glMultiTexCoord4fARB( target,  s,  t,  r,  q);
}

void OSMesaDriver::nfglMultiTexCoord4fvARB(void,GLenum target, const GLfloat *v)
{
	D(bug("nfosmesa: glMultiTexCoord4fvARB"));
	fn.glMultiTexCoord4fvARB( target,  v);
}

void OSMesaDriver::nfglMultiTexCoord4iARB(void,GLenum target, GLint s, GLint t, GLint r, GLint q)
{
	D(bug("nfosmesa: glMultiTexCoord4iARB"));
	fn.glMultiTexCoord4iARB( target,  s,  t,  r,  q);
}

void OSMesaDriver::nfglMultiTexCoord4ivARB(void,GLenum target, const GLint *v)
{
	D(bug("nfosmesa: glMultiTexCoord4ivARB"));
	fn.glMultiTexCoord4ivARB( target,  v);
}

void OSMesaDriver::nfglMultiTexCoord4sARB(void,GLenum target, GLshort s, GLshort t, GLshort r, GLshort q)
{
	D(bug("nfosmesa: glMultiTexCoord4sARB"));
	fn.glMultiTexCoord4sARB( target,  s,  t,  r,  q);
}

void OSMesaDriver::nfglMultiTexCoord4svARB(void,GLenum target, const GLshort *v)
{
	D(bug("nfosmesa: glMultiTexCoord4svARB"));
	fn.glMultiTexCoord4svARB( target,  v);
}
*/

void OSMesaDriver::nfglEnableTraceMESA(GLbitfield mask )
{
	D(bug("nfosmesa: glEnableTraceMESA"));
	fn.glEnableTraceMESA(  mask );
}

void OSMesaDriver::nfglDisableTraceMESA(GLbitfield mask )
{
	D(bug("nfosmesa: glDisableTraceMESA"));
	fn.glDisableTraceMESA(  mask );
}

void OSMesaDriver::nfglNewTraceMESA(GLbitfield mask, const GLubyte * traceName )
{
	D(bug("nfosmesa: glNewTraceMESA"));
	fn.glNewTraceMESA(  mask,  traceName );
}

void OSMesaDriver::nfglEndTraceMESA(void)
{
	D(bug("nfosmesa: glEndTraceMESA"));
	fn.glEndTraceMESA(  );
}

void OSMesaDriver::nfglTraceAssertAttribMESA(GLbitfield attribMask )
{
	D(bug("nfosmesa: glTraceAssertAttribMESA"));
	fn.glTraceAssertAttribMESA(  attribMask );
}

void OSMesaDriver::nfglTraceCommentMESA(const GLubyte * comment )
{
	D(bug("nfosmesa: glTraceCommentMESA"));
	fn.glTraceCommentMESA(  comment );
}

void OSMesaDriver::nfglTraceTextureMESA(GLuint name, const GLubyte* comment )
{
	D(bug("nfosmesa: glTraceTextureMESA"));
	fn.glTraceTextureMESA(  name,  comment );
}

void OSMesaDriver::nfglTraceListMESA(GLuint name, const GLubyte* comment )
{
	D(bug("nfosmesa: glTraceListMESA"));
	fn.glTraceListMESA(  name,  comment );
}

void OSMesaDriver::nfglTracePointerMESA(GLvoid* pointer, const GLubyte* comment )
{
	D(bug("nfosmesa: glTracePointerMESA"));
	fn.glTracePointerMESA(  pointer,  comment );
}

void OSMesaDriver::nfglTracePointerRangeMESA(const GLvoid* first, const GLvoid* last, const GLubyte* comment )
{
	D(bug("nfosmesa: glTracePointerRangeMESA"));
	fn.glTracePointerRangeMESA(  first,  last,  comment );
}

void OSMesaDriver::nfglBlendEquationSeparateATI(GLenum modeRGB, GLenum modeA )
{
	D(bug("nfosmesa: glBlendEquationSeparateATI"));
	fn.glBlendEquationSeparateATI(  modeRGB,  modeA );
}

/* Functions generated: 465 */
