/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 1.3u-20000712-1502 (Alpha 3)
 * 
 * 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
#               else
#                       define SWIGEXPORT(a) __declspec(dllexport) a
#               endif
#       else
#               if defined(__BORLANDC__)
#                       define SWIGEXPORT(a) a _export
#               else
#                       define SWIGEXPORT(a) a
#       endif
#endif
#else
#       define SWIGEXPORT(a) a
#endif

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

#ifdef __cplusplus
extern "C" {
#endif

typedef struct swig_type_info {
  char  *name;                 
  void *(*converter)(void *);
  char  *str;
  struct swig_type_info  *next;
  struct swig_type_info  *prev;
} swig_type_info;

#ifdef SWIG_NOINCLUDE
SWIGEXPORT(swig_type_info *) SWIG_TypeRegister(swig_type_info *);
SWIGEXPORT(swig_type_info *) SWIG_TypeCheck(char *c, swig_type_info *);
SWIGEXPORT(void *) SWIG_TypeCast(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 (needed for C++ inheritance */
SWIGRUNTIME(void *) 
SWIG_TypeCast(swig_type_info *ty, void *ptr) 
{
  if ((!ty) || (!ty->converter)) return ptr;
  return (*ty->converter)(ptr);
}

/* Search for a swig_type_info structure */
SWIGRUNTIME(void *)
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;
}

#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

/* 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(void)              SWIG_MakePtr(char *c, void *, swig_type_info *);
SWIGEXPORT(PyObject *)        SWIG_NewPointerObj(void *, 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,
  "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;
}
/* Convert a pointer value */
SWIGRUNTIME(int)
SWIG_ConvertPtr(PyObject *obj, void **ptr, swig_type_info *ty, int flags) {
  unsigned long p;
  register int d;
  swig_type_info *tc;
  char  *c;
  static PyObject *SWIG_this = 0;
  int    newref = 0;

  if (!obj || (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);
  p = 0;
  /* 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++;
  /* Extract hex value from pointer */
  while ((d = *c)) {
    if ((d >= '0') && (d <= '9'))
      p = (p << 4) + (d - '0');
    else if ((d >= 'a') && (d <= 'f'))
      p = (p << 4) + (d - ('a'-10));
    else
      break; 
    c++;
  }
  *ptr = (void *) p;
  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*)p);
  }
  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;
}

/* Take a pointer and convert it to a string */
SWIGRUNTIME(void) 
SWIG_MakePtr(char *c, void *ptr, swig_type_info *ty) {
  static char hex[17] = "0123456789abcdef";
  unsigned long p, s;
  char result[32], *r; 
  r = result;
  p = (unsigned long) ptr;
  if (p > 0) {
    while (p > 0) {
      s = p & 0xf;
      *(r++) = hex[s];
      p = p >> 4;
    }
    *r = '_';
    while (r >= result)
      *(c++) = *(r--);
    strcpy (c, ty->name);
  } else {
    strcpy (c, "NULL");
  }
}

/* Create a new pointer object */
SWIGRUNTIME(PyObject *)
SWIG_NewPointerObj(void *ptr, swig_type_info *type) {
  char result[512];
  PyObject *robj;
  if (!ptr) {
    Py_INCREF(Py_None);
    return Py_None;
  }
#ifdef SWIG_COBJECT_TYPES
  robj = PyCObject_FromVoidPtrAndDesc((void *) ptr, type->name, NULL);
#else
  SWIG_MakePtr(result,ptr,type);
  robj = PyString_FromString(result);
#endif
  return robj;
}

/* 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);
      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):= __init___.so
  ------------------------------------------------*/
#define SWIG_init    init__init___

#define SWIG_name    "__init___"

