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

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

#include <string.h>

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

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

#ifdef __cplusplus
extern "C" {
#endif

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

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

#ifdef SWIG_NOINCLUDE

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

#else

static swig_type_info *swig_type_list = 0;

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

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

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

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

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

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

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

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

#ifdef __cplusplus
}

#endif

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

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

#ifdef __cplusplus
extern "C" {
#endif

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

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

#ifdef SWIG_NOINCLUDE

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

#ifdef SWIG_COBJECT_TYPES
cobject:
#endif

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

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

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

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

type_error:

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

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

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

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

#endif

#ifdef __cplusplus
}
#endif








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

static swig_type_info *swig_types[1];

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

#define SWIG_init    initregister_combiners

#define SWIG_name    "register_combiners"

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



int __PyObject_AsArray_Size(PyObject* x);

#ifdef NUMERIC

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

#else /* NUMERIC */

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

#endif /* NUMERIC */


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

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

_PyObject_As(FloatArray, float)

_PyObject_As(DoubleArray, double)

_PyObject_As(CharArray, signed char)

_PyObject_As(UnsignedCharArray, unsigned char)

_PyObject_As(ShortArray, short)

_PyObject_As(UnsignedShortArray, unsigned short)

_PyObject_As(IntArray, int)

_PyObject_As(UnsignedIntArray, unsigned int)

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




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


#if HAS_DYNAMIC_EXT

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

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

#else

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


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

#endif


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

_PyTuple_From(UnsignedCharArray, unsigned char)

_PyTuple_From(CharArray, signed char)

_PyTuple_From(UnsignedShortArray, unsigned short)

_PyTuple_From(ShortArray, short)

_PyTuple_From(UnsignedIntArray, unsigned int)

_PyTuple_From(IntArray, int)

_PyTuple_From(FloatArray, float)

_PyTuple_From(DoubleArray, double)


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

_PyObject_From(UnsignedCharArray, unsigned char)

_PyObject_From(CharArray, signed char)

_PyObject_From(UnsignedShortArray, unsigned short)

_PyObject_From(ShortArray, short)

_PyObject_From(UnsignedIntArray, unsigned int)

_PyObject_From(IntArray, int)

_PyObject_From(FloatArray, float)

_PyObject_From(DoubleArray, double)


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

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

void SetupPixelWrite(int rank);

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

void* _PyObject_AsPointer(PyObject* x);

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

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

typedef void *PTR;

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



static util_API *_util_API = NULL;

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



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

int _PyObject_Dimension(PyObject* x, int rank);

#define ERROR_MSG_SEP ", "
#define ERROR_MSG_SEP_LEN 2

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

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

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

	return 0;
}

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

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




#if !EXT_DEFINES_PROTO || !defined(GL_NV_register_combiners)
DECLARE_VOID_EXT(glCombinerParameterfvNV, (GLenum pname, const GLfloat *params), (pname, params))
DECLARE_VOID_EXT(glCombinerParameterivNV, (GLenum pname, const GLint *params), (pname, params))
DECLARE_VOID_EXT(glCombinerParameterfNV, (GLenum pname, GLfloat param), (pname, param))
DECLARE_VOID_EXT(glCombinerParameteriNV, (GLenum pname, GLint param), (pname, param))
DECLARE_VOID_EXT(glCombinerInputNV,\
	(GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage),\
	(stage, portion, variable, input, mapping, componentUsage))
DECLARE_VOID_EXT(glCombinerOutputNV,\
	(GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum),\
	(stage, portion, abOutput, cdOutput, sumOutput, scale, bias, abDotProduct, cdDotProduct, muxSum))
DECLARE_VOID_EXT(glFinalCombinerInputNV,\
	(GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage),\
	(variable, input, mapping, componentUsage))
DECLARE_VOID_EXT(glGetCombinerInputParameterfvNV,\
	(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params),\
	(stage, portion, variable, pname, params))
DECLARE_VOID_EXT(glGetCombinerInputParameterivNV,\
	(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params),\
	(stage, portion, variable, pname, params))
DECLARE_VOID_EXT(glGetCombinerOutputParameterfvNV,\
	(GLenum stage, GLenum portion, GLenum pname, GLfloat *params),\
	(stage, portion, pname, params))
