/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 1.3.13u-20020617-2210
 * 
 * This file is not intended to be easily readable and contains a number of 
 * coding conventions designed to improve portability and efficiency. Do not make
 * changes to this file unless you know what you are doing--modify the SWIG 
 * interface file instead. 
 * ----------------------------------------------------------------------------- */

#define SWIGPYTHON
/***********************************************************************
 * common.swg
 *
 *     This file contains generic SWIG runtime support for pointer
 *     type checking as well as a few commonly used macros to control
 *     external linkage.
 *
 * Author : David Beazley (beazley@cs.uchicago.edu)
 *
 * Copyright (c) 1999-2000, The University of Chicago
 * 
 * This file may be freely redistributed without license or fee provided
 * this copyright message remains intact.
 ************************************************************************/

#include <string.h>

#if defined(_WIN32) || defined(__WIN32__)
#       if defined(_MSC_VER)
#               if defined(STATIC_LINKED)
#                       define SWIGEXPORT(a) a
#                       define SWIGIMPORT(a) extern a
#               else
#                       define SWIGEXPORT(a) __declspec(dllexport) a
#                       define SWIGIMPORT(a) extern a
#               endif
#       else
#               if defined(__BORLANDC__)
#                       define SWIGEXPORT(a) a _export
#                       define SWIGIMPORT(a) a _export
#               else
#                       define SWIGEXPORT(a) a
#                       define SWIGIMPORT(a) a
#               endif
#       endif
#else
#       define SWIGEXPORT(a) a
#       define SWIGIMPORT(a) a
#endif

#ifdef SWIG_GLOBAL
#define SWIGRUNTIME(a) SWIGEXPORT(a)
#else
#define SWIGRUNTIME(a) static a
#endif

#ifdef __cplusplus
extern "C" {
#endif

typedef void *(*swig_converter_func)(void *);
typedef struct swig_type_info *(*swig_dycast_func)(void **);

typedef struct swig_type_info {
  const char             *name;                 
  swig_converter_func     converter;
  const char             *str;
  swig_dycast_func        dcast;
  struct swig_type_info  *next;
  struct swig_type_info  *prev;
  void                   *clientdata;	
} swig_type_info;

#ifdef SWIG_NOINCLUDE

SWIGIMPORT(swig_type_info *) SWIG_TypeRegister(swig_type_info *);
SWIGIMPORT(swig_type_info *) SWIG_TypeCheck(char *c, swig_type_info *);
SWIGIMPORT(void *)           SWIG_TypeCast(swig_type_info *, void *);
SWIGIMPORT(swig_type_info *) SWIG_TypeDynamicCast(swig_type_info *, void **);
SWIGIMPORT(swig_type_info *) SWIG_TypeQuery(const char *);
SWIGIMPORT(void)             SWIG_TypeClientData(swig_type_info *, void *);

#else

static swig_type_info *swig_type_list = 0;

/* Register a type mapping with the type-checking */
SWIGRUNTIME(swig_type_info *)
SWIG_TypeRegister(swig_type_info *ti)
{
  swig_type_info *tc, *head, *ret, *next;
  /* Check to see if this type has already been registered */
  tc = swig_type_list;
  while (tc) {
    if (strcmp(tc->name, ti->name) == 0) {
      /* Already exists in the table.  Just add additional types to the list */
      head = tc;
      next = tc->next;
      goto l1;
    }
    tc = tc->prev;
  }
  head = ti;
  next = 0;

  /* Place in list */
  ti->prev = swig_type_list;
  swig_type_list = ti;

  /* Build linked lists */
 l1:
  ret = head;
  tc = ti + 1;
  /* Patch up the rest of the links */
  while (tc->name) {
    head->next = tc;
    tc->prev = head;
    head = tc;
    tc++;
  }
  head->next = next;
  return ret;
}

/* Check the typename */
SWIGRUNTIME(swig_type_info *) 
SWIG_TypeCheck(char *c, swig_type_info *ty)
{
  swig_type_info *s;
  if (!ty) return 0;        /* Void pointer */
  s = ty->next;             /* First element always just a name */
  while (s) {
    if (strcmp(s->name,c) == 0) {
      if (s == ty->next) return s;
      /* Move s to the top of the linked list */
      s->prev->next = s->next;
      if (s->next) {
	s->next->prev = s->prev;
      }
      /* Insert s as second element in the list */
      s->next = ty->next;
      if (ty->next) ty->next->prev = s;
      ty->next = s;
      return s;
    }
    s = s->next;
  }
  return 0;
}

/* Cast a pointer up an inheritance hierarchy */
SWIGRUNTIME(void *) 
SWIG_TypeCast(swig_type_info *ty, void *ptr) 
{
  if ((!ty) || (!ty->converter)) return ptr;
  return (*ty->converter)(ptr);
}

/* Dynamic pointer casting. Down an inheritance hierarchy */
SWIGRUNTIME(swig_type_info *) 
SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) 
{
  swig_type_info *lastty = ty;
  if (!ty || !ty->dcast) return ty;
  while (ty && (ty->dcast)) {
     ty = (*ty->dcast)(ptr);
     if (ty) lastty = ty;
  }
  return lastty;
}

/* Search for a swig_type_info structure */
SWIGRUNTIME(swig_type_info *)
SWIG_TypeQuery(const char *name) {
  swig_type_info *ty = swig_type_list;
  while (ty) {
    if (ty->str && (strcmp(name,ty->str) == 0)) return ty;
    if (ty->name && (strcmp(name,ty->name) == 0)) return ty;
    ty = ty->prev;
  }
  return 0;
}

/* Set the clientdata field for a type */
SWIGRUNTIME(void)
SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
  swig_type_info *tc, *equiv;
  if (ti->clientdata) return;
  ti->clientdata = clientdata;
  equiv = ti->next;
  while (equiv) {
    if (!equiv->converter) {
      tc = swig_type_list;
      while (tc) {
	if ((strcmp(tc->name, equiv->name) == 0))
	  SWIG_TypeClientData(tc,clientdata);
	tc = tc->prev;
      }
    }
    equiv = equiv->next;
  }
}
#endif

#ifdef __cplusplus
}

#endif

/***********************************************************************
 * python.swg
 *
 *     This file contains the runtime support for Python modules
 *     and includes code for managing global variables and pointer
 *     type checking.
 *
 * Author : David Beazley (beazley@cs.uchicago.edu)
 ************************************************************************/

#include <stdlib.h>
#include "Python.h"

#ifdef __cplusplus
extern "C" {
#endif

#define SWIG_PY_INT     1
#define SWIG_PY_FLOAT   2
#define SWIG_PY_STRING  3
#define SWIG_PY_POINTER 4
#define SWIG_PY_BINARY  5

/* Constant information structure */
typedef struct swig_const_info {
    int type;
    char *name;
    long lvalue;
    double dvalue;
    void   *pvalue;
    swig_type_info **ptype;
} swig_const_info;

#ifdef SWIG_NOINCLUDE

SWIGEXPORT(PyObject *)        SWIG_newvarlink();
SWIGEXPORT(void)              SWIG_addvarlink(PyObject *, char *, PyObject *(*)(void), int (*)(PyObject *));
SWIGEXPORT(int)               SWIG_ConvertPtr(PyObject *, void **, swig_type_info *, int);
SWIGEXPORT(int)               SWIG_ConvertPacked(PyObject *, void *, int sz, swig_type_info *, int);
SWIGEXPORT(char *)            SWIG_PackData(char *c, void *, int);
SWIGEXPORT(char *)            SWIG_UnpackData(char *c, void *, int);
SWIGEXPORT(PyObject *)        SWIG_NewPointerObj(void *, swig_type_info *,int own);
SWIGEXPORT(PyObject *)        SWIG_NewPackedObj(void *, int sz, swig_type_info *);
SWIGEXPORT(void)              SWIG_InstallConstants(PyObject *d, swig_const_info constants[]);
#else

/* -----------------------------------------------------------------------------
 * global variable support code.
 * ----------------------------------------------------------------------------- */

typedef struct swig_globalvar {   
  char       *name;                  /* Name of global variable */
  PyObject *(*get_attr)(void);       /* Return the current value */
  int       (*set_attr)(PyObject *); /* Set the value */
  struct swig_globalvar *next;
} swig_globalvar;

typedef struct swig_varlinkobject {
  PyObject_HEAD
  swig_globalvar *vars;
} swig_varlinkobject;

static PyObject *
swig_varlink_repr(swig_varlinkobject *v) {
  v = v;
  return PyString_FromString("<Global variables>");
}

static int
swig_varlink_print(swig_varlinkobject *v, FILE *fp, int flags) {
  swig_globalvar  *var;
  flags = flags;
  fprintf(fp,"Global variables { ");
  for (var = v->vars; var; var=var->next) {
    fprintf(fp,"%s", var->name);
    if (var->next) fprintf(fp,", ");
  }
  fprintf(fp," }\n");
  return 0;
}

static PyObject *
swig_varlink_getattr(swig_varlinkobject *v, char *n) {
  swig_globalvar *var = v->vars;
  while (var) {
    if (strcmp(var->name,n) == 0) {
      return (*var->get_attr)();
    }
    var = var->next;
  }
  PyErr_SetString(PyExc_NameError,"Unknown C global variable");
  return NULL;
}

static int
swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) {
  swig_globalvar *var = v->vars;
  while (var) {
    if (strcmp(var->name,n) == 0) {
      return (*var->set_attr)(p);
    }
    var = var->next;
  }
  PyErr_SetString(PyExc_NameError,"Unknown C global variable");
  return 1;
}

statichere PyTypeObject varlinktype = {
  PyObject_HEAD_INIT(0)              
  0,
  (char *)"swigvarlink",                      /* Type name    */
  sizeof(swig_varlinkobject),         /* Basic size   */
  0,                                  /* Itemsize     */
  0,                                  /* Deallocator  */ 
  (printfunc) swig_varlink_print,     /* Print        */
  (getattrfunc) swig_varlink_getattr, /* get attr     */
  (setattrfunc) swig_varlink_setattr, /* Set attr     */
  0,                                  /* tp_compare   */
  (reprfunc) swig_varlink_repr,       /* tp_repr      */    
  0,                                  /* tp_as_number */
  0,                                  /* tp_as_mapping*/
  0,                                  /* tp_hash      */
};

/* Create a variable linking object for use later */
SWIGRUNTIME(PyObject *)
SWIG_newvarlink(void) {
  swig_varlinkobject *result = 0;
  result = PyMem_NEW(swig_varlinkobject,1);
  varlinktype.ob_type = &PyType_Type;    /* Patch varlinktype into a PyType */
  result->ob_type = &varlinktype;
  result->vars = 0;
  result->ob_refcnt = 0;
  Py_XINCREF((PyObject *) result);
  return ((PyObject*) result);
}

SWIGRUNTIME(void)
SWIG_addvarlink(PyObject *p, char *name,
	   PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) {
  swig_varlinkobject *v;
  swig_globalvar *gv;
  v= (swig_varlinkobject *) p;
  gv = (swig_globalvar *) malloc(sizeof(swig_globalvar));
  gv->name = (char *) malloc(strlen(name)+1);
  strcpy(gv->name,name);
  gv->get_attr = get_attr;
  gv->set_attr = set_attr;
  gv->next = v->vars;
  v->vars = gv;
}

/* Pack binary data into a string */
SWIGRUNTIME(char *)
SWIG_PackData(char *c, void *ptr, int sz) {
  static char hex[17] = "0123456789abcdef";
  int i;
  unsigned char *u = (unsigned char *) ptr;
  register unsigned char uu;
  for (i = 0; i < sz; i++,u++) {
    uu = *u;
    *(c++) = hex[(uu & 0xf0) >> 4];
    *(c++) = hex[uu & 0xf];
  }
  return c;
}

/* Unpack binary data from a string */
SWIGRUNTIME(char *)
SWIG_UnpackData(char *c, void *ptr, int sz) {
  register unsigned char uu = 0;
  register int d;
  unsigned char *u = (unsigned char *) ptr;
  int i;
  for (i = 0; i < sz; i++, u++) {
    d = *(c++);
    if ((d >= '0') && (d <= '9'))
      uu = ((d - '0') << 4);
    else if ((d >= 'a') && (d <= 'f'))
      uu = ((d - ('a'-10)) << 4);
    d = *(c++);
    if ((d >= '0') && (d <= '9'))
      uu |= (d - '0');
    else if ((d >= 'a') && (d <= 'f'))
      uu |= (d - ('a'-10));
    *u = uu;
  }
  return c;
}

/* Convert a pointer value */
SWIGRUNTIME(int)
SWIG_ConvertPtr(PyObject *obj, void **ptr, swig_type_info *ty, int flags) {
  swig_type_info *tc;
  char  *c;
  static PyObject *SWIG_this = 0;
  int    newref = 0;

  if (!obj) return 0;
  if (obj == Py_None) {
    *ptr = 0;
    return 0;
  }
#ifdef SWIG_COBJECT_TYPES
  if (!(PyCObject_Check(obj))) {
    if (!SWIG_this)
      SWIG_this = PyString_InternFromString("this");
    obj = PyObject_GetAttr(obj,SWIG_this);
    newref = 1;
    if (!obj) goto type_error;
    if (!PyCObject_Check(obj)) {
      Py_DECREF(obj);
      goto type_error;
    }
  } 
  *ptr = PyCObject_AsVoidPtr(obj);
  c = (char *) PyCObject_GetDesc(obj);
  if (newref) Py_DECREF(obj);
  goto cobject;
#else
  if (!(PyString_Check(obj))) {
    if (!SWIG_this)
      SWIG_this = PyString_InternFromString("this");
    obj = PyObject_GetAttr(obj,SWIG_this);
    newref = 1;
    if (!obj) goto type_error;
    if (!PyString_Check(obj)) {
      Py_DECREF(obj);
      goto type_error;
    }
  } 
  c = PyString_AsString(obj);
  /* Pointer values must start with leading underscore */
  if (*c != '_') {
    *ptr = (void *) 0;
    if (strcmp(c,"NULL") == 0) {
      if (newref) { Py_DECREF(obj); }
      return 0;
    } else {
      if (newref) { Py_DECREF(obj); }
      goto type_error;
    }
  }
  c++;
  c = SWIG_UnpackData(c,ptr,sizeof(void *));
  if (newref) { Py_DECREF(obj); }
#endif

#ifdef SWIG_COBJECT_TYPES
cobject:
#endif

  if (ty) {
    tc = SWIG_TypeCheck(c,ty);
    if (!tc) goto type_error;
    *ptr = SWIG_TypeCast(tc,(void*) *ptr);
  }
  return 0;

type_error:
  if (flags) {
    if (ty) {
      char *temp = (char *) malloc(64+strlen(ty->name));
      sprintf(temp,"Type error. Expected %s", ty->name);
      PyErr_SetString(PyExc_TypeError, temp);
      free((char *) temp);
    } else {
      PyErr_SetString(PyExc_TypeError,"Expected a pointer");
    }
  }
  return -1;
}

/* Convert a packed value value */
SWIGRUNTIME(int)
SWIG_ConvertPacked(PyObject *obj, void *ptr, int sz, swig_type_info *ty, int flags) {
  swig_type_info *tc;
  char  *c;

  if ((!obj) || (!PyString_Check(obj))) goto type_error;
  c = PyString_AsString(obj);
  /* Pointer values must start with leading underscore */
  if (*c != '_') goto type_error;
  c++;
  c = SWIG_UnpackData(c,ptr,sz);
  if (ty) {
    tc = SWIG_TypeCheck(c,ty);
    if (!tc) goto type_error;
  }
  return 0;

type_error:

  if (flags) {
    if (ty) {
      char *temp = (char *) malloc(64+strlen(ty->name));
      sprintf(temp,"Type error. Expected %s", ty->name);
      PyErr_SetString(PyExc_TypeError, temp);
      free((char *) temp);
    } else {
      PyErr_SetString(PyExc_TypeError,"Expected a pointer");
    }
  }
  return -1;
}

/* Create a new pointer object */
SWIGRUNTIME(PyObject *)
SWIG_NewPointerObj(void *ptr, swig_type_info *type, int own) {
  PyObject *robj;
  if (!ptr) {
    Py_INCREF(Py_None);
    return Py_None;
  }
#ifdef SWIG_COBJECT_TYPES
  robj = PyCObject_FromVoidPtrAndDesc((void *) ptr, (char *) type->name, NULL);
#else
  {
    char result[1024];
    char *r = result;
    *(r++) = '_';
    r = SWIG_PackData(r,&ptr,sizeof(void *));
    strcpy(r,type->name);
    robj = PyString_FromString(result);
  }
#endif
  if (!robj || (robj == Py_None)) return robj;
  if (type->clientdata) {
    PyObject *inst;
    PyObject *args = Py_BuildValue((char*)"(O)", robj);
    Py_DECREF(robj);
    inst = PyObject_CallObject((PyObject *) type->clientdata, args);
    Py_DECREF(args);
    if (own) {
      PyObject *n = PyInt_FromLong(1);
      PyObject_SetAttrString(inst,(char*)"thisown",n);
      Py_DECREF(n);
    }
    robj = inst;
  }
  return robj;
}

SWIGRUNTIME(PyObject *)
SWIG_NewPackedObj(void *ptr, int sz, swig_type_info *type) {
  char result[1024];
  char *r = result;
  if ((2*sz + 1 + strlen(type->name)) > 1000) return 0;
  *(r++) = '_';
  r = SWIG_PackData(r,ptr,sz);
  strcpy(r,type->name);
  return PyString_FromString(result);
}

/* Install Constants */
SWIGRUNTIME(void)
SWIG_InstallConstants(PyObject *d, swig_const_info constants[]) {
  int i;
  PyObject *obj;
  for (i = 0; constants[i].type; i++) {
    switch(constants[i].type) {
    case SWIG_PY_INT:
      obj = PyInt_FromLong(constants[i].lvalue);
      break;
    case SWIG_PY_FLOAT:
      obj = PyFloat_FromDouble(constants[i].dvalue);
      break;
    case SWIG_PY_STRING:
      obj = PyString_FromString((char *) constants[i].pvalue);
      break;
    case SWIG_PY_POINTER:
      obj = SWIG_NewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0);
      break;
    case SWIG_PY_BINARY:
      obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype));
      break;
    default:
      obj = 0;
      break;
    }
    if (obj) {
      PyDict_SetItemString(d,constants[i].name,obj);
      Py_DECREF(obj);
    }
  }
}

#endif

#ifdef __cplusplus
}
#endif








/* -------- TYPES TABLE (BEGIN) -------- */

static swig_type_info *swig_types[1];

/* -------- TYPES TABLE (END) -------- */


/*-----------------------------------------------
              @(target):= GLU__init___.so
  ------------------------------------------------*/
#define SWIG_init    initGLU__init___

#define SWIG_name    "GLU__init___"

/**
 *
 * GLU Module for PyOpenGL
 * 
 * Date: May 2001
 *
 * Authors: Tarn Weisner Burton <twburton@users.sourceforge.net>
 * 
***/

/* License from SGI's OpenGLŪ Sample Implementation */

/*
# License Applicability. Except to the extent portions of this file are
# made subject to an alternative license as permitted in the SGI Free
# Software License B, Version 1.1 (the "License"), the contents of this
# file are subject only to the provisions of the License. You may not use
# this file except in compliance with the License. You may obtain a copy
# of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
# Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
#
# http://oss.sgi.com/projects/FreeB
#
# Note that, as provided in the License, the Software is distributed on an
# "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
# DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
# CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
# PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
#
# Original Code. The Original Code is: OpenGL Sample Implementation,
# Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
# Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
# Copyright in any portions created by third parties is as indicated
# elsewhere herein. All Rights Reserved.
#
# Additional Notice Provisions: The application programming interfaces
# established by SGI in conjunction with the Original Code are The
# OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
# April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
# 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
# Window System(R) (Version 1.3), released October 19, 1998. This software
# was created using the OpenGL(R) version 1.2.1 Sample Implementation
# published by SGI, but has not been independently verified as being
# compliant with the OpenGL(R) version 1.2.1 Specification.
*/



int __PyObject_AsArray_Size(PyObject* x);

#ifdef NUMERIC

#define _PyObject_AsArray_Size(x) ((x == Py_None) ? 0 : ((PyArray_Check(x)) ? PyArray_Size(x) : __PyObject_AsArray_Size(x)))

#else /* NUMERIC */

#define _PyObject_AsArray_Size(x) ((x == Py_None) ? 0 : __PyObject_AsArray_Size(x))

#endif /* NUMERIC */


#define _PyObject_As(NAME, BASE) BASE* _PyObject_As##NAME(PyObject* source, PyObject** temp, int* len);

#define _PyObject_AsArray_Cleanup(target, temp) if (temp) Py_XDECREF(temp); else PyMem_Del(target)

_PyObject_As(FloatArray, float)

_PyObject_As(DoubleArray, double)

_PyObject_As(CharArray, signed char)

_PyObject_As(UnsignedCharArray, unsigned char)

_PyObject_As(ShortArray, short)

_PyObject_As(UnsignedShortArray, unsigned short)

_PyObject_As(IntArray, int)

_PyObject_As(UnsignedIntArray, unsigned int)

void* _PyObject_AsArray(GLenum type, PyObject* source, PyObject** temp, int* len);




#define PyErr_XPrint() if (PyErr_Occurred()) PyErr_Print()


#if HAS_DYNAMIC_EXT