/**
 *
 * GLU Module for PyOpenGL
 * 
 * Date: May 2000
 *
 * 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_SetGLerror(GL_INVALID_OPERATION);\
	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_SetGLerror(GL_INVALID_OPERATION);\
}

#else

#define DECLARE_EXT(PROC_NAME, RET, ERROR_RET, PROTO, CALL)\
RET PROC_NAME PROTO\
{\
	PyErr_SetGLerror(GL_INVALID_OPERATION);\
	return ERROR_RET;\
}

#define DECLARE_VOID_EXT(PROC_NAME, PROTO, CALL)\
void PROC_NAME PROTO\
{\
	PyErr_SetGLerror(GL_INVALID_OPERATION);\
}

#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);

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;
}


typedef void (CALLBACK *callback)();
 static char _doc_gluErrorString[] = "gluErrorString(errCode) -> string";
 static char _doc_gluGetString[] = "gluGetString(name) -> string";
 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);
	}
	
	Py_INCREF(Py_None);
	return Py_None;
}

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* _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";

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) -> None";
 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;
} PyGLUtesselator;


PyGLUtesselator *currentTesselator = NULL;


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

	Py_DECREF(((PyGLUtesselator*)self)->lockedObjects);
	Py_DECREF(((PyGLUtesselator*)self)->callbacks);

    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(char *name)
{
	if (currentTesselator)
	{
		PyObject *this_callback = PyDict_GetItemString(currentTesselator->callbacks, name);
		if (this_callback != Py_None) return this_callback;
	}
	return NULL;
}


void CALLBACK PyGLUtesselator_begin(GLenum type)
{
	PyObject *this_callback = GetTessCallback("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)
{
	PyObject *this_callback = GetTessCallback("beginData");
	if (this_callback)
	{
		PyObject *result = PyObject_CallFunction(this_callback, "lO", (long)type, PYOBJ(polygon_data));
		Py_XDECREF(result);
		PyErr_XPrint();
	}
}


void CALLBACK PyGLUtesselator_edgeFlag(GLboolean flag)
{
	PyObject *this_callback = GetTessCallback("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("edgeFlagData");
	if (this_callback)
	{
		PyObject *result = PyObject_CallFunction(this_callback, "lO", (long)flag, PYOBJ(polygon_data));
		Py_XDECREF(result);
		PyErr_XPrint();
	}
}


void CALLBACK PyGLUtesselator_vertex(void *vertex_data)
{
	PyObject *this_callback = GetTessCallback("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("vertexData");
	if (this_callback)
	{
		PyObject *result = PyObject_CallFunction(this_callback, "OO", PYOBJ(vertex_data), PYOBJ(polygon_data));
		Py_XDECREF(result);
		PyErr_XPrint();
	}
}


void CALLBACK PyGLUtesselator_end()
{
	PyObject *this_callback = GetTessCallback("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("endData");
	if (this_callback)
	{
		PyObject *result = PyObject_CallFunction(this_callback, "(O)", PYOBJ(polygon_data));
		Py_XDECREF(result);
		PyErr_XPrint();
	}
}


void CALLBACK PyGLUtesselator_combine(GLdouble coords[3], void *vertex_data[4], GLfloat weight[4], void **outData)
{
	PyObject *this_callback = GetTessCallback("combine");
	if (this_callback)
	{
		PyObject *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(currentTesselator->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("combineData");
	if (this_callback)
	{
		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],
		                                         PYOBJ(polygon_data));
		if (result)
		{
			PyList_Append(currentTesselator->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();

	return self;
}

#define SET_TESS_CALLBACK(NAME)\
PyDict_SetItemString(self->callbacks, #NAME, pyfunc);\
gluTessCallback(self->obj, which, (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)
		break;
	case GLU_TESS_BEGIN_DATA:
		SET_TESS_CALLBACK(beginData)
		break;
	case GLU_TESS_EDGE_FLAG:
		SET_TESS_CALLBACK(edgeFlag)
		break;
	case GLU_TESS_EDGE_FLAG_DATA:
		SET_TESS_CALLBACK(edgeFlagData)
		break;
	case GLU_TESS_VERTEX:
		SET_TESS_CALLBACK(vertex)
		break;
	case GLU_TESS_VERTEX_DATA:
		SET_TESS_CALLBACK(vertexData)
		break;
	case GLU_TESS_END:
		SET_TESS_CALLBACK(end)
		break;
	case GLU_TESS_END_DATA:
		SET_TESS_CALLBACK(endData)
		break;
	case GLU_TESS_COMBINE:
		SET_TESS_CALLBACK(combine)
		break;
	case GLU_TESS_COMBINE_DATA:
		SET_TESS_CALLBACK(combineData)
		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) -> None";

void _gluTessBeginPolygon(PyGLUtesselator *self, PyObject *polygon_data)
{
	PyList_Append(self->lockedObjects, polygon_data);
	gluTessBeginPolygon(self->obj, (void*)polygon_data);
}
 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 = GetTessCallback("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 = GetTessCallback("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 = GetTessCallback("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 = GetTessCallback("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 = GetTessCallback("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 = GetTessCallback("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 = GetTessCallback("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 = GetTessCallback("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 = GetTessCallback("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 = GetTessCallback("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 = GetTessCallback("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";
 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, n_2, sknot, n_4, tknot, d_0, d_1, d_2, ctlarray, type)\
gluNurbsSurface(nobj, n_2, (GLfloat*)sknot, n_4, (GLfloat*)tknot, d_1*d_2, d_2, (GLfloat*)ctlarray, n_2-d_0, n_4-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)";

#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 arg0 ;
    GLubyte *result ;
    
    if(!PyArg_ParseTuple(args,"i:gluErrorString",&arg0)) return NULL;
    {
        result = (GLubyte *)gluErrorString(arg0);
        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 arg0 ;
    GLubyte *result ;
    
    if(!PyArg_ParseTuple(args,"i:gluGetString",&arg0)) return NULL;
    {
        result = (GLubyte *)gluGetString(arg0);
        if (GLErrOccurred()) return NULL; 
    }{
        if (result) resultobj = PyString_FromString(result); else Py_INCREF(resultobj = Py_None);
    }
    return resultobj;
}


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


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


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


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


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


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


static PyObject *_wrap_gluScaleImage(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg0 ;
    GLint arg1 ;
    GLint arg2 ;
    GLenum arg3 ;
    PyObject *arg4 ;
    GLint arg5 ;
    GLint arg6 ;
    GLenum arg7 ;
    PyObject * obj4  = 0 ;
    PyObject *result ;
    
    if(!PyArg_ParseTuple(args,"iiiiOiii:gluScaleImage",&arg0,&arg1,&arg2,&arg3,&obj4,&arg5,&arg6,&arg7)) return NULL;
    {
        arg4 = obj4;
    }
    {
        result = (PyObject *)_gluScaleImage(arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7);
        if (GLErrOccurred()) return NULL; 
    }{
        resultobj = result;
    }
    return resultobj;
}


static PyObject *_wrap_gluScaleImageb(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg0 ;
    GLint arg1 ;
    GLint arg2 ;
    GLenum arg3 ;
    GLbyte *arg4 ;
    GLint arg5 ;
    GLint arg6 ;
    PyObject *temp_datain ;
    PyObject * obj4  = 0 ;
    PyObject *result ;
    
    {
    }
    {
    }
    {
        arg3 = GL_BYTE;
    }
    if(!PyArg_ParseTuple(args,"iOii:gluScaleImageb",&arg0,&obj4,&arg5,&arg6)) return NULL;
    if (obj4)
    {
        arg4 = _PyObject_AsCharArray(obj4, &temp_datain, NULL); 
    }
    {
        arg1 = (GLint)_PyObject_Dimension(obj4, 1); 
    }
    {
        arg2 = (GLint)_PyObject_Dimension(obj4, 0); 
    }
    {
        result = (PyObject *)__gluScaleImage(arg0,arg1,arg2,arg3,(GLbyte const *)arg4,arg5,arg6);
        if (GLErrOccurred()) return NULL; 
    }{
        resultobj = result;
    }
    {
        _PyObject_AsArray_Cleanup(arg4, temp_datain); 
    }
    return resultobj;
}


static PyObject *_wrap_gluScaleImageub(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg0 ;
    GLint arg1 ;
    GLint arg2 ;
    GLenum arg3 ;
    GLubyte *arg4 ;
    GLint arg5 ;
    GLint arg6 ;
    PyObject *temp_datain ;
    PyObject * obj4  = 0 ;
    PyObject *result ;
    
    {
    }
    {
    }
    {
        arg3 = GL_UNSIGNED_BYTE;
    }
    if(!PyArg_ParseTuple(args,"iOii:gluScaleImageub",&arg0,&obj4,&arg5,&arg6)) return NULL;
    if (obj4)
    {
        arg4 = _PyObject_AsUnsignedCharArray(obj4, &temp_datain, NULL); 
    }
    {
        arg1 = (GLint)_PyObject_Dimension(obj4, 1); 
    }
    {
        arg2 = (GLint)_PyObject_Dimension(obj4, 0); 
    }
    {
        result = (PyObject *)__gluScaleImage(arg0,arg1,arg2,arg3,(GLubyte const *)arg4,arg5,arg6);
        if (GLErrOccurred()) return NULL; 
    }{
        resultobj = result;
    }
    {
        _PyObject_AsArray_Cleanup(arg4, temp_datain); 
    }
    return resultobj;
}


static PyObject *_wrap_gluScaleImages(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg0 ;
    GLint arg1 ;
    GLint arg2 ;
    GLenum arg3 ;
    GLshort *arg4 ;
    GLint arg5 ;
    GLint arg6 ;
    PyObject *temp_datain ;
    PyObject * obj4  = 0 ;
    PyObject *result ;
    
    {
    }
    {
    }
    {
        arg3 = GL_SHORT;
    }
    if(!PyArg_ParseTuple(args,"iOii:gluScaleImages",&arg0,&obj4,&arg5,&arg6)) return NULL;
    if (obj4)
    {
        arg4 = _PyObject_AsShortArray(obj4, &temp_datain, NULL); 
    }
    {
        arg1 = (GLint)_PyObject_Dimension(obj4, 1); 
    }
    {
        arg2 = (GLint)_PyObject_Dimension(obj4, 0); 
    }
    {
        result = (PyObject *)__gluScaleImage(arg0,arg1,arg2,arg3,(GLshort const *)arg4,arg5,arg6);
        if (GLErrOccurred()) return NULL; 
    }{
        resultobj = result;
    }
    {
        _PyObject_AsArray_Cleanup(arg4, temp_datain); 
    }
    return resultobj;
}


static PyObject *_wrap_gluScaleImageus(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg0 ;
    GLint arg1 ;
    GLint arg2 ;
    GLenum arg3 ;
    GLushort *arg4 ;
    GLint arg5 ;
    GLint arg6 ;
    PyObject *temp_datain ;
    PyObject * obj4  = 0 ;
    PyObject *result ;
    
    {
    }
    {
    }
    {
        arg3 = GL_UNSIGNED_SHORT;
    }
    if(!PyArg_ParseTuple(args,"iOii:gluScaleImageus",&arg0,&obj4,&arg5,&arg6)) return NULL;
    if (obj4)
    {
        arg4 = _PyObject_AsUnsignedShortArray(obj4, &temp_datain, NULL); 
    }
    {
        arg1 = (GLint)_PyObject_Dimension(obj4, 1); 
    }
    {
        arg2 = (GLint)_PyObject_Dimension(obj4, 0); 
    }
    {
        result = (PyObject *)__gluScaleImage(arg0,arg1,arg2,arg3,(GLushort const *)arg4,arg5,arg6);
        if (GLErrOccurred()) return NULL; 
    }{
        resultobj = result;
    }
    {
        _PyObject_AsArray_Cleanup(arg4, temp_datain); 
    }
    return resultobj;
}


static PyObject *_wrap_gluScaleImagei(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg0 ;
    GLint arg1 ;
    GLint arg2 ;
    GLenum arg3 ;
    GLint *arg4 ;
    GLint arg5 ;
    GLint arg6 ;
    PyObject *temp_datain ;
    PyObject * obj4  = 0 ;
    PyObject *result ;
    
    {
    }
    {
    }
    {
        arg3 = GL_INT;
    }
    if(!PyArg_ParseTuple(args,"iOii:gluScaleImagei",&arg0,&obj4,&arg5,&arg6)) return NULL;
    if (obj4)
    {
        arg4 = _PyObject_AsIntArray(obj4, &temp_datain, NULL); 
    }
    {
        arg1 = (GLint)_PyObject_Dimension(obj4, 1); 
    }
    {
        arg2 = (GLint)_PyObject_Dimension(obj4, 0); 
    }
    {
        result = (PyObject *)__gluScaleImage(arg0,arg1,arg2,arg3,(GLint const *)arg4,arg5,arg6);
        if (GLErrOccurred()) return NULL; 
    }{
        resultobj = result;
    }
    {
        _PyObject_AsArray_Cleanup(arg4, temp_datain); 
    }
    return resultobj;
}


static PyObject *_wrap_gluScaleImageui(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg0 ;
    GLint arg1 ;
    GLint arg2 ;
    GLenum arg3 ;
    GLuint *arg4 ;
    GLint arg5 ;
    GLint arg6 ;
    PyObject *temp_datain ;
    PyObject * obj4  = 0 ;
    PyObject *result ;
    
    {
    }
    {
    }
    {
        arg3 = GL_UNSIGNED_INT;
    }
    if(!PyArg_ParseTuple(args,"iOii:gluScaleImageui",&arg0,&obj4,&arg5,&arg6)) return NULL;
    if (obj4)
    {
        arg4 = _PyObject_AsUnsignedIntArray(obj4, &temp_datain, NULL); 
    }
    {
        arg1 = (GLint)_PyObject_Dimension(obj4, 1); 
    }
    {
        arg2 = (GLint)_PyObject_Dimension(obj4, 0); 
    }
    {
        result = (PyObject *)__gluScaleImage(arg0,arg1,arg2,arg3,(GLuint const *)arg4,arg5,arg6);
        if (GLErrOccurred()) return NULL; 
    }{
        resultobj = result;
    }
    {
        _PyObject_AsArray_Cleanup(arg4, temp_datain); 
    }
    return resultobj;
}


static PyObject *_wrap_gluScaleImagef(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg0 ;
    GLint arg1 ;
    GLint arg2 ;
    GLenum arg3 ;
    GLfloat *arg4 ;
    GLint arg5 ;
    GLint arg6 ;
    PyObject *temp_datain ;
    PyObject * obj4  = 0 ;
    PyObject *result ;
    
    {
    }
    {
    }
    {
        arg3 = GL_FLOAT;
    }
    if(!PyArg_ParseTuple(args,"iOii:gluScaleImagef",&arg0,&obj4,&arg5,&arg6)) return NULL;
    if (obj4)
    {
        arg4 = _PyObject_AsFloatArray(obj4, &temp_datain, NULL); 
    }
    {
        arg1 = (GLint)_PyObject_Dimension(obj4, 1); 
    }
    {
        arg2 = (GLint)_PyObject_Dimension(obj4, 0); 
    }
    {
        result = (PyObject *)__gluScaleImage(arg0,arg1,arg2,arg3,(GLfloat const *)arg4,arg5,arg6);
        if (GLErrOccurred()) return NULL; 
    }{
        resultobj = result;
    }
    {
        _PyObject_AsArray_Cleanup(arg4, temp_datain); 
    }
    return resultobj;
}


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


static PyObject *_wrap_gluBuild1DMipmapsb(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg0 ;
    GLint arg1 ;
    GLint arg2 ;
    GLenum arg3 ;
    GLenum arg4 ;
    GLbyte *arg5 ;
    PyObject *temp_buffer ;
    PyObject * obj5  = 0 ;
    PyObject *result ;
    
    {
    }
    {
        arg4 = GL_BYTE;
    }
    if(!PyArg_ParseTuple(args,"iiiO:gluBuild1DMipmapsb",&arg0,&arg1,&arg3,&obj5)) return NULL;
    if (obj5)
    {
        arg5 = _PyObject_AsCharArray(obj5, &temp_buffer, NULL); 
    }
    {
        arg2 = (GLint)_PyObject_Dimension(obj5, 0); 
    }
    {
        result = (PyObject *)__gluBuild1DMipmaps(arg0,arg1,arg2,arg3,arg4,(GLbyte const *)arg5);
        if (GLErrOccurred()) return NULL; 
    }{
        resultobj = result;
    }
    {
        _PyObject_AsArray_Cleanup(arg5, temp_buffer); 
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild1DMipmapsub(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg0 ;
    GLint arg1 ;
    GLint arg2 ;
    GLenum arg3 ;
    GLenum arg4 ;
    GLubyte *arg5 ;
    PyObject *temp_buffer ;
    PyObject * obj5  = 0 ;
    PyObject *result ;
    
    {
    }
    {
        arg4 = GL_UNSIGNED_BYTE;
    }
    if(!PyArg_ParseTuple(args,"iiiO:gluBuild1DMipmapsub",&arg0,&arg1,&arg3,&obj5)) return NULL;
    if (obj5)
    {
        arg5 = _PyObject_AsUnsignedCharArray(obj5, &temp_buffer, NULL); 
    }
    {
        arg2 = (GLint)_PyObject_Dimension(obj5, 0); 
    }
    {
        result = (PyObject *)__gluBuild1DMipmaps(arg0,arg1,arg2,arg3,arg4,(GLubyte const *)arg5);
        if (GLErrOccurred()) return NULL; 
    }{
        resultobj = result;
    }
    {
        _PyObject_AsArray_Cleanup(arg5, temp_buffer); 
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild1DMipmapss(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg0 ;
    GLint arg1 ;
    GLint arg2 ;
    GLenum arg3 ;
    GLenum arg4 ;
    GLshort *arg5 ;
    PyObject *temp_buffer ;
    PyObject * obj5  = 0 ;
    PyObject *result ;
    
    {
    }
    {
        arg4 = GL_SHORT;
    }
    if(!PyArg_ParseTuple(args,"iiiO:gluBuild1DMipmapss",&arg0,&arg1,&arg3,&obj5)) return NULL;
    if (obj5)
    {
        arg5 = _PyObject_AsShortArray(obj5, &temp_buffer, NULL); 
    }
    {
        arg2 = (GLint)_PyObject_Dimension(obj5, 0); 
    }
    {
        result = (PyObject *)__gluBuild1DMipmaps(arg0,arg1,arg2,arg3,arg4,(GLshort const *)arg5);
        if (GLErrOccurred()) return NULL; 
    }{
        resultobj = result;
    }
    {
        _PyObject_AsArray_Cleanup(arg5, temp_buffer); 
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild1DMipmapsus(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg0 ;
    GLint arg1 ;
    GLint arg2 ;
    GLenum arg3 ;
    GLenum arg4 ;
    GLushort *arg5 ;
    PyObject *temp_buffer ;
    PyObject * obj5  = 0 ;
    PyObject *result ;
    
    {
    }
    {
        arg4 = GL_UNSIGNED_SHORT;
    }
    if(!PyArg_ParseTuple(args,"iiiO:gluBuild1DMipmapsus",&arg0,&arg1,&arg3,&obj5)) return NULL;
    if (obj5)
    {
        arg5 = _PyObject_AsUnsignedShortArray(obj5, &temp_buffer, NULL); 
    }
    {
        arg2 = (GLint)_PyObject_Dimension(obj5, 0); 
    }
    {
        result = (PyObject *)__gluBuild1DMipmaps(arg0,arg1,arg2,arg3,arg4,(GLushort const *)arg5);
        if (GLErrOccurred()) return NULL; 
    }{
        resultobj = result;
    }
    {
        _PyObject_AsArray_Cleanup(arg5, temp_buffer); 
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild1DMipmapsi(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg0 ;
    GLint arg1 ;
    GLint arg2 ;
    GLenum arg3 ;
    GLenum arg4 ;
    GLint *arg5 ;
    PyObject *temp_buffer ;
    PyObject * obj5  = 0 ;
    PyObject *result ;
    
    {
    }
    {
        arg4 = GL_INT;
    }
    if(!PyArg_ParseTuple(args,"iiiO:gluBuild1DMipmapsi",&arg0,&arg1,&arg3,&obj5)) return NULL;
    if (obj5)
    {
        arg5 = _PyObject_AsIntArray(obj5, &temp_buffer, NULL); 
    }
    {
        arg2 = (GLint)_PyObject_Dimension(obj5, 0); 
    }
    {
        result = (PyObject *)__gluBuild1DMipmaps(arg0,arg1,arg2,arg3,arg4,(GLint const *)arg5);
        if (GLErrOccurred()) return NULL; 
    }{
        resultobj = result;
    }
    {
        _PyObject_AsArray_Cleanup(arg5, temp_buffer); 
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild1DMipmapsui(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg0 ;
    GLint arg1 ;
    GLint arg2 ;
    GLenum arg3 ;
    GLenum arg4 ;
    GLuint *arg5 ;
    PyObject *temp_buffer ;
    PyObject * obj5  = 0 ;
    PyObject *result ;
    
    {
    }
    {
        arg4 = GL_UNSIGNED_INT;
    }
    if(!PyArg_ParseTuple(args,"iiiO:gluBuild1DMipmapsui",&arg0,&arg1,&arg3,&obj5)) return NULL;
    if (obj5)
    {
        arg5 = _PyObject_AsUnsignedIntArray(obj5, &temp_buffer, NULL); 
    }
    {
        arg2 = (GLint)_PyObject_Dimension(obj5, 0); 
    }
    {
        result = (PyObject *)__gluBuild1DMipmaps(arg0,arg1,arg2,arg3,arg4,(GLuint const *)arg5);
        if (GLErrOccurred()) return NULL; 
    }{
        resultobj = result;
    }
    {
        _PyObject_AsArray_Cleanup(arg5, temp_buffer); 
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild1DMipmapsf(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg0 ;
    GLint arg1 ;
    GLint arg2 ;
    GLenum arg3 ;
    GLenum arg4 ;
    GLshort *arg5 ;
    PyObject *temp_buffer ;
    PyObject * obj5  = 0 ;
    PyObject *result ;
    
    {
    }
    {
        arg4 = GL_FLOAT;
    }
    if(!PyArg_ParseTuple(args,"iiiO:gluBuild1DMipmapsf",&arg0,&arg1,&arg3,&obj5)) return NULL;
    if (obj5)
    {
        arg5 = _PyObject_AsShortArray(obj5, &temp_buffer, NULL); 
    }
    {
        arg2 = (GLint)_PyObject_Dimension(obj5, 0); 
    }
    {
        result = (PyObject *)__gluBuild1DMipmaps(arg0,arg1,arg2,arg3,arg4,(GLshort const *)arg5);
        if (GLErrOccurred()) return NULL; 
    }{
        resultobj = result;
    }
    {
        _PyObject_AsArray_Cleanup(arg5, temp_buffer); 
    }
    return resultobj;
}


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


static PyObject *_wrap_gluBuild2DMipmapsb(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg0 ;
    GLint arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLenum arg4 ;
    GLenum arg5 ;
    GLbyte *arg6 ;
    PyObject *temp_buffer ;
    PyObject * obj6  = 0 ;
    PyObject *result ;
    
    {
    }
    {
    }
    {
        arg5 = GL_BYTE;
    }
    if(!PyArg_ParseTuple(args,"iiiO:gluBuild2DMipmapsb",&arg0,&arg1,&arg4,&obj6)) return NULL;
    if (obj6)
    {
        arg6 = _PyObject_AsCharArray(obj6, &temp_buffer, NULL); 
    }
    {
        arg2 = (GLint)_PyObject_Dimension(obj6, 1); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj6, 0); 
    }
    {
        result = (PyObject *)__gluBuild2DMipmaps(arg0,arg1,arg2,arg3,arg4,arg5,(GLbyte const *)arg6);
        if (GLErrOccurred()) return NULL; 
    }{
        resultobj = result;
    }
    {
        _PyObject_AsArray_Cleanup(arg6, temp_buffer); 
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild2DMipmapsub(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg0 ;
    GLint arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLenum arg4 ;
    GLenum arg5 ;
    GLubyte *arg6 ;
    PyObject *temp_buffer ;
    PyObject * obj6  = 0 ;
    PyObject *result ;
    
    {
    }
    {
    }
    {
        arg5 = GL_UNSIGNED_BYTE;
    }
    if(!PyArg_ParseTuple(args,"iiiO:gluBuild2DMipmapsub",&arg0,&arg1,&arg4,&obj6)) return NULL;
    if (obj6)
    {
        arg6 = _PyObject_AsUnsignedCharArray(obj6, &temp_buffer, NULL); 
    }
    {
        arg2 = (GLint)_PyObject_Dimension(obj6, 1); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj6, 0); 
    }
    {
        result = (PyObject *)__gluBuild2DMipmaps(arg0,arg1,arg2,arg3,arg4,arg5,(GLubyte const *)arg6);
        if (GLErrOccurred()) return NULL; 
    }{
        resultobj = result;
    }
    {
        _PyObject_AsArray_Cleanup(arg6, temp_buffer); 
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild2DMipmapss(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg0 ;
    GLint arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLenum arg4 ;
    GLenum arg5 ;
    GLshort *arg6 ;
    PyObject *temp_buffer ;
    PyObject * obj6  = 0 ;
    PyObject *result ;
    
    {
    }
    {
    }
    {
        arg5 = GL_SHORT;
    }
    if(!PyArg_ParseTuple(args,"iiiO:gluBuild2DMipmapss",&arg0,&arg1,&arg4,&obj6)) return NULL;
    if (obj6)
    {
        arg6 = _PyObject_AsShortArray(obj6, &temp_buffer, NULL); 
    }
    {
        arg2 = (GLint)_PyObject_Dimension(obj6, 1); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj6, 0); 
    }
    {
        result = (PyObject *)__gluBuild2DMipmaps(arg0,arg1,arg2,arg3,arg4,arg5,(GLshort const *)arg6);
        if (GLErrOccurred()) return NULL; 
    }{
        resultobj = result;
    }
    {
        _PyObject_AsArray_Cleanup(arg6, temp_buffer); 
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild2DMipmapsus(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg0 ;
    GLint arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLenum arg4 ;
    GLenum arg5 ;
    GLushort *arg6 ;
    PyObject *temp_buffer ;
    PyObject * obj6  = 0 ;
    PyObject *result ;
    
    {
    }
    {
    }
    {
        arg5 = GL_UNSIGNED_SHORT;
    }
    if(!PyArg_ParseTuple(args,"iiiO:gluBuild2DMipmapsus",&arg0,&arg1,&arg4,&obj6)) return NULL;
    if (obj6)
    {
        arg6 = _PyObject_AsUnsignedShortArray(obj6, &temp_buffer, NULL); 
    }
    {
        arg2 = (GLint)_PyObject_Dimension(obj6, 1); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj6, 0); 
    }
    {
        result = (PyObject *)__gluBuild2DMipmaps(arg0,arg1,arg2,arg3,arg4,arg5,(GLushort const *)arg6);
        if (GLErrOccurred()) return NULL; 
    }{
        resultobj = result;
    }
    {
        _PyObject_AsArray_Cleanup(arg6, temp_buffer); 
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild2DMipmapsi(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg0 ;
    GLint arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLenum arg4 ;
    GLenum arg5 ;
    GLint *arg6 ;
    PyObject *temp_buffer ;
    PyObject * obj6  = 0 ;
    PyObject *result ;
    
    {
    }
    {
    }
    {
        arg5 = GL_INT;
    }
    if(!PyArg_ParseTuple(args,"iiiO:gluBuild2DMipmapsi",&arg0,&arg1,&arg4,&obj6)) return NULL;
    if (obj6)
    {
        arg6 = _PyObject_AsIntArray(obj6, &temp_buffer, NULL); 
    }
    {
        arg2 = (GLint)_PyObject_Dimension(obj6, 1); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj6, 0); 
    }
    {
        result = (PyObject *)__gluBuild2DMipmaps(arg0,arg1,arg2,arg3,arg4,arg5,(GLint const *)arg6);
        if (GLErrOccurred()) return NULL; 
    }{
        resultobj = result;
    }
    {
        _PyObject_AsArray_Cleanup(arg6, temp_buffer); 
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild2DMipmapsui(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg0 ;
    GLint arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLenum arg4 ;
    GLenum arg5 ;
    GLuint *arg6 ;
    PyObject *temp_buffer ;
    PyObject * obj6  = 0 ;
    PyObject *result ;
    
    {
    }
    {
    }
    {
        arg5 = GL_UNSIGNED_INT;
    }
    if(!PyArg_ParseTuple(args,"iiiO:gluBuild2DMipmapsui",&arg0,&arg1,&arg4,&obj6)) return NULL;
    if (obj6)
    {
        arg6 = _PyObject_AsUnsignedIntArray(obj6, &temp_buffer, NULL); 
    }
    {
        arg2 = (GLint)_PyObject_Dimension(obj6, 1); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj6, 0); 
    }
    {
        result = (PyObject *)__gluBuild2DMipmaps(arg0,arg1,arg2,arg3,arg4,arg5,(GLuint const *)arg6);
        if (GLErrOccurred()) return NULL; 
    }{
        resultobj = result;
    }
    {
        _PyObject_AsArray_Cleanup(arg6, temp_buffer); 
    }
    return resultobj;
}


static PyObject *_wrap_gluBuild2DMipmapsf(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg0 ;
    GLint arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    GLenum arg4 ;
    GLenum arg5 ;
    GLshort *arg6 ;
    PyObject *temp_buffer ;
    PyObject * obj6  = 0 ;
    PyObject *result ;
    
    {
    }
    {
    }
    {
        arg5 = GL_FLOAT;
    }
    if(!PyArg_ParseTuple(args,"iiiO:gluBuild2DMipmapsf",&arg0,&arg1,&arg4,&obj6)) return NULL;
    if (obj6)
    {
        arg6 = _PyObject_AsShortArray(obj6, &temp_buffer, NULL); 
    }
    {
        arg2 = (GLint)_PyObject_Dimension(obj6, 1); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj6, 0); 
    }
    {
        result = (PyObject *)__gluBuild2DMipmaps(arg0,arg1,arg2,arg3,arg4,arg5,(GLshort const *)arg6);
        if (GLErrOccurred()) return NULL; 
    }{
        resultobj = result;
    }
    {
        _PyObject_AsArray_Cleanup(arg6, temp_buffer); 
    }
    return resultobj;
}


static PyObject *_wrap_gluNewQuadric(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    PyGLUquadric *result ;
    
    if(!PyArg_ParseTuple(args,":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 *arg0 ;
    PyObject * obj0  = 0 ;
    
    if(!PyArg_ParseTuple(args,"O:gluDeleteQuadric",&obj0)) return NULL;
    {
        arg0 = obj0;
    }
    {
        PyObject_Del(arg0);
        if (GLErrOccurred()) return NULL; 
    }    Py_INCREF(Py_None);
    resultobj = Py_None;
    return resultobj;
}


static PyObject *_wrap_gluQuadricNormals(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLUquadric *arg0 ;
    GLenum arg1 ;
    PyObject * obj0  = 0 ;
    
    if(!PyArg_ParseTuple(args,"Oi:gluQuadricNormals",&obj0,&arg1)) return NULL;
    {
        if (obj0->ob_type != &PyGLUquadric_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUquadric object.");
            return NULL;
        }
        currentQuadric = (PyGLUquadric*)obj0;
        arg0 = currentQuadric->obj;
    }
    {
        gluQuadricNormals(arg0,arg1);
        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 *arg0 ;
    GLboolean arg1 ;
    PyObject * obj0  = 0 ;
    PyObject * obj1  = 0 ;
    
    if(!PyArg_ParseTuple(args,"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;
        arg0 = currentQuadric->obj;
    }
    {
        arg1 = (PyObject_IsTrue(obj1)) ? GL_TRUE : GL_FALSE;
    }
    {
        gluQuadricTexture(arg0,arg1);
        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 *arg0 ;
    GLenum arg1 ;
    PyObject * obj0  = 0 ;
    
    if(!PyArg_ParseTuple(args,"Oi:gluQuadricOrientation",&obj0,&arg1)) return NULL;
    {
        if (obj0->ob_type != &PyGLUquadric_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUquadric object.");
            return NULL;
        }
        currentQuadric = (PyGLUquadric*)obj0;
        arg0 = currentQuadric->obj;
    }
    {
        gluQuadricOrientation(arg0,arg1);
        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 *arg0 ;
    GLenum arg1 ;
    PyObject * obj0  = 0 ;
    
    if(!PyArg_ParseTuple(args,"Oi:gluQuadricDrawStyle",&obj0,&arg1)) return NULL;
    {
        if (obj0->ob_type != &PyGLUquadric_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUquadric object.");
            return NULL;
        }
        currentQuadric = (PyGLUquadric*)obj0;
        arg0 = currentQuadric->obj;
    }
    {
        gluQuadricDrawStyle(arg0,arg1);
        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 *arg0 ;
    GLdouble arg1 ;
    GLdouble arg2 ;
    GLdouble arg3 ;
    GLint arg4 ;
    GLint arg5 ;
    PyObject * obj0  = 0 ;
    
    if(!PyArg_ParseTuple(args,"Odddii:gluCylinder",&obj0,&arg1,&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;
        arg0 = currentQuadric->obj;
    }
    {
        gluCylinder(arg0,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_gluDisk(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLUquadric *arg0 ;
    GLdouble arg1 ;
    GLdouble arg2 ;
    GLint arg3 ;
    GLint arg4 ;
    PyObject * obj0  = 0 ;
    
    if(!PyArg_ParseTuple(args,"Oddii:gluDisk",&obj0,&arg1,&arg2,&arg3,&arg4)) return NULL;
    {
        if (obj0->ob_type != &PyGLUquadric_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUquadric object.");
            return NULL;
        }
        currentQuadric = (PyGLUquadric*)obj0;
        arg0 = currentQuadric->obj;
    }
    {
        gluDisk(arg0,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_gluPartialDisk(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLUquadric *arg0 ;
    GLdouble arg1 ;
    GLdouble arg2 ;
    GLint arg3 ;
    GLint arg4 ;
    GLdouble arg5 ;
    GLdouble arg6 ;
    PyObject * obj0  = 0 ;
    
    if(!PyArg_ParseTuple(args,"Oddiidd:gluPartialDisk",&obj0,&arg1,&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;
        arg0 = currentQuadric->obj;
    }
    {
        gluPartialDisk(arg0,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_gluSphere(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLUquadric *arg0 ;
    GLdouble arg1 ;
    GLint arg2 ;
    GLint arg3 ;
    PyObject * obj0  = 0 ;
    
    if(!PyArg_ParseTuple(args,"Odii:gluSphere",&obj0,&arg1,&arg2,&arg3)) return NULL;
    {
        if (obj0->ob_type != &PyGLUquadric_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUquadric object.");
            return NULL;
        }
        currentQuadric = (PyGLUquadric*)obj0;
        arg0 = currentQuadric->obj;
    }
    {
        gluSphere(arg0,arg1,arg2,arg3);
        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 *arg0 ;
    GLenum arg1 ;
    PyObject *arg2 ;
    PyObject * obj0  = 0 ;
    PyObject * obj2  = 0 ;
    PyObject *result ;
    
    if(!PyArg_ParseTuple(args,"OiO:gluQuadricCallback",&obj0,&arg1,&obj2)) return NULL;
    {
        if (obj0->ob_type != &PyGLUquadric_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUquadric object.");
            return NULL;
        }
        arg0 = currentQuadric = (PyGLUquadric*)obj0;
    }
    {
        if (obj2 != Py_None && !PyCallable_Check(obj2))
        {
            PyErr_SetString(PyExc_Exception, "Not callable.");
            return NULL;
        }
        arg2 = obj2;
    }
    {
        result = (PyObject *)_gluQuadricCallback(arg0,arg1,arg2);
        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,":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 *arg0 ;
    PyObject * obj0  = 0 ;
    
    if(!PyArg_ParseTuple(args,"O:gluDeleteTess",&obj0)) return NULL;
    {
        arg0 = obj0;
    }
    {
        PyObject_Del(arg0);
        if (GLErrOccurred()) return NULL; 
    }    Py_INCREF(Py_None);
    resultobj = Py_None;
    return resultobj;
}


static PyObject *_wrap_gluTessBeginPolygon(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    PyGLUtesselator *arg0 ;
    PyObject *arg1 ;
    PyObject * obj0  = 0 ;
    PyObject * obj1  = 0 ;
    
    if(!PyArg_ParseTuple(args,"OO:gluTessBeginPolygon",&obj0,&obj1)) return NULL;
    {
        if (obj0->ob_type != &PyGLUtesselator_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUtesselator object.");
            return NULL;
        }
        arg0 = currentTesselator = (PyGLUtesselator*)obj0;
    }
    {
        arg1 = obj1;
    }
    {
        _gluTessBeginPolygon(arg0,arg1);
        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 *arg0 ;
    PyObject * obj0  = 0 ;
    
    if(!PyArg_ParseTuple(args,"O:gluBeginPolygon",&obj0)) return NULL;
    {
        if (obj0->ob_type != &PyGLUtesselator_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUtesselator object.");
            return NULL;
        }
        currentTesselator = (PyGLUtesselator*)obj0;
        arg0 = currentTesselator->obj;
    }
    {
        gluBeginPolygon(arg0);
        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 *arg0 ;
    PyObject * obj0  = 0 ;
    
    if(!PyArg_ParseTuple(args,"O:gluTessBeginContour",&obj0)) return NULL;
    {
        if (obj0->ob_type != &PyGLUtesselator_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUtesselator object.");
            return NULL;
        }
        currentTesselator = (PyGLUtesselator*)obj0;
        arg0 = currentTesselator->obj;
    }
    {
        gluTessBeginContour(arg0);
        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 *arg0 ;
    GLdouble *arg1 ;
    PyObject *arg2 ;
    PyObject * obj0  = 0 ;
    PyObject *temp_coords ;
    PyObject * obj1  = 0 ;
    PyObject * obj2  = 0 ;
    
    if(!PyArg_ParseTuple(args,"OOO:gluTessVertex",&obj0,&obj1,&obj2)) return NULL;
    {
        if (obj0->ob_type != &PyGLUtesselator_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUtesselator object.");
            return NULL;
        }
        arg0 = currentTesselator = (PyGLUtesselator*)obj0;
    }
    {
        arg1 = _PyObject_AsDoubleArray(obj1, &temp_coords, NULL); 
    }
    {
        arg2 = obj2;
    }
    {
        _gluTessVertex(arg0,(GLdouble const *)arg1,arg2);
        if (GLErrOccurred()) return NULL; 
    }    Py_INCREF(Py_None);
    resultobj = Py_None;
    {
        currentTesselator = NULL;
        if (PyErr_Occurred()) return NULL;
    }
    {
        _PyObject_AsArray_Cleanup(arg1, temp_coords); 
    }
    return resultobj;
}


static PyObject *_wrap_gluTessEndContour(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLUtesselator *arg0 ;
    PyObject * obj0  = 0 ;
    
    if(!PyArg_ParseTuple(args,"O:gluTessEndContour",&obj0)) return NULL;
    {
        if (obj0->ob_type != &PyGLUtesselator_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUtesselator object.");
            return NULL;
        }
        currentTesselator = (PyGLUtesselator*)obj0;
        arg0 = currentTesselator->obj;
    }
    {
        gluTessEndContour(arg0);
        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 *arg0 ;
    GLenum arg1 ;
    PyObject * obj0  = 0 ;
    
    if(!PyArg_ParseTuple(args,"Oi:gluNextContour",&obj0,&arg1)) return NULL;
    {
        if (obj0->ob_type != &PyGLUtesselator_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUtesselator object.");
            return NULL;
        }
        currentTesselator = (PyGLUtesselator*)obj0;
        arg0 = currentTesselator->obj;
    }
    {
        gluNextContour(arg0,arg1);
        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 *arg0 ;
    PyObject * obj0  = 0 ;
    
    if(!PyArg_ParseTuple(args,"O:gluTessEndPolygon",&obj0)) return NULL;
    {
        if (obj0->ob_type != &PyGLUtesselator_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUtesselator object.");
            return NULL;
        }
        arg0 = currentTesselator = (PyGLUtesselator*)obj0;
    }
    {
        _gluTessEndPolygon(arg0);
        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 *arg0 ;
    PyObject * obj0  = 0 ;
    
    if(!PyArg_ParseTuple(args,"O:gluEndPolygon",&obj0)) return NULL;
    {
        if (obj0->ob_type != &PyGLUtesselator_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUtesselator object.");
            return NULL;
        }
        currentTesselator = (PyGLUtesselator*)obj0;
        arg0 = currentTesselator->obj;
    }
    {
        gluEndPolygon(arg0);
        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 *arg0 ;
    GLenum arg1 ;
    GLdouble arg2 ;
    PyObject * obj0  = 0 ;
    
    if(!PyArg_ParseTuple(args,"Oid:gluTessProperty",&obj0,&arg1,&arg2)) return NULL;
    {
        if (obj0->ob_type != &PyGLUtesselator_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUtesselator object.");
            return NULL;
        }
        currentTesselator = (PyGLUtesselator*)obj0;
        arg0 = currentTesselator->obj;
    }
    {
        gluTessProperty(arg0,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_gluTessNormal(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLUtesselator *arg0 ;
    GLdouble arg1 ;
    GLdouble arg2 ;
    GLdouble arg3 ;
    PyObject * obj0  = 0 ;
    
    if(!PyArg_ParseTuple(args,"Oddd:gluTessNormal",&obj0,&arg1,&arg2,&arg3)) return NULL;
    {
        if (obj0->ob_type != &PyGLUtesselator_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUtesselator object.");
            return NULL;
        }
        currentTesselator = (PyGLUtesselator*)obj0;
        arg0 = currentTesselator->obj;
    }
    {
        gluTessNormal(arg0,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_gluTessCallback(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    PyGLUtesselator *arg0 ;
    GLenum arg1 ;
    PyObject *arg2 ;
    PyObject * obj0  = 0 ;
    PyObject * obj2  = 0 ;
    PyObject *result ;
    
    if(!PyArg_ParseTuple(args,"OiO:gluTessCallback",&obj0,&arg1,&obj2)) return NULL;
    {
        if (obj0->ob_type != &PyGLUtesselator_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUtesselator object.");
            return NULL;
        }
        arg0 = currentTesselator = (PyGLUtesselator*)obj0;
    }
    {
        if (obj2 != Py_None && !PyCallable_Check(obj2))
        {
            PyErr_SetString(PyExc_Exception, "Not callable.");
            return NULL;
        }
        arg2 = obj2;
    }
    {
        result = (PyObject *)_gluTessCallback(arg0,arg1,arg2);
        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 *arg0 ;
    GLenum arg1 ;
    double *arg2 ;
    double temp_value[1] ;
    PyObject * obj0  = 0 ;
    
    {
        int i; 	arg2 = temp_value; 	for (i = 0; i < 1; i++) arg2[i] = -DBL_MAX; 
    }
    if(!PyArg_ParseTuple(args,"Oi:gluGetTessProperty",&obj0,&arg1)) return NULL;
    {
        if (obj0->ob_type != &PyGLUtesselator_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUtesselator object.");
            return NULL;
        }
        currentTesselator = (PyGLUtesselator*)obj0;
        arg0 = currentTesselator->obj;
    }
    {
        gluGetTessProperty(arg0,arg1,arg2);
        if (GLErrOccurred()) return NULL; 
    }    Py_INCREF(Py_None);
    resultobj = Py_None;
    {
        int n, dims[2]; 	Py_XDECREF(resultobj); 	for (n = 0; n < 1 && arg2[n] != -DBL_MAX; n++); 	switch (n) 	{
            case 0: 		Py_INCREF(Py_None); 		resultobj = Py_None; 		break; 	case 1: 		resultobj = PyFloat_FromDouble(arg2[0]); 		break; 	case 16: 		dims[0] = 4; 		dims[1] = 4; 		resultobj = _PyObject_FromDoubleArray(2, dims, arg2, 0); 		break; 	default: 		resultobj = _PyTuple_FromDoubleArray(n, arg2); 	
        } 
    }
    {
        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,":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 *arg0 ;
    PyObject * obj0  = 0 ;
    
    if(!PyArg_ParseTuple(args,"O:gluDeleteNurbsRenderer",&obj0)) return NULL;
    {
        arg0 = obj0;
    }
    {
        PyObject_Del(arg0);
        if (GLErrOccurred()) return NULL; 
    }    Py_INCREF(Py_None);
    resultobj = Py_None;
    return resultobj;
}


static PyObject *_wrap_gluBeginSurface(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLUnurbs *arg0 ;
    PyObject * obj0  = 0 ;
    
    if(!PyArg_ParseTuple(args,"O:gluBeginSurface",&obj0)) return NULL;
    {
        if (obj0->ob_type != &PyGLUnurbs_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUnurbs object.");
            return NULL;
        }
        currentNurbs = (PyGLUnurbs*)obj0;
        arg0 = currentNurbs->obj;
    }
    {
        gluBeginSurface(arg0);
        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 *arg0 ;
    PyObject * obj0  = 0 ;
    
    if(!PyArg_ParseTuple(args,"O:gluBeginCurve",&obj0)) return NULL;
    {
        if (obj0->ob_type != &PyGLUnurbs_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUnurbs object.");
            return NULL;
        }
        currentNurbs = (PyGLUnurbs*)obj0;
        arg0 = currentNurbs->obj;
    }
    {
        gluBeginCurve(arg0);
        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 *arg0 ;
    PyObject * obj0  = 0 ;
    
    if(!PyArg_ParseTuple(args,"O:gluEndCurve",&obj0)) return NULL;
    {
        if (obj0->ob_type != &PyGLUnurbs_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUnurbs object.");
            return NULL;
        }
        currentNurbs = (PyGLUnurbs*)obj0;
        arg0 = currentNurbs->obj;
    }
    {
        gluEndCurve(arg0);
        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 *arg0 ;
    PyObject * obj0  = 0 ;
    
    if(!PyArg_ParseTuple(args,"O:gluEndSurface",&obj0)) return NULL;
    {
        if (obj0->ob_type != &PyGLUnurbs_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUnurbs object.");
            return NULL;
        }
        currentNurbs = (PyGLUnurbs*)obj0;
        arg0 = currentNurbs->obj;
    }
    {
        gluEndSurface(arg0);
        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 *arg0 ;
    PyObject * obj0  = 0 ;
    
    if(!PyArg_ParseTuple(args,"O:gluBeginTrim",&obj0)) return NULL;
    {
        if (obj0->ob_type != &PyGLUnurbs_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUnurbs object.");
            return NULL;
        }
        currentNurbs = (PyGLUnurbs*)obj0;
        arg0 = currentNurbs->obj;
    }
    {
        gluBeginTrim(arg0);
        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 *arg0 ;
    PyObject * obj0  = 0 ;
    
    if(!PyArg_ParseTuple(args,"O:gluEndTrim",&obj0)) return NULL;
    {
        if (obj0->ob_type != &PyGLUnurbs_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUnurbs object.");
            return NULL;
        }
        currentNurbs = (PyGLUnurbs*)obj0;
        arg0 = currentNurbs->obj;
    }
    {
        gluEndTrim(arg0);
        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 *arg0 ;
    GLint arg1 ;
    GLfloat *arg2 ;
    GLint arg3 ;
    GLenum arg4 ;
    PyObject * obj0  = 0 ;
    PyObject *temp_array ;
    PyObject * obj2  = 0 ;
    
    {
    }
    {
    }
    if(!PyArg_ParseTuple(args,"OOi:gluPwlCurve",&obj0,&obj2,&arg4)) return NULL;
    {
        if (obj0->ob_type != &PyGLUnurbs_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUnurbs object.");
            return NULL;
        }
        currentNurbs = (PyGLUnurbs*)obj0;
        arg0 = currentNurbs->obj;
    }
    {
        arg2 = _PyObject_AsFloatArray(obj2, &temp_array, NULL); 
    }
    {
        arg1 = (GLint)_PyObject_Dimension(obj2, 0); 
    }
    {
        arg3 = (GLint)_PyObject_Dimension(obj2, 1); 
    }
    {
        _gluPwlCurve(arg0,arg1,(GLfloat const *)arg2,arg3,arg4);
        if (GLErrOccurred()) return NULL; 
    }    Py_INCREF(Py_None);
    resultobj = Py_None;
    {
        currentNurbs = NULL;
        if (PyErr_Occurred()) return NULL;
    }
    {
        _PyObject_AsArray_Cleanup(arg2, temp_array); 
    }
    return resultobj;
}


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


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


static PyObject *_wrap_gluLoadSamplingMatrices(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLUnurbs *arg0 ;
    GLfloat *arg1 ;
    GLfloat *arg2 ;
    GLint *arg3 ;
    PyObject * obj0  = 0 ;
    PyObject *temp_modelMatrix ;
    PyObject * obj1  = 0 ;
    PyObject *temp_projMatrix ;
    PyObject * obj2  = 0 ;
    PyObject *temp_viewport ;
    PyObject * obj3  = 0 ;
    
    if(!PyArg_ParseTuple(args,"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;
        arg0 = currentNurbs->obj;
    }
    {
        arg1 = _PyObject_AsFloatArray(obj1, &temp_modelMatrix, NULL); 
    }
    {
        arg2 = _PyObject_AsFloatArray(obj2, &temp_projMatrix, NULL); 
    }
    {
        arg3 = _PyObject_AsIntArray(obj3, &temp_viewport, NULL); 
    }
    {
        gluLoadSamplingMatrices(arg0,(GLfloat const *)arg1,(GLfloat const *)arg2,(GLint const *)arg3);
        if (GLErrOccurred()) return NULL; 
    }    Py_INCREF(Py_None);
    resultobj = Py_None;
    {
        currentNurbs = NULL;
        if (PyErr_Occurred()) return NULL;
    }
    {
        _PyObject_AsArray_Cleanup(arg1, temp_modelMatrix); 
    }
    {
        _PyObject_AsArray_Cleanup(arg2, temp_projMatrix); 
    }
    {
        _PyObject_AsArray_Cleanup(arg3, temp_viewport); 
    }
    return resultobj;
}


static PyObject *_wrap_gluNurbsProperty(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLUnurbs *arg0 ;
    GLenum arg1 ;
    GLfloat arg2 ;
    PyObject * obj0  = 0 ;
    
    if(!PyArg_ParseTuple(args,"Oif:gluNurbsProperty",&obj0,&arg1,&arg2)) return NULL;
    {
        if (obj0->ob_type != &PyGLUnurbs_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUnurbs object.");
            return NULL;
        }
        currentNurbs = (PyGLUnurbs*)obj0;
        arg0 = currentNurbs->obj;
    }
    {
        gluNurbsProperty(arg0,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_gluGetNurbsProperty(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLUnurbs *arg0 ;
    GLenum arg1 ;
    float *arg2 ;
    float temp_value[1] ;
    PyObject * obj0  = 0 ;
    
    {
        int i; 	arg2 = temp_value; 	for (i = 0; i < 1; i++) arg2[i] = -FLT_MAX; 
    }
    if(!PyArg_ParseTuple(args,"Oi:gluGetNurbsProperty",&obj0,&arg1)) return NULL;
    {
        if (obj0->ob_type != &PyGLUnurbs_Type)
        {
            PyErr_SetString(PyExc_Exception, "Not a GLUnurbs object.");
            return NULL;
        }
        currentNurbs = (PyGLUnurbs*)obj0;
        arg0 = currentNurbs->obj;
    }
    {
        gluGetNurbsProperty(arg0,arg1,arg2);
        if (GLErrOccurred()) return NULL; 
    }    Py_INCREF(Py_None);
    resultobj = Py_None;
    {
        int n, dims[2]; 	Py_XDECREF(resultobj); 	for (n = 0; n < 1 && arg2[n] != -FLT_MAX; n++); 	switch (n) 	{
            case 0: 		Py_INCREF(Py_None); 		resultobj = Py_None; 		break; 	case 1: 		resultobj = PyFloat_FromDouble(arg2[0]); 		break; 	case 16: 		dims[0] = 4; 		dims[1] = 4; 		resultobj = _PyObject_FromFloatArray(2, dims, arg2, 0); 		break; 	default: 		resultobj = _PyTuple_FromFloatArray(n, arg2); 	
        } 
    }
    {
        currentNurbs = NULL;
        if (PyErr_Occurred()) return NULL;
    }
    return resultobj;
}


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


static PyObject *_wrap___gluNurbsCallbackDataEXT(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLUnurbs *arg0 ;
    PyObject *arg1 ;
    PyObject * obj0  = 0 ;
    PyObject * obj1  = 0 ;
    
    if(!PyArg_ParseTuple(args,"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;
        arg0 = currentNurbs->obj;
    }
    {
        arg1 = obj1;
    }
    {
        __gluNurbsCallbackDataEXT(arg0,arg1);
        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,":__gluInitNurbsTessellatorEXT")) return NULL;
    {
        result = (int )__gluInitNurbsTessellatorEXT();
        if (GLErrOccurred()) return NULL; 
    }    resultobj = PyInt_FromLong((long)result);
    return resultobj;
}


static PyMethodDef __init___Methods[] = {
	 {"gluErrorString", _wrap_gluErrorString, METH_VARARGS , _doc_gluErrorString},
	 {"gluGetString", _wrap_gluGetString, METH_VARARGS , _doc_gluGetString},
	 {"gluOrtho2D", _wrap_gluOrtho2D, METH_VARARGS , _doc_gluOrtho2D},
	 {"gluPerspective", _wrap_gluPerspective, METH_VARARGS , _doc_gluPerspective},
	 { "__gluPickMatrix", _wrap___gluPickMatrix, METH_VARARGS },
	 {"gluLookAt", _wrap_gluLookAt, METH_VARARGS , _doc_gluLookAt},
	 { "__gluProject", _wrap___gluProject, METH_VARARGS },
	 { "__gluUnProject", _wrap___gluUnProject, METH_VARARGS },
	 {"gluScaleImage", _wrap_gluScaleImage, METH_VARARGS , _doc_gluScaleImage},
	 {"gluScaleImageb", _wrap_gluScaleImageb, METH_VARARGS , _doc_gluScaleImageb},
	 {"gluScaleImageub", _wrap_gluScaleImageub, METH_VARARGS , _doc_gluScaleImageub},
	 {"gluScaleImages", _wrap_gluScaleImages, METH_VARARGS , _doc_gluScaleImages},
	 {"gluScaleImageus", _wrap_gluScaleImageus, METH_VARARGS , _doc_gluScaleImageus},
	 {"gluScaleImagei", _wrap_gluScaleImagei, METH_VARARGS , _doc_gluScaleImagei},
	 {"gluScaleImageui", _wrap_gluScaleImageui, METH_VARARGS , _doc_gluScaleImageui},
	 {"gluScaleImagef", _wrap_gluScaleImagef, METH_VARARGS , _doc_gluScaleImagef},
	 {"gluBuild1DMipmaps", _wrap_gluBuild1DMipmaps, METH_VARARGS , _doc_gluBuild1DMipmaps},
	 {"gluBuild1DMipmapsb", _wrap_gluBuild1DMipmapsb, METH_VARARGS , _doc_gluBuild1DMipmapsb},
	 {"gluBuild1DMipmapsub", _wrap_gluBuild1DMipmapsub, METH_VARARGS , _doc_gluBuild1DMipmapsub},
	 {"gluBuild1DMipmapss", _wrap_gluBuild1DMipmapss, METH_VARARGS , _doc_gluBuild1DMipmapss},
	 {"gluBuild1DMipmapsus", _wrap_gluBuild1DMipmapsus, METH_VARARGS , _doc_gluBuild1DMipmapsus},
	 {"gluBuild1DMipmapsi", _wrap_gluBuild1DMipmapsi, METH_VARARGS , _doc_gluBuild1DMipmapsi},
	 {"gluBuild1DMipmapsui", _wrap_gluBuild1DMipmapsui, METH_VARARGS , _doc_gluBuild1DMipmapsui},
	 {"gluBuild1DMipmapsf", _wrap_gluBuild1DMipmapsf, METH_VARARGS , _doc_gluBuild1DMipmapsf},
	 {"gluBuild2DMipmaps", _wrap_gluBuild2DMipmaps, METH_VARARGS , _doc_gluBuild2DMipmaps},
	 {"gluBuild2DMipmapsb", _wrap_gluBuild2DMipmapsb, METH_VARARGS , _doc_gluBuild2DMipmapsb},
	 {"gluBuild2DMipmapsub", _wrap_gluBuild2DMipmapsub, METH_VARARGS , _doc_gluBuild2DMipmapsub},
	 {"gluBuild2DMipmapss", _wrap_gluBuild2DMipmapss, METH_VARARGS , _doc_gluBuild2DMipmapss},
	 {"gluBuild2DMipmapsus", _wrap_gluBuild2DMipmapsus, METH_VARARGS , _doc_gluBuild2DMipmapsus},
	 {"gluBuild2DMipmapsi", _wrap_gluBuild2DMipmapsi, METH_VARARGS , _doc_gluBuild2DMipmapsi},
	 {"gluBuild2DMipmapsui", _wrap_gluBuild2DMipmapsui, METH_VARARGS , _doc_gluBuild2DMipmapsui},
	 {"gluBuild2DMipmapsf", _wrap_gluBuild2DMipmapsf, METH_VARARGS , _doc_gluBuild2DMipmapsf},
	 {"gluNewQuadric", _wrap_gluNewQuadric, METH_VARARGS , _doc_gluNewQuadric},
	 {"gluDeleteQuadric", _wrap_gluDeleteQuadric, METH_VARARGS , _doc_gluDeleteQuadric},
	 {"gluQuadricNormals", _wrap_gluQuadricNormals, METH_VARARGS , _doc_gluQuadricNormals},
	 {"gluQuadricTexture", _wrap_gluQuadricTexture, METH_VARARGS , _doc_gluQuadricTexture},
	 {"gluQuadricOrientation", _wrap_gluQuadricOrientation, METH_VARARGS , _doc_gluQuadricOrientation},
	 {"gluQuadricDrawStyle", _wrap_gluQuadricDrawStyle, METH_VARARGS , _doc_gluQuadricDrawStyle},
	 {"gluCylinder", _wrap_gluCylinder, METH_VARARGS , _doc_gluCylinder},
	 {"gluDisk", _wrap_gluDisk, METH_VARARGS , _doc_gluDisk},
	 {"gluPartialDisk", _wrap_gluPartialDisk, METH_VARARGS , _doc_gluPartialDisk},
	 {"gluSphere", _wrap_gluSphere, METH_VARARGS , _doc_gluSphere},
	 {"gluQuadricCallback", _wrap_gluQuadricCallback, METH_VARARGS , _doc_gluQuadricCallback},
	 {"gluNewTess", _wrap_gluNewTess, METH_VARARGS , _doc_gluNewTess},
	 {"gluDeleteTess", _wrap_gluDeleteTess, METH_VARARGS , _doc_gluDeleteTess},
	 {"gluTessBeginPolygon", _wrap_gluTessBeginPolygon, METH_VARARGS , _doc_gluTessBeginPolygon},
	 {"gluBeginPolygon", _wrap_gluBeginPolygon, METH_VARARGS , _doc_gluBeginPolygon},
	 {"gluTessBeginContour", _wrap_gluTessBeginContour, METH_VARARGS , _doc_gluTessBeginContour},
	 {"gluTessVertex", _wrap_gluTessVertex, METH_VARARGS , _doc_gluTessVertex},
	 {"gluTessEndContour", _wrap_gluTessEndContour, METH_VARARGS , _doc_gluTessEndContour},
	 {"gluNextContour", _wrap_gluNextContour, METH_VARARGS , _doc_gluNextContour},
	 {"gluTessEndPolygon", _wrap_gluTessEndPolygon, METH_VARARGS , _doc_gluTessEndPolygon},
	 {"gluEndPolygon", _wrap_gluEndPolygon, METH_VARARGS , _doc_gluEndPolygon},
	 {"gluTessProperty", _wrap_gluTessProperty, METH_VARARGS , _doc_gluTessProperty},
	 {"gluTessNormal", _wrap_gluTessNormal, METH_VARARGS , _doc_gluTessNormal},
	 {"gluTessCallback", _wrap_gluTessCallback, METH_VARARGS , _doc_gluTessCallback},
	 {"gluGetTessProperty", _wrap_gluGetTessProperty, METH_VARARGS , _doc_gluGetTessProperty},
	 {"gluNewNurbsRenderer", _wrap_gluNewNurbsRenderer, METH_VARARGS , _doc_gluNewNurbsRenderer},
	 {"gluDeleteNurbsRenderer", _wrap_gluDeleteNurbsRenderer, METH_VARARGS , _doc_gluDeleteNurbsRenderer},
	 {"gluBeginSurface", _wrap_gluBeginSurface, METH_VARARGS , _doc_gluBeginSurface},
	 {"gluBeginCurve", _wrap_gluBeginCurve, METH_VARARGS , _doc_gluBeginCurve},
	 {"gluEndCurve", _wrap_gluEndCurve, METH_VARARGS , _doc_gluEndCurve},
	 {"gluEndSurface", _wrap_gluEndSurface, METH_VARARGS , _doc_gluEndSurface},
	 {"gluBeginTrim", _wrap_gluBeginTrim, METH_VARARGS , _doc_gluBeginTrim},
	 {"gluEndTrim", _wrap_gluEndTrim, METH_VARARGS , _doc_gluEndTrim},
	 {"gluPwlCurve", _wrap_gluPwlCurve, METH_VARARGS , _doc_gluPwlCurve},
	 {"gluNurbsCurve", _wrap_gluNurbsCurve, METH_VARARGS , _doc_gluNurbsCurve},
	 {"gluNurbsSurface", _wrap_gluNurbsSurface, METH_VARARGS , _doc_gluNurbsSurface},
	 {"gluLoadSamplingMatrices", _wrap_gluLoadSamplingMatrices, METH_VARARGS , _doc_gluLoadSamplingMatrices},
	 {"gluNurbsProperty", _wrap_gluNurbsProperty, METH_VARARGS , _doc_gluNurbsProperty},
	 {"gluGetNurbsProperty", _wrap_gluGetNurbsProperty, METH_VARARGS , _doc_gluGetNurbsProperty},
	 {"gluNurbsCallback", _wrap_gluNurbsCallback, METH_VARARGS , _doc_gluNurbsCallback},
	 {"__gluNurbsCallbackDataEXT", _wrap___gluNurbsCallbackDataEXT, METH_VARARGS , _doc___gluNurbsCallbackDataEXT},
	 {"__gluInitNurbsTessellatorEXT", _wrap___gluInitNurbsTessellatorEXT, METH_VARARGS , _doc___gluInitNurbsTessellatorEXT},
	 { NULL, NULL }
};

#ifdef __cplusplus
}
#endif

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

static PyObject *SWIG_globals;
#ifdef __cplusplus
extern "C" 
#endif
SWIGEXPORT(void) init__init___(void) {
    PyObject *m, *d;
    int i;
    SWIG_globals = SWIG_newvarlink();
    m = Py_InitModule("__init___", __init___Methods);
    d = PyModule_GetDict(m);
    for (i = 0; swig_types_initial[i]; i++) {
        swig_types[i] = SWIG_TypeRegister(swig_types_initial[i]);
    }
    
    #ifdef NUMERIC
    PyArray_API = NULL;
    import_array();
    init_util();
    PyErr_Clear();
    #endif
    
    {
        PyObject *util = PyImport_ImportModule("OpenGL.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);
    SWIG_InstallConstants(d,swig_const_table);
}