DECLARE_VOID_EXT(glGetCombinerOutputParameterivNV,\
	(GLenum stage, GLenum portion, GLenum pname, GLint *params),\
	(stage, portion, pname, params))
DECLARE_VOID_EXT(glGetFinalCombinerInputParameterfvNV,\
	(GLenum variable, GLenum pname, GLfloat *params),\
	(variable, pname, params))
DECLARE_VOID_EXT(glGetFinalCombinerInputParameterivNV,\
	(GLenum variable, GLenum pname, GLint *params),\
	(variable, pname, params))
#endif

 static char _doc_glCombinerParameterfvNV[] = "glCombinerParameterfvNV(pname, params) -> None"; 
 static char _doc_glCombinerParameterivNV[] = "glCombinerParameterivNV(pname, params) -> None"; 
 static char _doc_glCombinerParameterfNV[] = "glCombinerParameterfNV(pname, param) -> None"; 
 static char _doc_glCombinerParameteriNV[] = "glCombinerParameteriNV(pname, param) -> None"; 
 static char _doc_glCombinerInputNV[] = "glCombinerInputNV(stage, portion, variable, input, mapping, componentUsage) -> None"; 
 static char _doc_glCombinerOutputNV[] = "glCombinerOutputNV(stage, portion, abOutput, cdOutput, sumOutput, scale, bias, abDotProduct, cdDotProduct, muxSum) -> None"; 
 static char _doc_glFinalCombinerInputNV[] = "glFinalCombinerInputNV(variable, input, mapping, componentUsage) -> None"; 
 static char _doc_glGetCombinerInputParameterfvNV[] = "glGetCombinerInputParameterfvNV(stage, portion, variable, pname) -> params"; 
 static char _doc_glGetCombinerInputParameterivNV[] = "glGetCombinerInputParameterivNV(stage, portion, variable, pname) -> params"; 
 static char _doc_glGetCombinerOutputParameterfvNV[] = "glGetCombinerOutputParameterfvNV(stage, portion, pname) -> params"; 
 static char _doc_glGetCombinerOutputParameterivNV[] = "glGetCombinerOutputParameterivNV(stage, portion, pname) -> params"; 
 static char _doc_glGetFinalCombinerInputParameterfvNV[] = "glGetFinalCombinerInputParameterfvNV(variable, pname) -> params"; 
 static char _doc_glGetFinalCombinerInputParameterivNV[] = "glGetFinalCombinerInputParameterivNV(variable, pname) -> params"; 

static char *proc_names[] =
{
#if !EXT_DEFINES_PROTO || !defined(GL_NV_register_combiners)
	"glCombinerParameterfvNV",
	"glCombinerParameterivNV",
	"glCombinerParameterfNV",
	"glCombinerParameteriNV",
	"glCombinerInputNV",
	"glCombinerOutputNV",
	"glFinalCombinerInputNV",
	"glGetCombinerInputParameterfvNV",
	"glGetCombinerInputParameterivNV",
	"glGetCombinerOutputParameterfvNV",
	"glGetCombinerOutputParameterivNV",
	"glGetFinalCombinerInputParameterfvNV",
	"glGetFinalCombinerInputParameterivNV",
#endif
	NULL
};

#define glInitRegisterCombinersNV() InitExtension("GL_NV_register_combiners", proc_names)

 static char _doc_glInitRegisterCombinersNV[] = "glInitRegisterCombinersNV() -> bool"; 

#ifndef GL_NV_register_combiners
#define GL_MAX_GENERAL_COMBINERS_NV           0x854D
#endif

PyObject *__info()
{
	if (glInitRegisterCombinersNV())
	{
		PyObject *info = PyList_New(0);
		PyList_Append(info, Py_BuildValue("sis", "GL_MAX_GENERAL_COMBINERS_NV", GL_MAX_GENERAL_COMBINERS_NV, "i"));
		return info;
	}
	
	Py_INCREF(Py_None);
	return Py_None;
}