#define DECLARE_EXT(PROC_NAME, RET, ERROR_RET, PROTO, CALL)\
RET PROC_NAME PROTO\
{\
	typedef RET (APIENTRY *proc_##PROC_NAME) PROTO;\
	proc_##PROC_NAME proc = (proc_##PROC_NAME)GL_GetProcAddress(#PROC_NAME);\
	if (proc) return proc CALL;\
	PyErr_SetGLErrorMessage( GL_INVALID_OPERATION, "Dynamic function loading not implemented/supported on this platform" );\
	return ERROR_RET;\
}

#define DECLARE_VOID_EXT(PROC_NAME, PROTO, CALL)\
void PROC_NAME PROTO\
{\
	typedef void (APIENTRY *proc_##PROC_NAME) PROTO;\
	proc_##PROC_NAME proc = (proc_##PROC_NAME)GL_GetProcAddress(#PROC_NAME);\
	if (proc) proc CALL;\
	else {\
		PyErr_SetGLErrorMessage( GL_INVALID_OPERATION, "Dynamic function loading not implemented/supported on this platform" );\
	}\
}

#else

#define DECLARE_EXT(PROC_NAME, RET, ERROR_RET, PROTO, CALL)\
RET PROC_NAME PROTO\
{\
	PyErr_SetGLErrorMessage( GL_INVALID_OPERATION, "Dynamic function loading not implemented/supported on this platform" );\
	return ERROR_RET;\
}


#define DECLARE_VOID_EXT(PROC_NAME, PROTO, CALL)\
void PROC_NAME PROTO\
{\
	PyErr_SetGLErrorMessage( GL_INVALID_OPERATION, "Dynamic function loading not implemented/supported on this platform" );\
}

#endif


#define _PyTuple_From(NAME, BASE) PyObject* _PyTuple_From##NAME(int len, BASE* data);

_PyTuple_From(UnsignedCharArray, unsigned char)

_PyTuple_From(CharArray, signed char)

_PyTuple_From(UnsignedShortArray, unsigned short)

_PyTuple_From(ShortArray, short)

_PyTuple_From(UnsignedIntArray, unsigned int)

_PyTuple_From(IntArray, int)

_PyTuple_From(FloatArray, float)

_PyTuple_From(DoubleArray, double)


#define _PyObject_From(NAME, BASE) PyObject* _PyObject_From##NAME(int nd, int* dims, BASE* data, int own);

_PyObject_From(UnsignedCharArray, unsigned char)

_PyObject_From(CharArray, signed char)

_PyObject_From(UnsignedShortArray, unsigned short)

_PyObject_From(ShortArray, short)

_PyObject_From(UnsignedIntArray, unsigned int)

_PyObject_From(IntArray, int)

_PyObject_From(FloatArray, float)

_PyObject_From(DoubleArray, double)


PyObject* _PyObject_FromArray(GLenum type, int nd, int *dims, void* data, int own);

void* SetupPixelRead(int rank, GLenum format, GLenum type, int *dims);

void SetupPixelWrite(int rank);

void* SetupRawPixelRead(GLenum format, GLenum type, int n, const int *dims, int* size);

void* _PyObject_AsPointer(PyObject* x);

/* The following line causes a warning on linux and cygwin

	The function is defined in interface_utils.c, which is
	linked to each extension module.  For some reason, though,
	this declaration doesn't get recognised as a declaration
	prototype for that function.
*/
void init_util();

typedef void *PTR;

typedef struct
{
	void (*_decrement)(void* pointer);
	void (*_decrementPointer)(GLenum pname);
	int (*_incrementLock)(void *pointer);
	int (*_incrementPointerLock)(GLenum pname);
	void (*_acquire)(void* pointer);
	void (*_acquirePointer)(GLenum pname);
#if HAS_DYNAMIC_EXT
	PTR (*GL_GetProcAddress)(const char* name);
#endif
	int (*InitExtension)(const char *name, const char** procs);
	PyObject *_GLerror;
	PyObject *_GLUerror;
}  util_API;



static util_API *_util_API = NULL;

#define decrementLock(x) (*_util_API)._decrement(x)
#define decrementPointerLock(x) (*_util_API)._decrementPointer(x)
#define incrementLock(x) (*_util_API)._incrementLock(x)
#define incrementPointerLock(x) (*_util_API)._incrementPointerLock(x)
#define acquire(x) (*_util_API)._acquire(x)
#define acquirePointer(x) (*_util_API)._acquirePointer(x)
#define GLerror (*_util_API)._GLerror
#define GLUerror (*_util_API)._GLUerror
#if HAS_DYNAMIC_EXT
#define GL_GetProcAddress(x) (*_util_API).GL_GetProcAddress(x)
#endif
#define InitExtension(x, y) (*_util_API).InitExtension(x, (const char**)y)



#define PyErr_SetGLerror(code) PyErr_SetObject(GLerror, Py_BuildValue("is", code, gluErrorString(code)));
#define PyErr_SetGLUerror(code) PyErr_SetObject(GLUerror, Py_BuildValue("is", code, gluErrorString(code)));

int _PyObject_Dimension(PyObject* x, int rank);

#define ERROR_MSG_SEP ", "
#define ERROR_MSG_SEP_LEN 2

int GLErrOccurred()
{
	if (PyErr_Occurred()) return 1;

	if (CurrentContextIsValid())
	{
		GLenum error, *errors = NULL;
		char *msg = NULL;
		const char *this_msg;
		int count = 0;
	
		error = glGetError();

		while (error != GL_NO_ERROR)
		{
			this_msg = gluErrorString(error);
			if (count)
			{
				msg = realloc(msg, (strlen(msg) + strlen(this_msg) + ERROR_MSG_SEP_LEN + 1)*sizeof(char));
				strcat(msg, ERROR_MSG_SEP);
				strcat(msg, this_msg);
				
				errors = realloc(errors, (count + 1)*sizeof(GLenum));
			}
			else
			{
				msg = malloc((strlen(this_msg) + 1)*sizeof(char));
				strcpy(msg, this_msg);
				
				errors = malloc(sizeof(GLenum));
			}
			
			errors[count++] = error;
			error = glGetError();
		}
		
		if (count)
		{
			PyErr_SetObject(GLerror, Py_BuildValue("Os", _PyTuple_FromIntArray(count, (int*)errors), msg));
			free(errors);
			free(msg);
			return 1;
		}
	}

	return 0;
}

void PyErr_SetGLErrorMessage( int id, char * message ) {
	/* set a GLerror with an ID and string message
	
	This tries pretty hard to look just like a regular
	error as produced by GLErrOccurred()'s formatter,
	save that there's only the single error being reported.

	Using id 0 is probably best for any future use where 
	there isn't a good match for the exception description
	in the error-enumeration set.
	 */
	PyObject * args = NULL;
	args = Py_BuildValue( "(i)s", id, message );
	if (args) {
		PyErr_SetObject( GLerror, args );
		Py_XDECREF( args );
	} else {
		PyErr_SetGLerror(id);
	}
}




void __ignoreDeletionCall(PyObject * tess ) {
}


typedef void (CALLBACK *callback)();

 static char _doc_gluErrorString[] = "gluErrorString(errCode) -> string"; 
 static char _doc_gluGetString[] = "gluGetString(name) -> string"; 
 static char _doc_gluCheckExtension[] = "gluCheckExtension(extName, extString) -> bool"; 
 static char _doc_gluOrtho2D[] = "gluOrtho2D(left, right, bottom, top) -> None"; 
 static char _doc_gluPerspective[] = "gluPerspective(fovy, aspect, zNear, zFar) -> None"; 

void __gluPickMatrix(GLdouble x, GLdouble y, GLdouble width, GLdouble height, const GLint *viewport)
{
	GLint _viewport[4];

	if (!viewport)
	{
		glGetIntegerv(GL_VIEWPORT, _viewport);
		viewport = _viewport;
	}
	
	gluPickMatrix(x, y, width, height, (GLint*)viewport);
}

 static char _doc_gluLookAt[] = "gluLookAt(eyex, eyey, eyez, centerx, centery, centerz, upx, upy, upz) -> None"; 

PyObject* __gluProject(GLdouble objx, GLdouble objy, GLdouble objz, const GLdouble *modelMatrix, const GLdouble *projMatrix, const GLint *viewport)
{
	GLdouble win[3], _modelMatrix[16], _projMatrix[16];
	GLint _viewport[4];

	if (!modelMatrix)
	{
		glGetDoublev(GL_MODELVIEW_MATRIX, _modelMatrix);
		modelMatrix = _modelMatrix;
	}
	
	if (!projMatrix)
	{
		glGetDoublev(GL_PROJECTION_MATRIX, _projMatrix);
		projMatrix = _projMatrix;
	}
	
	if (!viewport)
	{
		glGetIntegerv(GL_VIEWPORT, _viewport);
		viewport = _viewport;
	}

	if (gluProject(objx, objy, objz, modelMatrix, projMatrix, viewport, win, win + 1, win + 2))
	{
		return _PyTuple_FromDoubleArray(3, win);
	}
	PyErr_SetGLUerror( GL_INVALID_VALUE );
	return NULL;
}


PyObject* __gluUnProject(GLdouble winx, GLdouble winy, GLdouble winz, const GLdouble *modelMatrix, const GLdouble *projMatrix, const GLint *viewport)
{
	GLdouble obj[3], _modelMatrix[16], _projMatrix[16];
	GLint _viewport[4];

	if (!modelMatrix)
	{
		glGetDoublev(GL_MODELVIEW_MATRIX, _modelMatrix);
		modelMatrix = _modelMatrix;
	}
	
	if (!projMatrix)
	{
		glGetDoublev(GL_PROJECTION_MATRIX, _projMatrix);
		projMatrix = _projMatrix;
	}
	
	if (!viewport)
	{
		glGetIntegerv(GL_VIEWPORT, _viewport);
		viewport = _viewport;
	}

	if (gluUnProject(winx, winy, winz, modelMatrix, projMatrix, viewport, obj, obj + 1, obj + 2))
	{
		return _PyTuple_FromDoubleArray(3, obj);
	}
	
	Py_INCREF(Py_None);
	return Py_None;
}


PyObject* __gluUnProject4(GLdouble winx, GLdouble winy, GLdouble winz, GLdouble clipW, const GLdouble *modelMatrix, const GLdouble *projMatrix, const GLint *viewport, GLclampd near, GLclampd far)
{
	GLdouble obj[4], _modelMatrix[16], _projMatrix[16];
	GLint _viewport[4];

	if (!modelMatrix)
	{
		glGetDoublev(GL_MODELVIEW_MATRIX, _modelMatrix);
		modelMatrix = _modelMatrix;
	}
	
	if (!projMatrix)
	{
		glGetDoublev(GL_PROJECTION_MATRIX, _projMatrix);
		projMatrix = _projMatrix;
	}
	
	if (!viewport)
	{
		glGetIntegerv(GL_VIEWPORT, _viewport);
		viewport = _viewport;
	}

	if (gluUnProject4(winx, winy, winz, clipW, modelMatrix, projMatrix, viewport, near, far, obj, obj + 1, obj + 2, obj + 3))
	{
		return _PyTuple_FromDoubleArray(4, obj);
	}
	
	Py_INCREF(Py_None);
	return Py_None;
}


PyObject* _gluScaleImage(GLenum format, GLint widthin, GLint heightin, GLenum typein, const void *datain, GLint widthout,
                  GLint heightout, GLenum typeout)
{
	PyObject* result;
	int code, dims[2];
	int size;
	void* dataout;
	
	dims[0] = widthout;
	dims[1] = heightout;
	
	dataout = SetupRawPixelRead(format, typeout, 2, dims, &size);
	if (!dataout) return NULL;

	code = gluScaleImage(format, widthin, heightin, typein, datain, widthout, heightout, typeout, dataout);

	if (code)
	{
		PyMem_Del(dataout);
		PyErr_SetGLUerror(code);
		return NULL;
	}
	
	result = PyString_FromStringAndSize((const char*)dataout, size);
	PyMem_Del(dataout);

	return result;
}

PyObject* __gluScaleImage(GLenum format, GLint widthin, GLint heightin, GLenum type, const void *datain, GLint widthout, GLint heightout)
{
	int dims[3], code;
	void *dataout;

	SetupPixelWrite(2);

	dims[0] = widthout;
	dims[1] = heightout;
	
	dataout = SetupPixelRead(2, format, type, dims);
	if (!dataout) return NULL;
	
	code = gluScaleImage(format, widthin, heightin, type, datain, widthout, heightout, type, dataout);

	if (code)
	{
		PyMem_Del(dataout);
		PyErr_SetGLUerror(code);
		return NULL;
	}
	
	return _PyObject_FromArray(type, (dims[2] == 1) ? 2 : 3, dims, dataout, 1);
}

 static char _doc_gluScaleImage[] = "gluScaleImage(format, widthin, heightin, typein, datain, widthout, heightout, typeout) -> dataout"; 
 static char _doc_gluScaleImageb[] = "gluScaleImageb(format, datain, widthout, heightout) -> dataout"; 
 static char _doc_gluScaleImageub[] = "gluScaleImageub(format, datain, widthout, heightout) -> dataout"; 
 static char _doc_gluScaleImages[] = "gluScaleImages(format, datain, widthout, heightout) -> dataout"; 
 static char _doc_gluScaleImageus[] = "gluScaleImageus(format, datain, widthout, heightout) -> dataout"; 
 static char _doc_gluScaleImagei[] = "gluScaleImagei(format, datain, widthout, heightout) -> dataout"; 
 static char _doc_gluScaleImageui[] = "gluScaleImageui(format, datain, widthout, heightout) -> dataout"; 
 static char _doc_gluScaleImagef[] = "gluScaleImagef(format, datain, widthout, heightout) -> dataout"; 

PyObject* _gluBuild1DMipmaps(GLenum target, GLint components, GLint width, GLenum format, GLenum type, const void *buffer)
{
	int code;

	code = gluBuild1DMipmaps(target, components, width, format, type, buffer);
	
	if (code)
	{
		PyErr_SetGLUerror(code);
		return NULL;
	}
	
	Py_INCREF(Py_None);
	return Py_None;
}

 static char _doc_gluBuild1DMipmaps[] = "gluBuild1DMipmaps(target, components, width, format, type, data) -> None"; 

PyObject *__gluBuild1DMipmaps(GLenum target, GLint components, GLint width, GLenum format, GLenum type, const void *buffer)
{
	int code;

	SetupPixelWrite(1);
	code = gluBuild1DMipmaps(target, components, width, format, type, buffer);
	
	if (code)
	{
		PyErr_SetGLUerror(code);
		return NULL;
	}
	
	Py_INCREF(Py_None);
	return Py_None;
}

 static char _doc_gluBuild1DMipmapsb[] = "gluBuild1DMipmapsb(target, components, format, pixels) -> None"; 
 static char _doc_gluBuild1DMipmapsub[] = "gluBuild1DMipmapsub(target, components, format, pixels) -> None"; 
 static char _doc_gluBuild1DMipmapss[] = "gluBuild1DMipmapss(target, components, format, pixels) -> None"; 
 static char _doc_gluBuild1DMipmapsus[] = "gluBuild1DMipmapsus(target, components, format, pixels) -> None"; 
 static char _doc_gluBuild1DMipmapsi[] = "gluBuild1DMipmapsi(target, components, format, pixels) -> None"; 
 static char _doc_gluBuild1DMipmapsui[] = "gluBuild1DMipmapsui(target, components, format, pixels) -> None"; 
 static char _doc_gluBuild1DMipmapsf[] = "gluBuild1DMipmapsf(target, components, format, pixels) -> None"; 

PyObject* _gluBuild2DMipmaps(GLenum target, GLint components, GLint width, GLint height, GLenum format, GLenum type, const void *buffer)
{
	int code;
	
	code = gluBuild2DMipmaps(target, components, width, height, format, type, buffer);
	
	if (code)
	{
		PyErr_SetGLUerror(code);
		return NULL;
	}
	
	Py_INCREF(Py_None);
	return Py_None;
}

 static char _doc_gluBuild2DMipmaps[] = "gluBuild2DMipmaps(target, components, width, height, format, type, data) -> None"; 

PyObject *__gluBuild2DMipmaps(GLenum target, GLint components, GLint width, GLint height, GLenum format, GLenum type, const void *buffer)
{
	int code;

	SetupPixelWrite(2);
	code = gluBuild2DMipmaps(target, components, width, height, format, type, buffer);
	
	if (code)
	{
		PyErr_SetGLUerror(code);
		return NULL;
	}
	
	Py_INCREF(Py_None);
	return Py_None;
}

 static char _doc_gluBuild2DMipmapsb[] = "gluBuild2DMipmapsb(target, components, format, pixels) -> None"; 
 static char _doc_gluBuild2DMipmapsub[] = "gluBuild2DMipmapsub(target, components, format, pixels) -> None"; 
 static char _doc_gluBuild2DMipmapss[] = "gluBuild2DMipmapss(target, components, format, pixels) -> None"; 
 static char _doc_gluBuild2DMipmapsus[] = "gluBuild2DMipmapsus(target, components, format, pixels) -> None"; 
 static char _doc_gluBuild2DMipmapsi[] = "gluBuild2DMipmapsi(target, components, format, pixels) -> None"; 
 static char _doc_gluBuild2DMipmapsui[] = "gluBuild2DMipmapsui(target, components, format, pixels) -> None"; 
 static char _doc_gluBuild2DMipmapsf[] = "gluBuild2DMipmapsf(target, components, format, pixels) -> None"; 

PyObject* _gluBuild3DMipmaps(GLenum target, GLint components, GLint width, GLint height, GLint depth, GLenum format, GLenum type, const void *buffer)
{
	int code;
	
	code = gluBuild3DMipmaps(target, components, width, height, depth, format, type, buffer);
	
	if (code)
	{
		PyErr_SetGLUerror(code);
		return NULL;
	}
	
	Py_INCREF(Py_None);
	return Py_None;
}

 static char _doc_gluBuild3DMipmaps[] = "gluBuild3DMipmaps(target, components, width, height, depth, format, type, data) -> None"; 

PyObject *__gluBuild3DMipmaps(GLenum target, GLint components, GLint width, GLint height, GLint depth, GLenum format, GLenum type, const void *buffer)
{
	int code;

	SetupPixelWrite(2);
	code = gluBuild3DMipmaps(target, components, width, height, depth, format, type, buffer);
	
	if (code)
	{
		PyErr_SetGLUerror(code);
		return NULL;
	}
	
	Py_INCREF(Py_None);
	return Py_None;
}

 static char _doc_gluBuild3DMipmapsb[] = "gluBuild3DMipmapsb(target, components, format, pixels) -> None"; 
 static char _doc_gluBuild3DMipmapsub[] = "gluBuild3DMipmapsub(target, components, format, pixels) -> None"; 
 static char _doc_gluBuild3DMipmapss[] = "gluBuild3DMipmapss(target, components, format, pixels) -> None"; 
 static char _doc_gluBuild3DMipmapsus[] = "gluBuild3DMipmapsus(target, components, format, pixels) -> None"; 
 static char _doc_gluBuild3DMipmapsi[] = "gluBuild3DMipmapsi(target, components, format, pixels) -> None"; 
 static char _doc_gluBuild3DMipmapsui[] = "gluBuild3DMipmapsui(target, components, format, pixels) -> None"; 
 static char _doc_gluBuild3DMipmapsf[] = "gluBuild3DMipmapsf(target, components, format, pixels) -> None"; 

PyObject* _gluBuild1DMipmapLevels(GLenum target, GLint components, GLint width, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *buffer)
{
	int code;

	code = gluBuild1DMipmapLevels(target, components, width, format, type, level, base, max, buffer);
	
	if (code)
	{
		PyErr_SetGLUerror(code);
		return NULL;
	}
	
	Py_INCREF(Py_None);
	return Py_None;
}

 static char _doc_gluBuild1DMipmapLevels[] = "gluBuild1DMipmapLevels(target, components, width, format, type, level, base, max, data) -> None"; 

PyObject *__gluBuild1DMipmapLevels(GLenum target, GLint components, GLint width, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *buffer)
{
	int code;

	SetupPixelWrite(1);
	code = gluBuild1DMipmapLevels(target, components, width, format, type, level, base, max, buffer);
	
	if (code)
	{
		PyErr_SetGLUerror(code);
		return NULL;
	}
	
	Py_INCREF(Py_None);
	return Py_None;
}

 static char _doc_gluBuild1DMipmapLevelsb[] = "gluBuild1DMipmapLevelsb(target, components, format, level, base, max, pixels) -> None"; 
 static char _doc_gluBuild1DMipmapLevelsub[] = "gluBuild1DMipmapLevelsub(target, components, format, level, base, max, pixels) -> None"; 
 static char _doc_gluBuild1DMipmapLevelss[] = "gluBuild1DMipmapLevelss(target, components, format, level, base, max, pixels) -> None"; 
 static char _doc_gluBuild1DMipmapLevelsus[] = "gluBuild1DMipmapLevelsus(target, components, format, level, base, max, pixels) -> None"; 
 static char _doc_gluBuild1DMipmapLevelsi[] = "gluBuild1DMipmapLevelsi(target, components, format, level, base, max, pixels) -> None"; 
 static char _doc_gluBuild1DMipmapLevelsui[] = "gluBuild1DMipmapLevelsui(target, components, format, level, base, max, pixels) -> None"; 
 static char _doc_gluBuild1DMipmapLevelsf[] = "gluBuild1DMipmapLevelsf(target, components, format, level, base, max, pixels) -> None"; 

PyObject* _gluBuild2DMipmapLevels(GLenum target, GLint components, GLint width, GLint height, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *buffer)
{
	int code;
	
	code = gluBuild2DMipmapLevels(target, components, width, height, format, type, level, base, max, buffer);
	
	if (code)
	{
		PyErr_SetGLUerror(code);
		return NULL;
	}
	
	Py_INCREF(Py_None);
	return Py_None;
}

 static char _doc_gluBuild2DMipmapLevels[] = "gluBuild2DMipmapLevels(target, components, width, height, format, type, level, base, max, data) -> None"; 

PyObject *__gluBuild2DMipmapLevels(GLenum target, GLint components, GLint width, GLint height, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *buffer)
{
	int code;

	SetupPixelWrite(2);
	code = gluBuild2DMipmapLevels(target, components, width, height, format, type, level, base, max, buffer);
	
	if (code)
	{
		PyErr_SetGLUerror(code);
		return NULL;
	}
	
	Py_INCREF(Py_None);
	return Py_None;
}

 static char _doc_gluBuild2DMipmapLevelsb[] = "gluBuild2DMipmapLevelsb(target, components, format, level, base, max, pixels) -> None"; 
 static char _doc_gluBuild2DMipmapLevelsub[] = "gluBuild2DMipmapLevelsub(target, components, format, level, base, max, pixels) -> None"; 
 static char _doc_gluBuild2DMipmapLevelss[] = "gluBuild2DMipmapLevelss(target, components, format, level, base, max, pixels) -> None"; 
 static char _doc_gluBuild2DMipmapLevelsus[] = "gluBuild2DMipmapLevelsus(target, components, format, level, base, max, pixels) -> None"; 
 static char _doc_gluBuild2DMipmapLevelsi[] = "gluBuild2DMipmapLevelsi(target, components, format, level, base, max, pixels) -> None"; 
 static char _doc_gluBuild2DMipmapLevelsui[] = "gluBuild2DMipmapLevelsui(target, components, format, level, base, max, pixels) -> None"; 
 static char _doc_gluBuild2DMipmapLevelsf[] = "gluBuild2DMipmapLevelsf(target, components, format, level, base, max, pixels) -> None"; 

PyObject* _gluBuild3DMipmapLevels(GLenum target, GLint components, GLint width, GLint height, GLint depth, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *buffer)
{
	int code;
	
	code = gluBuild3DMipmapLevels(target, components, width, height, depth, format, type, level, base, max, buffer);
	
	if (code)
	{
		PyErr_SetGLUerror(code);
		return NULL;
	}
	
	Py_INCREF(Py_None);
	return Py_None;
}

 static char _doc_gluBuild3DMipmapLevels[] = "gluBuild3DMipmapLevels(target, components, width, height, depth, format, type, level, base, max, data) -> None"; 

PyObject *__gluBuild3DMipmapLevels(GLenum target, GLint components, GLint width, GLint height, GLint depth, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *buffer)
{
	int code;

	SetupPixelWrite(2);
	code = gluBuild3DMipmapLevels(target, components, width, height, depth, format, type, level, base, max, buffer);
	
	if (code)
	{
		PyErr_SetGLUerror(code);
		return NULL;
	}
	
	Py_INCREF(Py_None);
	return Py_None;
}

 static char _doc_gluBuild3DMipmapLevelsb[] = "gluBuild3DMipmapLevelsb(target, components, format, level, base, max, pixels) -> None"; 
 static char _doc_gluBuild3DMipmapLevelsub[] = "gluBuild3DMipmapLevelsub(target, components, format, level, base, max, pixels) -> None"; 
 static char _doc_gluBuild3DMipmapLevelss[] = "gluBuild3DMipmapLevelss(target, components, format, level, base, max, pixels) -> None"; 
 static char _doc_gluBuild3DMipmapLevelsus[] = "gluBuild3DMipmapLevelsus(target, components, format, level, base, max, pixels) -> None"; 
 static char _doc_gluBuild3DMipmapLevelsi[] = "gluBuild3DMipmapLevelsi(target, components, format, level, base, max, pixels) -> None"; 
 static char _doc_gluBuild3DMipmapLevelsui[] = "gluBuild3DMipmapLevelsui(target, components, format, level, base, max, pixels) -> None"; 
 static char _doc_gluBuild3DMipmapLevelsf[] = "gluBuild3DMipmapLevelsf(target, components, format, level, base, max, pixels) -> None"; 

void CALLBACK throwGLUerror(GLenum code)
{
	PyErr_SetGLUerror(code);
}



typedef struct
{
	PyObject_HEAD
	GLUquadric *obj;
	PyObject *begin, *beginData, *edgeFlag, *edgeFlagData, *vertex, *vertexData;
	PyObject *end, *endData, *combine, *combineData;
} PyGLUquadric;


PyGLUquadric *currentQuadric = NULL;

static void PyGLUquadric_Del(PyObject *self)
{
	gluDeleteQuadric(((PyGLUquadric*)self)->obj);

    PyObject_Del(self);
}


PyTypeObject PyGLUquadric_Type =
{
    PyObject_HEAD_INIT(0)
    0,							/* ob_size */
    "GLUquadric",			/* tp_name */
    sizeof(PyGLUquadric),	/* tp_basicsize */
    0,							/* tp_itemsize */
    PyGLUquadric_Del,		/* tp_dealloc */
};

#define PYOBJ(x) ((x) ? (PyObject*)x : Py_None)


PyGLUquadric* _gluNewQuadric()
{
	PyGLUquadric *self = PyObject_NEW(PyGLUquadric, &PyGLUquadric_Type);
	
	if (!(self->obj = gluNewQuadric()))
	{
		PyErr_SetGLUerror(GLU_OUT_OF_MEMORY);
		return NULL;
	}
	
	gluQuadricCallback(self->obj, GLU_ERROR, throwGLUerror);

	return self;
}

PyObject* _gluQuadricCallback(PyGLUquadric* self, GLenum which, PyObject* pyfunc)
{
	PyErr_SetString(PyExc_Exception, "Can't set that callback.");
	return NULL;
}


 static char _doc_gluNewQuadric[] = "gluNewQuadric() -> GLUquadric"; 
 static char _doc_gluDeleteQuadric[] = "gluDeleteQuadric(quadObject) -> (null function, use del nobj instead)"; 
 static char _doc_gluQuadricNormals[] = "gluQuadricNormals(quadObject, normals) -> None"; 
 static char _doc_gluQuadricTexture[] = "gluQuadricTexture(quadObject, textureCoords) -> None"; 
 static char _doc_gluQuadricOrientation[] = "gluQuadricOrientation(quadObject, orientation) -> None"; 
 static char _doc_gluQuadricDrawStyle[] = "gluQuadricDrawStyle(quadObject, drawStyle) -> None"; 
 static char _doc_gluCylinder[] = "gluCylinder(qobj, baseRadius, topRadius, height, slices, stacks) -> None"; 
 static char _doc_gluDisk[] = "gluDisk(qobj, innerRadius, outerRadius, slices, loops) -> None"; 
 static char _doc_gluPartialDisk[] = "gluPartialDisk(qobj, innerRadius, outerRadius, slices, loops, startAngle, sweepAngle) -> None"; 
 static char _doc_gluSphere[] = "gluSphere(qobj, radius, slices, stacks) -> None"; 
 static char _doc_gluQuadricCallback[] = "gluQuadricCallback(qobj, which, func)"; 


#ifndef GLU_VERSION_1_2
#define GLU_TESS_BEGIN 100100
#define GLU_TESS_VERTEX 100101
#define GLU_TESS_END 100102
#define GLU_TESS_ERROR 100103
#define GLU_TESS_EDGE_FLAG 100104
#define GLU_TESS_COMBINE 100105
#define GLU_TESS_BEGIN_DATA 100106
#define GLU_TESS_VERTEX_DATA 100107
#define GLU_TESS_END_DATA 100108
#define GLU_TESS_ERROR_DATA 100109
#define GLU_TESS_EDGE_FLAG_DATA 100110
#define GLU_TESS_COMBINE_DATA 100111
#endif

typedef struct
{
	PyObject_HEAD
	GLUtesselator *obj;
	PyObject *lockedObjects;
	PyObject *callbacks;
	PyObject *currentData;
} PyGLUtesselator;


static void PyGLUtesselator_Del(PyObject *self)
{
	gluDeleteTess(((PyGLUtesselator*)self)->obj);

	Py_DECREF(((PyGLUtesselator*)self)->lockedObjects);
	Py_DECREF(((PyGLUtesselator*)self)->callbacks);
	if (((PyGLUtesselator*)self)->currentData) {
		Py_DECREF(((PyGLUtesselator*)self)->currentData);
	}

    PyObject_Del(self);
}


PyTypeObject PyGLUtesselator_Type =
{
    PyObject_HEAD_INIT(0)
    0,							/* ob_size */
    "GLUtesselator",			/* tp_name */
    sizeof(PyGLUtesselator),	/* tp_basicsize */
    0,							/* tp_itemsize */
    PyGLUtesselator_Del,		/* tp_dealloc */
};

#define PYOBJ(x) ((x) ? (PyObject*)x : Py_None)

PyObject *GetTessCallback( void * currentTessellator, char *name)
{
	if (currentTessellator) {
		PyGLUtesselator * tess = (PyGLUtesselator *) ((PyObject *) currentTessellator);
		{

			PyObject *this_callback = PyDict_GetItemString(tess->callbacks, name);
			if (this_callback != Py_None) return this_callback;
		}
	}
	return NULL;
}
PyObject *GetTessData( void * currentTessellator)
{
	if (currentTessellator) {
		PyGLUtesselator * tess = (PyGLUtesselator *) ((PyObject *) currentTessellator);
		return tess->currentData;
	}
	return NULL;
}

void CALLBACK PyGLUtesselator_begin(GLenum type, void *polygon_data)
{
	/* callback when Python code has only specified begin */
	PyObject *this_callback = GetTessCallback( polygon_data, "begin");
	if (this_callback)
	{
		PyObject *result = PyObject_CallFunction(this_callback, "l", (long)type);
		Py_XDECREF(result);
		PyErr_XPrint();
	}
}

void CALLBACK PyGLUtesselator_beginData(GLenum type, void *polygon_data)
{
	/* callback when Python code has only specified begindata */
	PyObject *this_callback = GetTessCallback( polygon_data, "beginData");
	if (this_callback)
	{
		PyObject * data = GetTessData( polygon_data );
		PyObject *result = PyObject_CallFunction(this_callback, "lO", (long)type, data);
		Py_XDECREF(result);
		PyErr_XPrint();
	}
}

void CALLBACK PyGLUtesselator_edgeFlag(GLboolean flag, void *polygon_data)
{
	PyObject *this_callback = GetTessCallback( polygon_data, "edgeFlag");
	if (this_callback)
	{
		PyObject *result = PyObject_CallFunction(this_callback, "l", (long)flag);
		Py_XDECREF(result);
		PyErr_XPrint();
	}
}
void CALLBACK PyGLUtesselator_edgeFlagData(GLboolean flag, void *polygon_data)
{
	PyObject *this_callback = GetTessCallback( polygon_data, "edgeFlagData");
	if (this_callback)
	{
		PyObject * data = GetTessData( polygon_data );
		PyObject *result = PyObject_CallFunction(this_callback, "lO", (long)flag, data);
		Py_XDECREF(result);
		PyErr_XPrint();
	}
}


void CALLBACK PyGLUtesselator_vertex(void *vertex_data, void *polygon_data)
{
	PyObject *this_callback = GetTessCallback( polygon_data, "vertex");
	if (this_callback)
	{
		PyObject *result = PyObject_CallFunction(this_callback, "(O)", PYOBJ(vertex_data));
		Py_XDECREF(result);
		PyErr_XPrint();
	}
}


void CALLBACK PyGLUtesselator_vertexData(void *vertex_data, void *polygon_data)
{
	PyObject *this_callback = GetTessCallback( polygon_data, "vertexData");
	if (this_callback)
	{
		PyObject * data = GetTessData( polygon_data );
		PyObject *result = PyObject_CallFunction(this_callback, "OO", PYOBJ(vertex_data), data);
		Py_XDECREF(result);
		PyErr_XPrint();
	}
}


void CALLBACK PyGLUtesselator_end(void *polygon_data)
{
	PyObject *this_callback = GetTessCallback( polygon_data, "end");
	if (this_callback)
	{
		PyObject *result = PyObject_CallFunction(this_callback, NULL);
		Py_XDECREF(result);
		PyErr_XPrint();
	}
}


void CALLBACK PyGLUtesselator_endData(void *polygon_data)
{
	PyObject *this_callback = GetTessCallback( polygon_data, "endData");
	if (this_callback)
	{
		PyObject * data = GetTessData( polygon_data );
		PyObject *result = PyObject_CallFunction(this_callback, "(O)", data);
		Py_XDECREF(result);
		PyErr_XPrint();
	}
}


void CALLBACK PyGLUtesselator_combine(GLdouble coords[3], void *vertex_data[4], GLfloat weight[4], void **outData, void *polygon_data)
{
	PyObject *this_callback = GetTessCallback( polygon_data, "combine");
	if (this_callback)
	{
		PyObject *result = NULL;
		result = PyObject_CallFunction(this_callback,
		            	"(ddd)(OOOO)(ffff)",
		                                         coords[0], coords[1], coords[2],
		                                         PYOBJ(vertex_data[0]), PYOBJ(vertex_data[1]), PYOBJ(vertex_data[2]), PYOBJ(vertex_data[3]),
		                                         weight[0], weight[1], weight[2], weight[3]);

		if (result)
		{
			PyList_Append(
				((PyGLUtesselator *) ((PyObject *) polygon_data))->lockedObjects,
				result
			);
			*outData = (void*)result;
			Py_DECREF(result);
		}
		
		PyErr_XPrint();
	}
}


void CALLBACK PyGLUtesselator_combineData(GLdouble coords[3], void *vertex_data[4], GLfloat weight[4], void **outData, void *polygon_data)
{
	PyObject *this_callback = GetTessCallback( polygon_data, "combineData");
	if (this_callback)
	{
		PyObject * data = GetTessData( polygon_data );
		PyObject *result = PyObject_CallFunction(this_callback,
		            	"(ddd)(OOOO)(ffff)O",
		                                         coords[0], coords[1], coords[2],
		                                         PYOBJ(vertex_data[0]), PYOBJ(vertex_data[1]), PYOBJ(vertex_data[2]), PYOBJ(vertex_data[3]),
		                                         weight[0], weight[1], weight[2], weight[3],
		                                         data);
		if (result)
		{
			PyList_Append(
				((PyGLUtesselator *) ((PyObject *) polygon_data))->lockedObjects,
				result
			);
			*outData = (void*)result;
			Py_DECREF(result);
		}

		PyErr_XPrint();
	}
}


void CALLBACK tess_throwGLUerror(GLenum code, void *polygon_data)
{
	PyErr_SetObject(GLUerror, Py_BuildValue("isO", code, gluErrorString(code), PYOBJ(polygon_data)));
}


PyGLUtesselator* _gluNewTess()
{
	PyGLUtesselator *self = PyObject_NEW(PyGLUtesselator, &PyGLUtesselator_Type);
	
	if (!(self->obj = gluNewTess()))
	{
		PyErr_SetGLUerror(GLU_OUT_OF_MEMORY);
		return NULL;
	}
	
	gluTessCallback(self->obj, GLU_TESS_ERROR_DATA, tess_throwGLUerror);

	self->lockedObjects = PyList_New(0);
	self->callbacks = PyDict_New();
	self->currentData = Py_None;
	Py_INCREF( self->currentData );

	return self;
}

#define SET_TESS_CALLBACK(NAME,TYPE)\
PyDict_SetItemString(self->callbacks, #NAME, pyfunc);\
gluTessCallback(self->obj, TYPE, (pyfunc == Py_None) ? NULL : (callback)PyGLUtesselator_##NAME);

PyObject* _gluTessCallback(PyGLUtesselator* self, GLenum which, PyObject* pyfunc)
{
	switch (which)
	{
	case GLU_TESS_BEGIN:
		SET_TESS_CALLBACK(begin,GLU_TESS_BEGIN_DATA)
		break;
	case GLU_TESS_BEGIN_DATA:
		SET_TESS_CALLBACK(beginData,GLU_TESS_BEGIN_DATA)
		break;
	case GLU_TESS_EDGE_FLAG:
		SET_TESS_CALLBACK(edgeFlag,GLU_TESS_EDGE_FLAG_DATA)
		break;
	case GLU_TESS_EDGE_FLAG_DATA:
		SET_TESS_CALLBACK(edgeFlagData,GLU_TESS_EDGE_FLAG_DATA)
		break;
	case GLU_TESS_VERTEX:
		SET_TESS_CALLBACK(vertex,GLU_TESS_VERTEX_DATA)
		break;
	case GLU_TESS_VERTEX_DATA:
		SET_TESS_CALLBACK(vertexData,GLU_TESS_VERTEX_DATA)
		break;
	case GLU_TESS_END:
		SET_TESS_CALLBACK(end,GLU_TESS_END_DATA)
		break;
	case GLU_TESS_END_DATA:
		SET_TESS_CALLBACK(endData,GLU_TESS_END_DATA)
		break;
	case GLU_TESS_COMBINE:
		SET_TESS_CALLBACK(combine,GLU_TESS_COMBINE_DATA)
		break;
	case GLU_TESS_COMBINE_DATA:
		SET_TESS_CALLBACK(combineData,GLU_TESS_COMBINE_DATA)
		break;
	case GLU_TESS_ERROR:
	case GLU_TESS_ERROR_DATA:
		PyErr_SetString(PyExc_Exception, "Can't set that callback.");
		return NULL;
	default:
		PyErr_SetString(PyExc_Exception, "Unknown callback code.");
		return NULL;
	}
	
	Py_INCREF(Py_None);
	return Py_None;
}


 static char _doc_gluNewTess[] = "gluNewTess() -> GLUtesselator"; 
 static char _doc_gluDeleteTess[] = "gluDeleteTess(tess) -> (null function, use del tess instead)"; 

void _gluTessBeginPolygon(PyGLUtesselator *self, PyObject *polygon_data)
{
	PyList_Append(self->lockedObjects, polygon_data);
	if (self->currentData) {
		Py_DECREF( self->currentData);
	}
	self->currentData = polygon_data;
	Py_INCREF( polygon_data );
	gluTessBeginPolygon(self->obj, (void*)self);
}

 static char _doc_gluTessBeginPolygon[] = "gluTessBeginPolygon(tess, polygon_data) -> None"; 
 static char _doc_gluBeginPolygon[] = "gluBeginPolygon(tess) -> None"; 
 static char _doc_gluTessBeginContour[] = "gluTessBeginContour(tess) -> None"; 

void _gluTessVertex(PyGLUtesselator *self, const GLdouble *coords, PyObject *data)
{
	PyList_Append(self->lockedObjects, data);
	gluTessVertex(self->obj, (GLdouble*)coords, (void*)data);
}

 static char _doc_gluTessVertex[] = "gluTessVertex(tess, coords, data) -> None"; 
 static char _doc_gluTessEndContour[] = "gluTessEndContour(tess) -> None"; 
 static char _doc_gluNextContour[] = "gluNextContour(tess, type) -> None"; 

void _gluTessEndPolygon(PyGLUtesselator *self)
{
	gluTessEndPolygon(self->obj);
	PySequence_DelSlice(self->lockedObjects, 0, -1);
}

 static char _doc_gluTessEndPolygon[] = "gluTessEndPolygon(tess) -> None"; 
 static char _doc_gluEndPolygon[] = "gluEndPolygon(tess) -> None"; 
 static char _doc_gluTessProperty[] = "gluTessProperty(tess, which, value) -> None"; 
 static char _doc_gluTessNormal[] = "gluTessNormal(tess, x, y, z) -> None"; 
 static char _doc_gluTessCallback[] = "gluTessCallback(tess, which, pyfunc) -> None\n\
\n\
The error callbacks GLU_TESS_ERROR and GLU_TESS_ERROR_BEGIN cannot be set by\n\
gluTessCallback, instead an exception is thrown when an error occurs with the\n\
exception value set to a tuple (errno, polygon_data)"; 
 static char _doc_gluGetTessProperty[] = "gluGetTessProperty(tess, which) -> value"; 


#ifndef GLU_VERSION_1_3
#define GLU_NURBS_MODE             100160

#define GLU_NURBS_TESSELLATOR      100161
#define GLU_NURBS_RENDERER         100162

#define GLU_NURBS_BEGIN	               100164
#define GLU_NURBS_VERTEX                   100165
#define GLU_NURBS_NORMAL                   100166
#define GLU_NURBS_COLOR                    100167
#define GLU_NURBS_TEXTURE_COORD            100168
#define GLU_NURBS_END                      100169

#define GLU_NURBS_BEGIN_DATA	       100170
#define GLU_NURBS_VERTEX_DATA              100171
#define GLU_NURBS_NORMAL_DATA              100172
#define GLU_NURBS_COLOR_DATA               100173
#define GLU_NURBS_TEXTURE_COORD_DATA       100174
#define GLU_NURBS_END_DATA                 100175
#endif

typedef struct
{
	PyObject_HEAD
	GLUnurbs *obj;
	PyObject *data;
	PyObject *callbacks;
} PyGLUnurbs;


PyGLUnurbs *currentNurbs = NULL;

static void PyGLUnurbs_Del(PyObject *self)
{
	gluDeleteNurbsRenderer(((PyGLUnurbs*)self)->obj);

	Py_DECREF(((PyGLUnurbs*)self)->data);
	Py_DECREF(((PyGLUtesselator*)self)->callbacks);

    PyObject_Del(self);
}


PyTypeObject PyGLUnurbs_Type =
{
    PyObject_HEAD_INIT(0)
    0,							/* ob_size */
    "GLUnurbs",			/* tp_name */
    sizeof(PyGLUnurbs),	/* tp_basicsize */
    0,							/* tp_itemsize */
    PyGLUnurbs_Del,		/* tp_dealloc */
};

#define PYOBJ(x) ((x) ? (PyObject*)x : Py_None)

PyObject *GetNurbsCallback(char *name)
{
	if (currentNurbs)
	{
		PyObject *this_callback = PyDict_GetItemString(currentNurbs->callbacks, name);
		if (this_callback != Py_None) return this_callback;
	}
	return NULL;
}

PyGLUnurbs* _gluNewNurbsRenderer()
{
	PyGLUnurbs *self = PyObject_NEW(PyGLUnurbs, &PyGLUnurbs_Type);
	
	if (!(self->obj = gluNewNurbsRenderer()))
	{
		PyErr_SetGLUerror(GLU_OUT_OF_MEMORY);
		return NULL;
	}
	
	gluNurbsCallback(self->obj, GLU_ERROR, throwGLUerror);
	Py_INCREF(self->data = Py_None);
	self->callbacks = PyDict_New();

	return self;
}

void CALLBACK PyGLUnurbs_begin(GLenum type)
{
	PyObject *this_callback = GetNurbsCallback("begin");
	if (this_callback)
	{
		PyObject *result = PyObject_CallFunction(this_callback, "l", (long)type);
		Py_XDECREF(result);
		PyErr_XPrint();
	}
}


void CALLBACK PyGLUnurbs_beginData(GLenum type, void *userData)
{
	PyObject *this_callback = GetNurbsCallback("beginData");
	if (this_callback)
	{
		PyObject *result = PyObject_CallFunction(this_callback, "lO", (long)type, PYOBJ(userData));
		Py_XDECREF(result);
		PyErr_XPrint();
	}
}


void CALLBACK PyGLUnurbs_vertex(GLfloat *vertex)
{
	PyObject *this_callback = GetNurbsCallback("vertex");
	if (this_callback)
	{
		PyObject *result = PyObject_CallFunction(this_callback, "(fff)", vertex[0], vertex[1], vertex[2]);
		Py_XDECREF(result);
		PyErr_XPrint();
	}
}


void CALLBACK PyGLUnurbs_vertexData(GLfloat *vertex, void *userData)
{
	PyObject *this_callback = GetNurbsCallback("vertexData");
	if (this_callback)
	{
		PyObject *result = PyObject_CallFunction(this_callback, "(fff)O", vertex[0], vertex[1], vertex[2], PYOBJ(userData));
		Py_XDECREF(result);
		PyErr_XPrint();
	}
}


void CALLBACK PyGLUnurbs_normal(GLfloat *normal)
{
	PyObject *this_callback = GetNurbsCallback("normal");
	if (this_callback)
	{
		PyObject *result = PyObject_CallFunction(this_callback, "(fff)", normal[0], normal[1], normal[2]);
		Py_XDECREF(result);
		PyErr_XPrint();
	}
}


void CALLBACK PyGLUnurbs_normalData(GLfloat *normal, void *userData)
{
	PyObject *this_callback = GetNurbsCallback("normalData");
	if (this_callback)
	{
		PyObject *result = PyObject_CallFunction(this_callback, "(fff)O", normal[0], normal[1], normal[2], PYOBJ(userData));
		Py_XDECREF(result);
		PyErr_XPrint();
	}
}


void CALLBACK PyGLUnurbs_color(GLfloat *color)
{
	PyObject *this_callback = GetNurbsCallback("color");
	if (this_callback)
	{
		PyObject *result = PyObject_CallFunction(this_callback, "(ffff)", color[0], color[1], color[2], color[3]);
		Py_XDECREF(result);
		PyErr_XPrint();
	}
}


void CALLBACK PyGLUnurbs_colorData(GLfloat *color, void *userData)
{
	PyObject *this_callback = GetNurbsCallback("colorData");
	if (this_callback)
	{
		PyObject *result = PyObject_CallFunction(this_callback, "(ffff)O", color[0], color[1], color[2], color[3], PYOBJ(userData));
		Py_XDECREF(result);
		PyErr_XPrint();
	}
}


void CALLBACK PyGLUnurbs_texCoord(GLfloat *texCoord)
{
	PyObject *this_callback = GetNurbsCallback("texCoord");
	if (this_callback)
	{
		PyObject *result = NULL;
		
		if (glIsEnabled(GL_MAP1_TEXTURE_COORD_1) || glIsEnabled(GL_MAP2_TEXTURE_COORD_1))
		{
			result = PyObject_CallFunction(this_callback, "((f))", texCoord[0]);
		}
		else if (glIsEnabled(GL_MAP1_TEXTURE_COORD_2) || glIsEnabled(GL_MAP2_TEXTURE_COORD_2))
		{
			result = PyObject_CallFunction(this_callback, "(ff)", texCoord[0], texCoord[1]);
		}
		else if (glIsEnabled(GL_MAP1_TEXTURE_COORD_3) || glIsEnabled(GL_MAP2_TEXTURE_COORD_3))
		{
			result = PyObject_CallFunction(this_callback, "(fff)", texCoord[0], texCoord[1], texCoord[2]);
		}
		else if (glIsEnabled(GL_MAP1_TEXTURE_COORD_4) || glIsEnabled(GL_MAP2_TEXTURE_COORD_4))
		{
			result = PyObject_CallFunction(this_callback, "(ffff)", texCoord[0], texCoord[1], texCoord[2], texCoord[3]);
		}
		
		Py_XDECREF(result);
		PyErr_XPrint();
	}
}


void CALLBACK PyGLUnurbs_texCoordData(GLfloat *texCoord, void *userData)
{
	PyObject *this_callback = GetNurbsCallback("texCoordData");
	if (this_callback)
	{
		PyObject *result = NULL;
		
		if (glIsEnabled(GL_MAP1_TEXTURE_COORD_1) || glIsEnabled(GL_MAP2_TEXTURE_COORD_1))
		{
			result = PyObject_CallFunction(this_callback, "(f)O", texCoord[0], PYOBJ(userData));
		}
		else if (glIsEnabled(GL_MAP1_TEXTURE_COORD_2) || glIsEnabled(GL_MAP2_TEXTURE_COORD_2))
		{
			result = PyObject_CallFunction(this_callback, "(ff)O", texCoord[0], texCoord[1], PYOBJ(userData));
		}
		else if (glIsEnabled(GL_MAP1_TEXTURE_COORD_3) || glIsEnabled(GL_MAP2_TEXTURE_COORD_3))
		{
			result = PyObject_CallFunction(this_callback, "(fff)O", texCoord[0], texCoord[1], texCoord[2], PYOBJ(userData));
		}
		else if (glIsEnabled(GL_MAP1_TEXTURE_COORD_4) || glIsEnabled(GL_MAP2_TEXTURE_COORD_4))
		{
			result = PyObject_CallFunction(this_callback, "(ffff)O", texCoord[0], texCoord[1], texCoord[2], texCoord[3], PYOBJ(userData));
		}
		
		Py_XDECREF(result);
		PyErr_XPrint();
	}
}


void CALLBACK PyGLUnurbs_end()
{
	PyObject *this_callback = GetNurbsCallback("end");
	if (this_callback)
	{
		PyObject *result = PyObject_CallFunction(this_callback, NULL);
		Py_XDECREF(result);
		PyErr_XPrint();
	}
}


void CALLBACK PyGLUnurbs_endData(void *userData)
{
	PyObject *this_callback = GetNurbsCallback("endData");
	if (this_callback)
	{
		PyObject *result = PyObject_CallFunction(this_callback, "O", PYOBJ(userData));
		Py_XDECREF(result);
		PyErr_XPrint();
	}
}


#define SET_NURBS_CALLBACK(NAME)\
PyDict_SetItemString(self->callbacks, #NAME, pyfunc);\
gluNurbsCallback(self->obj, which, (pyfunc == Py_None) ? NULL : (callback)PyGLUnurbs_##NAME);

PyObject* _gluNurbsCallback(PyGLUnurbs* self, GLenum which, PyObject* pyfunc)
{
	switch (which)
	{
	case GLU_NURBS_BEGIN:
		SET_NURBS_CALLBACK(begin)
		break;
	case GLU_NURBS_BEGIN_DATA:
		SET_NURBS_CALLBACK(beginData)
		break;
	case GLU_NURBS_VERTEX:
		SET_NURBS_CALLBACK(vertex)
		break;
	case GLU_NURBS_VERTEX_DATA:
		SET_NURBS_CALLBACK(vertexData)
		break;
	case GLU_NURBS_NORMAL:
		SET_NURBS_CALLBACK(normal)
		break;
	case GLU_NURBS_NORMAL_DATA:
		SET_NURBS_CALLBACK(normalData)
		break;
	case GLU_NURBS_COLOR:
		SET_NURBS_CALLBACK(color)
		break;
	case GLU_NURBS_COLOR_DATA:
		SET_NURBS_CALLBACK(colorData)
		break;
	case GLU_NURBS_TEXTURE_COORD:
		SET_NURBS_CALLBACK(texCoord)
		break;
	case GLU_NURBS_TEXTURE_COORD_DATA:
		SET_NURBS_CALLBACK(texCoordData)
		break;
	case GLU_NURBS_END:
		SET_NURBS_CALLBACK(end)
		break;
	case GLU_NURBS_END_DATA:
		SET_NURBS_CALLBACK(endData)
		break;
	case GLU_ERROR:
		PyErr_SetString(PyExc_Exception, "Can't set that callback.");
		return NULL;
	default:
		PyErr_SetString(PyExc_Exception, "Unknown callback code.");
		return NULL;
	}
	
	Py_INCREF(Py_None);
	return Py_None;
}


 static char _doc_gluNewNurbsRenderer[] = "gluNewNurbsRenderer() -> GLUnurbs"; 
 static char _doc_gluDeleteNurbsRenderer[] = "gluDeleteNurbsRenderer(nobj) -> None (null function, use del nobj instead)"; 
 static char _doc_gluBeginSurface[] = "gluBeginSurface(nobj) -> None"; 
 static char _doc_gluBeginCurve[] = "gluBeginCurve(nobj) -> None"; 
 static char _doc_gluEndCurve[] = "gluEndCurve(nobj) -> None"; 
 static char _doc_gluEndSurface[] = "gluEndSurface(nobj) -> None"; 
 static char _doc_gluBeginTrim[] = "gluBeginTrim(nobj) -> None"; 
 static char _doc_gluEndTrim[] = "gluEndTrim(nobj) -> None"; 

#define _gluPwlCurve(nobj, count, array, stride, type) \
gluPwlCurve(nobj, count, (GLfloat*)array, stride, type)

 static char _doc_gluPwlCurve[] = "gluPwlCurve(nobj, array, type) -> None"; 

#define _gluNurbsCurve(nobj, n_2, knot, d_5_0, d_5_1, ctlarray, type) \
gluNurbsCurve(nobj, n_2, (GLfloat*)knot, d_5_1, (GLfloat*)ctlarray, n_2 - d_5_0, type)

 static char _doc_gluNurbsCurve[] = "gluNurbsCurve(nobj, knot, ctlarray, type) -> None"; 

#define _gluNurbsSurface(nobj, sknot_len, sknot, tknot_len, tknot, d_0, d_1, d_2, ctlarray, type)\
gluNurbsSurface(\
	nobj, sknot_len, (GLfloat*)sknot, tknot_len, (GLfloat*)tknot, \
	d_1*d_2, d_2, (GLfloat*)ctlarray, sknot_len-d_0, tknot_len-d_1, type \
)

 static char _doc_gluNurbsSurface[] = "gluNurbsSurface(nobj, sknot, tknot, ctlarray, type) -> None"; 
 static char _doc_gluLoadSamplingMatrices[] = "gluLoadSamplingMatrices(nobj, modelMatrix, projMatrix, viewport) -> None"; 
 static char _doc_gluNurbsProperty[] = "gluNurbsProperty(nobj, property, value) -> None"; 
 static char _doc_gluGetNurbsProperty[] = "gluGetNurbsProperty(nobj, property) -> value"; 
 static char _doc_gluNurbsCallback[] = "gluNurbsCallback(qobj, which, func)"; 

void _gluNurbsCallbackData(PyGLUnurbs *self, PyObject *data)
{
	Py_DECREF(self->data);
	Py_INCREF(self->data = data);
	gluNurbsCallbackData(self->obj, (void*)data);
}

 static char _doc_gluNurbsCallbackData[] = "gluNurbsCallbackData(nobj, data) -> None"; 

#if !EXT_DEFINES_PROTO || !defined(GLU_EXT_nurbs_tessellator)
DECLARE_VOID_EXT(gluNurbsCallbackDataEXT, \
	(GLUnurbs* theNurb, void* userData),\
	(theNurb, userData))
#endif

#define __gluNurbsCallbackDataEXT(nobj, data) gluNurbsCallbackDataEXT(nobj, (void*)data)

 static char _doc___gluNurbsCallbackDataEXT[] = "gluNurbsCallbackDataEXT(nobj, data) -> None"; 

static char *proc_names[] =
{
#if !EXT_DEFINES_PROTO || !defined(GLU_EXT_nurbs_tessellator)
	"gluNurbsCallbackDataEXT",
#endif
	NULL
};

#define __gluInitNurbsTessellatorEXT() InitExtension("GLU_EXT_nurbs_tessellator", proc_names)

 static char _doc___gluInitNurbsTessellatorEXT[] = "gluInitNurbsTessellatorEXT() -> bool"; 
#ifdef __cplusplus
extern "C" {
#endif
static PyObject *_wrap_gluErrorString(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLubyte *result;
    PyObject * obj0  = 0 ;
    
    if(!PyArg_ParseTuple(args,(char *)"O:gluErrorString",&obj0)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    {
        result = (GLubyte *)gluErrorString(arg1);
        if (GLErrOccurred()) return NULL; 
    }
    {
        if (result) 
        {
            resultobj= PyString_FromString(result); 
        }
        else 
        {
            Py_INCREF(resultobj = Py_None);
        }
    }
    return resultobj;
}


static PyObject *_wrap_gluGetString(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLubyte *result;
    PyObject * obj0  = 0 ;
    
    if(!PyArg_ParseTuple(args,(char *)"O:gluGetString",&obj0)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    {
        result = (GLubyte *)gluGetString(arg1);
        if (GLErrOccurred()) return NULL; 
    }
    {
        if (result) 
        {
            resultobj= PyString_FromString(result); 
        }
        else 
        {
            Py_INCREF(resultobj = Py_None);
        }
    }
    return resultobj;
}


static PyObject *_wrap_gluCheckExtension(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    char *arg1 ;
    char *arg2 ;
    GLboolean result;
    
    if(!PyArg_ParseTuple(args,(char *)"ss:gluCheckExtension",&arg1,&arg2)) return NULL;
    {
        result = (GLboolean)gluCheckExtension((char const *)arg1,(char const *)arg2);
        if (GLErrOccurred()) return NULL; 
    }
    resultobj = PyInt_FromLong((long)result);
    return resultobj;
}


static PyObject *_wrap_gluOrtho2D(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLdouble arg1 ;
    GLdouble arg2 ;
    GLdouble arg3 ;
    GLdouble arg4 ;
    
    if(!PyArg_ParseTuple(args,(char *)"dddd:gluOrtho2D",&arg1,&arg2,&arg3,&arg4)) return NULL;
    {
        gluOrtho2D(arg1,arg2,arg3,arg4);
        if (GLErrOccurred()) return NULL; 
    }
    Py_INCREF(Py_None); resultobj = Py_None;
    return resultobj;
}


static PyObject *_wrap_gluPerspective(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLdouble arg1 ;
    GLdouble arg2 ;
    GLdouble arg3 ;
    GLdouble arg4 ;
    
    if(!PyArg_ParseTuple(args,(char *)"dddd:gluPerspective",&arg1,&arg2,&arg3,&arg4)) return NULL;
    {
        gluPerspective(arg1,arg2,arg3,arg4);
        if (GLErrOccurred()) return NULL; 
    }
    Py_INCREF(Py_None); resultobj = Py_None;
    return resultobj;
}


static PyObject *_wrap___gluPickMatrix(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLdouble arg1 ;
    GLdouble arg2 ;
    GLdouble arg3 ;
    GLdouble arg4 ;
    GLint *arg5 ;
    PyObject *temp_5 ;
    PyObject * obj4  = 0 ;
    
    if(!PyArg_ParseTuple(args,(char *)"ddddO:__gluPickMatrix",&arg1,&arg2,&arg3,&arg4,&obj4)) return NULL;
    {
        arg5 = _PyObject_AsIntArray(obj4, &temp_5, NULL); 
    }
    {
        __gluPickMatrix(arg1,arg2,arg3,arg4,(GLint const *)arg5);
        if (GLErrOccurred()) return NULL; 
    }
    Py_INCREF(Py_None); resultobj = Py_None;
    {
        _PyObject_AsArray_Cleanup(arg5, temp_5); 
    }
    return resultobj;
}


static PyObject *_wrap_gluLookAt(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLdouble arg1 ;
    GLdouble arg2 ;
    GLdouble arg3 ;
    GLdouble arg4 ;
    GLdouble arg5 ;
    GLdouble arg6 ;
    GLdouble arg7 ;
    GLdouble arg8 ;
    GLdouble arg9 ;
    
    if(!PyArg_ParseTuple(args,(char *)"ddddddddd:gluLookAt",&arg1,&arg2,&arg3,&arg4,&arg5,&arg6,&arg7,&arg8,&arg9)) return NULL;
    {
        gluLookAt(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9);
        if (GLErrOccurred()) return NULL; 
    }
    Py_INCREF(Py_None); resultobj = Py_None;
    return resultobj;
}


static PyObject *_wrap___gluProject(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLdouble arg1 ;
    GLdouble arg2 ;
    GLdouble arg3 ;
    GLdouble *arg4 ;
    GLdouble *arg5 ;
    GLint *arg6 ;
    PyObject *result;
    PyObject *temp_4 ;
    PyObject *temp_5 ;
    PyObject *temp_6 ;
    PyObject * obj3  = 0 ;
    PyObject * obj4  = 0 ;
    PyObject * obj5  = 0 ;
    
    if(!PyArg_ParseTuple(args,(char *)"dddOOO:__gluProject",&arg1,&arg2,&arg3,&obj3,&obj4,&obj5)) return NULL;
    {
        arg4 = _PyObject_AsDoubleArray(obj3, &temp_4, NULL); 
    }
    {
        arg5 = _PyObject_AsDoubleArray(obj4, &temp_5, NULL); 
    }
    {
        arg6 = _PyObject_AsIntArray(obj5, &temp_6, NULL); 
    }
    {
        result = (PyObject *)__gluProject(arg1,arg2,arg3,(GLdouble const *)arg4,(GLdouble const *)arg5,(GLint const *)arg6);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    {
        _PyObject_AsArray_Cleanup(arg4, temp_4); 
    }
    {
        _PyObject_AsArray_Cleanup(arg5, temp_5); 
    }
    {
        _PyObject_AsArray_Cleanup(arg6, temp_6); 
    }
    return resultobj;
}


static PyObject *_wrap___gluUnProject(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLdouble arg1 ;
    GLdouble arg2 ;
    GLdouble arg3 ;
    GLdouble *arg4 ;
    GLdouble *arg5 ;
    GLint *arg6 ;
    PyObject *result;
    PyObject *temp_4 ;
    PyObject *temp_5 ;
    PyObject *temp_6 ;
    PyObject * obj3  = 0 ;
    PyObject * obj4  = 0 ;
    PyObject * obj5  = 0 ;
    
    if(!PyArg_ParseTuple(args,(char *)"dddOOO:__gluUnProject",&arg1,&arg2,&arg3,&obj3,&obj4,&obj5)) return NULL;
    {
        arg4 = _PyObject_AsDoubleArray(obj3, &temp_4, NULL); 
    }
    {
        arg5 = _PyObject_AsDoubleArray(obj4, &temp_5, NULL); 
    }
    {
        arg6 = _PyObject_AsIntArray(obj5, &temp_6, NULL); 
    }
    {
        result = (PyObject *)__gluUnProject(arg1,arg2,arg3,(GLdouble const *)arg4,(GLdouble const *)arg5,(GLint const *)arg6);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    {
        _PyObject_AsArray_Cleanup(arg4, temp_4); 
    }
    {
        _PyObject_AsArray_Cleanup(arg5, temp_5); 
    }
    {
        _PyObject_AsArray_Cleanup(arg6, temp_6); 
    }
    return resultobj;
}


static PyObject *_wrap___gluUnProject4(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLdouble arg1 ;
    GLdouble arg2 ;
    GLdouble arg3 ;
    GLdouble arg4 ;
    GLdouble *arg5 ;
    GLdouble *arg6 ;
    GLint *arg7 ;
    GLclampd arg8 ;
    GLclampd arg9 ;
    PyObject *result;
    PyObject *temp_5 ;
    PyObject *temp_6 ;
    PyObject *temp_7 ;
    PyObject * obj4  = 0 ;
    PyObject * obj5  = 0 ;
    PyObject * obj6  = 0 ;
    
    if(!PyArg_ParseTuple(args,(char *)"ddddOOOdd:__gluUnProject4",&arg1,&arg2,&arg3,&arg4,&obj4,&obj5,&obj6,&arg8,&arg9)) return NULL;
    {
        arg5 = _PyObject_AsDoubleArray(obj4, &temp_5, NULL); 
    }
    {
        arg6 = _PyObject_AsDoubleArray(obj5, &temp_6, NULL); 
    }
    {
        arg7 = _PyObject_AsIntArray(obj6, &temp_7, NULL); 
    }
    {
        result = (PyObject *)__gluUnProject4(arg1,arg2,arg3,arg4,(GLdouble const *)arg5,(GLdouble const *)arg6,(GLint const *)arg7,arg8,arg9);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    {
        _PyObject_AsArray_Cleanup(arg5, temp_5); 
    }
    {
        _PyObject_AsArray_Cleanup(arg6, temp_6); 
    }
    {
        _PyObject_AsArray_Cleanup(arg7, temp_7); 
    }
    return resultobj;
}


static PyObject *_wrap_gluScaleImage(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLenum arg4 ;
    PyObject *arg5 ;
    GLint arg6 ;
    GLint arg7 ;
    GLenum arg8 ;
    PyObject *result;
    PyObject * obj0  = 0 ;
    PyObject * obj3  = 0 ;
    PyObject * obj4  = 0 ;
    PyObject * obj7  = 0 ;
    
    if(!PyArg_ParseTuple(args,(char *)"OiiOOiiO:gluScaleImage",&obj0,&arg2,&arg3,&obj3,&obj4,&arg6,&arg7,&obj7)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg4 = (GLenum) PyInt_AsLong(obj3);
    if (PyErr_Occurred()) return NULL;
    {
        arg5 = obj4;
    }
    arg8 = (GLenum) PyInt_AsLong(obj7);
    if (PyErr_Occurred()) return NULL;
    {
        result = (PyObject *)_gluScaleImage(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    return resultobj;
}


static PyObject *_wrap_gluScaleImageb(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLenum arg4 ;
    GLbyte *arg5 ;
    GLint arg6 ;
    GLint arg7 ;
    PyObject *result;
    PyObject *temp_5 ;
    PyObject * obj0  = 0 ;
    PyObject * obj1  = 0 ;
    
    {
    }
    {
    }
    {
        arg4 = GL_BYTE;
    }
    if(!PyArg_ParseTuple(args,(char *)"OOii:gluScaleImageb",&obj0,&obj1,&arg6,&arg7)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    {
        arg5 = _PyObject_AsCharArray(obj1, &temp_5, NULL); 
    }
    {
        arg2 = (GLint)_PyObject_Dimension(obj1, 1); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj1, 0); 
    }
    {
        result = (PyObject *)__gluScaleImage(arg1,arg2,arg3,arg4,(GLbyte const *)arg5,arg6,arg7);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    {
        _PyObject_AsArray_Cleanup(arg5, temp_5); 
    }
    return resultobj;
}


static PyObject *_wrap_gluScaleImageub(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLenum arg4 ;
    GLubyte *arg5 ;
    GLint arg6 ;
    GLint arg7 ;
    PyObject *result;
    PyObject *temp_5 ;
    PyObject * obj0  = 0 ;
    PyObject * obj1  = 0 ;
    
    {
    }
    {
    }
    {
        arg4 = GL_UNSIGNED_BYTE;
    }
    if(!PyArg_ParseTuple(args,(char *)"OOii:gluScaleImageub",&obj0,&obj1,&arg6,&arg7)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    {
        arg5 = _PyObject_AsUnsignedCharArray(obj1, &temp_5, NULL); 
    }
    {
        arg2 = (GLint)_PyObject_Dimension(obj1, 1); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj1, 0); 
    }
    {
        result = (PyObject *)__gluScaleImage(arg1,arg2,arg3,arg4,(GLubyte const *)arg5,arg6,arg7);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    {
        _PyObject_AsArray_Cleanup(arg5, temp_5); 
    }
    return resultobj;
}


static PyObject *_wrap_gluScaleImages(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLenum arg4 ;
    GLshort *arg5 ;
    GLint arg6 ;
    GLint arg7 ;
    PyObject *result;
    PyObject *temp_5 ;
    PyObject * obj0  = 0 ;
    PyObject * obj1  = 0 ;
    
    {
    }
    {
    }
    {
        arg4 = GL_SHORT;
    }
    if(!PyArg_ParseTuple(args,(char *)"OOii:gluScaleImages",&obj0,&obj1,&arg6,&arg7)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    {
        arg5 = _PyObject_AsShortArray(obj1, &temp_5, NULL); 
    }
    {
        arg2 = (GLint)_PyObject_Dimension(obj1, 1); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj1, 0); 
    }
    {
        result = (PyObject *)__gluScaleImage(arg1,arg2,arg3,arg4,(GLshort const *)arg5,arg6,arg7);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    {
        _PyObject_AsArray_Cleanup(arg5, temp_5); 
    }
    return resultobj;
}


static PyObject *_wrap_gluScaleImageus(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLenum arg4 ;
    GLushort *arg5 ;
    GLint arg6 ;
    GLint arg7 ;
    PyObject *result;
    PyObject *temp_5 ;
    PyObject * obj0  = 0 ;
    PyObject * obj1  = 0 ;
    
    {
    }
    {
    }
    {
        arg4 = GL_UNSIGNED_SHORT;
    }
    if(!PyArg_ParseTuple(args,(char *)"OOii:gluScaleImageus",&obj0,&obj1,&arg6,&arg7)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    {
        arg5 = _PyObject_AsUnsignedShortArray(obj1, &temp_5, NULL); 
    }
    {
        arg2 = (GLint)_PyObject_Dimension(obj1, 1); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj1, 0); 
    }
    {
        result = (PyObject *)__gluScaleImage(arg1,arg2,arg3,arg4,(GLushort const *)arg5,arg6,arg7);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    {
        _PyObject_AsArray_Cleanup(arg5, temp_5); 
    }
    return resultobj;
}


static PyObject *_wrap_gluScaleImagei(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLenum arg4 ;
    GLint *arg5 ;
    GLint arg6 ;
    GLint arg7 ;
    PyObject *result;
    PyObject *temp_5 ;
    PyObject * obj0  = 0 ;
    PyObject * obj1  = 0 ;
    
    {
    }
    {
    }
    {
        arg4 = GL_INT;
    }
    if(!PyArg_ParseTuple(args,(char *)"OOii:gluScaleImagei",&obj0,&obj1,&arg6,&arg7)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    {
        arg5 = _PyObject_AsIntArray(obj1, &temp_5, NULL); 
    }
    {
        arg2 = (GLint)_PyObject_Dimension(obj1, 1); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj1, 0); 
    }
    {
        result = (PyObject *)__gluScaleImage(arg1,arg2,arg3,arg4,(GLint const *)arg5,arg6,arg7);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    {
        _PyObject_AsArray_Cleanup(arg5, temp_5); 
    }
    return resultobj;
}


static PyObject *_wrap_gluScaleImageui(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLenum arg4 ;
    GLuint *arg5 ;
    GLint arg6 ;
    GLint arg7 ;
    PyObject *result;
    PyObject *temp_5 ;
    PyObject * obj0  = 0 ;
    PyObject * obj1  = 0 ;
    
    {
    }
    {
    }
    {
        arg4 = GL_UNSIGNED_INT;
    }
    if(!PyArg_ParseTuple(args,(char *)"OOii:gluScaleImageui",&obj0,&obj1,&arg6,&arg7)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    {
        arg5 = _PyObject_AsUnsignedIntArray(obj1, &temp_5, NULL); 
    }
    {
        arg2 = (GLint)_PyObject_Dimension(obj1, 1); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj1, 0); 
    }
    {
        result = (PyObject *)__gluScaleImage(arg1,arg2,arg3,arg4,(GLuint const *)arg5,arg6,arg7);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    {
        _PyObject_AsArray_Cleanup(arg5, temp_5); 
    }
    return resultobj;
}


static PyObject *_wrap_gluScaleImagef(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLenum arg4 ;
    GLfloat *arg5 ;
    GLint arg6 ;
    GLint arg7 ;
    PyObject *result;
    PyObject *temp_5 ;
    PyObject * obj0  = 0 ;
    PyObject * obj1  = 0 ;
    
    {
    }
    {
    }
    {
        arg4 = GL_FLOAT;
    }
    if(!PyArg_ParseTuple(args,(char *)"OOii:gluScaleImagef",&obj0,&obj1,&arg6,&arg7)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    {
        arg5 = _PyObject_AsFloatArray(obj1, &temp_5, NULL); 
    }
    {
        arg2 = (GLint)_PyObject_Dimension(obj1, 1); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj1, 0); 
    }
    {
        result = (PyObject *)__gluScaleImage(arg1,arg2,arg3,arg4,(GLfloat const *)arg5,arg6,arg7);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    {
        _PyObject_AsArray_Cleanup(arg5, temp_5); 
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild1DMipmaps(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLenum arg4 ;
    GLenum arg5 ;
    void *arg6 ;
    PyObject *result;
    PyObject * obj0  = 0 ;
    PyObject * obj3  = 0 ;
    PyObject * obj4  = 0 ;
    PyObject * obj5  = 0 ;
    
    if(!PyArg_ParseTuple(args,(char *)"OiiOOO:gluBuild1DMipmaps",&obj0,&arg2,&arg3,&obj3,&obj4,&obj5)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg4 = (GLenum) PyInt_AsLong(obj3);
    if (PyErr_Occurred()) return NULL;
    arg5 = (GLenum) PyInt_AsLong(obj4);
    if (PyErr_Occurred()) return NULL;
    {
        int len;
        PyObject* str;
        if (obj5 == Py_None) 
        {
            arg6= NULL; 
        }
        else
        {
            str = PyObject_Str(obj5);
            PyString_AsStringAndSize(str, (char**)&arg6, &len);
            Py_DECREF(str);
        }
    }
    {
        result = (PyObject *)_gluBuild1DMipmaps(arg1,arg2,arg3,arg4,arg5,(void const *)arg6);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild1DMipmapsb(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLenum arg4 ;
    GLenum arg5 ;
    GLbyte *arg6 ;
    PyObject *result;
    PyObject *temp_6 ;
    PyObject * obj0  = 0 ;
    PyObject * obj2  = 0 ;
    PyObject * obj3  = 0 ;
    
    {
    }
    {
        arg5 = GL_BYTE;
    }
    if(!PyArg_ParseTuple(args,(char *)"OiOO:gluBuild1DMipmapsb",&obj0,&arg2,&obj2,&obj3)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg4 = (GLenum) PyInt_AsLong(obj2);
    if (PyErr_Occurred()) return NULL;
    {
        arg6 = _PyObject_AsCharArray(obj3, &temp_6, NULL); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj2, 0); 
    }
    {
        result = (PyObject *)__gluBuild1DMipmaps(arg1,arg2,arg3,arg4,arg5,(GLbyte const *)arg6);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    {
        _PyObject_AsArray_Cleanup(arg6, temp_6); 
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild1DMipmapsub(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLenum arg4 ;
    GLenum arg5 ;
    GLubyte *arg6 ;
    PyObject *result;
    PyObject *temp_6 ;
    PyObject * obj0  = 0 ;
    PyObject * obj2  = 0 ;
    PyObject * obj3  = 0 ;
    
    {
    }
    {
        arg5 = GL_UNSIGNED_BYTE;
    }
    if(!PyArg_ParseTuple(args,(char *)"OiOO:gluBuild1DMipmapsub",&obj0,&arg2,&obj2,&obj3)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg4 = (GLenum) PyInt_AsLong(obj2);
    if (PyErr_Occurred()) return NULL;
    {
        arg6 = _PyObject_AsUnsignedCharArray(obj3, &temp_6, NULL); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj2, 0); 
    }
    {
        result = (PyObject *)__gluBuild1DMipmaps(arg1,arg2,arg3,arg4,arg5,(GLubyte const *)arg6);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    {
        _PyObject_AsArray_Cleanup(arg6, temp_6); 
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild1DMipmapss(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLenum arg4 ;
    GLenum arg5 ;
    GLshort *arg6 ;
    PyObject *result;
    PyObject *temp_6 ;
    PyObject * obj0  = 0 ;
    PyObject * obj2  = 0 ;
    PyObject * obj3  = 0 ;
    
    {
    }
    {
        arg5 = GL_SHORT;
    }
    if(!PyArg_ParseTuple(args,(char *)"OiOO:gluBuild1DMipmapss",&obj0,&arg2,&obj2,&obj3)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg4 = (GLenum) PyInt_AsLong(obj2);
    if (PyErr_Occurred()) return NULL;
    {
        arg6 = _PyObject_AsShortArray(obj3, &temp_6, NULL); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj2, 0); 
    }
    {
        result = (PyObject *)__gluBuild1DMipmaps(arg1,arg2,arg3,arg4,arg5,(GLshort const *)arg6);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    {
        _PyObject_AsArray_Cleanup(arg6, temp_6); 
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild1DMipmapsus(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLenum arg4 ;
    GLenum arg5 ;
    GLushort *arg6 ;
    PyObject *result;
    PyObject *temp_6 ;
    PyObject * obj0  = 0 ;
    PyObject * obj2  = 0 ;
    PyObject * obj3  = 0 ;
    
    {
    }
    {
        arg5 = GL_UNSIGNED_SHORT;
    }
    if(!PyArg_ParseTuple(args,(char *)"OiOO:gluBuild1DMipmapsus",&obj0,&arg2,&obj2,&obj3)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg4 = (GLenum) PyInt_AsLong(obj2);
    if (PyErr_Occurred()) return NULL;
    {
        arg6 = _PyObject_AsUnsignedShortArray(obj3, &temp_6, NULL); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj2, 0); 
    }
    {
        result = (PyObject *)__gluBuild1DMipmaps(arg1,arg2,arg3,arg4,arg5,(GLushort const *)arg6);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    {
        _PyObject_AsArray_Cleanup(arg6, temp_6); 
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild1DMipmapsi(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLenum arg4 ;
    GLenum arg5 ;
    GLint *arg6 ;
    PyObject *result;
    PyObject *temp_6 ;
    PyObject * obj0  = 0 ;
    PyObject * obj2  = 0 ;
    PyObject * obj3  = 0 ;
    
    {
    }
    {
        arg5 = GL_INT;
    }
    if(!PyArg_ParseTuple(args,(char *)"OiOO:gluBuild1DMipmapsi",&obj0,&arg2,&obj2,&obj3)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg4 = (GLenum) PyInt_AsLong(obj2);
    if (PyErr_Occurred()) return NULL;
    {
        arg6 = _PyObject_AsIntArray(obj3, &temp_6, NULL); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj2, 0); 
    }
    {
        result = (PyObject *)__gluBuild1DMipmaps(arg1,arg2,arg3,arg4,arg5,(GLint const *)arg6);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    {
        _PyObject_AsArray_Cleanup(arg6, temp_6); 
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild1DMipmapsui(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLenum arg4 ;
    GLenum arg5 ;
    GLuint *arg6 ;
    PyObject *result;
    PyObject *temp_6 ;
    PyObject * obj0  = 0 ;
    PyObject * obj2  = 0 ;
    PyObject * obj3  = 0 ;
    
    {
    }
    {
        arg5 = GL_UNSIGNED_INT;
    }
    if(!PyArg_ParseTuple(args,(char *)"OiOO:gluBuild1DMipmapsui",&obj0,&arg2,&obj2,&obj3)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg4 = (GLenum) PyInt_AsLong(obj2);
    if (PyErr_Occurred()) return NULL;
    {
        arg6 = _PyObject_AsUnsignedIntArray(obj3, &temp_6, NULL); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj2, 0); 
    }
    {
        result = (PyObject *)__gluBuild1DMipmaps(arg1,arg2,arg3,arg4,arg5,(GLuint const *)arg6);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    {
        _PyObject_AsArray_Cleanup(arg6, temp_6); 
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild1DMipmapsf(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLenum arg4 ;
    GLenum arg5 ;
    GLshort *arg6 ;
    PyObject *result;
    PyObject *temp_6 ;
    PyObject * obj0  = 0 ;
    PyObject * obj2  = 0 ;
    PyObject * obj3  = 0 ;
    
    {
    }
    {
        arg5 = GL_FLOAT;
    }
    if(!PyArg_ParseTuple(args,(char *)"OiOO:gluBuild1DMipmapsf",&obj0,&arg2,&obj2,&obj3)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg4 = (GLenum) PyInt_AsLong(obj2);
    if (PyErr_Occurred()) return NULL;
    {
        arg6 = _PyObject_AsShortArray(obj3, &temp_6, NULL); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj2, 0); 
    }
    {
        result = (PyObject *)__gluBuild1DMipmaps(arg1,arg2,arg3,arg4,arg5,(GLshort const *)arg6);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    {
        _PyObject_AsArray_Cleanup(arg6, temp_6); 
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild2DMipmaps(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLint arg4 ;
    GLenum arg5 ;
    GLenum arg6 ;
    void *arg7 ;
    PyObject *result;
    PyObject * obj0  = 0 ;
    PyObject * obj4  = 0 ;
    PyObject * obj5  = 0 ;
    PyObject * obj6  = 0 ;
    
    if(!PyArg_ParseTuple(args,(char *)"OiiiOOO:gluBuild2DMipmaps",&obj0,&arg2,&arg3,&arg4,&obj4,&obj5,&obj6)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg5 = (GLenum) PyInt_AsLong(obj4);
    if (PyErr_Occurred()) return NULL;
    arg6 = (GLenum) PyInt_AsLong(obj5);
    if (PyErr_Occurred()) return NULL;
    {
        int len;
        PyObject* str;
        if (obj6 == Py_None) 
        {
            arg7= NULL; 
        }
        else
        {
            str = PyObject_Str(obj6);
            PyString_AsStringAndSize(str, (char**)&arg7, &len);
            Py_DECREF(str);
        }
    }
    {
        result = (PyObject *)_gluBuild2DMipmaps(arg1,arg2,arg3,arg4,arg5,arg6,(void const *)arg7);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild2DMipmapsb(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLint arg4 ;
    GLenum arg5 ;
    GLenum arg6 ;
    GLbyte *arg7 ;
    PyObject *result;
    PyObject *temp_7 ;
    PyObject * obj0  = 0 ;
    PyObject * obj2  = 0 ;
    PyObject * obj3  = 0 ;
    
    {
    }
    {
    }
    {
        arg6 = GL_BYTE;
    }
    if(!PyArg_ParseTuple(args,(char *)"OiOO:gluBuild2DMipmapsb",&obj0,&arg2,&obj2,&obj3)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg5 = (GLenum) PyInt_AsLong(obj2);
    if (PyErr_Occurred()) return NULL;
    {
        arg7 = _PyObject_AsCharArray(obj3, &temp_7, NULL); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj3, 1); 
    }
    {
        arg4 = (GLint)_PyObject_Dimension(obj3, 0); 
    }
    {
        result = (PyObject *)__gluBuild2DMipmaps(arg1,arg2,arg3,arg4,arg5,arg6,(GLbyte const *)arg7);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    {
        _PyObject_AsArray_Cleanup(arg7, temp_7); 
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild2DMipmapsub(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLint arg4 ;
    GLenum arg5 ;
    GLenum arg6 ;
    GLubyte *arg7 ;
    PyObject *result;
    PyObject *temp_7 ;
    PyObject * obj0  = 0 ;
    PyObject * obj2  = 0 ;
    PyObject * obj3  = 0 ;
    
    {
    }
    {
    }
    {
        arg6 = GL_UNSIGNED_BYTE;
    }
    if(!PyArg_ParseTuple(args,(char *)"OiOO:gluBuild2DMipmapsub",&obj0,&arg2,&obj2,&obj3)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg5 = (GLenum) PyInt_AsLong(obj2);
    if (PyErr_Occurred()) return NULL;
    {
        arg7 = _PyObject_AsUnsignedCharArray(obj3, &temp_7, NULL); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj3, 1); 
    }
    {
        arg4 = (GLint)_PyObject_Dimension(obj3, 0); 
    }
    {
        result = (PyObject *)__gluBuild2DMipmaps(arg1,arg2,arg3,arg4,arg5,arg6,(GLubyte const *)arg7);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    {
        _PyObject_AsArray_Cleanup(arg7, temp_7); 
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild2DMipmapss(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLint arg4 ;
    GLenum arg5 ;
    GLenum arg6 ;
    GLshort *arg7 ;
    PyObject *result;
    PyObject *temp_7 ;
    PyObject * obj0  = 0 ;
    PyObject * obj2  = 0 ;
    PyObject * obj3  = 0 ;
    
    {
    }
    {
    }
    {
        arg6 = GL_SHORT;
    }
    if(!PyArg_ParseTuple(args,(char *)"OiOO:gluBuild2DMipmapss",&obj0,&arg2,&obj2,&obj3)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg5 = (GLenum) PyInt_AsLong(obj2);
    if (PyErr_Occurred()) return NULL;
    {
        arg7 = _PyObject_AsShortArray(obj3, &temp_7, NULL); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj3, 1); 
    }
    {
        arg4 = (GLint)_PyObject_Dimension(obj3, 0); 
    }
    {
        result = (PyObject *)__gluBuild2DMipmaps(arg1,arg2,arg3,arg4,arg5,arg6,(GLshort const *)arg7);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    {
        _PyObject_AsArray_Cleanup(arg7, temp_7); 
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild2DMipmapsus(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLint arg4 ;
    GLenum arg5 ;
    GLenum arg6 ;
    GLushort *arg7 ;
    PyObject *result;
    PyObject *temp_7 ;
    PyObject * obj0  = 0 ;
    PyObject * obj2  = 0 ;
    PyObject * obj3  = 0 ;
    
    {
    }
    {
    }
    {
        arg6 = GL_UNSIGNED_SHORT;
    }
    if(!PyArg_ParseTuple(args,(char *)"OiOO:gluBuild2DMipmapsus",&obj0,&arg2,&obj2,&obj3)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg5 = (GLenum) PyInt_AsLong(obj2);
    if (PyErr_Occurred()) return NULL;
    {
        arg7 = _PyObject_AsUnsignedShortArray(obj3, &temp_7, NULL); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj3, 1); 
    }
    {
        arg4 = (GLint)_PyObject_Dimension(obj3, 0); 
    }
    {
        result = (PyObject *)__gluBuild2DMipmaps(arg1,arg2,arg3,arg4,arg5,arg6,(GLushort const *)arg7);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    {
        _PyObject_AsArray_Cleanup(arg7, temp_7); 
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild2DMipmapsi(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLint arg4 ;
    GLenum arg5 ;
    GLenum arg6 ;
    GLint *arg7 ;
    PyObject *result;
    PyObject *temp_7 ;
    PyObject * obj0  = 0 ;
    PyObject * obj2  = 0 ;
    PyObject * obj3  = 0 ;
    
    {
    }
    {
    }
    {
        arg6 = GL_INT;
    }
    if(!PyArg_ParseTuple(args,(char *)"OiOO:gluBuild2DMipmapsi",&obj0,&arg2,&obj2,&obj3)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg5 = (GLenum) PyInt_AsLong(obj2);
    if (PyErr_Occurred()) return NULL;
    {
        arg7 = _PyObject_AsIntArray(obj3, &temp_7, NULL); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj3, 1); 
    }
    {
        arg4 = (GLint)_PyObject_Dimension(obj3, 0); 
    }
    {
        result = (PyObject *)__gluBuild2DMipmaps(arg1,arg2,arg3,arg4,arg5,arg6,(GLint const *)arg7);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    {
        _PyObject_AsArray_Cleanup(arg7, temp_7); 
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild2DMipmapsui(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLint arg4 ;
    GLenum arg5 ;
    GLenum arg6 ;
    GLuint *arg7 ;
    PyObject *result;
    PyObject *temp_7 ;
    PyObject * obj0  = 0 ;
    PyObject * obj2  = 0 ;
    PyObject * obj3  = 0 ;
    
    {
    }
    {
    }
    {
        arg6 = GL_UNSIGNED_INT;
    }
    if(!PyArg_ParseTuple(args,(char *)"OiOO:gluBuild2DMipmapsui",&obj0,&arg2,&obj2,&obj3)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg5 = (GLenum) PyInt_AsLong(obj2);
    if (PyErr_Occurred()) return NULL;
    {
        arg7 = _PyObject_AsUnsignedIntArray(obj3, &temp_7, NULL); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj3, 1); 
    }
    {
        arg4 = (GLint)_PyObject_Dimension(obj3, 0); 
    }
    {
        result = (PyObject *)__gluBuild2DMipmaps(arg1,arg2,arg3,arg4,arg5,arg6,(GLuint const *)arg7);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    {
        _PyObject_AsArray_Cleanup(arg7, temp_7); 
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild2DMipmapsf(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLint arg4 ;
    GLenum arg5 ;
    GLenum arg6 ;
    GLshort *arg7 ;
    PyObject *result;
    PyObject *temp_7 ;
    PyObject * obj0  = 0 ;
    PyObject * obj2  = 0 ;
    PyObject * obj3  = 0 ;
    
    {
    }
    {
    }
    {
        arg6 = GL_FLOAT;
    }
    if(!PyArg_ParseTuple(args,(char *)"OiOO:gluBuild2DMipmapsf",&obj0,&arg2,&obj2,&obj3)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg5 = (GLenum) PyInt_AsLong(obj2);
    if (PyErr_Occurred()) return NULL;
    {
        arg7 = _PyObject_AsShortArray(obj3, &temp_7, NULL); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj3, 1); 
    }
    {
        arg4 = (GLint)_PyObject_Dimension(obj3, 0); 
    }
    {
        result = (PyObject *)__gluBuild2DMipmaps(arg1,arg2,arg3,arg4,arg5,arg6,(GLshort const *)arg7);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    {
        _PyObject_AsArray_Cleanup(arg7, temp_7); 
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild3DMipmaps(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLint arg4 ;
    GLint arg5 ;
    GLenum arg6 ;
    GLenum arg7 ;
    void *arg8 ;
    PyObject *result;
    PyObject * obj0  = 0 ;
    PyObject * obj5  = 0 ;
    PyObject * obj6  = 0 ;
    PyObject * obj7  = 0 ;
    
    if(!PyArg_ParseTuple(args,(char *)"OiiiiOOO:gluBuild3DMipmaps",&obj0,&arg2,&arg3,&arg4,&arg5,&obj5,&obj6,&obj7)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg6 = (GLenum) PyInt_AsLong(obj5);
    if (PyErr_Occurred()) return NULL;
    arg7 = (GLenum) PyInt_AsLong(obj6);
    if (PyErr_Occurred()) return NULL;
    {
        int len;
        PyObject* str;
        if (obj7 == Py_None) 
        {
            arg8= NULL; 
        }
        else
        {
            str = PyObject_Str(obj7);
            PyString_AsStringAndSize(str, (char**)&arg8, &len);
            Py_DECREF(str);
        }
    }
    {
        result = (PyObject *)_gluBuild3DMipmaps(arg1,arg2,arg3,arg4,arg5,arg6,arg7,(void const *)arg8);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild3DMipmapsb(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLint arg4 ;
    GLint arg5 ;
    GLenum arg6 ;
    GLenum arg7 ;
    GLbyte *arg8 ;
    PyObject *result;
    PyObject *temp_8 ;
    PyObject * obj0  = 0 ;
    PyObject * obj2  = 0 ;
    PyObject * obj3  = 0 ;
    
    {
    }
    {
    }
    {
    }
    {
        arg7 = GL_BYTE;
    }
    if(!PyArg_ParseTuple(args,(char *)"OiOO:gluBuild3DMipmapsb",&obj0,&arg2,&obj2,&obj3)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg6 = (GLenum) PyInt_AsLong(obj2);
    if (PyErr_Occurred()) return NULL;
    {
        arg8 = _PyObject_AsCharArray(obj3, &temp_8, NULL); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj3, 2); 
    }
    {
        arg4 = (GLint)_PyObject_Dimension(obj3, 1); 
    }
    {
        arg5 = (GLint)_PyObject_Dimension(obj3, 0); 
    }
    {
        result = (PyObject *)__gluBuild3DMipmaps(arg1,arg2,arg3,arg4,arg5,arg6,arg7,(GLbyte const *)arg8);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    {
        _PyObject_AsArray_Cleanup(arg8, temp_8); 
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild3DMipmapsub(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLint arg4 ;
    GLint arg5 ;
    GLenum arg6 ;
    GLenum arg7 ;
    GLubyte *arg8 ;
    PyObject *result;
    PyObject *temp_8 ;
    PyObject * obj0  = 0 ;
    PyObject * obj2  = 0 ;
    PyObject * obj3  = 0 ;
    
    {
    }
    {
    }
    {
    }
    {
        arg7 = GL_UNSIGNED_BYTE;
    }
    if(!PyArg_ParseTuple(args,(char *)"OiOO:gluBuild3DMipmapsub",&obj0,&arg2,&obj2,&obj3)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg6 = (GLenum) PyInt_AsLong(obj2);
    if (PyErr_Occurred()) return NULL;
    {
        arg8 = _PyObject_AsUnsignedCharArray(obj3, &temp_8, NULL); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj3, 2); 
    }
    {
        arg4 = (GLint)_PyObject_Dimension(obj3, 1); 
    }
    {
        arg5 = (GLint)_PyObject_Dimension(obj3, 0); 
    }
    {
        result = (PyObject *)__gluBuild3DMipmaps(arg1,arg2,arg3,arg4,arg5,arg6,arg7,(GLubyte const *)arg8);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    {
        _PyObject_AsArray_Cleanup(arg8, temp_8); 
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild3DMipmapss(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLint arg4 ;
    GLint arg5 ;
    GLenum arg6 ;
    GLenum arg7 ;
    GLshort *arg8 ;
    PyObject *result;
    PyObject *temp_8 ;
    PyObject * obj0  = 0 ;
    PyObject * obj2  = 0 ;
    PyObject * obj3  = 0 ;
    
    {
    }
    {
    }
    {
    }
    {
        arg7 = GL_SHORT;
    }
    if(!PyArg_ParseTuple(args,(char *)"OiOO:gluBuild3DMipmapss",&obj0,&arg2,&obj2,&obj3)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg6 = (GLenum) PyInt_AsLong(obj2);
    if (PyErr_Occurred()) return NULL;
    {
        arg8 = _PyObject_AsShortArray(obj3, &temp_8, NULL); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj3, 2); 
    }
    {
        arg4 = (GLint)_PyObject_Dimension(obj3, 1); 
    }
    {
        arg5 = (GLint)_PyObject_Dimension(obj3, 0); 
    }
    {
        result = (PyObject *)__gluBuild3DMipmaps(arg1,arg2,arg3,arg4,arg5,arg6,arg7,(GLshort const *)arg8);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    {
        _PyObject_AsArray_Cleanup(arg8, temp_8); 
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild3DMipmapsus(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLint arg4 ;
    GLint arg5 ;
    GLenum arg6 ;
    GLenum arg7 ;
    GLushort *arg8 ;
    PyObject *result;
    PyObject *temp_8 ;
    PyObject * obj0  = 0 ;
    PyObject * obj2  = 0 ;
    PyObject * obj3  = 0 ;
    
    {
    }
    {
    }
    {
    }
    {
        arg7 = GL_UNSIGNED_SHORT;
    }
    if(!PyArg_ParseTuple(args,(char *)"OiOO:gluBuild3DMipmapsus",&obj0,&arg2,&obj2,&obj3)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg6 = (GLenum) PyInt_AsLong(obj2);
    if (PyErr_Occurred()) return NULL;
    {
        arg8 = _PyObject_AsUnsignedShortArray(obj3, &temp_8, NULL); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj3, 2); 
    }
    {
        arg4 = (GLint)_PyObject_Dimension(obj3, 1); 
    }
    {
        arg5 = (GLint)_PyObject_Dimension(obj3, 0); 
    }
    {
        result = (PyObject *)__gluBuild3DMipmaps(arg1,arg2,arg3,arg4,arg5,arg6,arg7,(GLushort const *)arg8);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    {
        _PyObject_AsArray_Cleanup(arg8, temp_8); 
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild3DMipmapsi(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLint arg4 ;
    GLint arg5 ;
    GLenum arg6 ;
    GLenum arg7 ;
    GLint *arg8 ;
    PyObject *result;
    PyObject *temp_8 ;
    PyObject * obj0  = 0 ;
    PyObject * obj2  = 0 ;
    PyObject * obj3  = 0 ;
    
    {
    }
    {
    }
    {
    }
    {
        arg7 = GL_INT;
    }
    if(!PyArg_ParseTuple(args,(char *)"OiOO:gluBuild3DMipmapsi",&obj0,&arg2,&obj2,&obj3)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg6 = (GLenum) PyInt_AsLong(obj2);
    if (PyErr_Occurred()) return NULL;
    {
        arg8 = _PyObject_AsIntArray(obj3, &temp_8, NULL); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj3, 2); 
    }
    {
        arg4 = (GLint)_PyObject_Dimension(obj3, 1); 
    }
    {
        arg5 = (GLint)_PyObject_Dimension(obj3, 0); 
    }
    {
        result = (PyObject *)__gluBuild3DMipmaps(arg1,arg2,arg3,arg4,arg5,arg6,arg7,(GLint const *)arg8);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    {
        _PyObject_AsArray_Cleanup(arg8, temp_8); 
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild3DMipmapsui(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLint arg4 ;
    GLint arg5 ;
    GLenum arg6 ;
    GLenum arg7 ;
    GLuint *arg8 ;
    PyObject *result;
    PyObject *temp_8 ;
    PyObject * obj0  = 0 ;
    PyObject * obj2  = 0 ;
    PyObject * obj3  = 0 ;
    
    {
    }
    {
    }
    {
    }
    {
        arg7 = GL_UNSIGNED_INT;
    }
    if(!PyArg_ParseTuple(args,(char *)"OiOO:gluBuild3DMipmapsui",&obj0,&arg2,&obj2,&obj3)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg6 = (GLenum) PyInt_AsLong(obj2);
    if (PyErr_Occurred()) return NULL;
    {
        arg8 = _PyObject_AsUnsignedIntArray(obj3, &temp_8, NULL); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj3, 2); 
    }
    {
        arg4 = (GLint)_PyObject_Dimension(obj3, 1); 
    }
    {
        arg5 = (GLint)_PyObject_Dimension(obj3, 0); 
    }
    {
        result = (PyObject *)__gluBuild3DMipmaps(arg1,arg2,arg3,arg4,arg5,arg6,arg7,(GLuint const *)arg8);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    {
        _PyObject_AsArray_Cleanup(arg8, temp_8); 
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild3DMipmapsf(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLint arg4 ;
    GLint arg5 ;
    GLenum arg6 ;
    GLenum arg7 ;
    GLshort *arg8 ;
    PyObject *result;
    PyObject *temp_8 ;
    PyObject * obj0  = 0 ;
    PyObject * obj2  = 0 ;
    PyObject * obj3  = 0 ;
    
    {
    }
    {
    }
    {
    }
    {
        arg7 = GL_FLOAT;
    }
    if(!PyArg_ParseTuple(args,(char *)"OiOO:gluBuild3DMipmapsf",&obj0,&arg2,&obj2,&obj3)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg6 = (GLenum) PyInt_AsLong(obj2);
    if (PyErr_Occurred()) return NULL;
    {
        arg8 = _PyObject_AsShortArray(obj3, &temp_8, NULL); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj3, 2); 
    }
    {
        arg4 = (GLint)_PyObject_Dimension(obj3, 1); 
    }
    {
        arg5 = (GLint)_PyObject_Dimension(obj3, 0); 
    }
    {
        result = (PyObject *)__gluBuild3DMipmaps(arg1,arg2,arg3,arg4,arg5,arg6,arg7,(GLshort const *)arg8);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    {
        _PyObject_AsArray_Cleanup(arg8, temp_8); 
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild1DMipmapLevels(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLenum arg4 ;
    GLenum arg5 ;
    GLint arg6 ;
    GLint arg7 ;
    GLint arg8 ;
    void *arg9 ;
    PyObject *result;
    PyObject * obj0  = 0 ;
    PyObject * obj3  = 0 ;
    PyObject * obj4  = 0 ;
    PyObject * obj8  = 0 ;
    
    if(!PyArg_ParseTuple(args,(char *)"OiiOOiiiO:gluBuild1DMipmapLevels",&obj0,&arg2,&arg3,&obj3,&obj4,&arg6,&arg7,&arg8,&obj8)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg4 = (GLenum) PyInt_AsLong(obj3);
    if (PyErr_Occurred()) return NULL;
    arg5 = (GLenum) PyInt_AsLong(obj4);
    if (PyErr_Occurred()) return NULL;
    {
        int len;
        PyObject* str;
        if (obj8 == Py_None) 
        {
            arg9= NULL; 
        }
        else
        {
            str = PyObject_Str(obj8);
            PyString_AsStringAndSize(str, (char**)&arg9, &len);
            Py_DECREF(str);
        }
    }
    {
        result = (PyObject *)_gluBuild1DMipmapLevels(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,(void const *)arg9);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild1DMipmapLevelsb(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLenum arg4 ;
    GLenum arg5 ;
    GLint arg6 ;
    GLint arg7 ;
    GLint arg8 ;
    GLbyte *arg9 ;
    PyObject *result;
    PyObject *temp_9 ;
    PyObject * obj0  = 0 ;
    PyObject * obj2  = 0 ;
    PyObject * obj6  = 0 ;
    
    {
    }
    {
        arg5 = GL_BYTE;
    }
    if(!PyArg_ParseTuple(args,(char *)"OiOiiiO:gluBuild1DMipmapLevelsb",&obj0,&arg2,&obj2,&arg6,&arg7,&arg8,&obj6)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg4 = (GLenum) PyInt_AsLong(obj2);
    if (PyErr_Occurred()) return NULL;
    {
        arg9 = _PyObject_AsCharArray(obj6, &temp_9, NULL); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj2, 0); 
    }
    {
        result = (PyObject *)__gluBuild1DMipmapLevels(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,(GLbyte const *)arg9);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    {
        _PyObject_AsArray_Cleanup(arg9, temp_9); 
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild1DMipmapLevelsub(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLenum arg4 ;
    GLenum arg5 ;
    GLint arg6 ;
    GLint arg7 ;
    GLint arg8 ;
    GLubyte *arg9 ;
    PyObject *result;
    PyObject *temp_9 ;
    PyObject * obj0  = 0 ;
    PyObject * obj2  = 0 ;
    PyObject * obj6  = 0 ;
    
    {
    }
    {
        arg5 = GL_UNSIGNED_BYTE;
    }
    if(!PyArg_ParseTuple(args,(char *)"OiOiiiO:gluBuild1DMipmapLevelsub",&obj0,&arg2,&obj2,&arg6,&arg7,&arg8,&obj6)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg4 = (GLenum) PyInt_AsLong(obj2);
    if (PyErr_Occurred()) return NULL;
    {
        arg9 = _PyObject_AsUnsignedCharArray(obj6, &temp_9, NULL); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj2, 0); 
    }
    {
        result = (PyObject *)__gluBuild1DMipmapLevels(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,(GLubyte const *)arg9);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    {
        _PyObject_AsArray_Cleanup(arg9, temp_9); 
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild1DMipmapLevelss(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLenum arg4 ;
    GLenum arg5 ;
    GLint arg6 ;
    GLint arg7 ;
    GLint arg8 ;
    GLshort *arg9 ;
    PyObject *result;
    PyObject *temp_9 ;
    PyObject * obj0  = 0 ;
    PyObject * obj2  = 0 ;
    PyObject * obj6  = 0 ;
    
    {
    }
    {
        arg5 = GL_SHORT;
    }
    if(!PyArg_ParseTuple(args,(char *)"OiOiiiO:gluBuild1DMipmapLevelss",&obj0,&arg2,&obj2,&arg6,&arg7,&arg8,&obj6)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg4 = (GLenum) PyInt_AsLong(obj2);
    if (PyErr_Occurred()) return NULL;
    {
        arg9 = _PyObject_AsShortArray(obj6, &temp_9, NULL); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj2, 0); 
    }
    {
        result = (PyObject *)__gluBuild1DMipmapLevels(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,(GLshort const *)arg9);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    {
        _PyObject_AsArray_Cleanup(arg9, temp_9); 
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild1DMipmapLevelsus(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLenum arg4 ;
    GLenum arg5 ;
    GLint arg6 ;
    GLint arg7 ;
    GLint arg8 ;
    GLushort *arg9 ;
    PyObject *result;
    PyObject *temp_9 ;
    PyObject * obj0  = 0 ;
    PyObject * obj2  = 0 ;
    PyObject * obj6  = 0 ;
    
    {
    }
    {
        arg5 = GL_UNSIGNED_SHORT;
    }
    if(!PyArg_ParseTuple(args,(char *)"OiOiiiO:gluBuild1DMipmapLevelsus",&obj0,&arg2,&obj2,&arg6,&arg7,&arg8,&obj6)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg4 = (GLenum) PyInt_AsLong(obj2);
    if (PyErr_Occurred()) return NULL;
    {
        arg9 = _PyObject_AsUnsignedShortArray(obj6, &temp_9, NULL); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj2, 0); 
    }
    {
        result = (PyObject *)__gluBuild1DMipmapLevels(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,(GLushort const *)arg9);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    {
        _PyObject_AsArray_Cleanup(arg9, temp_9); 
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild1DMipmapLevelsi(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLenum arg4 ;
    GLenum arg5 ;
    GLint arg6 ;
    GLint arg7 ;
    GLint arg8 ;
    GLint *arg9 ;
    PyObject *result;
    PyObject *temp_9 ;
    PyObject * obj0  = 0 ;
    PyObject * obj2  = 0 ;
    PyObject * obj6  = 0 ;
    
    {
    }
    {
        arg5 = GL_INT;
    }
    if(!PyArg_ParseTuple(args,(char *)"OiOiiiO:gluBuild1DMipmapLevelsi",&obj0,&arg2,&obj2,&arg6,&arg7,&arg8,&obj6)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg4 = (GLenum) PyInt_AsLong(obj2);
    if (PyErr_Occurred()) return NULL;
    {
        arg9 = _PyObject_AsIntArray(obj6, &temp_9, NULL); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj2, 0); 
    }
    {
        result = (PyObject *)__gluBuild1DMipmapLevels(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,(GLint const *)arg9);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    {
        _PyObject_AsArray_Cleanup(arg9, temp_9); 
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild1DMipmapLevelsui(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLenum arg4 ;
    GLenum arg5 ;
    GLint arg6 ;
    GLint arg7 ;
    GLint arg8 ;
    GLuint *arg9 ;
    PyObject *result;
    PyObject *temp_9 ;
    PyObject * obj0  = 0 ;
    PyObject * obj2  = 0 ;
    PyObject * obj6  = 0 ;
    
    {
    }
    {
        arg5 = GL_UNSIGNED_INT;
    }
    if(!PyArg_ParseTuple(args,(char *)"OiOiiiO:gluBuild1DMipmapLevelsui",&obj0,&arg2,&obj2,&arg6,&arg7,&arg8,&obj6)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg4 = (GLenum) PyInt_AsLong(obj2);
    if (PyErr_Occurred()) return NULL;
    {
        arg9 = _PyObject_AsUnsignedIntArray(obj6, &temp_9, NULL); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj2, 0); 
    }
    {
        result = (PyObject *)__gluBuild1DMipmapLevels(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,(GLuint const *)arg9);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    {
        _PyObject_AsArray_Cleanup(arg9, temp_9); 
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild1DMipmapLevelsf(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLenum arg4 ;
    GLenum arg5 ;
    GLint arg6 ;
    GLint arg7 ;
    GLint arg8 ;
    GLshort *arg9 ;
    PyObject *result;
    PyObject *temp_9 ;
    PyObject * obj0  = 0 ;
    PyObject * obj2  = 0 ;
    PyObject * obj6  = 0 ;
    
    {
    }
    {
        arg5 = GL_FLOAT;
    }
    if(!PyArg_ParseTuple(args,(char *)"OiOiiiO:gluBuild1DMipmapLevelsf",&obj0,&arg2,&obj2,&arg6,&arg7,&arg8,&obj6)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg4 = (GLenum) PyInt_AsLong(obj2);
    if (PyErr_Occurred()) return NULL;
    {
        arg9 = _PyObject_AsShortArray(obj6, &temp_9, NULL); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj2, 0); 
    }
    {
        result = (PyObject *)__gluBuild1DMipmapLevels(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,(GLshort const *)arg9);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    {
        _PyObject_AsArray_Cleanup(arg9, temp_9); 
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild2DMipmapLevels(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLint arg4 ;
    GLenum arg5 ;
    GLenum arg6 ;
    GLint arg7 ;
    GLint arg8 ;
    GLint arg9 ;
    void *arg10 ;
    PyObject *result;
    PyObject * obj0  = 0 ;
    PyObject * obj4  = 0 ;
    PyObject * obj5  = 0 ;
    PyObject * obj9  = 0 ;
    
    if(!PyArg_ParseTuple(args,(char *)"OiiiOOiiiO:gluBuild2DMipmapLevels",&obj0,&arg2,&arg3,&arg4,&obj4,&obj5,&arg7,&arg8,&arg9,&obj9)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg5 = (GLenum) PyInt_AsLong(obj4);
    if (PyErr_Occurred()) return NULL;
    arg6 = (GLenum) PyInt_AsLong(obj5);
    if (PyErr_Occurred()) return NULL;
    {
        int len;
        PyObject* str;
        if (obj9 == Py_None) 
        {
            arg10= NULL; 
        }
        else
        {
            str = PyObject_Str(obj9);
            PyString_AsStringAndSize(str, (char**)&arg10, &len);
            Py_DECREF(str);
        }
    }
    {
        result = (PyObject *)_gluBuild2DMipmapLevels(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,(void const *)arg10);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild2DMipmapLevelsb(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLint arg4 ;
    GLenum arg5 ;
    GLenum arg6 ;
    GLint arg7 ;
    GLint arg8 ;
    GLint arg9 ;
    GLbyte *arg10 ;
    PyObject *result;
    PyObject *temp_10 ;
    PyObject * obj0  = 0 ;
    PyObject * obj2  = 0 ;
    PyObject * obj6  = 0 ;
    
    {
    }
    {
    }
    {
        arg6 = GL_BYTE;
    }
    if(!PyArg_ParseTuple(args,(char *)"OiOiiiO:gluBuild2DMipmapLevelsb",&obj0,&arg2,&obj2,&arg7,&arg8,&arg9,&obj6)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg5 = (GLenum) PyInt_AsLong(obj2);
    if (PyErr_Occurred()) return NULL;
    {
        arg10 = _PyObject_AsCharArray(obj6, &temp_10, NULL); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj6, 1); 
    }
    {
        arg4 = (GLint)_PyObject_Dimension(obj6, 0); 
    }
    {
        result = (PyObject *)__gluBuild2DMipmapLevels(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,(GLbyte const *)arg10);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    {
        _PyObject_AsArray_Cleanup(arg10, temp_10); 
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild2DMipmapLevelsub(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLint arg4 ;
    GLenum arg5 ;
    GLenum arg6 ;
    GLint arg7 ;
    GLint arg8 ;
    GLint arg9 ;
    GLubyte *arg10 ;
    PyObject *result;
    PyObject *temp_10 ;
    PyObject * obj0  = 0 ;
    PyObject * obj2  = 0 ;
    PyObject * obj6  = 0 ;
    
    {
    }
    {
    }
    {
        arg6 = GL_UNSIGNED_BYTE;
    }
    if(!PyArg_ParseTuple(args,(char *)"OiOiiiO:gluBuild2DMipmapLevelsub",&obj0,&arg2,&obj2,&arg7,&arg8,&arg9,&obj6)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg5 = (GLenum) PyInt_AsLong(obj2);
    if (PyErr_Occurred()) return NULL;
    {
        arg10 = _PyObject_AsUnsignedCharArray(obj6, &temp_10, NULL); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj6, 1); 
    }
    {
        arg4 = (GLint)_PyObject_Dimension(obj6, 0); 
    }
    {
        result = (PyObject *)__gluBuild2DMipmapLevels(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,(GLubyte const *)arg10);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    {
        _PyObject_AsArray_Cleanup(arg10, temp_10); 
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild2DMipmapLevelss(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLint arg4 ;
    GLenum arg5 ;
    GLenum arg6 ;
    GLint arg7 ;
    GLint arg8 ;
    GLint arg9 ;
    GLshort *arg10 ;
    PyObject *result;
    PyObject *temp_10 ;
    PyObject * obj0  = 0 ;
    PyObject * obj2  = 0 ;
    PyObject * obj6  = 0 ;
    
    {
    }
    {
    }
    {
        arg6 = GL_SHORT;
    }
    if(!PyArg_ParseTuple(args,(char *)"OiOiiiO:gluBuild2DMipmapLevelss",&obj0,&arg2,&obj2,&arg7,&arg8,&arg9,&obj6)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg5 = (GLenum) PyInt_AsLong(obj2);
    if (PyErr_Occurred()) return NULL;
    {
        arg10 = _PyObject_AsShortArray(obj6, &temp_10, NULL); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj6, 1); 
    }
    {
        arg4 = (GLint)_PyObject_Dimension(obj6, 0); 
    }
    {
        result = (PyObject *)__gluBuild2DMipmapLevels(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,(GLshort const *)arg10);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    {
        _PyObject_AsArray_Cleanup(arg10, temp_10); 
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild2DMipmapLevelsus(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLint arg4 ;
    GLenum arg5 ;
    GLenum arg6 ;
    GLint arg7 ;
    GLint arg8 ;
    GLint arg9 ;
    GLushort *arg10 ;
    PyObject *result;
    PyObject *temp_10 ;
    PyObject * obj0  = 0 ;
    PyObject * obj2  = 0 ;
    PyObject * obj6  = 0 ;
    
    {
    }
    {
    }
    {
        arg6 = GL_UNSIGNED_SHORT;
    }
    if(!PyArg_ParseTuple(args,(char *)"OiOiiiO:gluBuild2DMipmapLevelsus",&obj0,&arg2,&obj2,&arg7,&arg8,&arg9,&obj6)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg5 = (GLenum) PyInt_AsLong(obj2);
    if (PyErr_Occurred()) return NULL;
    {
        arg10 = _PyObject_AsUnsignedShortArray(obj6, &temp_10, NULL); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj6, 1); 
    }
    {
        arg4 = (GLint)_PyObject_Dimension(obj6, 0); 
    }
    {
        result = (PyObject *)__gluBuild2DMipmapLevels(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,(GLushort const *)arg10);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    {
        _PyObject_AsArray_Cleanup(arg10, temp_10); 
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild2DMipmapLevelsi(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLint arg4 ;
    GLenum arg5 ;
    GLenum arg6 ;
    GLint arg7 ;
    GLint arg8 ;
    GLint arg9 ;
    GLint *arg10 ;
    PyObject *result;
    PyObject *temp_10 ;
    PyObject * obj0  = 0 ;
    PyObject * obj2  = 0 ;
    PyObject * obj6  = 0 ;
    
    {
    }
    {
    }
    {
        arg6 = GL_INT;
    }
    if(!PyArg_ParseTuple(args,(char *)"OiOiiiO:gluBuild2DMipmapLevelsi",&obj0,&arg2,&obj2,&arg7,&arg8,&arg9,&obj6)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg5 = (GLenum) PyInt_AsLong(obj2);
    if (PyErr_Occurred()) return NULL;
    {
        arg10 = _PyObject_AsIntArray(obj6, &temp_10, NULL); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj6, 1); 
    }
    {
        arg4 = (GLint)_PyObject_Dimension(obj6, 0); 
    }
    {
        result = (PyObject *)__gluBuild2DMipmapLevels(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,(GLint const *)arg10);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    {
        _PyObject_AsArray_Cleanup(arg10, temp_10); 
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild2DMipmapLevelsui(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLint arg4 ;
    GLenum arg5 ;
    GLenum arg6 ;
    GLint arg7 ;
    GLint arg8 ;
    GLint arg9 ;
    GLuint *arg10 ;
    PyObject *result;
    PyObject *temp_10 ;
    PyObject * obj0  = 0 ;
    PyObject * obj2  = 0 ;
    PyObject * obj6  = 0 ;
    
    {
    }
    {
    }
    {
        arg6 = GL_UNSIGNED_INT;
    }
    if(!PyArg_ParseTuple(args,(char *)"OiOiiiO:gluBuild2DMipmapLevelsui",&obj0,&arg2,&obj2,&arg7,&arg8,&arg9,&obj6)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg5 = (GLenum) PyInt_AsLong(obj2);
    if (PyErr_Occurred()) return NULL;
    {
        arg10 = _PyObject_AsUnsignedIntArray(obj6, &temp_10, NULL); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj6, 1); 
    }
    {
        arg4 = (GLint)_PyObject_Dimension(obj6, 0); 
    }
    {
        result = (PyObject *)__gluBuild2DMipmapLevels(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,(GLuint const *)arg10);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    {
        _PyObject_AsArray_Cleanup(arg10, temp_10); 
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild2DMipmapLevelsf(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLint arg4 ;
    GLenum arg5 ;
    GLenum arg6 ;
    GLint arg7 ;
    GLint arg8 ;
    GLint arg9 ;
    GLshort *arg10 ;
    PyObject *result;
    PyObject *temp_10 ;
    PyObject * obj0  = 0 ;
    PyObject * obj2  = 0 ;
    PyObject * obj6  = 0 ;
    
    {
    }
    {
    }
    {
        arg6 = GL_FLOAT;
    }
    if(!PyArg_ParseTuple(args,(char *)"OiOiiiO:gluBuild2DMipmapLevelsf",&obj0,&arg2,&obj2,&arg7,&arg8,&arg9,&obj6)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg5 = (GLenum) PyInt_AsLong(obj2);
    if (PyErr_Occurred()) return NULL;
    {
        arg10 = _PyObject_AsShortArray(obj6, &temp_10, NULL); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj6, 1); 
    }
    {
        arg4 = (GLint)_PyObject_Dimension(obj6, 0); 
    }
    {
        result = (PyObject *)__gluBuild2DMipmapLevels(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,(GLshort const *)arg10);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    {
        _PyObject_AsArray_Cleanup(arg10, temp_10); 
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild3DMipmapLevels(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLint arg4 ;
    GLint arg5 ;
    GLenum arg6 ;
    GLenum arg7 ;
    GLint arg8 ;
    GLint arg9 ;
    GLint arg10 ;
    void *arg11 ;
    PyObject *result;
    PyObject * obj0  = 0 ;
    PyObject * obj5  = 0 ;
    PyObject * obj6  = 0 ;
    PyObject * obj10  = 0 ;
    
    if(!PyArg_ParseTuple(args,(char *)"OiiiiOOiiiO:gluBuild3DMipmapLevels",&obj0,&arg2,&arg3,&arg4,&arg5,&obj5,&obj6,&arg8,&arg9,&arg10,&obj10)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg6 = (GLenum) PyInt_AsLong(obj5);
    if (PyErr_Occurred()) return NULL;
    arg7 = (GLenum) PyInt_AsLong(obj6);
    if (PyErr_Occurred()) return NULL;
    {
        int len;
        PyObject* str;
        if (obj10 == Py_None) 
        {
            arg11= NULL; 
        }
        else
        {
            str = PyObject_Str(obj10);
            PyString_AsStringAndSize(str, (char**)&arg11, &len);
            Py_DECREF(str);
        }
    }
    {
        result = (PyObject *)_gluBuild3DMipmapLevels(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,(void const *)arg11);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild3DMipmapLevelsb(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLint arg4 ;
    GLint arg5 ;
    GLenum arg6 ;
    GLenum arg7 ;
    GLint arg8 ;
    GLint arg9 ;
    GLint arg10 ;
    GLbyte *arg11 ;
    PyObject *result;
    PyObject *temp_11 ;
    PyObject * obj0  = 0 ;
    PyObject * obj2  = 0 ;
    PyObject * obj6  = 0 ;
    
    {
    }
    {
    }
    {
    }
    {
        arg7 = GL_BYTE;
    }
    if(!PyArg_ParseTuple(args,(char *)"OiOiiiO:gluBuild3DMipmapLevelsb",&obj0,&arg2,&obj2,&arg8,&arg9,&arg10,&obj6)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg6 = (GLenum) PyInt_AsLong(obj2);
    if (PyErr_Occurred()) return NULL;
    {
        arg11 = _PyObject_AsCharArray(obj6, &temp_11, NULL); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj6, 2); 
    }
    {
        arg4 = (GLint)_PyObject_Dimension(obj6, 1); 
    }
    {
        arg5 = (GLint)_PyObject_Dimension(obj6, 0); 
    }
    {
        result = (PyObject *)__gluBuild3DMipmapLevels(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,(GLbyte const *)arg11);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    {
        _PyObject_AsArray_Cleanup(arg11, temp_11); 
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild3DMipmapLevelsub(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLint arg4 ;
    GLint arg5 ;
    GLenum arg6 ;
    GLenum arg7 ;
    GLint arg8 ;
    GLint arg9 ;
    GLint arg10 ;
    GLubyte *arg11 ;
    PyObject *result;
    PyObject *temp_11 ;
    PyObject * obj0  = 0 ;
    PyObject * obj2  = 0 ;
    PyObject * obj6  = 0 ;
    
    {
    }
    {
    }
    {
    }
    {
        arg7 = GL_UNSIGNED_BYTE;
    }
    if(!PyArg_ParseTuple(args,(char *)"OiOiiiO:gluBuild3DMipmapLevelsub",&obj0,&arg2,&obj2,&arg8,&arg9,&arg10,&obj6)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg6 = (GLenum) PyInt_AsLong(obj2);
    if (PyErr_Occurred()) return NULL;
    {
        arg11 = _PyObject_AsUnsignedCharArray(obj6, &temp_11, NULL); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj6, 2); 
    }
    {
        arg4 = (GLint)_PyObject_Dimension(obj6, 1); 
    }
    {
        arg5 = (GLint)_PyObject_Dimension(obj6, 0); 
    }
    {
        result = (PyObject *)__gluBuild3DMipmapLevels(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,(GLubyte const *)arg11);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    {
        _PyObject_AsArray_Cleanup(arg11, temp_11); 
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild3DMipmapLevelss(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLint arg4 ;
    GLint arg5 ;
    GLenum arg6 ;
    GLenum arg7 ;
    GLint arg8 ;
    GLint arg9 ;
    GLint arg10 ;
    GLshort *arg11 ;
    PyObject *result;
    PyObject *temp_11 ;
    PyObject * obj0  = 0 ;
    PyObject * obj2  = 0 ;
    PyObject * obj6  = 0 ;
    
    {
    }
    {
    }
    {
    }
    {
        arg7 = GL_SHORT;
    }
    if(!PyArg_ParseTuple(args,(char *)"OiOiiiO:gluBuild3DMipmapLevelss",&obj0,&arg2,&obj2,&arg8,&arg9,&arg10,&obj6)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg6 = (GLenum) PyInt_AsLong(obj2);
    if (PyErr_Occurred()) return NULL;
    {
        arg11 = _PyObject_AsShortArray(obj6, &temp_11, NULL); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj6, 2); 
    }
    {
        arg4 = (GLint)_PyObject_Dimension(obj6, 1); 
    }
    {
        arg5 = (GLint)_PyObject_Dimension(obj6, 0); 
    }
    {
        result = (PyObject *)__gluBuild3DMipmapLevels(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,(GLshort const *)arg11);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    {
        _PyObject_AsArray_Cleanup(arg11, temp_11); 
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild3DMipmapLevelsus(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLint arg4 ;
    GLint arg5 ;
    GLenum arg6 ;
    GLenum arg7 ;
    GLint arg8 ;
    GLint arg9 ;
    GLint arg10 ;
    GLushort *arg11 ;
    PyObject *result;
    PyObject *temp_11 ;
    PyObject * obj0  = 0 ;
    PyObject * obj2  = 0 ;
    PyObject * obj6  = 0 ;
    
    {
    }
    {
    }
    {
    }
    {
        arg7 = GL_UNSIGNED_SHORT;
    }
    if(!PyArg_ParseTuple(args,(char *)"OiOiiiO:gluBuild3DMipmapLevelsus",&obj0,&arg2,&obj2,&arg8,&arg9,&arg10,&obj6)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg6 = (GLenum) PyInt_AsLong(obj2);
    if (PyErr_Occurred()) return NULL;
    {
        arg11 = _PyObject_AsUnsignedShortArray(obj6, &temp_11, NULL); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj6, 2); 
    }
    {
        arg4 = (GLint)_PyObject_Dimension(obj6, 1); 
    }
    {
        arg5 = (GLint)_PyObject_Dimension(obj6, 0); 
    }
    {
        result = (PyObject *)__gluBuild3DMipmapLevels(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,(GLushort const *)arg11);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    {
        _PyObject_AsArray_Cleanup(arg11, temp_11); 
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild3DMipmapLevelsi(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLint arg4 ;
    GLint arg5 ;
    GLenum arg6 ;
    GLenum arg7 ;
    GLint arg8 ;
    GLint arg9 ;
    GLint arg10 ;
    GLint *arg11 ;
    PyObject *result;
    PyObject *temp_11 ;
    PyObject * obj0  = 0 ;
    PyObject * obj2  = 0 ;
    PyObject * obj6  = 0 ;
    
    {
    }
    {
    }
    {
    }
    {
        arg7 = GL_INT;
    }
    if(!PyArg_ParseTuple(args,(char *)"OiOiiiO:gluBuild3DMipmapLevelsi",&obj0,&arg2,&obj2,&arg8,&arg9,&arg10,&obj6)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg6 = (GLenum) PyInt_AsLong(obj2);
    if (PyErr_Occurred()) return NULL;
    {
        arg11 = _PyObject_AsIntArray(obj6, &temp_11, NULL); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj6, 2); 
    }
    {
        arg4 = (GLint)_PyObject_Dimension(obj6, 1); 
    }
    {
        arg5 = (GLint)_PyObject_Dimension(obj6, 0); 
    }
    {
        result = (PyObject *)__gluBuild3DMipmapLevels(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,(GLint const *)arg11);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    {
        _PyObject_AsArray_Cleanup(arg11, temp_11); 
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild3DMipmapLevelsui(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLint arg4 ;
    GLint arg5 ;
    GLenum arg6 ;
    GLenum arg7 ;
    GLint arg8 ;
    GLint arg9 ;
    GLint arg10 ;
    GLuint *arg11 ;
    PyObject *result;
    PyObject *temp_11 ;
    PyObject * obj0  = 0 ;
    PyObject * obj2  = 0 ;
    PyObject * obj6  = 0 ;
    
    {
    }
    {
    }
    {
    }
    {
        arg7 = GL_UNSIGNED_INT;
    }
    if(!PyArg_ParseTuple(args,(char *)"OiOiiiO:gluBuild3DMipmapLevelsui",&obj0,&arg2,&obj2,&arg8,&arg9,&arg10,&obj6)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg6 = (GLenum) PyInt_AsLong(obj2);
    if (PyErr_Occurred()) return NULL;
    {
        arg11 = _PyObject_AsUnsignedIntArray(obj6, &temp_11, NULL); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj6, 2); 
    }
    {
        arg4 = (GLint)_PyObject_Dimension(obj6, 1); 
    }
    {
        arg5 = (GLint)_PyObject_Dimension(obj6, 0); 
    }
    {
        result = (PyObject *)__gluBuild3DMipmapLevels(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,(GLuint const *)arg11);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    {
        _PyObject_AsArray_Cleanup(arg11, temp_11); 
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild3DMipmapLevelsf(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLint arg4 ;
    GLint arg5 ;
    GLenum arg6 ;
    GLenum arg7 ;
    GLint arg8 ;
    GLint arg9 ;
    GLint arg10 ;
    GLshort *arg11 ;
    PyObject *result;
    PyObject *temp_11 ;
    PyObject * obj0  = 0 ;
    PyObject * obj2  = 0 ;
    PyObject * obj6  = 0 ;
    
    {
    }
    {
    }
    {
    }
    {
        arg7 = GL_FLOAT;
    }
    if(!PyArg_ParseTuple(args,(char *)"OiOiiiO:gluBuild3DMipmapLevelsf",&obj0,&arg2,&obj2,&arg8,&arg9,&arg10,&obj6)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg6 = (GLenum) PyInt_AsLong(obj2);
    if (PyErr_Occurred()) return NULL;
    {
        arg11 = _PyObject_AsShortArray(obj6, &temp_11, NULL); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj6, 2); 
    }
    {
        arg4 = (GLint)_PyObject_Dimension(obj6, 1); 
    }
    {
        arg5 = (GLint)_PyObject_Dimension(obj6, 0); 
    }
    {
        result = (PyObject *)__gluBuild3DMipmapLevels(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,(GLshort const *)arg11);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    {
        _PyObject_AsArray_Cleanup(arg11, temp_11); 
    }
    return resultobj;
}


static PyObject *_wrap_gluNewQuadric(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    PyGLUquadric *result;
    
    if(!PyArg_ParseTuple(args,(char *)":gluNewQuadric")) return NULL;
    {
        result = (PyGLUquadric *)_gluNewQuadric();
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj = (PyObject*)result;
    }
    return resultobj;
}


static PyObject *_wrap_gluDeleteQuadric(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    PyObject *arg1 ;
    PyObject * obj0  = 0 ;
    
    if(!PyArg_ParseTuple(args,(char *)"O:gluDeleteQuadric",&obj0)) return NULL;
    {
        arg1 = obj0;
    }
    {
        __ignoreDeletionCall(arg1);
        if (GLErrOccurred()) return NULL; 
    }
    Py_INCREF(Py_None); resultobj = Py_None;
    return resultobj;
}


static PyObject *_wrap_gluQuadricNormals(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLUquadric *arg1 ;
    GLenum arg2 ;
    PyObject * obj0  = 0 ;
    PyObject * obj1  = 0 ;
    
    if(!PyArg_ParseTuple(args,(char *)"OO:gluQuadricNormals",&obj0,&obj1)) return NULL;
    {
        if (obj0->ob_type != &PyGLUquadric_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUquadric object.");
            return NULL;
        }
        currentQuadric = (PyGLUquadric*)obj0;
        arg1 = currentQuadric->obj;
    }
    arg2 = (GLenum) PyInt_AsLong(obj1);
    if (PyErr_Occurred()) return NULL;
    {
        gluQuadricNormals(arg1,arg2);
        if (GLErrOccurred()) return NULL; 
    }
    Py_INCREF(Py_None); resultobj = Py_None;
    {
        currentQuadric = NULL;
        if (PyErr_Occurred()) return NULL;
    }
    return resultobj;
}


static PyObject *_wrap_gluQuadricTexture(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLUquadric *arg1 ;
    GLboolean arg2 ;
    PyObject * obj0  = 0 ;
    PyObject * obj1  = 0 ;
    
    if(!PyArg_ParseTuple(args,(char *)"OO:gluQuadricTexture",&obj0,&obj1)) return NULL;
    {
        if (obj0->ob_type != &PyGLUquadric_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUquadric object.");
            return NULL;
        }
        currentQuadric = (PyGLUquadric*)obj0;
        arg1 = currentQuadric->obj;
    }
    {
        arg2= (PyObject_IsTrue(obj1)) ? GL_TRUE : GL_FALSE;
    }
    {
        gluQuadricTexture(arg1,arg2);
        if (GLErrOccurred()) return NULL; 
    }
    Py_INCREF(Py_None); resultobj = Py_None;
    {
        currentQuadric = NULL;
        if (PyErr_Occurred()) return NULL;
    }
    return resultobj;
}


static PyObject *_wrap_gluQuadricOrientation(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLUquadric *arg1 ;
    GLenum arg2 ;
    PyObject * obj0  = 0 ;
    PyObject * obj1  = 0 ;
    
    if(!PyArg_ParseTuple(args,(char *)"OO:gluQuadricOrientation",&obj0,&obj1)) return NULL;
    {
        if (obj0->ob_type != &PyGLUquadric_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUquadric object.");
            return NULL;
        }
        currentQuadric = (PyGLUquadric*)obj0;
        arg1 = currentQuadric->obj;
    }
    arg2 = (GLenum) PyInt_AsLong(obj1);
    if (PyErr_Occurred()) return NULL;
    {
        gluQuadricOrientation(arg1,arg2);
        if (GLErrOccurred()) return NULL; 
    }
    Py_INCREF(Py_None); resultobj = Py_None;
    {
        currentQuadric = NULL;
        if (PyErr_Occurred()) return NULL;
    }
    return resultobj;
}


static PyObject *_wrap_gluQuadricDrawStyle(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLUquadric *arg1 ;
    GLenum arg2 ;
    PyObject * obj0  = 0 ;
    PyObject * obj1  = 0 ;
    
    if(!PyArg_ParseTuple(args,(char *)"OO:gluQuadricDrawStyle",&obj0,&obj1)) return NULL;
    {
        if (obj0->ob_type != &PyGLUquadric_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUquadric object.");
            return NULL;
        }
        currentQuadric = (PyGLUquadric*)obj0;
        arg1 = currentQuadric->obj;
    }
    arg2 = (GLenum) PyInt_AsLong(obj1);
    if (PyErr_Occurred()) return NULL;
    {
        gluQuadricDrawStyle(arg1,arg2);
        if (GLErrOccurred()) return NULL; 
    }
    Py_INCREF(Py_None); resultobj = Py_None;
    {
        currentQuadric = NULL;
        if (PyErr_Occurred()) return NULL;
    }
    return resultobj;
}


static PyObject *_wrap_gluCylinder(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLUquadric *arg1 ;
    GLdouble arg2 ;
    GLdouble arg3 ;
    GLdouble arg4 ;
    GLint arg5 ;
    GLint arg6 ;
    PyObject * obj0  = 0 ;
    
    if(!PyArg_ParseTuple(args,(char *)"Odddii:gluCylinder",&obj0,&arg2,&arg3,&arg4,&arg5,&arg6)) return NULL;
    {
        if (obj0->ob_type != &PyGLUquadric_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUquadric object.");
            return NULL;
        }
        currentQuadric = (PyGLUquadric*)obj0;
        arg1 = currentQuadric->obj;
    }
    {
        gluCylinder(arg1,arg2,arg3,arg4,arg5,arg6);
        if (GLErrOccurred()) return NULL; 
    }
    Py_INCREF(Py_None); resultobj = Py_None;
    {
        currentQuadric = NULL;
        if (PyErr_Occurred()) return NULL;
    }
    return resultobj;
}


static PyObject *_wrap_gluDisk(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLUquadric *arg1 ;
    GLdouble arg2 ;
    GLdouble arg3 ;
    GLint arg4 ;
    GLint arg5 ;
    PyObject * obj0  = 0 ;
    
    if(!PyArg_ParseTuple(args,(char *)"Oddii:gluDisk",&obj0,&arg2,&arg3,&arg4,&arg5)) return NULL;
    {
        if (obj0->ob_type != &PyGLUquadric_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUquadric object.");
            return NULL;
        }
        currentQuadric = (PyGLUquadric*)obj0;
        arg1 = currentQuadric->obj;
    }
    {
        gluDisk(arg1,arg2,arg3,arg4,arg5);
        if (GLErrOccurred()) return NULL; 
    }
    Py_INCREF(Py_None); resultobj = Py_None;
    {
        currentQuadric = NULL;
        if (PyErr_Occurred()) return NULL;
    }
    return resultobj;
}


static PyObject *_wrap_gluPartialDisk(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLUquadric *arg1 ;
    GLdouble arg2 ;
    GLdouble arg3 ;
    GLint arg4 ;
    GLint arg5 ;
    GLdouble arg6 ;
    GLdouble arg7 ;
    PyObject * obj0  = 0 ;
    
    if(!PyArg_ParseTuple(args,(char *)"Oddiidd:gluPartialDisk",&obj0,&arg2,&arg3,&arg4,&arg5,&arg6,&arg7)) return NULL;
    {
        if (obj0->ob_type != &PyGLUquadric_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUquadric object.");
            return NULL;
        }
        currentQuadric = (PyGLUquadric*)obj0;
        arg1 = currentQuadric->obj;
    }
    {
        gluPartialDisk(arg1,arg2,arg3,arg4,arg5,arg6,arg7);
        if (GLErrOccurred()) return NULL; 
    }
    Py_INCREF(Py_None); resultobj = Py_None;
    {
        currentQuadric = NULL;
        if (PyErr_Occurred()) return NULL;
    }
    return resultobj;
}


static PyObject *_wrap_gluSphere(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLUquadric *arg1 ;
    GLdouble arg2 ;
    GLint arg3 ;
    GLint arg4 ;
    PyObject * obj0  = 0 ;
    
    if(!PyArg_ParseTuple(args,(char *)"Odii:gluSphere",&obj0,&arg2,&arg3,&arg4)) return NULL;
    {
        if (obj0->ob_type != &PyGLUquadric_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUquadric object.");
            return NULL;
        }
        currentQuadric = (PyGLUquadric*)obj0;
        arg1 = currentQuadric->obj;
    }
    {
        gluSphere(arg1,arg2,arg3,arg4);
        if (GLErrOccurred()) return NULL; 
    }
    Py_INCREF(Py_None); resultobj = Py_None;
    {
        currentQuadric = NULL;
        if (PyErr_Occurred()) return NULL;
    }
    return resultobj;
}


static PyObject *_wrap_gluQuadricCallback(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    PyGLUquadric *arg1 ;
    GLenum arg2 ;
    PyObject *arg3 ;
    PyObject *result;
    PyObject * obj0  = 0 ;
    PyObject * obj1  = 0 ;
    PyObject * obj2  = 0 ;
    
    if(!PyArg_ParseTuple(args,(char *)"OOO:gluQuadricCallback",&obj0,&obj1,&obj2)) return NULL;
    {
        if (obj0->ob_type != &PyGLUquadric_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUquadric object.");
            return NULL;
        }
        arg1 = currentQuadric = (PyGLUquadric*)obj0;
    }
    arg2 = (GLenum) PyInt_AsLong(obj1);
    if (PyErr_Occurred()) return NULL;
    {
        if (obj2 != Py_None && !PyCallable_Check(obj2))
        {
            PyErr_SetString(PyExc_Exception, "Not callable.");
            return NULL;
        }
        arg3 = obj2;
    }
    {
        result = (PyObject *)_gluQuadricCallback(arg1,arg2,arg3);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    {
        currentQuadric = NULL;
        if (PyErr_Occurred()) return NULL;
    }
    return resultobj;
}


static PyObject *_wrap_gluNewTess(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    PyGLUtesselator *result;
    
    if(!PyArg_ParseTuple(args,(char *)":gluNewTess")) return NULL;
    {
        result = (PyGLUtesselator *)_gluNewTess();
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj = (PyObject*)result;
    }
    return resultobj;
}


static PyObject *_wrap_gluDeleteTess(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    PyObject *arg1 ;
    PyObject * obj0  = 0 ;
    
    if(!PyArg_ParseTuple(args,(char *)"O:gluDeleteTess",&obj0)) return NULL;
    {
        arg1 = obj0;
    }
    {
        __ignoreDeletionCall(arg1);
        if (GLErrOccurred()) return NULL; 
    }
    Py_INCREF(Py_None); resultobj = Py_None;
    return resultobj;
}


static PyObject *_wrap_gluTessBeginPolygon(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    PyGLUtesselator *arg1 ;
    PyObject *arg2 ;
    PyObject * obj0  = 0 ;
    PyObject * obj1  = 0 ;
    
    if(!PyArg_ParseTuple(args,(char *)"OO:gluTessBeginPolygon",&obj0,&obj1)) return NULL;
    {
        if (obj0->ob_type != &PyGLUtesselator_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUtesselator object.");
            return NULL;
        }
        arg1 = (PyGLUtesselator*)obj0;
    }
    {
        arg2 = obj1;
    }
    {
        _gluTessBeginPolygon(arg1,arg2);
        if (GLErrOccurred()) return NULL; 
    }
    Py_INCREF(Py_None); resultobj = Py_None;
    {
        /*currentTesselator = NULL;*/
        if (PyErr_Occurred()) return NULL;
    }
    return resultobj;
}


static PyObject *_wrap_gluBeginPolygon(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLUtesselator *arg1 ;
    PyObject * obj0  = 0 ;
    
    if(!PyArg_ParseTuple(args,(char *)"O:gluBeginPolygon",&obj0)) return NULL;
    {
        if (obj0->ob_type != &PyGLUtesselator_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUtesselator object.");
            return NULL;
        }
        /*currentTesselator = (PyGLUtesselator*)obj0;*/
        arg1 = ((PyGLUtesselator*)obj0)->obj;
    }
    {
        gluBeginPolygon(arg1);
        if (GLErrOccurred()) return NULL; 
    }
    Py_INCREF(Py_None); resultobj = Py_None;
    {
        /*currentTesselator = NULL;*/
        if (PyErr_Occurred()) return NULL;
    }
    return resultobj;
}


static PyObject *_wrap_gluTessBeginContour(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLUtesselator *arg1 ;
    PyObject * obj0  = 0 ;
    
    if(!PyArg_ParseTuple(args,(char *)"O:gluTessBeginContour",&obj0)) return NULL;
    {
        if (obj0->ob_type != &PyGLUtesselator_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUtesselator object.");
            return NULL;
        }
        /*currentTesselator = (PyGLUtesselator*)obj0;*/
        arg1 = ((PyGLUtesselator*)obj0)->obj;
    }
    {
        gluTessBeginContour(arg1);
        if (GLErrOccurred()) return NULL; 
    }
    Py_INCREF(Py_None); resultobj = Py_None;
    {
        /*currentTesselator = NULL;*/
        if (PyErr_Occurred()) return NULL;
    }
    return resultobj;
}


static PyObject *_wrap_gluTessVertex(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    PyGLUtesselator *arg1 ;
    GLdouble *arg2 ;
    PyObject *arg3 ;
    PyObject *temp_2 ;
    PyObject * obj0  = 0 ;
    PyObject * obj1  = 0 ;
    PyObject * obj2  = 0 ;
    
    if(!PyArg_ParseTuple(args,(char *)"OOO:gluTessVertex",&obj0,&obj1,&obj2)) return NULL;
    {
        if (obj0->ob_type != &PyGLUtesselator_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUtesselator object.");
            return NULL;
        }
        arg1 = (PyGLUtesselator*)obj0;
    }
    {
        arg2 = _PyObject_AsDoubleArray(obj1, &temp_2, NULL); 
    }
    {
        arg3 = obj2;
    }
    {
        _gluTessVertex(arg1,(GLdouble const *)arg2,arg3);
        if (GLErrOccurred()) return NULL; 
    }
    Py_INCREF(Py_None); resultobj = Py_None;
    {
        /*currentTesselator = NULL;*/
        if (PyErr_Occurred()) return NULL;
    }
    {
        _PyObject_AsArray_Cleanup(arg2, temp_2); 
    }
    return resultobj;
}


static PyObject *_wrap_gluTessEndContour(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLUtesselator *arg1 ;
    PyObject * obj0  = 0 ;
    
    if(!PyArg_ParseTuple(args,(char *)"O:gluTessEndContour",&obj0)) return NULL;
    {
        if (obj0->ob_type != &PyGLUtesselator_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUtesselator object.");
            return NULL;
        }
        /*currentTesselator = (PyGLUtesselator*)obj0;*/
        arg1 = ((PyGLUtesselator*)obj0)->obj;
    }
    {
        gluTessEndContour(arg1);
        if (GLErrOccurred()) return NULL; 
    }
    Py_INCREF(Py_None); resultobj = Py_None;
    {
        /*currentTesselator = NULL;*/
        if (PyErr_Occurred()) return NULL;
    }
    return resultobj;
}


static PyObject *_wrap_gluNextContour(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLUtesselator *arg1 ;
    GLenum arg2 ;
    PyObject * obj0  = 0 ;
    PyObject * obj1  = 0 ;
    
    if(!PyArg_ParseTuple(args,(char *)"OO:gluNextContour",&obj0,&obj1)) return NULL;
    {
        if (obj0->ob_type != &PyGLUtesselator_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUtesselator object.");
            return NULL;
        }
        /*currentTesselator = (PyGLUtesselator*)obj0;*/
        arg1 = ((PyGLUtesselator*)obj0)->obj;
    }
    arg2 = (GLenum) PyInt_AsLong(obj1);
    if (PyErr_Occurred()) return NULL;
    {
        gluNextContour(arg1,arg2);
        if (GLErrOccurred()) return NULL; 
    }
    Py_INCREF(Py_None); resultobj = Py_None;
    {
        /*currentTesselator = NULL;*/
        if (PyErr_Occurred()) return NULL;
    }
    return resultobj;
}


static PyObject *_wrap_gluTessEndPolygon(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    PyGLUtesselator *arg1 ;
    PyObject * obj0  = 0 ;
    
    if(!PyArg_ParseTuple(args,(char *)"O:gluTessEndPolygon",&obj0)) return NULL;
    {
        if (obj0->ob_type != &PyGLUtesselator_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUtesselator object.");
            return NULL;
        }
        arg1 = (PyGLUtesselator*)obj0;
    }
    {
        _gluTessEndPolygon(arg1);
        if (GLErrOccurred()) return NULL; 
    }
    Py_INCREF(Py_None); resultobj = Py_None;
    {
        /*currentTesselator = NULL;*/
        if (PyErr_Occurred()) return NULL;
    }
    return resultobj;
}


static PyObject *_wrap_gluEndPolygon(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLUtesselator *arg1 ;
    PyObject * obj0  = 0 ;
    
    if(!PyArg_ParseTuple(args,(char *)"O:gluEndPolygon",&obj0)) return NULL;
    {
        if (obj0->ob_type != &PyGLUtesselator_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUtesselator object.");
            return NULL;
        }
        /*currentTesselator = (PyGLUtesselator*)obj0;*/
        arg1 = ((PyGLUtesselator*)obj0)->obj;
    }
    {
        gluEndPolygon(arg1);
        if (GLErrOccurred()) return NULL; 
    }
    Py_INCREF(Py_None); resultobj = Py_None;
    {
        /*currentTesselator = NULL;*/
        if (PyErr_Occurred()) return NULL;
    }
    return resultobj;
}


static PyObject *_wrap_gluTessProperty(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLUtesselator *arg1 ;
    GLenum arg2 ;
    GLdouble arg3 ;
    PyObject * obj0  = 0 ;
    PyObject * obj1  = 0 ;
    
    if(!PyArg_ParseTuple(args,(char *)"OOd:gluTessProperty",&obj0,&obj1,&arg3)) return NULL;
    {
        if (obj0->ob_type != &PyGLUtesselator_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUtesselator object.");
            return NULL;
        }
        /*currentTesselator = (PyGLUtesselator*)obj0;*/
        arg1 = ((PyGLUtesselator*)obj0)->obj;
    }
    arg2 = (GLenum) PyInt_AsLong(obj1);
    if (PyErr_Occurred()) return NULL;
    {
        gluTessProperty(arg1,arg2,arg3);
        if (GLErrOccurred()) return NULL; 
    }
    Py_INCREF(Py_None); resultobj = Py_None;
    {
        /*currentTesselator = NULL;*/
        if (PyErr_Occurred()) return NULL;
    }
    return resultobj;
}


static PyObject *_wrap_gluTessNormal(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLUtesselator *arg1 ;
    GLdouble arg2 ;
    GLdouble arg3 ;
    GLdouble arg4 ;
    PyObject * obj0  = 0 ;
    
    if(!PyArg_ParseTuple(args,(char *)"Oddd:gluTessNormal",&obj0,&arg2,&arg3,&arg4)) return NULL;
    {
        if (obj0->ob_type != &PyGLUtesselator_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUtesselator object.");
            return NULL;
        }
        /*currentTesselator = (PyGLUtesselator*)obj0;*/
        arg1 = ((PyGLUtesselator*)obj0)->obj;
    }
    {
        gluTessNormal(arg1,arg2,arg3,arg4);
        if (GLErrOccurred()) return NULL; 
    }
    Py_INCREF(Py_None); resultobj = Py_None;
    {
        /*currentTesselator = NULL;*/
        if (PyErr_Occurred()) return NULL;
    }
    return resultobj;
}


static PyObject *_wrap_gluTessCallback(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    PyGLUtesselator *arg1 ;
    GLenum arg2 ;
    PyObject *arg3 ;
    PyObject *result;
    PyObject * obj0  = 0 ;
    PyObject * obj1  = 0 ;
    PyObject * obj2  = 0 ;
    
    if(!PyArg_ParseTuple(args,(char *)"OOO:gluTessCallback",&obj0,&obj1,&obj2)) return NULL;
    {
        if (obj0->ob_type != &PyGLUtesselator_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUtesselator object.");
            return NULL;
        }
        arg1 = (PyGLUtesselator*)obj0;
    }
    arg2 = (GLenum) PyInt_AsLong(obj1);
    if (PyErr_Occurred()) return NULL;
    {
        if (obj2 != Py_None && !PyCallable_Check(obj2))
        {
            PyErr_SetString(PyExc_Exception, "Not callable.");
            return NULL;
        }
        arg3 = obj2;
    }
    {
        result = (PyObject *)_gluTessCallback(arg1,arg2,arg3);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    {
        /*currentTesselator = NULL;*/
        if (PyErr_Occurred()) return NULL;
    }
    return resultobj;
}


static PyObject *_wrap_gluGetTessProperty(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLUtesselator *arg1 ;
    GLenum arg2 ;
    GLdouble *arg3 ;
    double temp_3[1] ;
    PyObject * obj0  = 0 ;
    PyObject * obj1  = 0 ;
    
    {
        int i; 	arg3 = temp_3; 	for (i = 0; i < 1; i++) arg3[i] = -DBL_MAX; 
    }
    if(!PyArg_ParseTuple(args,(char *)"OO:gluGetTessProperty",&obj0,&obj1)) return NULL;
    {
        if (obj0->ob_type != &PyGLUtesselator_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUtesselator object.");
            return NULL;
        }
        /*currentTesselator = (PyGLUtesselator*)obj0;*/
        arg1 = ((PyGLUtesselator*)obj0)->obj;
    }
    arg2 = (GLenum) PyInt_AsLong(obj1);
    if (PyErr_Occurred()) return NULL;
    {
        gluGetTessProperty(arg1,arg2,arg3);
        if (GLErrOccurred()) return NULL; 
    }
    Py_INCREF(Py_None); resultobj = Py_None;
    {
        int n, dims[2]; 	Py_XDECREF(resultobj); 	 	for (n = 0; n < 1 && arg3[n] != -DBL_MAX; n++); 	switch (n) 	{
            case 0: 		Py_INCREF(Py_None); 		resultobj = Py_None; 		break; 	case 1: 		resultobj = PyFloat_FromDouble(arg3[0]); 		break; 	case 16: 		dims[0] = 4; 		dims[1] = 4; 		resultobj = _PyObject_FromDoubleArray(2, dims, arg3, 0); 		break; 	default: 		resultobj = _PyTuple_FromDoubleArray(n, arg3); 	
        } 
    }
    {
        /*currentTesselator = NULL;*/
        if (PyErr_Occurred()) return NULL;
    }
    return resultobj;
}


static PyObject *_wrap_gluNewNurbsRenderer(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    PyGLUnurbs *result;
    
    if(!PyArg_ParseTuple(args,(char *)":gluNewNurbsRenderer")) return NULL;
    {
        result = (PyGLUnurbs *)_gluNewNurbsRenderer();
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj = (PyObject*)result;
    }
    return resultobj;
}


static PyObject *_wrap_gluDeleteNurbsRenderer(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    PyObject *arg1 ;
    PyObject * obj0  = 0 ;
    
    if(!PyArg_ParseTuple(args,(char *)"O:gluDeleteNurbsRenderer",&obj0)) return NULL;
    {
        arg1 = obj0;
    }
    {
        __ignoreDeletionCall(arg1);
        if (GLErrOccurred()) return NULL; 
    }
    Py_INCREF(Py_None); resultobj = Py_None;
    return resultobj;
}


static PyObject *_wrap_gluBeginSurface(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLUnurbs *arg1 ;
    PyObject * obj0  = 0 ;
    
    if(!PyArg_ParseTuple(args,(char *)"O:gluBeginSurface",&obj0)) return NULL;
    {
        if (obj0->ob_type != &PyGLUnurbs_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUnurbs object.");
            return NULL;
        }
        currentNurbs = (PyGLUnurbs*)obj0;
        arg1 = currentNurbs->obj;
    }
    {
        gluBeginSurface(arg1);
        if (GLErrOccurred()) return NULL; 
    }
    Py_INCREF(Py_None); resultobj = Py_None;
    {
        currentNurbs = NULL;
        if (PyErr_Occurred()) return NULL;
    }
    return resultobj;
}


static PyObject *_wrap_gluBeginCurve(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLUnurbs *arg1 ;
    PyObject * obj0  = 0 ;
    
    if(!PyArg_ParseTuple(args,(char *)"O:gluBeginCurve",&obj0)) return NULL;
    {
        if (obj0->ob_type != &PyGLUnurbs_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUnurbs object.");
            return NULL;
        }
        currentNurbs = (PyGLUnurbs*)obj0;
        arg1 = currentNurbs->obj;
    }
    {
        gluBeginCurve(arg1);
        if (GLErrOccurred()) return NULL; 
    }
    Py_INCREF(Py_None); resultobj = Py_None;
    {
        currentNurbs = NULL;
        if (PyErr_Occurred()) return NULL;
    }
    return resultobj;
}


static PyObject *_wrap_gluEndCurve(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLUnurbs *arg1 ;
    PyObject * obj0  = 0 ;
    
    if(!PyArg_ParseTuple(args,(char *)"O:gluEndCurve",&obj0)) return NULL;
    {
        if (obj0->ob_type != &PyGLUnurbs_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUnurbs object.");
            return NULL;
        }
        currentNurbs = (PyGLUnurbs*)obj0;
        arg1 = currentNurbs->obj;
    }
    {
        gluEndCurve(arg1);
        if (GLErrOccurred()) return NULL; 
    }
    Py_INCREF(Py_None); resultobj = Py_None;
    {
        currentNurbs = NULL;
        if (PyErr_Occurred()) return NULL;
    }
    return resultobj;
}


static PyObject *_wrap_gluEndSurface(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLUnurbs *arg1 ;
    PyObject * obj0  = 0 ;
    
    if(!PyArg_ParseTuple(args,(char *)"O:gluEndSurface",&obj0)) return NULL;
    {
        if (obj0->ob_type != &PyGLUnurbs_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUnurbs object.");
            return NULL;
        }
        currentNurbs = (PyGLUnurbs*)obj0;
        arg1 = currentNurbs->obj;
    }
    {
        gluEndSurface(arg1);
        if (GLErrOccurred()) return NULL; 
    }
    Py_INCREF(Py_None); resultobj = Py_None;
    {
        currentNurbs = NULL;
        if (PyErr_Occurred()) return NULL;
    }
    return resultobj;
}


static PyObject *_wrap_gluBeginTrim(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLUnurbs *arg1 ;
    PyObject * obj0  = 0 ;
    
    if(!PyArg_ParseTuple(args,(char *)"O:gluBeginTrim",&obj0)) return NULL;
    {
        if (obj0->ob_type != &PyGLUnurbs_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUnurbs object.");
            return NULL;
        }
        currentNurbs = (PyGLUnurbs*)obj0;
        arg1 = currentNurbs->obj;
    }
    {
        gluBeginTrim(arg1);
        if (GLErrOccurred()) return NULL; 
    }
    Py_INCREF(Py_None); resultobj = Py_None;
    {
        currentNurbs = NULL;
        if (PyErr_Occurred()) return NULL;
    }
    return resultobj;
}


static PyObject *_wrap_gluEndTrim(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLUnurbs *arg1 ;
    PyObject * obj0  = 0 ;
    
    if(!PyArg_ParseTuple(args,(char *)"O:gluEndTrim",&obj0)) return NULL;
    {
        if (obj0->ob_type != &PyGLUnurbs_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUnurbs object.");
            return NULL;
        }
        currentNurbs = (PyGLUnurbs*)obj0;
        arg1 = currentNurbs->obj;
    }
    {
        gluEndTrim(arg1);
        if (GLErrOccurred()) return NULL; 
    }
    Py_INCREF(Py_None); resultobj = Py_None;
    {
        currentNurbs = NULL;
        if (PyErr_Occurred()) return NULL;
    }
    return resultobj;
}


static PyObject *_wrap_gluPwlCurve(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLUnurbs *arg1 ;
    GLint arg2 ;
    GLfloat *arg3 ;
    GLint arg4 ;
    GLenum arg5 ;
    PyObject *temp_3 ;
    PyObject * obj0  = 0 ;
    PyObject * obj1  = 0 ;
    PyObject * obj2  = 0 ;
    
    {
    }
    {
    }
    if(!PyArg_ParseTuple(args,(char *)"OOO:gluPwlCurve",&obj0,&obj1,&obj2)) return NULL;
    {
        if (obj0->ob_type != &PyGLUnurbs_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUnurbs object.");
            return NULL;
        }
        currentNurbs = (PyGLUnurbs*)obj0;
        arg1 = currentNurbs->obj;
    }
    {
        arg3 = _PyObject_AsFloatArray(obj1, &temp_3, NULL); 
    }
    arg5 = (GLenum) PyInt_AsLong(obj2);
    if (PyErr_Occurred()) return NULL;
    {
        arg2 = (GLint)_PyObject_Dimension(obj1, 0); 
    }
    {
        arg4 = (GLint)_PyObject_Dimension(obj1, 1); 
    }
    {
        _gluPwlCurve(arg1,arg2,(GLfloat const *)arg3,arg4,arg5);
        if (GLErrOccurred()) return NULL; 
    }
    Py_INCREF(Py_None); resultobj = Py_None;
    {
        currentNurbs = NULL;
        if (PyErr_Occurred()) return NULL;
    }
    {
        _PyObject_AsArray_Cleanup(arg3, temp_3); 
    }
    return resultobj;
}


static PyObject *_wrap_gluNurbsCurve(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLUnurbs *arg1 ;
    GLint arg2 ;
    GLfloat *arg3 ;
    GLint arg4 ;
    GLint arg5 ;
    GLfloat *arg6 ;
    GLenum arg7 ;
    PyObject *temp_3 ;
    PyObject *temp_6 ;
    PyObject * obj0  = 0 ;
    PyObject * obj1  = 0 ;
    PyObject * obj2  = 0 ;
    PyObject * obj3  = 0 ;
    
    {
    }
    {
    }
    {
    }
    if(!PyArg_ParseTuple(args,(char *)"OOOO:gluNurbsCurve",&obj0,&obj1,&obj2,&obj3)) return NULL;
    {
        if (obj0->ob_type != &PyGLUnurbs_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUnurbs object.");
            return NULL;
        }
        currentNurbs = (PyGLUnurbs*)obj0;
        arg1 = currentNurbs->obj;
    }
    {
        arg3 = _PyObject_AsFloatArray(obj1, &temp_3, NULL); 
    }
    {
        arg6 = _PyObject_AsFloatArray(obj2, &temp_6, NULL); 
    }
    arg7 = (GLenum) PyInt_AsLong(obj3);
    if (PyErr_Occurred()) return NULL;
    {
        arg2 = (GLint)_PyObject_AsArray_Size(obj1); 
    }
    {
        arg4 = (GLint)_PyObject_Dimension(obj2, 0); 
    }
    {
        arg5 = (GLint)_PyObject_Dimension(obj2, 1); 
    }
    {
        _gluNurbsCurve(arg1,arg2,(GLfloat const *)arg3,arg4,arg5,(GLfloat const *)arg6,arg7);
        if (GLErrOccurred()) return NULL; 
    }
    Py_INCREF(Py_None); resultobj = Py_None;
    {
        currentNurbs = NULL;
        if (PyErr_Occurred()) return NULL;
    }
    {
        _PyObject_AsArray_Cleanup(arg3, temp_3); 
    }
    {
        _PyObject_AsArray_Cleanup(arg6, temp_6); 
    }
    return resultobj;
}


static PyObject *_wrap_gluNurbsSurface(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLUnurbs *arg1 ;
    GLint arg2 ;
    GLfloat *arg3 ;
    GLint arg4 ;
    GLfloat *arg5 ;
    GLint arg6 ;
    GLint arg7 ;
    GLint arg8 ;
    GLfloat *arg9 ;
    GLenum arg10 ;
    PyObject *temp_3 ;
    PyObject *temp_5 ;
    PyObject *temp_9 ;
    PyObject * obj0  = 0 ;
    PyObject * obj1  = 0 ;
    PyObject * obj2  = 0 ;
    PyObject * obj3  = 0 ;
    PyObject * obj4  = 0 ;
    
    {
    }
    {
    }
    {
    }
    {
    }
    {
    }
    if(!PyArg_ParseTuple(args,(char *)"OOOOO:gluNurbsSurface",&obj0,&obj1,&obj2,&obj3,&obj4)) return NULL;
    {
        if (obj0->ob_type != &PyGLUnurbs_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUnurbs object.");
            return NULL;
        }
        currentNurbs = (PyGLUnurbs*)obj0;
        arg1 = currentNurbs->obj;
    }
    {
        arg3 = _PyObject_AsFloatArray(obj1, &temp_3, NULL); 
    }
    {
        arg5 = _PyObject_AsFloatArray(obj2, &temp_5, NULL); 
    }
    {
        arg9 = _PyObject_AsFloatArray(obj3, &temp_9, NULL); 
    }
    arg10 = (GLenum) PyInt_AsLong(obj4);
    if (PyErr_Occurred()) return NULL;
    {
        arg2 = (GLint)_PyObject_AsArray_Size(obj1); 
    }
    {
        arg4 = (GLint)_PyObject_AsArray_Size(obj2); 
    }
    {
        arg6 = (GLint)_PyObject_Dimension(obj3, 0); 
    }
    {
        arg7 = (GLint)_PyObject_Dimension(obj3, 1); 
    }
    {
        arg8 = (GLint)_PyObject_Dimension(obj3, 2); 
    }
    {
        _gluNurbsSurface(arg1,arg2,(GLfloat const *)arg3,arg4,(GLfloat const *)arg5,arg6,arg7,arg8,(GLfloat const *)arg9,arg10);
        if (GLErrOccurred()) return NULL; 
    }
    Py_INCREF(Py_None); resultobj = Py_None;
    {
        currentNurbs = NULL;
        if (PyErr_Occurred()) return NULL;
    }
    {
        _PyObject_AsArray_Cleanup(arg3, temp_3); 
    }
    {
        _PyObject_AsArray_Cleanup(arg5, temp_5); 
    }
    {
        _PyObject_AsArray_Cleanup(arg9, temp_9); 
    }
    return resultobj;
}


static PyObject *_wrap_gluLoadSamplingMatrices(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLUnurbs *arg1 ;
    GLfloat *arg2 ;
    GLfloat *arg3 ;
    GLint *arg4 ;
    PyObject *temp_2 ;
    PyObject *temp_3 ;
    PyObject *temp_4 ;
    PyObject * obj0  = 0 ;
    PyObject * obj1  = 0 ;
    PyObject * obj2  = 0 ;
    PyObject * obj3  = 0 ;
    
    if(!PyArg_ParseTuple(args,(char *)"OOOO:gluLoadSamplingMatrices",&obj0,&obj1,&obj2,&obj3)) return NULL;
    {
        if (obj0->ob_type != &PyGLUnurbs_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUnurbs object.");
            return NULL;
        }
        currentNurbs = (PyGLUnurbs*)obj0;
        arg1 = currentNurbs->obj;
    }
    {
        arg2 = _PyObject_AsFloatArray(obj1, &temp_2, NULL); 
    }
    {
        arg3 = _PyObject_AsFloatArray(obj2, &temp_3, NULL); 
    }
    {
        arg4 = _PyObject_AsIntArray(obj3, &temp_4, NULL); 
    }
    {
        gluLoadSamplingMatrices(arg1,(GLfloat const *)arg2,(GLfloat const *)arg3,(GLint const *)arg4);
        if (GLErrOccurred()) return NULL; 
    }
    Py_INCREF(Py_None); resultobj = Py_None;
    {
        currentNurbs = NULL;
        if (PyErr_Occurred()) return NULL;
    }
    {
        _PyObject_AsArray_Cleanup(arg2, temp_2); 
    }
    {
        _PyObject_AsArray_Cleanup(arg3, temp_3); 
    }
    {
        _PyObject_AsArray_Cleanup(arg4, temp_4); 
    }
    return resultobj;
}


static PyObject *_wrap_gluNurbsProperty(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLUnurbs *arg1 ;
    GLenum arg2 ;
    GLfloat arg3 ;
    PyObject * obj0  = 0 ;
    PyObject * obj1  = 0 ;
    
    if(!PyArg_ParseTuple(args,(char *)"OOf:gluNurbsProperty",&obj0,&obj1,&arg3)) return NULL;
    {
        if (obj0->ob_type != &PyGLUnurbs_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUnurbs object.");
            return NULL;
        }
        currentNurbs = (PyGLUnurbs*)obj0;
        arg1 = currentNurbs->obj;
    }
    arg2 = (GLenum) PyInt_AsLong(obj1);
    if (PyErr_Occurred()) return NULL;
    {
        gluNurbsProperty(arg1,arg2,arg3);
        if (GLErrOccurred()) return NULL; 
    }
    Py_INCREF(Py_None); resultobj = Py_None;
    {
        currentNurbs = NULL;
        if (PyErr_Occurred()) return NULL;
    }
    return resultobj;
}


static PyObject *_wrap_gluGetNurbsProperty(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLUnurbs *arg1 ;
    GLenum arg2 ;
    GLfloat *arg3 ;
    float temp_3[1] ;
    PyObject * obj0  = 0 ;
    PyObject * obj1  = 0 ;
    
    {
        int i; 	arg3 = temp_3; 	for (i = 0; i < 1; i++) arg3[i] = -FLT_MAX; 
    }
    if(!PyArg_ParseTuple(args,(char *)"OO:gluGetNurbsProperty",&obj0,&obj1)) return NULL;
    {
        if (obj0->ob_type != &PyGLUnurbs_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUnurbs object.");
            return NULL;
        }
        currentNurbs = (PyGLUnurbs*)obj0;
        arg1 = currentNurbs->obj;
    }
    arg2 = (GLenum) PyInt_AsLong(obj1);
    if (PyErr_Occurred()) return NULL;
    {
        gluGetNurbsProperty(arg1,arg2,arg3);
        if (GLErrOccurred()) return NULL; 
    }
    Py_INCREF(Py_None); resultobj = Py_None;
    {
        int n, dims[2]; 	Py_XDECREF(resultobj); 	 	for (n = 0; n < 1 && arg3[n] != -FLT_MAX; n++); 	switch (n) 	{
            case 0: 		Py_INCREF(Py_None); 		resultobj = Py_None; 		break; 	case 1: 		resultobj = PyFloat_FromDouble(arg3[0]); 		break; 	case 16: 		dims[0] = 4; 		dims[1] = 4; 		resultobj = _PyObject_FromFloatArray(2, dims, arg3, 0); 		break; 	default: 		resultobj = _PyTuple_FromFloatArray(n, arg3); 	
        } 
    }
    {
        currentNurbs = NULL;
        if (PyErr_Occurred()) return NULL;
    }
    return resultobj;
}


static PyObject *_wrap_gluNurbsCallback(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    PyGLUnurbs *arg1 ;
    GLenum arg2 ;
    PyObject *arg3 ;
    PyObject *result;
    PyObject * obj0  = 0 ;
    PyObject * obj1  = 0 ;
    PyObject * obj2  = 0 ;
    
    if(!PyArg_ParseTuple(args,(char *)"OOO:gluNurbsCallback",&obj0,&obj1,&obj2)) return NULL;
    {
        if (obj0->ob_type != &PyGLUnurbs_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUnurbs object.");
            return NULL;
        }
        arg1 = currentNurbs = (PyGLUnurbs*)obj0;
    }
    arg2 = (GLenum) PyInt_AsLong(obj1);
    if (PyErr_Occurred()) return NULL;
    {
        if (obj2 != Py_None && !PyCallable_Check(obj2))
        {
            PyErr_SetString(PyExc_Exception, "Not callable.");
            return NULL;
        }
        arg3 = obj2;
    }
    {
        result = (PyObject *)_gluNurbsCallback(arg1,arg2,arg3);
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    {
        currentNurbs = NULL;
        if (PyErr_Occurred()) return NULL;
    }
    return resultobj;
}


static PyObject *_wrap_gluNurbsCallbackData(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    PyGLUnurbs *arg1 ;
    PyObject *arg2 ;
    PyObject * obj0  = 0 ;
    PyObject * obj1  = 0 ;
    
    if(!PyArg_ParseTuple(args,(char *)"OO:gluNurbsCallbackData",&obj0,&obj1)) return NULL;
    {
        if (obj0->ob_type != &PyGLUnurbs_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUnurbs object.");
            return NULL;
        }
        arg1 = currentNurbs = (PyGLUnurbs*)obj0;
    }
    {
        arg2 = obj1;
    }
    {
        _gluNurbsCallbackData(arg1,arg2);
        if (GLErrOccurred()) return NULL; 
    }
    Py_INCREF(Py_None); resultobj = Py_None;
    {
        currentNurbs = NULL;
        if (PyErr_Occurred()) return NULL;
    }
    return resultobj;
}


static PyObject *_wrap___gluNurbsCallbackDataEXT(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLUnurbs *arg1 ;
    PyObject *arg2 ;
    PyObject * obj0  = 0 ;
    PyObject * obj1  = 0 ;
    
    if(!PyArg_ParseTuple(args,(char *)"OO:__gluNurbsCallbackDataEXT",&obj0,&obj1)) return NULL;
    {
        if (obj0->ob_type != &PyGLUnurbs_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUnurbs object.");
            return NULL;
        }
        currentNurbs = (PyGLUnurbs*)obj0;
        arg1 = currentNurbs->obj;
    }
    {
        arg2 = obj1;
    }
    {
        __gluNurbsCallbackDataEXT(arg1,arg2);
        if (GLErrOccurred()) return NULL; 
    }
    Py_INCREF(Py_None); resultobj = Py_None;
    {
        currentNurbs = NULL;
        if (PyErr_Occurred()) return NULL;
    }
    return resultobj;
}


static PyObject *_wrap___gluInitNurbsTessellatorEXT(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    int result;
    
    if(!PyArg_ParseTuple(args,(char *)":__gluInitNurbsTessellatorEXT")) return NULL;
    {
        result = (int)__gluInitNurbsTessellatorEXT();
        if (GLErrOccurred()) return NULL; 
    }
    resultobj = PyInt_FromLong((long)result);
    return resultobj;
}


static PyMethodDef SwigMethods[] = {
	 { (char *)"gluErrorString", _wrap_gluErrorString, METH_VARARGS , _doc_gluErrorString},
	 { (char *)"gluGetString", _wrap_gluGetString, METH_VARARGS , _doc_gluGetString},
	 { (char *)"gluCheckExtension", _wrap_gluCheckExtension, METH_VARARGS , _doc_gluCheckExtension},
	 { (char *)"gluOrtho2D", _wrap_gluOrtho2D, METH_VARARGS , _doc_gluOrtho2D},
	 { (char *)"gluPerspective", _wrap_gluPerspective, METH_VARARGS , _doc_gluPerspective},
	 { (char *)"__gluPickMatrix", _wrap___gluPickMatrix, METH_VARARGS },
	 { (char *)"gluLookAt", _wrap_gluLookAt, METH_VARARGS , _doc_gluLookAt},
	 { (char *)"__gluProject", _wrap___gluProject, METH_VARARGS },
	 { (char *)"__gluUnProject", _wrap___gluUnProject, METH_VARARGS },
	 { (char *)"__gluUnProject4", _wrap___gluUnProject4, METH_VARARGS },
	 { (char *)"gluScaleImage", _wrap_gluScaleImage, METH_VARARGS , _doc_gluScaleImage},
	 { (char *)"gluScaleImageb", _wrap_gluScaleImageb, METH_VARARGS , _doc_gluScaleImageb},
	 { (char *)"gluScaleImageub", _wrap_gluScaleImageub, METH_VARARGS , _doc_gluScaleImageub},
	 { (char *)"gluScaleImages", _wrap_gluScaleImages, METH_VARARGS , _doc_gluScaleImages},
	 { (char *)"gluScaleImageus", _wrap_gluScaleImageus, METH_VARARGS , _doc_gluScaleImageus},
	 { (char *)"gluScaleImagei", _wrap_gluScaleImagei, METH_VARARGS , _doc_gluScaleImagei},
	 { (char *)"gluScaleImageui", _wrap_gluScaleImageui, METH_VARARGS , _doc_gluScaleImageui},
	 { (char *)"gluScaleImagef", _wrap_gluScaleImagef, METH_VARARGS , _doc_gluScaleImagef},
	 { (char *)"gluBuild1DMipmaps", _wrap_gluBuild1DMipmaps, METH_VARARGS , _doc_gluBuild1DMipmaps},
	 { (char *)"gluBuild1DMipmapsb", _wrap_gluBuild1DMipmapsb, METH_VARARGS , _doc_gluBuild1DMipmapsb},
	 { (char *)"gluBuild1DMipmapsub", _wrap_gluBuild1DMipmapsub, METH_VARARGS , _doc_gluBuild1DMipmapsub},
	 { (char *)"gluBuild1DMipmapss", _wrap_gluBuild1DMipmapss, METH_VARARGS , _doc_gluBuild1DMipmapss},
	 { (char *)"gluBuild1DMipmapsus", _wrap_gluBuild1DMipmapsus, METH_VARARGS , _doc_gluBuild1DMipmapsus},
	 { (char *)"gluBuild1DMipmapsi", _wrap_gluBuild1DMipmapsi, METH_VARARGS , _doc_gluBuild1DMipmapsi},
	 { (char *)"gluBuild1DMipmapsui", _wrap_gluBuild1DMipmapsui, METH_VARARGS , _doc_gluBuild1DMipmapsui},
	 { (char *)"gluBuild1DMipmapsf", _wrap_gluBuild1DMipmapsf, METH_VARARGS , _doc_gluBuild1DMipmapsf},
	 { (char *)"gluBuild2DMipmaps", _wrap_gluBuild2DMipmaps, METH_VARARGS , _doc_gluBuild2DMipmaps},
	 { (char *)"gluBuild2DMipmapsb", _wrap_gluBuild2DMipmapsb, METH_VARARGS , _doc_gluBuild2DMipmapsb},
	 { (char *)"gluBuild2DMipmapsub", _wrap_gluBuild2DMipmapsub, METH_VARARGS , _doc_gluBuild2DMipmapsub},
	 { (char *)"gluBuild2DMipmapss", _wrap_gluBuild2DMipmapss, METH_VARARGS , _doc_gluBuild2DMipmapss},
	 { (char *)"gluBuild2DMipmapsus", _wrap_gluBuild2DMipmapsus, METH_VARARGS , _doc_gluBuild2DMipmapsus},
	 { (char *)"gluBuild2DMipmapsi", _wrap_gluBuild2DMipmapsi, METH_VARARGS , _doc_gluBuild2DMipmapsi},
	 { (char *)"gluBuild2DMipmapsui", _wrap_gluBuild2DMipmapsui, METH_VARARGS , _doc_gluBuild2DMipmapsui},
	 { (char *)"gluBuild2DMipmapsf", _wrap_gluBuild2DMipmapsf, METH_VARARGS , _doc_gluBuild2DMipmapsf},
	 { (char *)"gluBuild3DMipmaps", _wrap_gluBuild3DMipmaps, METH_VARARGS , _doc_gluBuild3DMipmaps},
	 { (char *)"gluBuild3DMipmapsb", _wrap_gluBuild3DMipmapsb, METH_VARARGS , _doc_gluBuild3DMipmapsb},
	 { (char *)"gluBuild3DMipmapsub", _wrap_gluBuild3DMipmapsub, METH_VARARGS , _doc_gluBuild3DMipmapsub},
	 { (char *)"gluBuild3DMipmapss", _wrap_gluBuild3DMipmapss, METH_VARARGS , _doc_gluBuild3DMipmapss},
	 { (char *)"gluBuild3DMipmapsus", _wrap_gluBuild3DMipmapsus, METH_VARARGS , _doc_gluBuild3DMipmapsus},
	 { (char *)"gluBuild3DMipmapsi", _wrap_gluBuild3DMipmapsi, METH_VARARGS , _doc_gluBuild3DMipmapsi},
	 { (char *)"gluBuild3DMipmapsui", _wrap_gluBuild3DMipmapsui, METH_VARARGS , _doc_gluBuild3DMipmapsui},
	 { (char *)"gluBuild3DMipmapsf", _wrap_gluBuild3DMipmapsf, METH_VARARGS , _doc_gluBuild3DMipmapsf},
	 { (char *)"gluBuild1DMipmapLevels", _wrap_gluBuild1DMipmapLevels, METH_VARARGS , _doc_gluBuild1DMipmapLevels},
	 { (char *)"gluBuild1DMipmapLevelsb", _wrap_gluBuild1DMipmapLevelsb, METH_VARARGS , _doc_gluBuild1DMipmapLevelsb},
	 { (char *)"gluBuild1DMipmapLevelsub", _wrap_gluBuild1DMipmapLevelsub, METH_VARARGS , _doc_gluBuild1DMipmapLevelsub},
	 { (char *)"gluBuild1DMipmapLevelss", _wrap_gluBuild1DMipmapLevelss, METH_VARARGS , _doc_gluBuild1DMipmapLevelss},
	 { (char *)"gluBuild1DMipmapLevelsus", _wrap_gluBuild1DMipmapLevelsus, METH_VARARGS , _doc_gluBuild1DMipmapLevelsus},
	 { (char *)"gluBuild1DMipmapLevelsi", _wrap_gluBuild1DMipmapLevelsi, METH_VARARGS , _doc_gluBuild1DMipmapLevelsi},
	 { (char *)"gluBuild1DMipmapLevelsui", _wrap_gluBuild1DMipmapLevelsui, METH_VARARGS , _doc_gluBuild1DMipmapLevelsui},
	 { (char *)"gluBuild1DMipmapLevelsf", _wrap_gluBuild1DMipmapLevelsf, METH_VARARGS , _doc_gluBuild1DMipmapLevelsf},
	 { (char *)"gluBuild2DMipmapLevels", _wrap_gluBuild2DMipmapLevels, METH_VARARGS , _doc_gluBuild2DMipmapLevels},
	 { (char *)"gluBuild2DMipmapLevelsb", _wrap_gluBuild2DMipmapLevelsb, METH_VARARGS , _doc_gluBuild2DMipmapLevelsb},
	 { (char *)"gluBuild2DMipmapLevelsub", _wrap_gluBuild2DMipmapLevelsub, METH_VARARGS , _doc_gluBuild2DMipmapLevelsub},
	 { (char *)"gluBuild2DMipmapLevelss", _wrap_gluBuild2DMipmapLevelss, METH_VARARGS , _doc_gluBuild2DMipmapLevelss},
	 { (char *)"gluBuild2DMipmapLevelsus", _wrap_gluBuild2DMipmapLevelsus, METH_VARARGS , _doc_gluBuild2DMipmapLevelsus},
	 { (char *)"gluBuild2DMipmapLevelsi", _wrap_gluBuild2DMipmapLevelsi, METH_VARARGS , _doc_gluBuild2DMipmapLevelsi},
	 { (char *)"gluBuild2DMipmapLevelsui", _wrap_gluBuild2DMipmapLevelsui, METH_VARARGS , _doc_gluBuild2DMipmapLevelsui},
	 { (char *)"gluBuild2DMipmapLevelsf", _wrap_gluBuild2DMipmapLevelsf, METH_VARARGS , _doc_gluBuild2DMipmapLevelsf},
	 { (char *)"gluBuild3DMipmapLevels", _wrap_gluBuild3DMipmapLevels, METH_VARARGS , _doc_gluBuild3DMipmapLevels},
	 { (char *)"gluBuild3DMipmapLevelsb", _wrap_gluBuild3DMipmapLevelsb, METH_VARARGS , _doc_gluBuild3DMipmapLevelsb},
	 { (char *)"gluBuild3DMipmapLevelsub", _wrap_gluBuild3DMipmapLevelsub, METH_VARARGS , _doc_gluBuild3DMipmapLevelsub},
	 { (char *)"gluBuild3DMipmapLevelss", _wrap_gluBuild3DMipmapLevelss, METH_VARARGS , _doc_gluBuild3DMipmapLevelss},
	 { (char *)"gluBuild3DMipmapLevelsus", _wrap_gluBuild3DMipmapLevelsus, METH_VARARGS , _doc_gluBuild3DMipmapLevelsus},
	 { (char *)"gluBuild3DMipmapLevelsi", _wrap_gluBuild3DMipmapLevelsi, METH_VARARGS , _doc_gluBuild3DMipmapLevelsi},
	 { (char *)"gluBuild3DMipmapLevelsui", _wrap_gluBuild3DMipmapLevelsui, METH_VARARGS , _doc_gluBuild3DMipmapLevelsui},
	 { (char *)"gluBuild3DMipmapLevelsf", _wrap_gluBuild3DMipmapLevelsf, METH_VARARGS , _doc_gluBuild3DMipmapLevelsf},
	 { (char *)"gluNewQuadric", _wrap_gluNewQuadric, METH_VARARGS , _doc_gluNewQuadric},
	 { (char *)"gluDeleteQuadric", _wrap_gluDeleteQuadric, METH_VARARGS , _doc_gluDeleteQuadric},
	 { (char *)"gluQuadricNormals", _wrap_gluQuadricNormals, METH_VARARGS , _doc_gluQuadricNormals},
	 { (char *)"gluQuadricTexture", _wrap_gluQuadricTexture, METH_VARARGS , _doc_gluQuadricTexture},
	 { (char *)"gluQuadricOrientation", _wrap_gluQuadricOrientation, METH_VARARGS , _doc_gluQuadricOrientation},
	 { (char *)"gluQuadricDrawStyle", _wrap_gluQuadricDrawStyle, METH_VARARGS , _doc_gluQuadricDrawStyle},
	 { (char *)"gluCylinder", _wrap_gluCylinder, METH_VARARGS , _doc_gluCylinder},
	 { (char *)"gluDisk", _wrap_gluDisk, METH_VARARGS , _doc_gluDisk},
	 { (char *)"gluPartialDisk", _wrap_gluPartialDisk, METH_VARARGS , _doc_gluPartialDisk},
	 { (char *)"gluSphere", _wrap_gluSphere, METH_VARARGS , _doc_gluSphere},
	 { (char *)"gluQuadricCallback", _wrap_gluQuadricCallback, METH_VARARGS , _doc_gluQuadricCallback},
	 { (char *)"gluNewTess", _wrap_gluNewTess, METH_VARARGS , _doc_gluNewTess},
	 { (char *)"gluDeleteTess", _wrap_gluDeleteTess, METH_VARARGS , _doc_gluDeleteTess},
	 { (char *)"gluTessBeginPolygon", _wrap_gluTessBeginPolygon, METH_VARARGS , _doc_gluTessBeginPolygon},
	 { (char *)"gluBeginPolygon", _wrap_gluBeginPolygon, METH_VARARGS , _doc_gluBeginPolygon},
	 { (char *)"gluTessBeginContour", _wrap_gluTessBeginContour, METH_VARARGS , _doc_gluTessBeginContour},
	 { (char *)"gluTessVertex", _wrap_gluTessVertex, METH_VARARGS , _doc_gluTessVertex},
	 { (char *)"gluTessEndContour", _wrap_gluTessEndContour, METH_VARARGS , _doc_gluTessEndContour},
	 { (char *)"gluNextContour", _wrap_gluNextContour, METH_VARARGS , _doc_gluNextContour},
	 { (char *)"gluTessEndPolygon", _wrap_gluTessEndPolygon, METH_VARARGS , _doc_gluTessEndPolygon},
	 { (char *)"gluEndPolygon", _wrap_gluEndPolygon, METH_VARARGS , _doc_gluEndPolygon},
	 { (char *)"gluTessProperty", _wrap_gluTessProperty, METH_VARARGS , _doc_gluTessProperty},
	 { (char *)"gluTessNormal", _wrap_gluTessNormal, METH_VARARGS , _doc_gluTessNormal},
	 { (char *)"gluTessCallback", _wrap_gluTessCallback, METH_VARARGS , _doc_gluTessCallback},
	 { (char *)"gluGetTessProperty", _wrap_gluGetTessProperty, METH_VARARGS , _doc_gluGetTessProperty},
	 { (char *)"gluNewNurbsRenderer", _wrap_gluNewNurbsRenderer, METH_VARARGS , _doc_gluNewNurbsRenderer},
	 { (char *)"gluDeleteNurbsRenderer", _wrap_gluDeleteNurbsRenderer, METH_VARARGS , _doc_gluDeleteNurbsRenderer},
	 { (char *)"gluBeginSurface", _wrap_gluBeginSurface, METH_VARARGS , _doc_gluBeginSurface},
	 { (char *)"gluBeginCurve", _wrap_gluBeginCurve, METH_VARARGS , _doc_gluBeginCurve},
	 { (char *)"gluEndCurve", _wrap_gluEndCurve, METH_VARARGS , _doc_gluEndCurve},
	 { (char *)"gluEndSurface", _wrap_gluEndSurface, METH_VARARGS , _doc_gluEndSurface},
	 { (char *)"gluBeginTrim", _wrap_gluBeginTrim, METH_VARARGS , _doc_gluBeginTrim},
	 { (char *)"gluEndTrim", _wrap_gluEndTrim, METH_VARARGS , _doc_gluEndTrim},
	 { (char *)"gluPwlCurve", _wrap_gluPwlCurve, METH_VARARGS , _doc_gluPwlCurve},
	 { (char *)"gluNurbsCurve", _wrap_gluNurbsCurve, METH_VARARGS , _doc_gluNurbsCurve},
	 { (char *)"gluNurbsSurface", _wrap_gluNurbsSurface, METH_VARARGS , _doc_gluNurbsSurface},
	 { (char *)"gluLoadSamplingMatrices", _wrap_gluLoadSamplingMatrices, METH_VARARGS , _doc_gluLoadSamplingMatrices},
	 { (char *)"gluNurbsProperty", _wrap_gluNurbsProperty, METH_VARARGS , _doc_gluNurbsProperty},
	 { (char *)"gluGetNurbsProperty", _wrap_gluGetNurbsProperty, METH_VARARGS , _doc_gluGetNurbsProperty},
	 { (char *)"gluNurbsCallback", _wrap_gluNurbsCallback, METH_VARARGS , _doc_gluNurbsCallback},
	 { (char *)"gluNurbsCallbackData", _wrap_gluNurbsCallbackData, METH_VARARGS , _doc_gluNurbsCallbackData},
	 { (char *)"__gluNurbsCallbackDataEXT", _wrap___gluNurbsCallbackDataEXT, METH_VARARGS , _doc___gluNurbsCallbackDataEXT},
	 { (char *)"__gluInitNurbsTessellatorEXT", _wrap___gluInitNurbsTessellatorEXT, METH_VARARGS , _doc___gluInitNurbsTessellatorEXT},
	 { NULL, NULL }
};


/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */


static swig_type_info *swig_types_initial[] = {
0
};


/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */

static swig_const_info swig_const_table[] = {
{ SWIG_PY_STRING,  (char*)"__version__", 0, 0, (void *)"1.1", 0},
{ SWIG_PY_STRING,  (char*)"__date__", 0, 0, (void *)"2003/10/19 04:09:43", 0},
{ SWIG_PY_INT,     (char *)"__api_version__", (long) 259, 0, 0, 0},
{ SWIG_PY_STRING,  (char*)"__author__", 0, 0, (void *)"Tarn Weisner Burton <twburton@users.sourceforge.net>", 0},
{ SWIG_PY_STRING,  (char*)"__doc__", 0, 0, (void *)"http://www.opengl.org/developers/documentation/glx.html", 0},
{ SWIG_PY_INT,     (char *)"GLU_VERSION_1_1", (long) 1, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_VERSION_1_2", (long) 1, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_VERSION_1_3", (long) 1, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_INVALID_ENUM", (long) 100900, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_INVALID_VALUE", (long) 100901, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_OUT_OF_MEMORY", (long) 100902, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_INCOMPATIBLE_GL_VERSION", (long) 100903, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_VERSION", (long) 100800, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_EXTENSIONS", (long) 100801, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_SMOOTH", (long) 100000, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_FLAT", (long) 100001, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_NONE", (long) 100002, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_POINT", (long) 100010, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_LINE", (long) 100011, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_FILL", (long) 100012, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_SILHOUETTE", (long) 100013, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_OUTSIDE", (long) 100020, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_INSIDE", (long) 100021, 0, 0, 0},
{ SWIG_PY_FLOAT,   (char*)"GLU_TESS_MAX_COORD", 0, (double) 1.0e150, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_TESS_WINDING_RULE", (long) 100140, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_TESS_BOUNDARY_ONLY", (long) 100141, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_TESS_TOLERANCE", (long) 100142, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_TESS_WINDING_ODD", (long) 100130, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_TESS_WINDING_NONZERO", (long) 100131, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_TESS_WINDING_POSITIVE", (long) 100132, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_TESS_WINDING_NEGATIVE", (long) 100133, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_TESS_WINDING_ABS_GEQ_TWO", (long) 100134, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_TESS_BEGIN", (long) 100100, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_TESS_VERTEX", (long) 100101, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_TESS_END", (long) 100102, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_TESS_ERROR", (long) 100103, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_TESS_EDGE_FLAG", (long) 100104, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_TESS_COMBINE", (long) 100105, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_TESS_BEGIN_DATA", (long) 100106, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_TESS_VERTEX_DATA", (long) 100107, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_TESS_END_DATA", (long) 100108, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_TESS_ERROR_DATA", (long) 100109, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_TESS_EDGE_FLAG_DATA", (long) 100110, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_TESS_COMBINE_DATA", (long) 100111, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_TESS_ERROR1", (long) 100151, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_TESS_ERROR2", (long) 100152, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_TESS_ERROR3", (long) 100153, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_TESS_ERROR4", (long) 100154, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_TESS_ERROR5", (long) 100155, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_TESS_ERROR6", (long) 100156, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_TESS_ERROR7", (long) 100157, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_TESS_ERROR8", (long) 100158, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_TESS_MISSING_BEGIN_POLYGON", (long) 100151, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_TESS_MISSING_BEGIN_CONTOUR", (long) 100152, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_TESS_MISSING_END_POLYGON", (long) 100153, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_TESS_MISSING_END_CONTOUR", (long) 100154, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_TESS_COORD_TOO_LARGE", (long) 100155, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_TESS_NEED_COMBINE_CALLBACK", (long) 100156, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_AUTO_LOAD_MATRIX", (long) 100200, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_CULLING", (long) 100201, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_SAMPLING_TOLERANCE", (long) 100203, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_DISPLAY_MODE", (long) 100204, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_PARAMETRIC_TOLERANCE", (long) 100202, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_SAMPLING_METHOD", (long) 100205, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_U_STEP", (long) 100206, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_V_STEP", (long) 100207, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_PATH_LENGTH", (long) 100215, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_PARAMETRIC_ERROR", (long) 100216, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_DOMAIN_DISTANCE", (long) 100217, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_MAP1_TRIM_2", (long) 100210, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_MAP1_TRIM_3", (long) 100211, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_OUTLINE_POLYGON", (long) 100240, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_OUTLINE_PATCH", (long) 100241, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_NURBS_ERROR1", (long) 100251, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_NURBS_ERROR2", (long) 100252, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_NURBS_ERROR3", (long) 100253, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_NURBS_ERROR4", (long) 100254, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_NURBS_ERROR5", (long) 100255, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_NURBS_ERROR6", (long) 100256, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_NURBS_ERROR7", (long) 100257, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_NURBS_ERROR8", (long) 100258, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_NURBS_ERROR9", (long) 100259, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_NURBS_ERROR10", (long) 100260, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_NURBS_ERROR11", (long) 100261, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_NURBS_ERROR12", (long) 100262, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_NURBS_ERROR13", (long) 100263, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_NURBS_ERROR14", (long) 100264, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_NURBS_ERROR15", (long) 100265, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_NURBS_ERROR16", (long) 100266, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_NURBS_ERROR17", (long) 100267, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_NURBS_ERROR18", (long) 100268, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_NURBS_ERROR19", (long) 100269, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_NURBS_ERROR20", (long) 100270, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_NURBS_ERROR21", (long) 100271, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_NURBS_ERROR22", (long) 100272, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_NURBS_ERROR23", (long) 100273, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_NURBS_ERROR24", (long) 100274, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_NURBS_ERROR25", (long) 100275, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_NURBS_ERROR26", (long) 100276, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_NURBS_ERROR27", (long) 100277, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_NURBS_ERROR28", (long) 100278, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_NURBS_ERROR29", (long) 100279, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_NURBS_ERROR30", (long) 100280, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_NURBS_ERROR31", (long) 100281, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_NURBS_ERROR32", (long) 100282, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_NURBS_ERROR33", (long) 100283, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_NURBS_ERROR34", (long) 100284, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_NURBS_ERROR35", (long) 100285, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_NURBS_ERROR36", (long) 100286, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_NURBS_ERROR37", (long) 100287, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_CW", (long) 100120, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_CCW", (long) 100121, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_INTERIOR", (long) 100122, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_EXTERIOR", (long) 100123, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_UNKNOWN", (long) 100124, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_BEGIN", (long) 100100, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_VERTEX", (long) 100101, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_END", (long) 100102, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_ERROR", (long) 100103, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_EDGE_FLAG", (long) 100104, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_NURBS_MODE", (long) 100160, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_NURBS_TESSELLATOR", (long) 100161, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_NURBS_RENDERER", (long) 100162, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_NURBS_BEGIN", (long) 100164, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_NURBS_VERTEX", (long) 100165, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_NURBS_NORMAL", (long) 100166, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_NURBS_COLOR", (long) 100167, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_NURBS_TEXTURE_COORD", (long) 100168, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_NURBS_END", (long) 100169, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_NURBS_BEGIN_DATA", (long) 100170, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_NURBS_VERTEX_DATA", (long) 100171, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_NURBS_NORMAL_DATA", (long) 100172, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_NURBS_COLOR_DATA", (long) 100173, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_NURBS_TEXTURE_COORD_DATA", (long) 100174, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_NURBS_END_DATA", (long) 100175, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_OBJECT_PARAMETRIC_ERROR", (long) 100208, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GLU_OBJECT_PATH_LENGTH", (long) 100209, 0, 0, 0},
{0}};

#ifdef __cplusplus
}
#endif

#ifdef __cplusplus
extern "C"
#endif
SWIGEXPORT(void) SWIG_init(void) {
    static PyObject *SWIG_globals = 0; 
    static int       typeinit = 0;
    PyObject *m, *d;
    int       i;
    if (!SWIG_globals) SWIG_globals = SWIG_newvarlink();
    m = Py_InitModule((char *) SWIG_name, SwigMethods);
    d = PyModule_GetDict(m);
    
    if (!typeinit) {
        for (i = 0; swig_types_initial[i]; i++) {
            swig_types[i] = SWIG_TypeRegister(swig_types_initial[i]);
        }
        typeinit = 1;
    }
    SWIG_InstallConstants(d,swig_const_table);
    
    
    #ifdef NUMERIC
    PyArray_API = NULL;
    import_array();
    init_util();
    PyErr_Clear();
    #endif
    
    
    {
        PyObject *util = PyImport_ImportModule("OpenGL.GL.GL__init___");
        if (util)
        {
            PyObject *api_object = PyDict_GetItemString(PyModule_GetDict(util), "_util_API");
            if (PyCObject_Check(api_object)) _util_API = (util_API*)PyCObject_AsVoidPtr(api_object);
        }
    }
    
    
    PyDict_SetItemString(d, "GLUerror", GLUerror);
    
}