#ifdef __cplusplus
extern "C" {
#endif
static PyObject *_wrap_glCombinerParameterfvNV(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLfloat *arg2 ;
    PyObject *temp_2 ;
    PyObject * obj0  = 0 ;
    PyObject * obj1  = 0 ;
    
    if(!PyArg_ParseTuple(args,(char *)"OO:glCombinerParameterfvNV",&obj0,&obj1)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    {
        arg2 = _PyObject_AsFloatArray(obj1, &temp_2, NULL); 
    }
    {
        glCombinerParameterfvNV(arg1,(GLfloat const *)arg2);
        if (GLErrOccurred()) return NULL; 
    }
    Py_INCREF(Py_None); resultobj = Py_None;
    {
        _PyObject_AsArray_Cleanup(arg2, temp_2); 
    }
    return resultobj;
}


static PyObject *_wrap_glCombinerParameterivNV(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint *arg2 ;
    PyObject *temp_2 ;
    PyObject * obj0  = 0 ;
    PyObject * obj1  = 0 ;
    
    if(!PyArg_ParseTuple(args,(char *)"OO:glCombinerParameterivNV",&obj0,&obj1)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    {
        arg2 = _PyObject_AsIntArray(obj1, &temp_2, NULL); 
    }
    {
        glCombinerParameterivNV(arg1,(GLint const *)arg2);
        if (GLErrOccurred()) return NULL; 
    }
    Py_INCREF(Py_None); resultobj = Py_None;
    {
        _PyObject_AsArray_Cleanup(arg2, temp_2); 
    }
    return resultobj;
}


static PyObject *_wrap_glCombinerParameterfNV(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLfloat arg2 ;
    PyObject * obj0  = 0 ;
    
    if(!PyArg_ParseTuple(args,(char *)"Of:glCombinerParameterfNV",&obj0,&arg2)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    {
        glCombinerParameterfNV(arg1,arg2);
        if (GLErrOccurred()) return NULL; 
    }
    Py_INCREF(Py_None); resultobj = Py_None;
    return resultobj;
}


static PyObject *_wrap_glCombinerParameteriNV(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLint arg2 ;
    PyObject * obj0  = 0 ;
    
    if(!PyArg_ParseTuple(args,(char *)"Oi:glCombinerParameteriNV",&obj0,&arg2)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    {
        glCombinerParameteriNV(arg1,arg2);
        if (GLErrOccurred()) return NULL; 
    }
    Py_INCREF(Py_None); resultobj = Py_None;
    return resultobj;
}


static PyObject *_wrap_glCombinerInputNV(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLenum arg2 ;
    GLenum arg3 ;
    GLenum arg4 ;
    GLenum arg5 ;
    GLenum arg6 ;
    PyObject * obj0  = 0 ;
    PyObject * obj1  = 0 ;
    PyObject * obj2  = 0 ;
    PyObject * obj3  = 0 ;
    PyObject * obj4  = 0 ;
    PyObject * obj5  = 0 ;
    
    if(!PyArg_ParseTuple(args,(char *)"OOOOOO:glCombinerInputNV",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg2 = (GLenum) PyInt_AsLong(obj1);
    if (PyErr_Occurred()) return NULL;
    arg3 = (GLenum) PyInt_AsLong(obj2);
    if (PyErr_Occurred()) return NULL;
    arg4 = (GLenum) PyInt_AsLong(obj3);
    if (PyErr_Occurred()) return NULL;
    arg5 = (GLenum) PyInt_AsLong(obj4);
    if (PyErr_Occurred()) return NULL;
    arg6 = (GLenum) PyInt_AsLong(obj5);
    if (PyErr_Occurred()) return NULL;
    {
        glCombinerInputNV(arg1,arg2,arg3,arg4,arg5,arg6);
        if (GLErrOccurred()) return NULL; 
    }
    Py_INCREF(Py_None); resultobj = Py_None;
    return resultobj;
}


static PyObject *_wrap_glCombinerOutputNV(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLenum arg2 ;
    GLenum arg3 ;
    GLenum arg4 ;
    GLenum arg5 ;
    GLenum arg6 ;
    GLenum arg7 ;
    GLboolean arg8 ;
    GLboolean arg9 ;
    GLboolean arg10 ;
    PyObject * obj0  = 0 ;
    PyObject * obj1  = 0 ;
    PyObject * obj2  = 0 ;
    PyObject * obj3  = 0 ;
    PyObject * obj4  = 0 ;
    PyObject * obj5  = 0 ;
    PyObject * obj6  = 0 ;
    PyObject * obj7  = 0 ;
    PyObject * obj8  = 0 ;
    PyObject * obj9  = 0 ;
    
    if(!PyArg_ParseTuple(args,(char *)"OOOOOOOOOO:glCombinerOutputNV",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg2 = (GLenum) PyInt_AsLong(obj1);
    if (PyErr_Occurred()) return NULL;
    arg3 = (GLenum) PyInt_AsLong(obj2);
    if (PyErr_Occurred()) return NULL;
    arg4 = (GLenum) PyInt_AsLong(obj3);
    if (PyErr_Occurred()) return NULL;
    arg5 = (GLenum) PyInt_AsLong(obj4);
    if (PyErr_Occurred()) return NULL;
    arg6 = (GLenum) PyInt_AsLong(obj5);
    if (PyErr_Occurred()) return NULL;
    arg7 = (GLenum) PyInt_AsLong(obj6);
    if (PyErr_Occurred()) return NULL;
    {
        arg8= (PyObject_IsTrue(obj7)) ? GL_TRUE : GL_FALSE;
    }
    {
        arg9= (PyObject_IsTrue(obj8)) ? GL_TRUE : GL_FALSE;
    }
    {
        arg10= (PyObject_IsTrue(obj9)) ? GL_TRUE : GL_FALSE;
    }
    {
        glCombinerOutputNV(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10);
        if (GLErrOccurred()) return NULL; 
    }
    Py_INCREF(Py_None); resultobj = Py_None;
    return resultobj;
}


static PyObject *_wrap_glFinalCombinerInputNV(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLenum arg2 ;
    GLenum arg3 ;
    GLenum arg4 ;
    PyObject * obj0  = 0 ;
    PyObject * obj1  = 0 ;
    PyObject * obj2  = 0 ;
    PyObject * obj3  = 0 ;
    
    if(!PyArg_ParseTuple(args,(char *)"OOOO:glFinalCombinerInputNV",&obj0,&obj1,&obj2,&obj3)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg2 = (GLenum) PyInt_AsLong(obj1);
    if (PyErr_Occurred()) return NULL;
    arg3 = (GLenum) PyInt_AsLong(obj2);
    if (PyErr_Occurred()) return NULL;
    arg4 = (GLenum) PyInt_AsLong(obj3);
    if (PyErr_Occurred()) return NULL;
    {
        glFinalCombinerInputNV(arg1,arg2,arg3,arg4);
        if (GLErrOccurred()) return NULL; 
    }
    Py_INCREF(Py_None); resultobj = Py_None;
    return resultobj;
}


static PyObject *_wrap_glGetCombinerInputParameterfvNV(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLenum arg2 ;
    GLenum arg3 ;
    GLenum arg4 ;
    GLfloat *arg5 ;
    float temp_5[4] ;
    PyObject * obj0  = 0 ;
    PyObject * obj1  = 0 ;
    PyObject * obj2  = 0 ;
    PyObject * obj3  = 0 ;
    
    {
        int i; 	arg5 = temp_5; 	for (i = 0; i < 4; i++) arg5[i] = -FLT_MAX; 
    }
    if(!PyArg_ParseTuple(args,(char *)"OOOO:glGetCombinerInputParameterfvNV",&obj0,&obj1,&obj2,&obj3)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg2 = (GLenum) PyInt_AsLong(obj1);
    if (PyErr_Occurred()) return NULL;
    arg3 = (GLenum) PyInt_AsLong(obj2);
    if (PyErr_Occurred()) return NULL;
    arg4 = (GLenum) PyInt_AsLong(obj3);
    if (PyErr_Occurred()) return NULL;
    {
        glGetCombinerInputParameterfvNV(arg1,arg2,arg3,arg4,arg5);
        if (GLErrOccurred()) return NULL; 
    }
    Py_INCREF(Py_None); resultobj = Py_None;
    {
        int n, dims[2]; 	Py_XDECREF(resultobj); 	 	for (n = 0; n < 4 && arg5[n] != -FLT_MAX; n++); 	switch (n) 	{
            case 0: 		Py_INCREF(Py_None); 		resultobj = Py_None; 		break; 	case 1: 		resultobj = PyFloat_FromDouble(arg5[0]); 		break; 	case 16: 		dims[0] = 4; 		dims[1] = 4; 		resultobj = _PyObject_FromFloatArray(2, dims, arg5, 0); 		break; 	default: 		resultobj = _PyTuple_FromFloatArray(n, arg5); 	
        } 
    }
    return resultobj;
}


static PyObject *_wrap_glGetCombinerInputParameterivNV(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLenum arg2 ;
    GLenum arg3 ;
    GLenum arg4 ;
    GLint *arg5 ;
    int temp_5[4] ;
    PyObject * obj0  = 0 ;
    PyObject * obj1  = 0 ;
    PyObject * obj2  = 0 ;
    PyObject * obj3  = 0 ;
    
    {
        int i; 	arg5 = temp_5; 	for (i = 0; i < 4; i++) arg5[i] = INT_MIN; 
    }
    if(!PyArg_ParseTuple(args,(char *)"OOOO:glGetCombinerInputParameterivNV",&obj0,&obj1,&obj2,&obj3)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg2 = (GLenum) PyInt_AsLong(obj1);
    if (PyErr_Occurred()) return NULL;
    arg3 = (GLenum) PyInt_AsLong(obj2);
    if (PyErr_Occurred()) return NULL;
    arg4 = (GLenum) PyInt_AsLong(obj3);
    if (PyErr_Occurred()) return NULL;
    {
        glGetCombinerInputParameterivNV(arg1,arg2,arg3,arg4,arg5);
        if (GLErrOccurred()) return NULL; 
    }
    Py_INCREF(Py_None); resultobj = Py_None;
    {
        int n, dims[2]; 	Py_XDECREF(resultobj); 	 	for (n = 0; n < 4 && arg5[n] != INT_MIN; n++); 	switch (n) 	{
            case 0: 		Py_INCREF(Py_None); 		resultobj = Py_None; 		break; 	case 1: 		resultobj = PyInt_FromLong(arg5[0]); 		break; 	case 16: 		dims[0] = 4; 		dims[1] = 4; 		resultobj = _PyObject_FromIntArray(2, dims, arg5, 0); 		break; 	default: 		resultobj = _PyTuple_FromIntArray(n, arg5); 	
        } 
    }
    return resultobj;
}


static PyObject *_wrap_glGetCombinerOutputParameterfvNV(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLenum arg2 ;
    GLenum arg3 ;
    GLfloat *arg4 ;
    float temp_4[4] ;
    PyObject * obj0  = 0 ;
    PyObject * obj1  = 0 ;
    PyObject * obj2  = 0 ;
    
    {
        int i; 	arg4 = temp_4; 	for (i = 0; i < 4; i++) arg4[i] = -FLT_MAX; 
    }
    if(!PyArg_ParseTuple(args,(char *)"OOO:glGetCombinerOutputParameterfvNV",&obj0,&obj1,&obj2)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg2 = (GLenum) PyInt_AsLong(obj1);
    if (PyErr_Occurred()) return NULL;
    arg3 = (GLenum) PyInt_AsLong(obj2);
    if (PyErr_Occurred()) return NULL;
    {
        glGetCombinerOutputParameterfvNV(arg1,arg2,arg3,arg4);
        if (GLErrOccurred()) return NULL; 
    }
    Py_INCREF(Py_None); resultobj = Py_None;
    {
        int n, dims[2]; 	Py_XDECREF(resultobj); 	 	for (n = 0; n < 4 && arg4[n] != -FLT_MAX; n++); 	switch (n) 	{
            case 0: 		Py_INCREF(Py_None); 		resultobj = Py_None; 		break; 	case 1: 		resultobj = PyFloat_FromDouble(arg4[0]); 		break; 	case 16: 		dims[0] = 4; 		dims[1] = 4; 		resultobj = _PyObject_FromFloatArray(2, dims, arg4, 0); 		break; 	default: 		resultobj = _PyTuple_FromFloatArray(n, arg4); 	
        } 
    }
    return resultobj;
}


static PyObject *_wrap_glGetCombinerOutputParameterivNV(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLenum arg2 ;
    GLenum arg3 ;
    GLint *arg4 ;
    int temp_4[4] ;
    PyObject * obj0  = 0 ;
    PyObject * obj1  = 0 ;
    PyObject * obj2  = 0 ;
    
    {
        int i; 	arg4 = temp_4; 	for (i = 0; i < 4; i++) arg4[i] = INT_MIN; 
    }
    if(!PyArg_ParseTuple(args,(char *)"OOO:glGetCombinerOutputParameterivNV",&obj0,&obj1,&obj2)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg2 = (GLenum) PyInt_AsLong(obj1);
    if (PyErr_Occurred()) return NULL;
    arg3 = (GLenum) PyInt_AsLong(obj2);
    if (PyErr_Occurred()) return NULL;
    {
        glGetCombinerOutputParameterivNV(arg1,arg2,arg3,arg4);
        if (GLErrOccurred()) return NULL; 
    }
    Py_INCREF(Py_None); resultobj = Py_None;
    {
        int n, dims[2]; 	Py_XDECREF(resultobj); 	 	for (n = 0; n < 4 && arg4[n] != INT_MIN; n++); 	switch (n) 	{
            case 0: 		Py_INCREF(Py_None); 		resultobj = Py_None; 		break; 	case 1: 		resultobj = PyInt_FromLong(arg4[0]); 		break; 	case 16: 		dims[0] = 4; 		dims[1] = 4; 		resultobj = _PyObject_FromIntArray(2, dims, arg4, 0); 		break; 	default: 		resultobj = _PyTuple_FromIntArray(n, arg4); 	
        } 
    }
    return resultobj;
}


static PyObject *_wrap_glGetFinalCombinerInputParameterfvNV(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLenum arg2 ;
    GLfloat *arg3 ;
    float temp_3[4] ;
    PyObject * obj0  = 0 ;
    PyObject * obj1  = 0 ;
    
    {
        int i; 	arg3 = temp_3; 	for (i = 0; i < 4; i++) arg3[i] = -FLT_MAX; 
    }
    if(!PyArg_ParseTuple(args,(char *)"OO:glGetFinalCombinerInputParameterfvNV",&obj0,&obj1)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg2 = (GLenum) PyInt_AsLong(obj1);
    if (PyErr_Occurred()) return NULL;
    {
        glGetFinalCombinerInputParameterfvNV(arg1,arg2,arg3);
        if (GLErrOccurred()) return NULL; 
    }
    Py_INCREF(Py_None); resultobj = Py_None;
    {
        int n, dims[2]; 	Py_XDECREF(resultobj); 	 	for (n = 0; n < 4 && arg3[n] != -FLT_MAX; n++); 	switch (n) 	{
            case 0: 		Py_INCREF(Py_None); 		resultobj = Py_None; 		break; 	case 1: 		resultobj = PyFloat_FromDouble(arg3[0]); 		break; 	case 16: 		dims[0] = 4; 		dims[1] = 4; 		resultobj = _PyObject_FromFloatArray(2, dims, arg3, 0); 		break; 	default: 		resultobj = _PyTuple_FromFloatArray(n, arg3); 	
        } 
    }
    return resultobj;
}


static PyObject *_wrap_glGetFinalCombinerInputParameterivNV(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    GLenum arg1 ;
    GLenum arg2 ;
    GLint *arg3 ;
    int temp_3[4] ;
    PyObject * obj0  = 0 ;
    PyObject * obj1  = 0 ;
    
    {
        int i; 	arg3 = temp_3; 	for (i = 0; i < 4; i++) arg3[i] = INT_MIN; 
    }
    if(!PyArg_ParseTuple(args,(char *)"OO:glGetFinalCombinerInputParameterivNV",&obj0,&obj1)) return NULL;
    arg1 = (GLenum) PyInt_AsLong(obj0);
    if (PyErr_Occurred()) return NULL;
    arg2 = (GLenum) PyInt_AsLong(obj1);
    if (PyErr_Occurred()) return NULL;
    {
        glGetFinalCombinerInputParameterivNV(arg1,arg2,arg3);
        if (GLErrOccurred()) return NULL; 
    }
    Py_INCREF(Py_None); resultobj = Py_None;
    {
        int n, dims[2]; 	Py_XDECREF(resultobj); 	 	for (n = 0; n < 4 && arg3[n] != INT_MIN; n++); 	switch (n) 	{
            case 0: 		Py_INCREF(Py_None); 		resultobj = Py_None; 		break; 	case 1: 		resultobj = PyInt_FromLong(arg3[0]); 		break; 	case 16: 		dims[0] = 4; 		dims[1] = 4; 		resultobj = _PyObject_FromIntArray(2, dims, arg3, 0); 		break; 	default: 		resultobj = _PyTuple_FromIntArray(n, arg3); 	
        } 
    }
    return resultobj;
}


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


static PyObject *_wrap___info(PyObject *self, PyObject *args) {
    PyObject *resultobj;
    PyObject *result;
    
    if(!PyArg_ParseTuple(args,(char *)":__info")) return NULL;
    {
        result = (PyObject *)__info();
        if (GLErrOccurred()) return NULL; 
    }
    {
        resultobj= result;
    }
    return resultobj;
}


static PyMethodDef SwigMethods[] = {
	 { (char *)"glCombinerParameterfvNV", _wrap_glCombinerParameterfvNV, METH_VARARGS , _doc_glCombinerParameterfvNV},
	 { (char *)"glCombinerParameterivNV", _wrap_glCombinerParameterivNV, METH_VARARGS , _doc_glCombinerParameterivNV},
	 { (char *)"glCombinerParameterfNV", _wrap_glCombinerParameterfNV, METH_VARARGS , _doc_glCombinerParameterfNV},
	 { (char *)"glCombinerParameteriNV", _wrap_glCombinerParameteriNV, METH_VARARGS , _doc_glCombinerParameteriNV},
	 { (char *)"glCombinerInputNV", _wrap_glCombinerInputNV, METH_VARARGS , _doc_glCombinerInputNV},
	 { (char *)"glCombinerOutputNV", _wrap_glCombinerOutputNV, METH_VARARGS , _doc_glCombinerOutputNV},
	 { (char *)"glFinalCombinerInputNV", _wrap_glFinalCombinerInputNV, METH_VARARGS , _doc_glFinalCombinerInputNV},
	 { (char *)"glGetCombinerInputParameterfvNV", _wrap_glGetCombinerInputParameterfvNV, METH_VARARGS , _doc_glGetCombinerInputParameterfvNV},
	 { (char *)"glGetCombinerInputParameterivNV", _wrap_glGetCombinerInputParameterivNV, METH_VARARGS , _doc_glGetCombinerInputParameterivNV},
	 { (char *)"glGetCombinerOutputParameterfvNV", _wrap_glGetCombinerOutputParameterfvNV, METH_VARARGS , _doc_glGetCombinerOutputParameterfvNV},
	 { (char *)"glGetCombinerOutputParameterivNV", _wrap_glGetCombinerOutputParameterivNV, METH_VARARGS , _doc_glGetCombinerOutputParameterivNV},
	 { (char *)"glGetFinalCombinerInputParameterfvNV", _wrap_glGetFinalCombinerInputParameterfvNV, METH_VARARGS , _doc_glGetFinalCombinerInputParameterfvNV},
	 { (char *)"glGetFinalCombinerInputParameterivNV", _wrap_glGetFinalCombinerInputParameterivNV, METH_VARARGS , _doc_glGetFinalCombinerInputParameterivNV},
	 { (char *)"glInitRegisterCombinersNV", _wrap_glInitRegisterCombinersNV, METH_VARARGS , _doc_glInitRegisterCombinersNV},
	 { (char *)"__info", _wrap___info, METH_VARARGS },
	 { NULL, NULL }
};


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


static swig_type_info *swig_types_initial[] = {
0
};


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

static swig_const_info swig_const_table[] = {
{ SWIG_PY_STRING,  (char*)"__version__", 0, 0, (void *)"1.20", 0},
{ SWIG_PY_STRING,  (char*)"__date__", 0, 0, (void *)"2001/10/05 17:39:12", 0},
{ SWIG_PY_INT,     (char *)"__api_version__", (long) 260, 0, 0, 0},
{ SWIG_PY_STRING,  (char*)"__author__", 0, 0, (void *)"Tarn Weisner Burton <twburton@users.sourceforge.net>", 0},
{ SWIG_PY_STRING,  (char*)"__doc__", 0, 0, (void *)"http://oss.sgi.com/projects/ogl-sample/registry/NV/register_combiners.txt", 0},
{ SWIG_PY_INT,     (char *)"GL_ALL_COMPLETED_NV", (long) 0x84F2, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GL_REGISTER_COMBINERS_NV", (long) 0x8522, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GL_COMBINER0_NV", (long) 0x8550, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GL_COMBINER1_NV", (long) 0x8551, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GL_COMBINER2_NV", (long) 0x8552, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GL_COMBINER3_NV", (long) 0x8553, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GL_COMBINER4_NV", (long) 0x8554, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GL_COMBINER5_NV", (long) 0x8555, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GL_COMBINER6_NV", (long) 0x8556, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GL_COMBINER7_NV", (long) 0x8557, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GL_VARIABLE_A_NV", (long) 0x8523, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GL_VARIABLE_B_NV", (long) 0x8524, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GL_VARIABLE_C_NV", (long) 0x8525, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GL_VARIABLE_D_NV", (long) 0x8526, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GL_VARIABLE_E_NV", (long) 0x8527, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GL_VARIABLE_F_NV", (long) 0x8528, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GL_VARIABLE_G_NV", (long) 0x8529, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GL_CONSTANT_COLOR0_NV", (long) 0x852A, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GL_CONSTANT_COLOR1_NV", (long) 0x852B, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GL_PRIMARY_COLOR_NV", (long) 0x852C, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GL_SECONDARY_COLOR_NV", (long) 0x852D, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GL_SPARE0_NV", (long) 0x852E, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GL_SPARE1_NV", (long) 0x852F, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GL_UNSIGNED_IDENTITY_NV", (long) 0x8536, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GL_UNSIGNED_INVERT_NV", (long) 0x8537, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GL_EXPAND_NORMAL_NV", (long) 0x8538, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GL_EXPAND_NEGATE_NV", (long) 0x8539, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GL_HALF_BIAS_NORMAL_NV", (long) 0x853A, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GL_HALF_BIAS_NEGATE_NV", (long) 0x853B, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GL_SIGNED_IDENTITY_NV", (long) 0x853C, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GL_SIGNED_NEGATE_NV", (long) 0x853D, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GL_E_TIMES_F_NV", (long) 0x8531, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GL_SPARE0_PLUS_SECONDARY_COLOR_NV", (long) 0x8532, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GL_SCALE_BY_TWO_NV", (long) 0x853E, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GL_SCALE_BY_FOUR_NV", (long) 0x853F, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GL_SCALE_BY_ONE_HALF_NV", (long) 0x8540, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GL_BIAS_BY_NEGATIVE_ONE_HALF_NV", (long) 0x8541, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GL_DISCARD_NV", (long) 0x8530, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GL_COMBINER_INPUT_NV", (long) 0x8542, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GL_COMBINER_MAPPING_NV", (long) 0x8543, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GL_COMBINER_COMPONENT_USAGE_NV", (long) 0x8544, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GL_COMBINER_AB_DOT_PRODUCT_NV", (long) 0x8545, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GL_COMBINER_CD_DOT_PRODUCT_NV", (long) 0x8546, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GL_COMBINER_MUX_SUM_NV", (long) 0x8547, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GL_COMBINER_SCALE_NV", (long) 0x8548, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GL_COMBINER_BIAS_NV", (long) 0x8549, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GL_COMBINER_AB_OUTPUT_NV", (long) 0x854A, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GL_COMBINER_CD_OUTPUT_NV", (long) 0x854B, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GL_COMBINER_SUM_OUTPUT_NV", (long) 0x854C, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GL_NUM_GENERAL_COMBINERS_NV", (long) 0x854E, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GL_COLOR_SUM_CLAMP_NV", (long) 0x854F, 0, 0, 0},
{ SWIG_PY_INT,     (char *)"GL_MAX_GENERAL_COMBINERS_NV", (long) 0x854D, 0, 0, 0},
{0}};

#ifdef __cplusplus
}
#endif

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

