/* Generated by Cython 0.17.4 on Sun Jun 16 22:00:39 2013 */

#define PY_SSIZE_T_CLEAN
#include "Python.h"
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x02040000
    #error Cython requires Python 2.4+.
#else
#include <stddef.h> /* For offsetof */
#ifndef offsetof
#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif
#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
  #define Py_HUGE_VAL HUGE_VAL
#endif
#ifdef PYPY_VERSION
#define CYTHON_COMPILING_IN_PYPY 1
#define CYTHON_COMPILING_IN_CPYTHON 0
#else
#define CYTHON_COMPILING_IN_PYPY 0
#define CYTHON_COMPILING_IN_CPYTHON 1
#endif
#if PY_VERSION_HEX < 0x02050000
  typedef int Py_ssize_t;
  #define PY_SSIZE_T_MAX INT_MAX
  #define PY_SSIZE_T_MIN INT_MIN
  #define PY_FORMAT_SIZE_T ""
  #define CYTHON_FORMAT_SSIZE_T ""
  #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
  #define PyInt_AsSsize_t(o)   __Pyx_PyInt_AsInt(o)
  #define PyNumber_Index(o)    ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \
                                (PyErr_Format(PyExc_TypeError, \
                                              "expected index value, got %.200s", Py_TYPE(o)->tp_name), \
                                 (PyObject*)0))
  #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \
                                  !PyComplex_Check(o))
  #define PyIndex_Check __Pyx_PyIndex_Check
  #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
  #define __PYX_BUILD_PY_SSIZE_T "i"
#else
  #define __PYX_BUILD_PY_SSIZE_T "n"
  #define CYTHON_FORMAT_SSIZE_T "z"
  #define __Pyx_PyIndex_Check PyIndex_Check
#endif
#if PY_VERSION_HEX < 0x02060000
  #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
  #define Py_TYPE(ob)   (((PyObject*)(ob))->ob_type)
  #define Py_SIZE(ob)   (((PyVarObject*)(ob))->ob_size)
  #define PyVarObject_HEAD_INIT(type, size) \
          PyObject_HEAD_INIT(type) size,
  #define PyType_Modified(t)
  typedef struct {
     void *buf;
     PyObject *obj;
     Py_ssize_t len;
     Py_ssize_t itemsize;
     int readonly;
     int ndim;
     char *format;
     Py_ssize_t *shape;
     Py_ssize_t *strides;
     Py_ssize_t *suboffsets;
     void *internal;
  } Py_buffer;
  #define PyBUF_SIMPLE 0
  #define PyBUF_WRITABLE 0x0001
  #define PyBUF_FORMAT 0x0004
  #define PyBUF_ND 0x0008
  #define PyBUF_STRIDES (0x0010 | PyBUF_ND)
  #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
  #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
  #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
  #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
  #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE)
  #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE)
  typedef int (*getbufferproc)(PyObject *, Py_buffer *, int);
  typedef void (*releasebufferproc)(PyObject *, Py_buffer *);
#endif
#if PY_MAJOR_VERSION < 3
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
          PyCode_New(a, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
          PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#endif
#if PY_MAJOR_VERSION < 3 && PY_MINOR_VERSION < 6
  #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict")
#endif
#if PY_MAJOR_VERSION >= 3
  #define Py_TPFLAGS_CHECKTYPES 0
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif
#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  #define CYTHON_PEP393_ENABLED 1
  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ? \
                                              0 : _PyUnicode_Ready((PyObject *)(op)))
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
#else
  #define CYTHON_PEP393_ENABLED 0
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
  #define __Pyx_PyUnicode_READ(k, d, i)   ((k=k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBaseString_Type            PyUnicode_Type
  #define PyStringObject               PyUnicodeObject
  #define PyString_Type                PyUnicode_Type
  #define PyString_Check               PyUnicode_Check
  #define PyString_CheckExact          PyUnicode_CheckExact
#endif
#if PY_VERSION_HEX < 0x02060000
  #define PyBytesObject                PyStringObject
  #define PyBytes_Type                 PyString_Type
  #define PyBytes_Check                PyString_Check
  #define PyBytes_CheckExact           PyString_CheckExact
  #define PyBytes_FromString           PyString_FromString
  #define PyBytes_FromStringAndSize    PyString_FromStringAndSize
  #define PyBytes_FromFormat           PyString_FromFormat
  #define PyBytes_DecodeEscape         PyString_DecodeEscape
  #define PyBytes_AsString             PyString_AsString
  #define PyBytes_AsStringAndSize      PyString_AsStringAndSize
  #define PyBytes_Size                 PyString_Size
  #define PyBytes_AS_STRING            PyString_AS_STRING
  #define PyBytes_GET_SIZE             PyString_GET_SIZE
  #define PyBytes_Repr                 PyString_Repr
  #define PyBytes_Concat               PyString_Concat
  #define PyBytes_ConcatAndDel         PyString_ConcatAndDel
#endif
#if PY_VERSION_HEX < 0x02060000
  #define PySet_Check(obj)             PyObject_TypeCheck(obj, &PySet_Type)
  #define PyFrozenSet_Check(obj)       PyObject_TypeCheck(obj, &PyFrozenSet_Type)
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
#endif
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#if PY_MAJOR_VERSION >= 3
  #define PyIntObject                  PyLongObject
  #define PyInt_Type                   PyLong_Type
  #define PyInt_Check(op)              PyLong_Check(op)
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
  #define PyInt_FromString             PyLong_FromString
  #define PyInt_FromUnicode            PyLong_FromUnicode
  #define PyInt_FromLong               PyLong_FromLong
  #define PyInt_FromSize_t             PyLong_FromSize_t
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
  #define PyInt_AsLong                 PyLong_AsLong
  #define PyInt_AS_LONG                PyLong_AS_LONG
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif
#if PY_VERSION_HEX < 0x03020000
  typedef long Py_hash_t;
  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
#else
  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
#endif
#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300)
  #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b)
  #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value)
  #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b)
#else
  #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \
            (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0)))
  #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \
            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1)))
  #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \
            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1)))
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
#endif
#if PY_VERSION_HEX < 0x02050000
  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),((char *)(n)))
  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),((char *)(n)))
#else
  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),(n))
  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),(n))
#endif
#if PY_VERSION_HEX < 0x02050000
  #define __Pyx_NAMESTR(n) ((char *)(n))
  #define __Pyx_DOCSTR(n)  ((char *)(n))
#else
  #define __Pyx_NAMESTR(n) (n)
  #define __Pyx_DOCSTR(n)  (n)
#endif


#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#else
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#endif

#ifndef __PYX_EXTERN_C
  #ifdef __cplusplus
    #define __PYX_EXTERN_C extern "C"
  #else
    #define __PYX_EXTERN_C extern
  #endif
#endif

#if defined(WIN32) || defined(MS_WINDOWS)
#define _USE_MATH_DEFINES
#endif
#include <math.h>
#define __PYX_HAVE___gldraw
#define __PYX_HAVE_API___gldraw
#include "stddef.h"
#include "stdint.h"
#include "GL/gl.h"
#include "GL/glext.h"
#include "glm/glm.hpp"
#include "glm/gtx/transform.hpp"
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

#ifdef PYREX_WITHOUT_ASSERTIONS
#define CYTHON_WITHOUT_ASSERTIONS
#endif


/* inline attribute */
#ifndef CYTHON_INLINE
  #if defined(__GNUC__)
    #define CYTHON_INLINE __inline__
  #elif defined(_MSC_VER)
    #define CYTHON_INLINE __inline
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_INLINE inline
  #else
    #define CYTHON_INLINE
  #endif
#endif

/* unused attribute */
#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define CYTHON_UNUSED __attribute__ ((__unused__))
#   else
#     define CYTHON_UNUSED
#   endif
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
#   define CYTHON_UNUSED __attribute__ ((__unused__))
# else
#   define CYTHON_UNUSED
# endif
#endif

typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/


/* Type Conversion Predeclarations */

#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s)
#define __Pyx_PyBytes_AsUString(s)   ((unsigned char*) PyBytes_AsString(s))

#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);

static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);

#if CYTHON_COMPILING_IN_CPYTHON
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#else
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#endif
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))

#ifdef __GNUC__
  /* Test for GCC > 2.95 */
  #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
    #define likely(x)   __builtin_expect(!!(x), 1)
    #define unlikely(x) __builtin_expect(!!(x), 0)
  #else /* __GNUC__ > 2 ... */
    #define likely(x)   (x)
    #define unlikely(x) (x)
  #endif /* __GNUC__ > 2 ... */
#else /* __GNUC__ */
  #define likely(x)   (x)
  #define unlikely(x) (x)
#endif /* __GNUC__ */
    
static PyObject *__pyx_m;
static PyObject *__pyx_b;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
static const char *__pyx_filename;


static const char *__pyx_f[] = {
  "_gldraw.pyx",
};

/* "gl.pxd":5147
 * # from /usr/include/GL/gl.h:
 * 
 * ctypedef unsigned int	GLenum             # <<<<<<<<<<<<<<
 * ctypedef unsigned char	GLboolean
 * ctypedef unsigned int	GLbitfield
 */
typedef unsigned int __pyx_t_2gl_GLenum;

/* "gl.pxd":5148
 * 
 * ctypedef unsigned int	GLenum
 * ctypedef unsigned char	GLboolean             # <<<<<<<<<<<<<<
 * ctypedef unsigned int	GLbitfield
 * ctypedef void		GLvoid
 */
typedef unsigned char __pyx_t_2gl_GLboolean;

/* "gl.pxd":5149
 * ctypedef unsigned int	GLenum
 * ctypedef unsigned char	GLboolean
 * ctypedef unsigned int	GLbitfield             # <<<<<<<<<<<<<<
 * ctypedef void		GLvoid
 * ctypedef signed char	GLbyte
 */
typedef unsigned int __pyx_t_2gl_GLbitfield;

/* "gl.pxd":5151
 * ctypedef unsigned int	GLbitfield
 * ctypedef void		GLvoid
 * ctypedef signed char	GLbyte             # <<<<<<<<<<<<<<
 * ctypedef short		GLshort
 * ctypedef int		GLint
 */
typedef signed char __pyx_t_2gl_GLbyte;

/* "gl.pxd":5152
 * ctypedef void		GLvoid
 * ctypedef signed char	GLbyte
 * ctypedef short		GLshort             # <<<<<<<<<<<<<<
 * ctypedef int		GLint
 * ctypedef unsigned char	GLubyte
 */
typedef short __pyx_t_2gl_GLshort;

/* "gl.pxd":5153
 * ctypedef signed char	GLbyte
 * ctypedef short		GLshort
 * ctypedef int		GLint             # <<<<<<<<<<<<<<
 * ctypedef unsigned char	GLubyte
 * ctypedef unsigned short	GLushort
 */
typedef int __pyx_t_2gl_GLint;

/* "gl.pxd":5154
 * ctypedef short		GLshort
 * ctypedef int		GLint
 * ctypedef unsigned char	GLubyte             # <<<<<<<<<<<<<<
 * ctypedef unsigned short	GLushort
 * ctypedef unsigned int	GLuint
 */
typedef unsigned char __pyx_t_2gl_GLubyte;

/* "gl.pxd":5155
 * ctypedef int		GLint
 * ctypedef unsigned char	GLubyte
 * ctypedef unsigned short	GLushort             # <<<<<<<<<<<<<<
 * ctypedef unsigned int	GLuint
 * ctypedef int		GLsizei
 */
typedef unsigned short __pyx_t_2gl_GLushort;

/* "gl.pxd":5156
 * ctypedef unsigned char	GLubyte
 * ctypedef unsigned short	GLushort
 * ctypedef unsigned int	GLuint             # <<<<<<<<<<<<<<
 * ctypedef int		GLsizei
 * ctypedef float		GLfloat
 */
typedef unsigned int __pyx_t_2gl_GLuint;

/* "gl.pxd":5157
 * ctypedef unsigned short	GLushort
 * ctypedef unsigned int	GLuint
 * ctypedef int		GLsizei             # <<<<<<<<<<<<<<
 * ctypedef float		GLfloat
 * ctypedef float		GLclampf
 */
typedef int __pyx_t_2gl_GLsizei;

/* "gl.pxd":5158
 * ctypedef unsigned int	GLuint
 * ctypedef int		GLsizei
 * ctypedef float		GLfloat             # <<<<<<<<<<<<<<
 * ctypedef float		GLclampf
 * ctypedef double		GLdouble
 */
typedef float __pyx_t_2gl_GLfloat;

/* "gl.pxd":5159
 * ctypedef int		GLsizei
 * ctypedef float		GLfloat
 * ctypedef float		GLclampf             # <<<<<<<<<<<<<<
 * ctypedef double		GLdouble
 * ctypedef double		GLclampd
 */
typedef float __pyx_t_2gl_GLclampf;

/* "gl.pxd":5160
 * ctypedef float		GLfloat
 * ctypedef float		GLclampf
 * ctypedef double		GLdouble             # <<<<<<<<<<<<<<
 * ctypedef double		GLclampd
 * 
 */
typedef double __pyx_t_2gl_GLdouble;

/* "gl.pxd":5161
 * ctypedef float		GLclampf
 * ctypedef double		GLdouble
 * ctypedef double		GLclampd             # <<<<<<<<<<<<<<
 * 
 * 
 */
typedef double __pyx_t_2gl_GLclampd;

/* "gl.pxd":5166
 * # from /usr/include/GL/glext.h:
 * 
 * ctypedef char GLchar             # <<<<<<<<<<<<<<
 * ctypedef ptrdiff_t GLintptr
 * ctypedef ptrdiff_t GLsizeiptr
 */
typedef char __pyx_t_2gl_GLchar;

/* "gl.pxd":5167
 * 
 * ctypedef char GLchar
 * ctypedef ptrdiff_t GLintptr             # <<<<<<<<<<<<<<
 * ctypedef ptrdiff_t GLsizeiptr
 * 
 */
typedef ptrdiff_t __pyx_t_2gl_GLintptr;

/* "gl.pxd":5168
 * ctypedef char GLchar
 * ctypedef ptrdiff_t GLintptr
 * ctypedef ptrdiff_t GLsizeiptr             # <<<<<<<<<<<<<<
 * 
 * 
 */
typedef ptrdiff_t __pyx_t_2gl_GLsizeiptr;

/*--- Type declarations ---*/

/* "gl.pxd":5150
 * ctypedef unsigned char	GLboolean
 * ctypedef unsigned int	GLbitfield
 * ctypedef void		GLvoid             # <<<<<<<<<<<<<<
 * ctypedef signed char	GLbyte
 * ctypedef short		GLshort
 */
typedef void __pyx_t_2gl_GLvoid;
struct __pyx_t_7_gldraw_Block;
struct __pyx_t_7_gldraw_Cube;
struct __pyx_t_7_gldraw_Animation_Struct;

/* "_gldraw.pxd":4
 * 
 * from gl cimport *    #line 37
 * cdef enum: #    #line 48             # <<<<<<<<<<<<<<
 *     VERTEX_ATTRIB_LOCATION = 0    #line 54
 *     NORMAL_ATTRIB_LOCATION = 1    #line 55
 */
enum  {
  __pyx_e_7_gldraw_VERTEX_ATTRIB_LOCATION = 0,
  __pyx_e_7_gldraw_NORMAL_ATTRIB_LOCATION = 1,
  __pyx_e_7_gldraw_COLOR_ATTRIB_LOCATION = 2,
  __pyx_e_7_gldraw_TEXCOORD_ATTRIB_LOCATION = 3
};

/* "_gldraw.pyx":49
 * 
 * 
 * cdef enum: # #pxd/             # <<<<<<<<<<<<<<
 * #px if True:
 *     MAX_BLOCKS = 1000
 */
enum  {
  __pyx_e_7_gldraw_MAX_BLOCKS = 1000,
  __pyx_e_7_gldraw_MAX_FACES = 6,
  __pyx_e_7_gldraw_MAX_FACES_PER_BLOCK = 6
};

/* "_gldraw.pyx":60
 *     #px TEXCOORD_ATTRIB_LOCATION = 3
 * 
 * cdef struct Block: #px/             # <<<<<<<<<<<<<<
 * #px class Block:     # pylint: disable=R0903
 * #px #px-
 */
struct __pyx_t_7_gldraw_Block {
  glm::mat4 transformation;
  int in_motion;
  int cnt_faces;
  int idx_label[__pyx_e_7_gldraw_MAX_FACES_PER_BLOCK];
  int cnt_label[__pyx_e_7_gldraw_MAX_FACES_PER_BLOCK];
  int texname[__pyx_e_7_gldraw_MAX_FACES_PER_BLOCK];
  int idx_triangles;
  int cnt_triangles;
};

/* "_gldraw.pyx":86
 *         #px self.cnt_triangles = None
 * 
 * cdef struct Cube: #px/             # <<<<<<<<<<<<<<
 * #px class cube:     # pylint: disable=W0232, R0903
 *     unsigned int number_blocks #px+
 */
struct __pyx_t_7_gldraw_Cube {
  unsigned int number_blocks;
  struct __pyx_t_7_gldraw_Block blocks[__pyx_e_7_gldraw_MAX_BLOCKS];
  int idx_pick;
  int cnt_pick;
  int idx_debug;
  __pyx_t_2gl_GLuint object_location;
  __pyx_t_2gl_GLuint glbuffer;
};

/* "_gldraw.pyx":101
 * cdef Cube cube #px+
 * 
 * cdef struct Animation_Struct: #px/             # <<<<<<<<<<<<<<
 * #px class animation:    # pylint: disable=W0232, R0903
 *     float angle, angle_max #px+
 */
struct __pyx_t_7_gldraw_Animation_Struct {
  float angle;
  float angle_max;
  glm::vec3 rotation;
  glm::mat4 rotation_matrix;
};
#ifndef CYTHON_REFNANNY
  #define CYTHON_REFNANNY 0
#endif
#if CYTHON_REFNANNY
  typedef struct {
    void (*INCREF)(void*, PyObject*, int);
    void (*DECREF)(void*, PyObject*, int);
    void (*GOTREF)(void*, PyObject*, int);
    void (*GIVEREF)(void*, PyObject*, int);
    void* (*SetupContext)(const char*, int, const char*);
    void (*FinishContext)(void**);
  } __Pyx_RefNannyAPIStruct;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/
  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
#ifdef WITH_THREAD
  #define __Pyx_RefNannySetupContext(name, acquire_gil) \
          if (acquire_gil) { \
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
              PyGILState_Release(__pyx_gilstate_save); \
          } else { \
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
          }
#else
  #define __Pyx_RefNannySetupContext(name, acquire_gil) \
          __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
#endif
  #define __Pyx_RefNannyFinishContext() \
          __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
  #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
  #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
  #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
#else
  #define __Pyx_RefNannyDeclarations
  #define __Pyx_RefNannySetupContext(name, acquire_gil)
  #define __Pyx_RefNannyFinishContext()
  #define __Pyx_INCREF(r) Py_INCREF(r)
  #define __Pyx_DECREF(r) Py_DECREF(r)
  #define __Pyx_GOTREF(r)
  #define __Pyx_GIVEREF(r)
  #define __Pyx_XINCREF(r) Py_XINCREF(r)
  #define __Pyx_XDECREF(r) Py_XDECREF(r)
  #define __Pyx_XGOTREF(r)
  #define __Pyx_XGIVEREF(r)
#endif /* CYTHON_REFNANNY */
#define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
#define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)

static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/

static double __Pyx__PyObject_AsDouble(PyObject* obj); /* proto */
#if CYTHON_COMPILING_IN_PYPY
#define __Pyx_PyObject_AsDouble(obj) \
(likely(PyFloat_CheckExact(obj)) ? PyFloat_AS_DOUBLE(obj) : \
 likely(PyInt_CheckExact(obj)) ? \
 PyFloat_AsDouble(obj) : __Pyx__PyObject_AsDouble(obj))
#else
#define __Pyx_PyObject_AsDouble(obj) \
((likely(PyFloat_CheckExact(obj))) ? \
 PyFloat_AS_DOUBLE(obj) : __Pyx__PyObject_AsDouble(obj))
#endif

static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (!j) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}
#define __Pyx_GetItemInt_List(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
                                                    __Pyx_GetItemInt_List_Fast(o, i) : \
                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, i);
        Py_INCREF(r);
        return r;
    }
    else if ((-PyList_GET_SIZE(o) <= i) & (i < 0)) {
        PyObject *r = PyList_GET_ITEM(o, PyList_GET_SIZE(o) + i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
                                                    __Pyx_GetItemInt_Tuple_Fast(o, i) : \
                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, i);
        Py_INCREF(r);
        return r;
    }
    else if ((-PyTuple_GET_SIZE(o) <= i) & (i < 0)) {
        PyObject *r = PyTuple_GET_ITEM(o, PyTuple_GET_SIZE(o) + i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
#define __Pyx_GetItemInt(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
                                                    __Pyx_GetItemInt_Fast(o, i) : \
                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (PyList_CheckExact(o)) {
        Py_ssize_t n = (likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if (likely((n >= 0) & (n < PyList_GET_SIZE(o)))) {
            PyObject *r = PyList_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    }
    else if (PyTuple_CheckExact(o)) {
        Py_ssize_t n = (likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if (likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    } else {  /* inlined PySequence_GetItem() */
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_item)) {
            if (unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (unlikely(l < 0)) return NULL;
                i += l;
            }
            return m->sq_item(o, i);
        }
    }
#else
    if (PySequence_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);

static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);

static CYTHON_INLINE int __Pyx_IterFinish(void); /*proto*/

static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*proto*/

static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/

static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/

static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
    PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
    const char* function_name); /*proto*/

static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
    const char *name, int exact); /*proto*/

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, long level); /*proto*/

static CYTHON_INLINE void __Pyx_RaiseImportError(PyObject *name);

static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);

static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);

static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);

static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);

static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);

static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);

static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);

static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);

static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);

static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *);

static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);

static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);

static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);

static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);

static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);

static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);

static int __Pyx_check_binary_version(void);

static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); /*proto*/

typedef struct {
    int code_line;
    PyCodeObject* code_object;
} __Pyx_CodeObjectCacheEntry;
struct __Pyx_CodeObjectCache {
    int count;
    int max_count;
    __Pyx_CodeObjectCacheEntry* entries;
};
static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
static PyCodeObject *__pyx_find_code_object(int code_line);
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);

static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename); /*proto*/

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/


/* Module declarations from 'libc.stddef' */

/* Module declarations from 'libc.stdint' */

/* Module declarations from 'gl' */

/* Module declarations from 'glm' */

/* Module declarations from '_gldraw' */
static struct __pyx_t_7_gldraw_Cube __pyx_v_7_gldraw_cube;
static struct __pyx_t_7_gldraw_Animation_Struct __pyx_v_7_gldraw_animation;
static PyObject *__pyx_f_7_gldraw_set_animation_start(PyObject *, float, float, float, float, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_7_gldraw_set_animation_next(float, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_7_gldraw__gl_draw_block(int); /*proto*/
static PyObject *__pyx_f_7_gldraw_gl_set_data(int, PyObject *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch); /*proto*/
#define __Pyx_MODULE_NAME "_gldraw"
int __pyx_module_is_main__gldraw = 0;

/* Implementation of '_gldraw' */
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_enumerate;
static PyObject *__pyx_pf_7_gldraw_init_module(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7_gldraw_2set_transformations(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_blocks); /* proto */
static PyObject *__pyx_pf_7_gldraw_4set_animation_start(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_blocks, float __pyx_v_angle_max, float __pyx_v_axisx, float __pyx_v_axisy, float __pyx_v_axisz); /* proto */
static PyObject *__pyx_pf_7_gldraw_6set_animation_next(CYTHON_UNUSED PyObject *__pyx_self, float __pyx_v_increment); /* proto */
static PyObject *__pyx_pf_7_gldraw_8gl_set_data(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_nblocks, PyObject *__pyx_v_vertexdata, PyObject *__pyx_v_vertexpointers, PyObject *__pyx_v_vertexinfo, PyObject *__pyx_v_texnames); /* proto */
static char __pyx_k_1[] = "GL data: %d bytes";
static char __pyx_k_2[] = "VERTEX_ATTRIB_LOCATION";
static char __pyx_k_3[] = "NORMAL_ATTRIB_LOCATION";
static char __pyx_k_4[] = "COLOR_ATTRIB_LOCATION";
static char __pyx_k_5[] = "TEXCOORD_ATTRIB_LOCATION";
static char __pyx_k_6[] = "gl_init_object_location";
static char __pyx_k_7[] = "Importing module:";
static char __pyx_k_8[] = "  from package:";
static char __pyx_k_9[] = "  compiled:";
static char __pyx_k_12[] = "/home/barcc/Projekte/pybik/trunk/build/temp.linux-x86_64-3.3/pybiklib/_gldraw.pyx";
static char __pyx_k__b[] = "b";
static char __pyx_k__i[] = "i";
static char __pyx_k__j[] = "j";
static char __pyx_k__axisx[] = "axisx";
static char __pyx_k__axisy[] = "axisy";
static char __pyx_k__axisz[] = "axisz";
static char __pyx_k__debug[] = "debug";
static char __pyx_k__range[] = "range";
static char __pyx_k__blocks[] = "blocks";
static char __pyx_k____all__[] = "__all__";
static char __pyx_k___gldraw[] = "_gldraw";
static char __pyx_k__nblocks[] = "nblocks";
static char __pyx_k____main__[] = "__main__";
static char __pyx_k____name__[] = "__name__";
static char __pyx_k____test__[] = "__test__";
static char __pyx_k__texnames[] = "texnames";
static char __pyx_k__angle_max[] = "angle_max";
static char __pyx_k__enumerate[] = "enumerate";
static char __pyx_k____compiled[] = "__compiled";
static char __pyx_k__vertexdata[] = "vertexdata";
static char __pyx_k__vertexinfo[] = "vertexinfo";
static char __pyx_k____package__[] = "__package__";
static char __pyx_k__init_module[] = "init_module";
static char __pyx_k__gl_draw_cube[] = "gl_draw_cube";
static char __pyx_k__gl_pick_cube[] = "gl_pick_cube";
static char __pyx_k__vertexpointers[] = "vertexpointers";
static char __pyx_k__gl_init_buffers[] = "gl_init_buffers";
static char __pyx_k__gl_delete_buffers[] = "gl_delete_buffers";
static char __pyx_k__gl_draw_cube_debug[] = "gl_draw_cube_debug";
static char __pyx_k__set_transformations[] = "set_transformations";
static PyObject *__pyx_kp_u_1;
static PyObject *__pyx_kp_s_12;
static PyObject *__pyx_n_u_2;
static PyObject *__pyx_n_u_3;
static PyObject *__pyx_n_u_4;
static PyObject *__pyx_n_u_5;
static PyObject *__pyx_n_u_6;
static PyObject *__pyx_kp_u_7;
static PyObject *__pyx_kp_u_8;
static PyObject *__pyx_kp_u_9;
static PyObject *__pyx_n_s____all__;
static PyObject *__pyx_n_s____compiled;
static PyObject *__pyx_n_s____main__;
static PyObject *__pyx_n_s____name__;
static PyObject *__pyx_n_s____package__;
static PyObject *__pyx_n_s____test__;
static PyObject *__pyx_n_s___gldraw;
static PyObject *__pyx_n_s__angle_max;
static PyObject *__pyx_n_s__axisx;
static PyObject *__pyx_n_s__axisy;
static PyObject *__pyx_n_s__axisz;
static PyObject *__pyx_n_s__b;
static PyObject *__pyx_n_s__blocks;
static PyObject *__pyx_n_s__debug;
static PyObject *__pyx_n_s__enumerate;
static PyObject *__pyx_n_u__gl_delete_buffers;
static PyObject *__pyx_n_u__gl_draw_cube;
static PyObject *__pyx_n_u__gl_draw_cube_debug;
static PyObject *__pyx_n_u__gl_init_buffers;
static PyObject *__pyx_n_u__gl_pick_cube;
static PyObject *__pyx_n_s__i;
static PyObject *__pyx_n_s__init_module;
static PyObject *__pyx_n_s__j;
static PyObject *__pyx_n_s__nblocks;
static PyObject *__pyx_n_s__range;
static PyObject *__pyx_n_s__set_transformations;
static PyObject *__pyx_n_s__texnames;
static PyObject *__pyx_n_s__vertexdata;
static PyObject *__pyx_n_s__vertexinfo;
static PyObject *__pyx_n_s__vertexpointers;
static PyObject *__pyx_k_tuple_10;
static PyObject *__pyx_k_tuple_13;
static PyObject *__pyx_k_codeobj_11;
static PyObject *__pyx_k_codeobj_14;

/* Python wrapper */
static PyObject *__pyx_pw_7_gldraw_1init_module(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_7_gldraw_1init_module = {__Pyx_NAMESTR("init_module"), (PyCFunction)__pyx_pw_7_gldraw_1init_module, METH_NOARGS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_7_gldraw_1init_module(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init_module (wrapper)", 0);
  __pyx_r = __pyx_pf_7_gldraw_init_module(__pyx_self);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_gldraw.pyx":110
 * 
 * 
 * def init_module():             # <<<<<<<<<<<<<<
 *     cdef int i #px+
 * 
 */

static PyObject *__pyx_pf_7_gldraw_init_module(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init_module", 0);

  /* "_gldraw.pyx":113
 *     cdef int i #px+
 * 
 *     cube.number_blocks = 0             # <<<<<<<<<<<<<<
 *     #cube.blocks
 * 
 */
  __pyx_v_7_gldraw_cube.number_blocks = 0;

  /* "_gldraw.pyx":116
 *     #cube.blocks
 * 
 *     cube.idx_pick = 0             # <<<<<<<<<<<<<<
 *     cube.cnt_pick = 0
 *     cube.idx_debug = 0
 */
  __pyx_v_7_gldraw_cube.idx_pick = 0;

  /* "_gldraw.pyx":117
 * 
 *     cube.idx_pick = 0
 *     cube.cnt_pick = 0             # <<<<<<<<<<<<<<
 *     cube.idx_debug = 0
 * 
 */
  __pyx_v_7_gldraw_cube.cnt_pick = 0;

  /* "_gldraw.pyx":118
 *     cube.idx_pick = 0
 *     cube.cnt_pick = 0
 *     cube.idx_debug = 0             # <<<<<<<<<<<<<<
 * 
 *     animation.angle = animation.angle_max = 0
 */
  __pyx_v_7_gldraw_cube.idx_debug = 0;

  /* "_gldraw.pyx":120
 *     cube.idx_debug = 0
 * 
 *     animation.angle = animation.angle_max = 0             # <<<<<<<<<<<<<<
 * 
 * def set_transformations(blocks):
 */
  __pyx_v_7_gldraw_animation.angle = 0;
  __pyx_v_7_gldraw_animation.angle_max = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7_gldraw_3set_transformations(PyObject *__pyx_self, PyObject *__pyx_v_blocks); /*proto*/
static PyMethodDef __pyx_mdef_7_gldraw_3set_transformations = {__Pyx_NAMESTR("set_transformations"), (PyCFunction)__pyx_pw_7_gldraw_3set_transformations, METH_O, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_7_gldraw_3set_transformations(PyObject *__pyx_self, PyObject *__pyx_v_blocks) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_transformations (wrapper)", 0);
  __pyx_r = __pyx_pf_7_gldraw_2set_transformations(__pyx_self, ((PyObject *)__pyx_v_blocks));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_gldraw.pyx":122
 *     animation.angle = animation.angle_max = 0
 * 
 * def set_transformations(blocks):             # <<<<<<<<<<<<<<
 *     cdef unsigned int b,i,j #px+
 *     for b in range(cube.number_blocks):
 */

static PyObject *__pyx_pf_7_gldraw_2set_transformations(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_blocks) {
  unsigned int __pyx_v_b;
  unsigned int __pyx_v_i;
  unsigned int __pyx_v_j;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  unsigned int __pyx_t_1;
  unsigned int __pyx_t_2;
  unsigned int __pyx_t_3;
  unsigned int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  double __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_transformations", 0);

  /* "_gldraw.pyx":124
 * def set_transformations(blocks):
 *     cdef unsigned int b,i,j #px+
 *     for b in range(cube.number_blocks):             # <<<<<<<<<<<<<<
 *         for i in range(4):
 *             for j in range(4):
 */
  __pyx_t_1 = __pyx_v_7_gldraw_cube.number_blocks;
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_b = __pyx_t_2;

    /* "_gldraw.pyx":125
 *     cdef unsigned int b,i,j #px+
 *     for b in range(cube.number_blocks):
 *         for i in range(4):             # <<<<<<<<<<<<<<
 *             for j in range(4):
 *                 cube.blocks[b].transformation[i][j] = float(blocks[b][i][j])
 */
    for (__pyx_t_3 = 0; __pyx_t_3 < 4; __pyx_t_3+=1) {
      __pyx_v_i = __pyx_t_3;

      /* "_gldraw.pyx":126
 *     for b in range(cube.number_blocks):
 *         for i in range(4):
 *             for j in range(4):             # <<<<<<<<<<<<<<
 *                 cube.blocks[b].transformation[i][j] = float(blocks[b][i][j])
 *         cube.blocks[b].in_motion = False
 */
      for (__pyx_t_4 = 0; __pyx_t_4 < 4; __pyx_t_4+=1) {
        __pyx_v_j = __pyx_t_4;

        /* "_gldraw.pyx":127
 *         for i in range(4):
 *             for j in range(4):
 *                 cube.blocks[b].transformation[i][j] = float(blocks[b][i][j])             # <<<<<<<<<<<<<<
 *         cube.blocks[b].in_motion = False
 * 
 */
        __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_blocks, __pyx_v_b, sizeof(unsigned int)+1, PyLong_FromUnsignedLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, __pyx_v_i, sizeof(unsigned int)+1, PyLong_FromUnsignedLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, __pyx_v_j, sizeof(unsigned int)+1, PyLong_FromUnsignedLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_7 = __Pyx_PyObject_AsDouble(__pyx_t_5); if (unlikely(__pyx_t_7 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        (((__pyx_v_7_gldraw_cube.blocks[__pyx_v_b]).transformation[__pyx_v_i])[__pyx_v_j]) = __pyx_t_7;
      }
    }

    /* "_gldraw.pyx":128
 *             for j in range(4):
 *                 cube.blocks[b].transformation[i][j] = float(blocks[b][i][j])
 *         cube.blocks[b].in_motion = False             # <<<<<<<<<<<<<<
 * 
 * cpdef set_animation_start(blocks, float angle_max, float axisx, float axisy, float axisz): #px/
 */
    (__pyx_v_7_gldraw_cube.blocks[__pyx_v_b]).in_motion = 0;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("_gldraw.set_transformations", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_gldraw.pyx":130
 *         cube.blocks[b].in_motion = False
 * 
 * cpdef set_animation_start(blocks, float angle_max, float axisx, float axisy, float axisz): #px/             # <<<<<<<<<<<<<<
 * #px def set_animation_start(blocks, angle_max, axisx, axisy, axisz):
 *     animation.angle = 0.0
 */

static PyObject *__pyx_pw_7_gldraw_5set_animation_start(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_7_gldraw_set_animation_start(PyObject *__pyx_v_blocks, float __pyx_v_angle_max, float __pyx_v_axisx, float __pyx_v_axisy, float __pyx_v_axisz, CYTHON_UNUSED int __pyx_skip_dispatch) {
  int __pyx_v_block_id;
  int __pyx_v_selected;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_animation_start", 0);

  /* "_gldraw.pyx":132
 * cpdef set_animation_start(blocks, float angle_max, float axisx, float axisy, float axisz): #px/
 * #px def set_animation_start(blocks, angle_max, axisx, axisy, axisz):
 *     animation.angle = 0.0             # <<<<<<<<<<<<<<
 *     animation.angle_max = angle_max
 *     animation.rotation = vec3(axisx, axisy, axisz)
 */
  __pyx_v_7_gldraw_animation.angle = 0.0;

  /* "_gldraw.pyx":133
 * #px def set_animation_start(blocks, angle_max, axisx, axisy, axisz):
 *     animation.angle = 0.0
 *     animation.angle_max = angle_max             # <<<<<<<<<<<<<<
 *     animation.rotation = vec3(axisx, axisy, axisz)
 *     animation.rotation_matrix = mat4(1.)
 */
  __pyx_v_7_gldraw_animation.angle_max = __pyx_v_angle_max;

  /* "_gldraw.pyx":134
 *     animation.angle = 0.0
 *     animation.angle_max = angle_max
 *     animation.rotation = vec3(axisx, axisy, axisz)             # <<<<<<<<<<<<<<
 *     animation.rotation_matrix = mat4(1.)
 *     cdef int block_id #px+
 */
  __pyx_v_7_gldraw_animation.rotation = glm::vec3(__pyx_v_axisx, __pyx_v_axisy, __pyx_v_axisz);

  /* "_gldraw.pyx":135
 *     animation.angle_max = angle_max
 *     animation.rotation = vec3(axisx, axisy, axisz)
 *     animation.rotation_matrix = mat4(1.)             # <<<<<<<<<<<<<<
 *     cdef int block_id #px+
 *     cdef bint selected #px+
 */
  __pyx_v_7_gldraw_animation.rotation_matrix = glm::mat4(1.);

  /* "_gldraw.pyx":138
 *     cdef int block_id #px+
 *     cdef bint selected #px+
 *     for block_id, selected in blocks:             # <<<<<<<<<<<<<<
 *         cube.blocks[block_id].in_motion = selected
 * 
 */
  if (PyList_CheckExact(__pyx_v_blocks) || PyTuple_CheckExact(__pyx_v_blocks)) {
    __pyx_t_1 = __pyx_v_blocks; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_blocks); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
  }
  for (;;) {
    if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) {
      if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
      if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
      PyObject* sequence = __pyx_t_4;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      #else
      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else
    {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
      index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L6_unpacking_done:;
    }
    __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_5); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_block_id = __pyx_t_9;
    __pyx_v_selected = __pyx_t_10;

    /* "_gldraw.pyx":139
 *     cdef bint selected #px+
 *     for block_id, selected in blocks:
 *         cube.blocks[block_id].in_motion = selected             # <<<<<<<<<<<<<<
 * 
 * cpdef set_animation_next(float increment): #px/
 */
    (__pyx_v_7_gldraw_cube.blocks[__pyx_v_block_id]).in_motion = __pyx_v_selected;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("_gldraw.set_animation_start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7_gldraw_5set_animation_start(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_7_gldraw_5set_animation_start(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_blocks = 0;
  float __pyx_v_angle_max;
  float __pyx_v_axisx;
  float __pyx_v_axisy;
  float __pyx_v_axisz;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_animation_start (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__blocks,&__pyx_n_s__angle_max,&__pyx_n_s__axisx,&__pyx_n_s__axisy,&__pyx_n_s__axisz,0};
    PyObject* values[5] = {0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__blocks)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__angle_max)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_animation_start", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__axisx)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_animation_start", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__axisy)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_animation_start", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__axisz)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_animation_start", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_animation_start") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
    }
    __pyx_v_blocks = values[0];
    __pyx_v_angle_max = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_angle_max == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_axisx = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_axisx == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_axisy = __pyx_PyFloat_AsFloat(values[3]); if (unlikely((__pyx_v_axisy == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_axisz = __pyx_PyFloat_AsFloat(values[4]); if (unlikely((__pyx_v_axisz == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_animation_start", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("_gldraw.set_animation_start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_gldraw_4set_animation_start(__pyx_self, __pyx_v_blocks, __pyx_v_angle_max, __pyx_v_axisx, __pyx_v_axisy, __pyx_v_axisz);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_gldraw.pyx":130
 *         cube.blocks[b].in_motion = False
 * 
 * cpdef set_animation_start(blocks, float angle_max, float axisx, float axisy, float axisz): #px/             # <<<<<<<<<<<<<<
 * #px def set_animation_start(blocks, angle_max, axisx, axisy, axisz):
 *     animation.angle = 0.0
 */

static PyObject *__pyx_pf_7_gldraw_4set_animation_start(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_blocks, float __pyx_v_angle_max, float __pyx_v_axisx, float __pyx_v_axisy, float __pyx_v_axisz) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_animation_start", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7_gldraw_set_animation_start(__pyx_v_blocks, __pyx_v_angle_max, __pyx_v_axisx, __pyx_v_axisy, __pyx_v_axisz, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_gldraw.set_animation_start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_gldraw.pyx":141
 *         cube.blocks[block_id].in_motion = selected
 * 
 * cpdef set_animation_next(float increment): #px/             # <<<<<<<<<<<<<<
 * #px def set_animation_next(increment):
 *     animation.angle -= increment
 */

static PyObject *__pyx_pw_7_gldraw_7set_animation_next(PyObject *__pyx_self, PyObject *__pyx_arg_increment); /*proto*/
static PyObject *__pyx_f_7_gldraw_set_animation_next(float __pyx_v_increment, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_animation_next", 0);

  /* "_gldraw.pyx":143
 * cpdef set_animation_next(float increment): #px/
 * #px def set_animation_next(increment):
 *     animation.angle -= increment             # <<<<<<<<<<<<<<
 *     animation.rotation_matrix = rotate(animation.angle, animation.rotation)
 *     return abs(animation.angle) < animation.angle_max
 */
  __pyx_v_7_gldraw_animation.angle = (__pyx_v_7_gldraw_animation.angle - __pyx_v_increment);

  /* "_gldraw.pyx":144
 * #px def set_animation_next(increment):
 *     animation.angle -= increment
 *     animation.rotation_matrix = rotate(animation.angle, animation.rotation)             # <<<<<<<<<<<<<<
 *     return abs(animation.angle) < animation.angle_max
 * 
 */
  __pyx_v_7_gldraw_animation.rotation_matrix = glm::rotate(__pyx_v_7_gldraw_animation.angle, __pyx_v_7_gldraw_animation.rotation);

  /* "_gldraw.pyx":145
 *     animation.angle -= increment
 *     animation.rotation_matrix = rotate(animation.angle, animation.rotation)
 *     return abs(animation.angle) < animation.angle_max             # <<<<<<<<<<<<<<
 * 
 * cdef void gl_draw_cube(): #pxd/
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong((fabsf(__pyx_v_7_gldraw_animation.angle) < __pyx_v_7_gldraw_animation.angle_max)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_gldraw.set_animation_next", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7_gldraw_7set_animation_next(PyObject *__pyx_self, PyObject *__pyx_arg_increment); /*proto*/
static PyObject *__pyx_pw_7_gldraw_7set_animation_next(PyObject *__pyx_self, PyObject *__pyx_arg_increment) {
  float __pyx_v_increment;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_animation_next (wrapper)", 0);
  assert(__pyx_arg_increment); {
    __pyx_v_increment = __pyx_PyFloat_AsFloat(__pyx_arg_increment); if (unlikely((__pyx_v_increment == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("_gldraw.set_animation_next", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7_gldraw_6set_animation_next(__pyx_self, ((float)__pyx_v_increment));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_gldraw.pyx":141
 *         cube.blocks[block_id].in_motion = selected
 * 
 * cpdef set_animation_next(float increment): #px/             # <<<<<<<<<<<<<<
 * #px def set_animation_next(increment):
 *     animation.angle -= increment
 */

static PyObject *__pyx_pf_7_gldraw_6set_animation_next(CYTHON_UNUSED PyObject *__pyx_self, float __pyx_v_increment) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_animation_next", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7_gldraw_set_animation_next(__pyx_v_increment, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_gldraw.set_animation_next", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_gldraw.pyx":147
 *     return abs(animation.angle) < animation.angle_max
 * 
 * cdef void gl_draw_cube(): #pxd/             # <<<<<<<<<<<<<<
 * #px def gl_draw_cube():
 *     glEnableVertexAttribArray(VERTEX_ATTRIB_LOCATION)
 */

static void __pyx_f_7_gldraw_gl_draw_cube(void) {
  unsigned int __pyx_v_i;
  glm::mat4 __pyx_v_object_matrix;
  __Pyx_RefNannyDeclarations
  unsigned int __pyx_t_1;
  unsigned int __pyx_t_2;
  __Pyx_RefNannySetupContext("gl_draw_cube", 0);

  /* "_gldraw.pyx":149
 * cdef void gl_draw_cube(): #pxd/
 * #px def gl_draw_cube():
 *     glEnableVertexAttribArray(VERTEX_ATTRIB_LOCATION)             # <<<<<<<<<<<<<<
 *     glEnableVertexAttribArray(NORMAL_ATTRIB_LOCATION)
 *     glEnableVertexAttribArray(COLOR_ATTRIB_LOCATION)
 */
  glEnableVertexAttribArray(__pyx_e_7_gldraw_VERTEX_ATTRIB_LOCATION);

  /* "_gldraw.pyx":150
 * #px def gl_draw_cube():
 *     glEnableVertexAttribArray(VERTEX_ATTRIB_LOCATION)
 *     glEnableVertexAttribArray(NORMAL_ATTRIB_LOCATION)             # <<<<<<<<<<<<<<
 *     glEnableVertexAttribArray(COLOR_ATTRIB_LOCATION)
 *     glEnableVertexAttribArray(TEXCOORD_ATTRIB_LOCATION)
 */
  glEnableVertexAttribArray(__pyx_e_7_gldraw_NORMAL_ATTRIB_LOCATION);

  /* "_gldraw.pyx":151
 *     glEnableVertexAttribArray(VERTEX_ATTRIB_LOCATION)
 *     glEnableVertexAttribArray(NORMAL_ATTRIB_LOCATION)
 *     glEnableVertexAttribArray(COLOR_ATTRIB_LOCATION)             # <<<<<<<<<<<<<<
 *     glEnableVertexAttribArray(TEXCOORD_ATTRIB_LOCATION)
 *     cdef unsigned int i #px+
 */
  glEnableVertexAttribArray(__pyx_e_7_gldraw_COLOR_ATTRIB_LOCATION);

  /* "_gldraw.pyx":152
 *     glEnableVertexAttribArray(NORMAL_ATTRIB_LOCATION)
 *     glEnableVertexAttribArray(COLOR_ATTRIB_LOCATION)
 *     glEnableVertexAttribArray(TEXCOORD_ATTRIB_LOCATION)             # <<<<<<<<<<<<<<
 *     cdef unsigned int i #px+
 *     cdef mat4 object_matrix #px+
 */
  glEnableVertexAttribArray(__pyx_e_7_gldraw_TEXCOORD_ATTRIB_LOCATION);

  /* "_gldraw.pyx":155
 *     cdef unsigned int i #px+
 *     cdef mat4 object_matrix #px+
 *     for i in range(cube.number_blocks):             # <<<<<<<<<<<<<<
 *         if cube.blocks[i].in_motion:
 *             object_matrix = animation.rotation_matrix * cube.blocks[i].transformation
 */
  __pyx_t_1 = __pyx_v_7_gldraw_cube.number_blocks;
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "_gldraw.pyx":156
 *     cdef mat4 object_matrix #px+
 *     for i in range(cube.number_blocks):
 *         if cube.blocks[i].in_motion:             # <<<<<<<<<<<<<<
 *             object_matrix = animation.rotation_matrix * cube.blocks[i].transformation
 *             glUniformMatrix4fv(cube.object_location, 1, GL_FALSE, &object_matrix[0][0]) #px/
 */
    if ((__pyx_v_7_gldraw_cube.blocks[__pyx_v_i]).in_motion) {

      /* "_gldraw.pyx":157
 *     for i in range(cube.number_blocks):
 *         if cube.blocks[i].in_motion:
 *             object_matrix = animation.rotation_matrix * cube.blocks[i].transformation             # <<<<<<<<<<<<<<
 *             glUniformMatrix4fv(cube.object_location, 1, GL_FALSE, &object_matrix[0][0]) #px/
 *             #px glUniformMatrix4fv(cube.object_location, 1, GL_FALSE, object_matrix)
 */
      __pyx_v_object_matrix = (__pyx_v_7_gldraw_animation.rotation_matrix * (__pyx_v_7_gldraw_cube.blocks[__pyx_v_i]).transformation);

      /* "_gldraw.pyx":158
 *         if cube.blocks[i].in_motion:
 *             object_matrix = animation.rotation_matrix * cube.blocks[i].transformation
 *             glUniformMatrix4fv(cube.object_location, 1, GL_FALSE, &object_matrix[0][0]) #px/             # <<<<<<<<<<<<<<
 *             #px glUniformMatrix4fv(cube.object_location, 1, GL_FALSE, object_matrix)
 *         else:
 */
      glUniformMatrix4fv(__pyx_v_7_gldraw_cube.object_location, 1, GL_FALSE, (&((__pyx_v_object_matrix[0])[0])));
      goto __pyx_L5;
    }
    /*else*/ {

      /* "_gldraw.pyx":161
 *             #px glUniformMatrix4fv(cube.object_location, 1, GL_FALSE, object_matrix)
 *         else:
 *             glUniformMatrix4fv(cube.object_location, 1, GL_FALSE, &cube.blocks[i].transformation[0][0]) #px/             # <<<<<<<<<<<<<<
 *             #px glUniformMatrix4fv(cube.object_location, 1, GL_FALSE, cube.blocks[i].transformation)
 *         _gl_draw_block(i)
 */
      glUniformMatrix4fv(__pyx_v_7_gldraw_cube.object_location, 1, GL_FALSE, (&(((__pyx_v_7_gldraw_cube.blocks[__pyx_v_i]).transformation[0])[0])));
    }
    __pyx_L5:;

    /* "_gldraw.pyx":163
 *             glUniformMatrix4fv(cube.object_location, 1, GL_FALSE, &cube.blocks[i].transformation[0][0]) #px/
 *             #px glUniformMatrix4fv(cube.object_location, 1, GL_FALSE, cube.blocks[i].transformation)
 *         _gl_draw_block(i)             # <<<<<<<<<<<<<<
 *     glDisableVertexAttribArray(VERTEX_ATTRIB_LOCATION)
 *     glDisableVertexAttribArray(NORMAL_ATTRIB_LOCATION)
 */
    __pyx_f_7_gldraw__gl_draw_block(__pyx_v_i);
  }

  /* "_gldraw.pyx":164
 *             #px glUniformMatrix4fv(cube.object_location, 1, GL_FALSE, cube.blocks[i].transformation)
 *         _gl_draw_block(i)
 *     glDisableVertexAttribArray(VERTEX_ATTRIB_LOCATION)             # <<<<<<<<<<<<<<
 *     glDisableVertexAttribArray(NORMAL_ATTRIB_LOCATION)
 *     glDisableVertexAttribArray(COLOR_ATTRIB_LOCATION)
 */
  glDisableVertexAttribArray(__pyx_e_7_gldraw_VERTEX_ATTRIB_LOCATION);

  /* "_gldraw.pyx":165
 *         _gl_draw_block(i)
 *     glDisableVertexAttribArray(VERTEX_ATTRIB_LOCATION)
 *     glDisableVertexAttribArray(NORMAL_ATTRIB_LOCATION)             # <<<<<<<<<<<<<<
 *     glDisableVertexAttribArray(COLOR_ATTRIB_LOCATION)
 *     glDisableVertexAttribArray(TEXCOORD_ATTRIB_LOCATION)
 */
  glDisableVertexAttribArray(__pyx_e_7_gldraw_NORMAL_ATTRIB_LOCATION);

  /* "_gldraw.pyx":166
 *     glDisableVertexAttribArray(VERTEX_ATTRIB_LOCATION)
 *     glDisableVertexAttribArray(NORMAL_ATTRIB_LOCATION)
 *     glDisableVertexAttribArray(COLOR_ATTRIB_LOCATION)             # <<<<<<<<<<<<<<
 *     glDisableVertexAttribArray(TEXCOORD_ATTRIB_LOCATION)
 * 
 */
  glDisableVertexAttribArray(__pyx_e_7_gldraw_COLOR_ATTRIB_LOCATION);

  /* "_gldraw.pyx":167
 *     glDisableVertexAttribArray(NORMAL_ATTRIB_LOCATION)
 *     glDisableVertexAttribArray(COLOR_ATTRIB_LOCATION)
 *     glDisableVertexAttribArray(TEXCOORD_ATTRIB_LOCATION)             # <<<<<<<<<<<<<<
 * 
 * cdef void _gl_draw_block(int block_id): #px/
 */
  glDisableVertexAttribArray(__pyx_e_7_gldraw_TEXCOORD_ATTRIB_LOCATION);

  __Pyx_RefNannyFinishContext();
}

/* "_gldraw.pyx":169
 *     glDisableVertexAttribArray(TEXCOORD_ATTRIB_LOCATION)
 * 
 * cdef void _gl_draw_block(int block_id): #px/             # <<<<<<<<<<<<<<
 * #px def _gl_draw_block(block_id):
 *     cdef int i #px+
 */

static void __pyx_f_7_gldraw__gl_draw_block(int __pyx_v_block_id) {
  int __pyx_v_i;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("_gl_draw_block", 0);

  /* "_gldraw.pyx":173
 *     cdef int i #px+
 * 
 *     glBindTexture(GL_TEXTURE_2D, 0)             # <<<<<<<<<<<<<<
 *     glDrawArrays(GL_TRIANGLES, cube.blocks[block_id].idx_triangles, cube.blocks[block_id].cnt_triangles)
 * 
 */
  glBindTexture(GL_TEXTURE_2D, 0);

  /* "_gldraw.pyx":174
 * 
 *     glBindTexture(GL_TEXTURE_2D, 0)
 *     glDrawArrays(GL_TRIANGLES, cube.blocks[block_id].idx_triangles, cube.blocks[block_id].cnt_triangles)             # <<<<<<<<<<<<<<
 * 
 *     for i in range(cube.blocks[block_id].cnt_faces):
 */
  glDrawArrays(GL_TRIANGLES, (__pyx_v_7_gldraw_cube.blocks[__pyx_v_block_id]).idx_triangles, (__pyx_v_7_gldraw_cube.blocks[__pyx_v_block_id]).cnt_triangles);

  /* "_gldraw.pyx":176
 *     glDrawArrays(GL_TRIANGLES, cube.blocks[block_id].idx_triangles, cube.blocks[block_id].cnt_triangles)
 * 
 *     for i in range(cube.blocks[block_id].cnt_faces):             # <<<<<<<<<<<<<<
 *         # render the colors (ie the little sticky labels)
 *         glBindTexture(GL_TEXTURE_2D, cube.blocks[block_id].texname[i])
 */
  __pyx_t_1 = (__pyx_v_7_gldraw_cube.blocks[__pyx_v_block_id]).cnt_faces;
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "_gldraw.pyx":178
 *     for i in range(cube.blocks[block_id].cnt_faces):
 *         # render the colors (ie the little sticky labels)
 *         glBindTexture(GL_TEXTURE_2D, cube.blocks[block_id].texname[i])             # <<<<<<<<<<<<<<
 *         #TODO: Workaround for artifacts on the bottom and left sides of images
 *         glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_MIRRORED_REPEAT)
 */
    glBindTexture(GL_TEXTURE_2D, ((__pyx_v_7_gldraw_cube.blocks[__pyx_v_block_id]).texname[__pyx_v_i]));

    /* "_gldraw.pyx":180
 *         glBindTexture(GL_TEXTURE_2D, cube.blocks[block_id].texname[i])
 *         #TODO: Workaround for artifacts on the bottom and left sides of images
 *         glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_MIRRORED_REPEAT)             # <<<<<<<<<<<<<<
 *         glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_MIRRORED_REPEAT)
 *         glDrawArrays(GL_TRIANGLES, cube.blocks[block_id].idx_label[i], cube.blocks[block_id].cnt_label[i])
 */
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_MIRRORED_REPEAT);

    /* "_gldraw.pyx":181
 *         #TODO: Workaround for artifacts on the bottom and left sides of images
 *         glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_MIRRORED_REPEAT)
 *         glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_MIRRORED_REPEAT)             # <<<<<<<<<<<<<<
 *         glDrawArrays(GL_TRIANGLES, cube.blocks[block_id].idx_label[i], cube.blocks[block_id].cnt_label[i])
 * 
 */
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_MIRRORED_REPEAT);

    /* "_gldraw.pyx":182
 *         glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_MIRRORED_REPEAT)
 *         glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_MIRRORED_REPEAT)
 *         glDrawArrays(GL_TRIANGLES, cube.blocks[block_id].idx_label[i], cube.blocks[block_id].cnt_label[i])             # <<<<<<<<<<<<<<
 * 
 * cdef void gl_pick_cube(): #pxd/
 */
    glDrawArrays(GL_TRIANGLES, ((__pyx_v_7_gldraw_cube.blocks[__pyx_v_block_id]).idx_label[__pyx_v_i]), ((__pyx_v_7_gldraw_cube.blocks[__pyx_v_block_id]).cnt_label[__pyx_v_i]));
  }

  __Pyx_RefNannyFinishContext();
}

/* "_gldraw.pyx":184
 *         glDrawArrays(GL_TRIANGLES, cube.blocks[block_id].idx_label[i], cube.blocks[block_id].cnt_label[i])
 * 
 * cdef void gl_pick_cube(): #pxd/             # <<<<<<<<<<<<<<
 * #px def gl_pick_cube():
 *     glEnableVertexAttribArray(VERTEX_ATTRIB_LOCATION)
 */

static void __pyx_f_7_gldraw_gl_pick_cube(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("gl_pick_cube", 0);

  /* "_gldraw.pyx":186
 * cdef void gl_pick_cube(): #pxd/
 * #px def gl_pick_cube():
 *     glEnableVertexAttribArray(VERTEX_ATTRIB_LOCATION)             # <<<<<<<<<<<<<<
 *     glEnableVertexAttribArray(COLOR_ATTRIB_LOCATION)
 *     glDrawArrays(GL_TRIANGLES, cube.idx_pick, cube.cnt_pick)
 */
  glEnableVertexAttribArray(__pyx_e_7_gldraw_VERTEX_ATTRIB_LOCATION);

  /* "_gldraw.pyx":187
 * #px def gl_pick_cube():
 *     glEnableVertexAttribArray(VERTEX_ATTRIB_LOCATION)
 *     glEnableVertexAttribArray(COLOR_ATTRIB_LOCATION)             # <<<<<<<<<<<<<<
 *     glDrawArrays(GL_TRIANGLES, cube.idx_pick, cube.cnt_pick)
 *     glDisableVertexAttribArray(VERTEX_ATTRIB_LOCATION)
 */
  glEnableVertexAttribArray(__pyx_e_7_gldraw_COLOR_ATTRIB_LOCATION);

  /* "_gldraw.pyx":188
 *     glEnableVertexAttribArray(VERTEX_ATTRIB_LOCATION)
 *     glEnableVertexAttribArray(COLOR_ATTRIB_LOCATION)
 *     glDrawArrays(GL_TRIANGLES, cube.idx_pick, cube.cnt_pick)             # <<<<<<<<<<<<<<
 *     glDisableVertexAttribArray(VERTEX_ATTRIB_LOCATION)
 *     glDisableVertexAttribArray(COLOR_ATTRIB_LOCATION)
 */
  glDrawArrays(GL_TRIANGLES, __pyx_v_7_gldraw_cube.idx_pick, __pyx_v_7_gldraw_cube.cnt_pick);

  /* "_gldraw.pyx":189
 *     glEnableVertexAttribArray(COLOR_ATTRIB_LOCATION)
 *     glDrawArrays(GL_TRIANGLES, cube.idx_pick, cube.cnt_pick)
 *     glDisableVertexAttribArray(VERTEX_ATTRIB_LOCATION)             # <<<<<<<<<<<<<<
 *     glDisableVertexAttribArray(COLOR_ATTRIB_LOCATION)
 * 
 */
  glDisableVertexAttribArray(__pyx_e_7_gldraw_VERTEX_ATTRIB_LOCATION);

  /* "_gldraw.pyx":190
 *     glDrawArrays(GL_TRIANGLES, cube.idx_pick, cube.cnt_pick)
 *     glDisableVertexAttribArray(VERTEX_ATTRIB_LOCATION)
 *     glDisableVertexAttribArray(COLOR_ATTRIB_LOCATION)             # <<<<<<<<<<<<<<
 * 
 * cdef void gl_init_buffers(): #pxd/
 */
  glDisableVertexAttribArray(__pyx_e_7_gldraw_COLOR_ATTRIB_LOCATION);

  __Pyx_RefNannyFinishContext();
}

/* "_gldraw.pyx":192
 *     glDisableVertexAttribArray(COLOR_ATTRIB_LOCATION)
 * 
 * cdef void gl_init_buffers(): #pxd/             # <<<<<<<<<<<<<<
 * #px def gl_init_buffers():
 *     glGenBuffers(1, &cube.glbuffer) #px/
 */

static void __pyx_f_7_gldraw_gl_init_buffers(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("gl_init_buffers", 0);

  /* "_gldraw.pyx":194
 * cdef void gl_init_buffers(): #pxd/
 * #px def gl_init_buffers():
 *     glGenBuffers(1, &cube.glbuffer) #px/             # <<<<<<<<<<<<<<
 *     #px cube.glbuffer = glGenBuffers(1)
 * 
 */
  glGenBuffers(1, (&__pyx_v_7_gldraw_cube.glbuffer));

  __Pyx_RefNannyFinishContext();
}

/* "_gldraw.pyx":197
 *     #px cube.glbuffer = glGenBuffers(1)
 * 
 * cdef void gl_delete_buffers(): #pxd/             # <<<<<<<<<<<<<<
 * #px def gl_delete_buffers():
 *     glBindBuffer(GL_ARRAY_BUFFER, 0)
 */

static void __pyx_f_7_gldraw_gl_delete_buffers(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("gl_delete_buffers", 0);

  /* "_gldraw.pyx":199
 * cdef void gl_delete_buffers(): #pxd/
 * #px def gl_delete_buffers():
 *     glBindBuffer(GL_ARRAY_BUFFER, 0)             # <<<<<<<<<<<<<<
 *     glDeleteBuffers(1, &cube.glbuffer) #px/
 *     #px glDeleteBuffers(1, [cube.glbuffer])
 */
  glBindBuffer(GL_ARRAY_BUFFER, 0);

  /* "_gldraw.pyx":200
 * #px def gl_delete_buffers():
 *     glBindBuffer(GL_ARRAY_BUFFER, 0)
 *     glDeleteBuffers(1, &cube.glbuffer) #px/             # <<<<<<<<<<<<<<
 *     #px glDeleteBuffers(1, [cube.glbuffer])
 *     cube.glbuffer = 0
 */
  glDeleteBuffers(1, (&__pyx_v_7_gldraw_cube.glbuffer));

  /* "_gldraw.pyx":202
 *     glDeleteBuffers(1, &cube.glbuffer) #px/
 *     #px glDeleteBuffers(1, [cube.glbuffer])
 *     cube.glbuffer = 0             # <<<<<<<<<<<<<<
 * 
 * cpdef gl_set_data(int nblocks, bytes vertexdata, vertexpointers, vertexinfo, texnames): #px/
 */
  __pyx_v_7_gldraw_cube.glbuffer = 0;

  __Pyx_RefNannyFinishContext();
}

/* "_gldraw.pyx":204
 *     cube.glbuffer = 0
 * 
 * cpdef gl_set_data(int nblocks, bytes vertexdata, vertexpointers, vertexinfo, texnames): #px/             # <<<<<<<<<<<<<<
 * #px def gl_set_data(nblocks, vertexdata, vertexpointers, vertexinfo, texnames):
 *     cube.number_blocks = nblocks
 */

static PyObject *__pyx_pw_7_gldraw_9gl_set_data(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_7_gldraw_gl_set_data(int __pyx_v_nblocks, PyObject *__pyx_v_vertexdata, PyObject *__pyx_v_vertexpointers, PyObject *__pyx_v_vertexinfo, PyObject *__pyx_v_texnames, CYTHON_UNUSED int __pyx_skip_dispatch) {
  long __pyx_v_normalpointer;
  long __pyx_v_colorpointer;
  long __pyx_v_texpospointer;
  unsigned int __pyx_v_idx_block;
  unsigned int __pyx_v_idx_pick;
  unsigned int __pyx_v_cnt_pick;
  unsigned int __pyx_v_idx_debug;
  PyObject *__pyx_v_labelinfos = NULL;
  PyObject *__pyx_v_cnts_block = NULL;
  unsigned int __pyx_v_block;
  unsigned int __pyx_v_i;
  unsigned int __pyx_v_idx_label;
  unsigned int __pyx_v_cnt;
  unsigned int __pyx_v_faceno;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  long __pyx_t_6;
  long __pyx_t_7;
  long __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  unsigned int __pyx_t_12;
  unsigned int __pyx_t_13;
  unsigned int __pyx_t_14;
  unsigned int __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  PyObject *(*__pyx_t_17)(PyObject *);
  unsigned int __pyx_t_18;
  int __pyx_t_19;
  char *__pyx_t_20;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("gl_set_data", 0);

  /* "_gldraw.pyx":206
 * cpdef gl_set_data(int nblocks, bytes vertexdata, vertexpointers, vertexinfo, texnames): #px/
 * #px def gl_set_data(nblocks, vertexdata, vertexpointers, vertexinfo, texnames):
 *     cube.number_blocks = nblocks             # <<<<<<<<<<<<<<
 *     assert cube.number_blocks <= MAX_BLOCKS
 * 
 */
  __pyx_v_7_gldraw_cube.number_blocks = __pyx_v_nblocks;

  /* "_gldraw.pyx":207
 * #px def gl_set_data(nblocks, vertexdata, vertexpointers, vertexinfo, texnames):
 *     cube.number_blocks = nblocks
 *     assert cube.number_blocks <= MAX_BLOCKS             # <<<<<<<<<<<<<<
 * 
 *     #### Create the raw GL data ####
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!(__pyx_v_7_gldraw_cube.number_blocks <= __pyx_e_7_gldraw_MAX_BLOCKS))) {
    PyErr_SetNone(PyExc_AssertionError);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #endif

  /* "_gldraw.pyx":212
 *     cdef long normalpointer, colorpointer, texpospointer #px+
 *     cdef unsigned int idx_block, idx_pick, cnt_pick, idx_debug #px+
 *     normalpointer, colorpointer, texpospointer = vertexpointers             # <<<<<<<<<<<<<<
 *     labelinfos, idx_block, cnts_block, idx_pick, cnt_pick, idx_debug = vertexinfo
 * 
 */
  if ((likely(PyTuple_CheckExact(__pyx_v_vertexpointers))) || (PyList_CheckExact(__pyx_v_vertexpointers))) {
    PyObject* sequence = __pyx_v_vertexpointers;
    #if CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 3)) {
      if (size > 3) __Pyx_RaiseTooManyValuesError(3);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); 
    } else {
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 2); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    #endif
  } else
  {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_v_vertexpointers); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 2; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_unpacking_done:;
  }
  __pyx_t_6 = __Pyx_PyInt_AsLong(__pyx_t_1); if (unlikely((__pyx_t_6 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_7 = __Pyx_PyInt_AsLong(__pyx_t_2); if (unlikely((__pyx_t_7 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_8 = __Pyx_PyInt_AsLong(__pyx_t_3); if (unlikely((__pyx_t_8 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_normalpointer = __pyx_t_6;
  __pyx_v_colorpointer = __pyx_t_7;
  __pyx_v_texpospointer = __pyx_t_8;

  /* "_gldraw.pyx":213
 *     cdef unsigned int idx_block, idx_pick, cnt_pick, idx_debug #px+
 *     normalpointer, colorpointer, texpospointer = vertexpointers
 *     labelinfos, idx_block, cnts_block, idx_pick, cnt_pick, idx_debug = vertexinfo             # <<<<<<<<<<<<<<
 * 
 *     cdef unsigned int block, i, idx_label, cnt, faceno #px+
 */
  if ((likely(PyTuple_CheckExact(__pyx_v_vertexinfo))) || (PyList_CheckExact(__pyx_v_vertexinfo))) {
    PyObject* sequence = __pyx_v_vertexinfo;
    #if CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 6)) {
      if (size > 6) __Pyx_RaiseTooManyValuesError(6);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 2); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 3); 
      __pyx_t_9 = PyTuple_GET_ITEM(sequence, 4); 
      __pyx_t_10 = PyTuple_GET_ITEM(sequence, 5); 
    } else {
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_1 = PyList_GET_ITEM(sequence, 2); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 3); 
      __pyx_t_9 = PyList_GET_ITEM(sequence, 4); 
      __pyx_t_10 = PyList_GET_ITEM(sequence, 5); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_9);
    __Pyx_INCREF(__pyx_t_10);
    #else
    Py_ssize_t i;
    PyObject** temps[6] = {&__pyx_t_3,&__pyx_t_2,&__pyx_t_1,&__pyx_t_4,&__pyx_t_9,&__pyx_t_10};
    for (i=0; i < 6; i++) {
      PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      *(temps[i]) = item;
    }
    #endif
  } else
  {
    Py_ssize_t index = -1;
    PyObject** temps[6] = {&__pyx_t_3,&__pyx_t_2,&__pyx_t_1,&__pyx_t_4,&__pyx_t_9,&__pyx_t_10};
    __pyx_t_11 = PyObject_GetIter(__pyx_v_vertexinfo); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_5 = Py_TYPE(__pyx_t_11)->tp_iternext;
    for (index=0; index < 6; index++) {
      PyObject* item = __pyx_t_5(__pyx_t_11); if (unlikely(!item)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(item);
      *(temps[index]) = item;
    }
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_11), 6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    goto __pyx_L6_unpacking_done;
    __pyx_L5_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L6_unpacking_done:;
  }
  __pyx_t_12 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_2); if (unlikely((__pyx_t_12 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_13 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_4); if (unlikely((__pyx_t_13 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_14 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_9); if (unlikely((__pyx_t_14 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_15 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_10); if (unlikely((__pyx_t_15 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_v_labelinfos = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_idx_block = __pyx_t_12;
  __pyx_v_cnts_block = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_idx_pick = __pyx_t_13;
  __pyx_v_cnt_pick = __pyx_t_14;
  __pyx_v_idx_debug = __pyx_t_15;

  /* "_gldraw.pyx":216
 * 
 *     cdef unsigned int block, i, idx_label, cnt, faceno #px+
 *     idx_label = 0             # <<<<<<<<<<<<<<
 *     for block in range(cube.number_blocks):
 *         cube.blocks[block].cnt_faces = len(labelinfos[block])
 */
  __pyx_v_idx_label = 0;

  /* "_gldraw.pyx":217
 *     cdef unsigned int block, i, idx_label, cnt, faceno #px+
 *     idx_label = 0
 *     for block in range(cube.number_blocks):             # <<<<<<<<<<<<<<
 *         cube.blocks[block].cnt_faces = len(labelinfos[block])
 *         for i, (cnt, faceno) in enumerate(labelinfos[block]):
 */
  __pyx_t_15 = __pyx_v_7_gldraw_cube.number_blocks;
  for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_15; __pyx_t_14+=1) {
    __pyx_v_block = __pyx_t_14;

    /* "_gldraw.pyx":218
 *     idx_label = 0
 *     for block in range(cube.number_blocks):
 *         cube.blocks[block].cnt_faces = len(labelinfos[block])             # <<<<<<<<<<<<<<
 *         for i, (cnt, faceno) in enumerate(labelinfos[block]):
 *             cube.blocks[block].idx_label[i] = idx_label
 */
    __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_labelinfos, __pyx_v_block, sizeof(unsigned int)+1, PyLong_FromUnsignedLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_16 = PyObject_Length(__pyx_t_10); if (unlikely(__pyx_t_16 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    (__pyx_v_7_gldraw_cube.blocks[__pyx_v_block]).cnt_faces = __pyx_t_16;

    /* "_gldraw.pyx":219
 *     for block in range(cube.number_blocks):
 *         cube.blocks[block].cnt_faces = len(labelinfos[block])
 *         for i, (cnt, faceno) in enumerate(labelinfos[block]):             # <<<<<<<<<<<<<<
 *             cube.blocks[block].idx_label[i] = idx_label
 *             cube.blocks[block].cnt_label[i] = cnt
 */
    __pyx_t_13 = 0;
    __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_labelinfos, __pyx_v_block, sizeof(unsigned int)+1, PyLong_FromUnsignedLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    if (PyList_CheckExact(__pyx_t_10) || PyTuple_CheckExact(__pyx_t_10)) {
      __pyx_t_9 = __pyx_t_10; __Pyx_INCREF(__pyx_t_9); __pyx_t_16 = 0;
      __pyx_t_17 = NULL;
    } else {
      __pyx_t_16 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_17 = Py_TYPE(__pyx_t_9)->tp_iternext;
    }
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    for (;;) {
      if (!__pyx_t_17 && PyList_CheckExact(__pyx_t_9)) {
        if (__pyx_t_16 >= PyList_GET_SIZE(__pyx_t_9)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_10 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_16); __Pyx_INCREF(__pyx_t_10); __pyx_t_16++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_10 = PySequence_ITEM(__pyx_t_9, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_17 && PyTuple_CheckExact(__pyx_t_9)) {
        if (__pyx_t_16 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_16); __Pyx_INCREF(__pyx_t_10); __pyx_t_16++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_10 = PySequence_ITEM(__pyx_t_9, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_10 = __pyx_t_17(__pyx_t_9);
        if (unlikely(!__pyx_t_10)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_10);
      }
      if ((likely(PyTuple_CheckExact(__pyx_t_10))) || (PyList_CheckExact(__pyx_t_10))) {
        PyObject* sequence = __pyx_t_10;
        #if CYTHON_COMPILING_IN_CPYTHON
        Py_ssize_t size = Py_SIZE(sequence);
        #else
        Py_ssize_t size = PySequence_Size(sequence);
        #endif
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        #if CYTHON_COMPILING_IN_CPYTHON
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_1);
        #else
        __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      } else
      {
        Py_ssize_t index = -1;
        __pyx_t_2 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext;
        index = 0; __pyx_t_4 = __pyx_t_5(__pyx_t_2); if (unlikely(!__pyx_t_4)) goto __pyx_L11_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_4);
        index = 1; __pyx_t_1 = __pyx_t_5(__pyx_t_2); if (unlikely(!__pyx_t_1)) goto __pyx_L11_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_1);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_2), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_5 = NULL;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        goto __pyx_L12_unpacking_done;
        __pyx_L11_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_5 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_L12_unpacking_done:;
      }
      __pyx_t_12 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_4); if (unlikely((__pyx_t_12 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_18 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_1); if (unlikely((__pyx_t_18 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_cnt = __pyx_t_12;
      __pyx_v_faceno = __pyx_t_18;
      __pyx_v_i = __pyx_t_13;
      __pyx_t_13 = (__pyx_t_13 + 1);

      /* "_gldraw.pyx":220
 *         cube.blocks[block].cnt_faces = len(labelinfos[block])
 *         for i, (cnt, faceno) in enumerate(labelinfos[block]):
 *             cube.blocks[block].idx_label[i] = idx_label             # <<<<<<<<<<<<<<
 *             cube.blocks[block].cnt_label[i] = cnt
 *             cube.blocks[block].texname[i] = texnames[faceno]
 */
      ((__pyx_v_7_gldraw_cube.blocks[__pyx_v_block]).idx_label[__pyx_v_i]) = __pyx_v_idx_label;

      /* "_gldraw.pyx":221
 *         for i, (cnt, faceno) in enumerate(labelinfos[block]):
 *             cube.blocks[block].idx_label[i] = idx_label
 *             cube.blocks[block].cnt_label[i] = cnt             # <<<<<<<<<<<<<<
 *             cube.blocks[block].texname[i] = texnames[faceno]
 *             idx_label += cnt
 */
      ((__pyx_v_7_gldraw_cube.blocks[__pyx_v_block]).cnt_label[__pyx_v_i]) = __pyx_v_cnt;

      /* "_gldraw.pyx":222
 *             cube.blocks[block].idx_label[i] = idx_label
 *             cube.blocks[block].cnt_label[i] = cnt
 *             cube.blocks[block].texname[i] = texnames[faceno]             # <<<<<<<<<<<<<<
 *             idx_label += cnt
 *         cube.blocks[block].idx_triangles = idx_block
 */
      __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_texnames, __pyx_v_faceno, sizeof(unsigned int)+1, PyLong_FromUnsignedLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_19 = __Pyx_PyInt_AsInt(__pyx_t_10); if (unlikely((__pyx_t_19 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      ((__pyx_v_7_gldraw_cube.blocks[__pyx_v_block]).texname[__pyx_v_i]) = __pyx_t_19;

      /* "_gldraw.pyx":223
 *             cube.blocks[block].cnt_label[i] = cnt
 *             cube.blocks[block].texname[i] = texnames[faceno]
 *             idx_label += cnt             # <<<<<<<<<<<<<<
 *         cube.blocks[block].idx_triangles = idx_block
 *         cube.blocks[block].cnt_triangles = cnts_block[block]
 */
      __pyx_v_idx_label = (__pyx_v_idx_label + __pyx_v_cnt);
    }
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "_gldraw.pyx":224
 *             cube.blocks[block].texname[i] = texnames[faceno]
 *             idx_label += cnt
 *         cube.blocks[block].idx_triangles = idx_block             # <<<<<<<<<<<<<<
 *         cube.blocks[block].cnt_triangles = cnts_block[block]
 *         idx_block += cnts_block[block]
 */
    (__pyx_v_7_gldraw_cube.blocks[__pyx_v_block]).idx_triangles = __pyx_v_idx_block;

    /* "_gldraw.pyx":225
 *             idx_label += cnt
 *         cube.blocks[block].idx_triangles = idx_block
 *         cube.blocks[block].cnt_triangles = cnts_block[block]             # <<<<<<<<<<<<<<
 *         idx_block += cnts_block[block]
 * 
 */
    __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_cnts_block, __pyx_v_block, sizeof(unsigned int)+1, PyLong_FromUnsignedLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_19 = __Pyx_PyInt_AsInt(__pyx_t_9); if (unlikely((__pyx_t_19 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    (__pyx_v_7_gldraw_cube.blocks[__pyx_v_block]).cnt_triangles = __pyx_t_19;

    /* "_gldraw.pyx":226
 *         cube.blocks[block].idx_triangles = idx_block
 *         cube.blocks[block].cnt_triangles = cnts_block[block]
 *         idx_block += cnts_block[block]             # <<<<<<<<<<<<<<
 * 
 *     cube.idx_pick = idx_pick
 */
    __pyx_t_9 = PyLong_FromUnsignedLong(__pyx_v_idx_block); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_cnts_block, __pyx_v_block, sizeof(unsigned int)+1, PyLong_FromUnsignedLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_13 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_1); if (unlikely((__pyx_t_13 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_idx_block = __pyx_t_13;
  }

  /* "_gldraw.pyx":228
 *         idx_block += cnts_block[block]
 * 
 *     cube.idx_pick = idx_pick             # <<<<<<<<<<<<<<
 *     cube.cnt_pick = cnt_pick
 *     cube.idx_debug = idx_debug
 */
  __pyx_v_7_gldraw_cube.idx_pick = __pyx_v_idx_pick;

  /* "_gldraw.pyx":229
 * 
 *     cube.idx_pick = idx_pick
 *     cube.cnt_pick = cnt_pick             # <<<<<<<<<<<<<<
 *     cube.idx_debug = idx_debug
 * 
 */
  __pyx_v_7_gldraw_cube.cnt_pick = __pyx_v_cnt_pick;

  /* "_gldraw.pyx":230
 *     cube.idx_pick = idx_pick
 *     cube.cnt_pick = cnt_pick
 *     cube.idx_debug = idx_debug             # <<<<<<<<<<<<<<
 * 
 *     debug('GL data: %d bytes' % len(vertexdata))
 */
  __pyx_v_7_gldraw_cube.idx_debug = __pyx_v_idx_debug;

  /* "_gldraw.pyx":232
 *     cube.idx_debug = idx_debug
 * 
 *     debug('GL data: %d bytes' % len(vertexdata))             # <<<<<<<<<<<<<<
 *     glBindBuffer(GL_ARRAY_BUFFER, cube.glbuffer)
 *     glBufferData(GL_ARRAY_BUFFER, len(vertexdata), <char*>vertexdata, GL_STATIC_DRAW) #px/
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__debug); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(((PyObject *)__pyx_v_vertexdata) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_16 = PyBytes_GET_SIZE(((PyObject *)__pyx_v_vertexdata)); if (unlikely(__pyx_t_16 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_10 = PyInt_FromSsize_t(__pyx_t_16); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_9 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_1), __pyx_t_10); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_9));
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_t_9));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_9));
  __pyx_t_9 = 0;
  __pyx_t_9 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

  /* "_gldraw.pyx":233
 * 
 *     debug('GL data: %d bytes' % len(vertexdata))
 *     glBindBuffer(GL_ARRAY_BUFFER, cube.glbuffer)             # <<<<<<<<<<<<<<
 *     glBufferData(GL_ARRAY_BUFFER, len(vertexdata), <char*>vertexdata, GL_STATIC_DRAW) #px/
 *     #px glBufferData(GL_ARRAY_BUFFER, len(vertexdata), vertexdata, GL_STATIC_DRAW)
 */
  glBindBuffer(GL_ARRAY_BUFFER, __pyx_v_7_gldraw_cube.glbuffer);

  /* "_gldraw.pyx":234
 *     debug('GL data: %d bytes' % len(vertexdata))
 *     glBindBuffer(GL_ARRAY_BUFFER, cube.glbuffer)
 *     glBufferData(GL_ARRAY_BUFFER, len(vertexdata), <char*>vertexdata, GL_STATIC_DRAW) #px/             # <<<<<<<<<<<<<<
 *     #px glBufferData(GL_ARRAY_BUFFER, len(vertexdata), vertexdata, GL_STATIC_DRAW)
 * 
 */
  if (unlikely(((PyObject *)__pyx_v_vertexdata) == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_16 = PyBytes_GET_SIZE(((PyObject *)__pyx_v_vertexdata)); if (unlikely(__pyx_t_16 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_20 = PyBytes_AsString(((PyObject *)__pyx_v_vertexdata)); if (unlikely((!__pyx_t_20) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  glBufferData(GL_ARRAY_BUFFER, __pyx_t_16, ((char *)__pyx_t_20), GL_STATIC_DRAW);

  /* "_gldraw.pyx":237
 *     #px glBufferData(GL_ARRAY_BUFFER, len(vertexdata), vertexdata, GL_STATIC_DRAW)
 * 
 *     glVertexAttribPointer(VERTEX_ATTRIB_LOCATION, 3, GL_FLOAT, GL_FALSE, 0, <void*>0) #px/             # <<<<<<<<<<<<<<
 *     #px glVertexAttribPointer(VERTEX_ATTRIB_LOCATION, 3, GL_FLOAT, GL_FALSE, 0, 0)
 *     glVertexAttribPointer(NORMAL_ATTRIB_LOCATION, 3, GL_FLOAT, GL_FALSE, 0, <void*>normalpointer) #px/
 */
  glVertexAttribPointer(__pyx_e_7_gldraw_VERTEX_ATTRIB_LOCATION, 3, GL_FLOAT, GL_FALSE, 0, ((void *)0));

  /* "_gldraw.pyx":239
 *     glVertexAttribPointer(VERTEX_ATTRIB_LOCATION, 3, GL_FLOAT, GL_FALSE, 0, <void*>0) #px/
 *     #px glVertexAttribPointer(VERTEX_ATTRIB_LOCATION, 3, GL_FLOAT, GL_FALSE, 0, 0)
 *     glVertexAttribPointer(NORMAL_ATTRIB_LOCATION, 3, GL_FLOAT, GL_FALSE, 0, <void*>normalpointer) #px/             # <<<<<<<<<<<<<<
 *     #px glVertexAttribPointer(NORMAL_ATTRIB_LOCATION, 3, GL_FLOAT, GL_FALSE, 0, normalpointer)
 *     glVertexAttribPointer(COLOR_ATTRIB_LOCATION, 3, GL_UNSIGNED_BYTE, GL_TRUE, 0, <void*>colorpointer) #px/
 */
  glVertexAttribPointer(__pyx_e_7_gldraw_NORMAL_ATTRIB_LOCATION, 3, GL_FLOAT, GL_FALSE, 0, ((void *)__pyx_v_normalpointer));

  /* "_gldraw.pyx":241
 *     glVertexAttribPointer(NORMAL_ATTRIB_LOCATION, 3, GL_FLOAT, GL_FALSE, 0, <void*>normalpointer) #px/
 *     #px glVertexAttribPointer(NORMAL_ATTRIB_LOCATION, 3, GL_FLOAT, GL_FALSE, 0, normalpointer)
 *     glVertexAttribPointer(COLOR_ATTRIB_LOCATION, 3, GL_UNSIGNED_BYTE, GL_TRUE, 0, <void*>colorpointer) #px/             # <<<<<<<<<<<<<<
 *     #px glVertexAttribPointer(COLOR_ATTRIB_LOCATION, 3, GL_UNSIGNED_BYTE, GL_TRUE, 0, colorpointer)
 *     glVertexAttribPointer(TEXCOORD_ATTRIB_LOCATION, 2, GL_FLOAT, GL_FALSE, 0, <void*>texpospointer) #px/
 */
  glVertexAttribPointer(__pyx_e_7_gldraw_COLOR_ATTRIB_LOCATION, 3, GL_UNSIGNED_BYTE, GL_TRUE, 0, ((void *)__pyx_v_colorpointer));

  /* "_gldraw.pyx":243
 *     glVertexAttribPointer(COLOR_ATTRIB_LOCATION, 3, GL_UNSIGNED_BYTE, GL_TRUE, 0, <void*>colorpointer) #px/
 *     #px glVertexAttribPointer(COLOR_ATTRIB_LOCATION, 3, GL_UNSIGNED_BYTE, GL_TRUE, 0, colorpointer)
 *     glVertexAttribPointer(TEXCOORD_ATTRIB_LOCATION, 2, GL_FLOAT, GL_FALSE, 0, <void*>texpospointer) #px/             # <<<<<<<<<<<<<<
 *     #px glVertexAttribPointer(TEXCOORD_ATTRIB_LOCATION, 2, GL_FLOAT, GL_FALSE, 0, texpospointer)
 * 
 */
  glVertexAttribPointer(__pyx_e_7_gldraw_TEXCOORD_ATTRIB_LOCATION, 2, GL_FLOAT, GL_FALSE, 0, ((void *)__pyx_v_texpospointer));

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("_gldraw.gl_set_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_labelinfos);
  __Pyx_XDECREF(__pyx_v_cnts_block);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7_gldraw_9gl_set_data(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_7_gldraw_9gl_set_data(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_nblocks;
  PyObject *__pyx_v_vertexdata = 0;
  PyObject *__pyx_v_vertexpointers = 0;
  PyObject *__pyx_v_vertexinfo = 0;
  PyObject *__pyx_v_texnames = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("gl_set_data (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__nblocks,&__pyx_n_s__vertexdata,&__pyx_n_s__vertexpointers,&__pyx_n_s__vertexinfo,&__pyx_n_s__texnames,0};
    PyObject* values[5] = {0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__nblocks)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__vertexdata)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("gl_set_data", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__vertexpointers)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("gl_set_data", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__vertexinfo)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("gl_set_data", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__texnames)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("gl_set_data", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gl_set_data") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
    }
    __pyx_v_nblocks = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_nblocks == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_vertexdata = ((PyObject*)values[1]);
    __pyx_v_vertexpointers = values[2];
    __pyx_v_vertexinfo = values[3];
    __pyx_v_texnames = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("gl_set_data", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("_gldraw.gl_set_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vertexdata), (&PyBytes_Type), 1, "vertexdata", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_7_gldraw_8gl_set_data(__pyx_self, __pyx_v_nblocks, __pyx_v_vertexdata, __pyx_v_vertexpointers, __pyx_v_vertexinfo, __pyx_v_texnames);
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_gldraw.pyx":204
 *     cube.glbuffer = 0
 * 
 * cpdef gl_set_data(int nblocks, bytes vertexdata, vertexpointers, vertexinfo, texnames): #px/             # <<<<<<<<<<<<<<
 * #px def gl_set_data(nblocks, vertexdata, vertexpointers, vertexinfo, texnames):
 *     cube.number_blocks = nblocks
 */

static PyObject *__pyx_pf_7_gldraw_8gl_set_data(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_nblocks, PyObject *__pyx_v_vertexdata, PyObject *__pyx_v_vertexpointers, PyObject *__pyx_v_vertexinfo, PyObject *__pyx_v_texnames) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("gl_set_data", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7_gldraw_gl_set_data(__pyx_v_nblocks, __pyx_v_vertexdata, __pyx_v_vertexpointers, __pyx_v_vertexinfo, __pyx_v_texnames, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_gldraw.gl_set_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_gldraw.pyx":246
 *     #px glVertexAttribPointer(TEXCOORD_ATTRIB_LOCATION, 2, GL_FLOAT, GL_FALSE, 0, texpospointer)
 * 
 * cdef void gl_draw_cube_debug(): #pxd/             # <<<<<<<<<<<<<<
 * #px def gl_draw_cube_debug():
 *     cdef mat4 object_matrix #px+
 */

static void __pyx_f_7_gldraw_gl_draw_cube_debug(void) {
  glm::mat4 __pyx_v_object_matrix;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("gl_draw_cube_debug", 0);

  /* "_gldraw.pyx":249
 * #px def gl_draw_cube_debug():
 *     cdef mat4 object_matrix #px+
 *     object_matrix = mat4(1.)             # <<<<<<<<<<<<<<
 *     glUniformMatrix4fv(cube.object_location, 1, GL_FALSE, &object_matrix[0][0]) #px/
 *     #px glUniformMatrix4fv(cube.object_location, 1, GL_FALSE, object_matrix)
 */
  __pyx_v_object_matrix = glm::mat4(1.);

  /* "_gldraw.pyx":250
 *     cdef mat4 object_matrix #px+
 *     object_matrix = mat4(1.)
 *     glUniformMatrix4fv(cube.object_location, 1, GL_FALSE, &object_matrix[0][0]) #px/             # <<<<<<<<<<<<<<
 *     #px glUniformMatrix4fv(cube.object_location, 1, GL_FALSE, object_matrix)
 *     glEnableVertexAttribArray(VERTEX_ATTRIB_LOCATION)
 */
  glUniformMatrix4fv(__pyx_v_7_gldraw_cube.object_location, 1, GL_FALSE, (&((__pyx_v_object_matrix[0])[0])));

  /* "_gldraw.pyx":252
 *     glUniformMatrix4fv(cube.object_location, 1, GL_FALSE, &object_matrix[0][0]) #px/
 *     #px glUniformMatrix4fv(cube.object_location, 1, GL_FALSE, object_matrix)
 *     glEnableVertexAttribArray(VERTEX_ATTRIB_LOCATION)             # <<<<<<<<<<<<<<
 *     glEnableVertexAttribArray(COLOR_ATTRIB_LOCATION)
 *     glDrawArrays(GL_LINES, cube.idx_debug, 6)
 */
  glEnableVertexAttribArray(__pyx_e_7_gldraw_VERTEX_ATTRIB_LOCATION);

  /* "_gldraw.pyx":253
 *     #px glUniformMatrix4fv(cube.object_location, 1, GL_FALSE, object_matrix)
 *     glEnableVertexAttribArray(VERTEX_ATTRIB_LOCATION)
 *     glEnableVertexAttribArray(COLOR_ATTRIB_LOCATION)             # <<<<<<<<<<<<<<
 *     glDrawArrays(GL_LINES, cube.idx_debug, 6)
 *     glDisableVertexAttribArray(VERTEX_ATTRIB_LOCATION)
 */
  glEnableVertexAttribArray(__pyx_e_7_gldraw_COLOR_ATTRIB_LOCATION);

  /* "_gldraw.pyx":254
 *     glEnableVertexAttribArray(VERTEX_ATTRIB_LOCATION)
 *     glEnableVertexAttribArray(COLOR_ATTRIB_LOCATION)
 *     glDrawArrays(GL_LINES, cube.idx_debug, 6)             # <<<<<<<<<<<<<<
 *     glDisableVertexAttribArray(VERTEX_ATTRIB_LOCATION)
 *     glDisableVertexAttribArray(COLOR_ATTRIB_LOCATION)
 */
  glDrawArrays(GL_LINES, __pyx_v_7_gldraw_cube.idx_debug, 6);

  /* "_gldraw.pyx":255
 *     glEnableVertexAttribArray(COLOR_ATTRIB_LOCATION)
 *     glDrawArrays(GL_LINES, cube.idx_debug, 6)
 *     glDisableVertexAttribArray(VERTEX_ATTRIB_LOCATION)             # <<<<<<<<<<<<<<
 *     glDisableVertexAttribArray(COLOR_ATTRIB_LOCATION)
 * 
 */
  glDisableVertexAttribArray(__pyx_e_7_gldraw_VERTEX_ATTRIB_LOCATION);

  /* "_gldraw.pyx":256
 *     glDrawArrays(GL_LINES, cube.idx_debug, 6)
 *     glDisableVertexAttribArray(VERTEX_ATTRIB_LOCATION)
 *     glDisableVertexAttribArray(COLOR_ATTRIB_LOCATION)             # <<<<<<<<<<<<<<
 * 
 * cdef void gl_draw_select_debug(GLfloat *selectdata, GLsizeiptr size, GLuint prog_hud): #pxd/
 */
  glDisableVertexAttribArray(__pyx_e_7_gldraw_COLOR_ATTRIB_LOCATION);

  __Pyx_RefNannyFinishContext();
}

/* "_gldraw.pyx":258
 *     glDisableVertexAttribArray(COLOR_ATTRIB_LOCATION)
 * 
 * cdef void gl_draw_select_debug(GLfloat *selectdata, GLsizeiptr size, GLuint prog_hud): #pxd/             # <<<<<<<<<<<<<<
 * #px def gl_draw_select_debug(selectdata, size, prog_hud):
 *     cdef int i, j #px+
 */

static void __pyx_f_7_gldraw_gl_draw_select_debug(__pyx_t_2gl_GLfloat *__pyx_v_selectdata, __pyx_t_2gl_GLsizeiptr __pyx_v_size, __pyx_t_2gl_GLuint __pyx_v_prog_hud) {
  __pyx_t_2gl_GLintptr __pyx_v_offset;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("gl_draw_select_debug", 0);

  /* "_gldraw.pyx":262
 *     cdef int i, j #px+
 *     cdef GLintptr offset #px+
 *     offset = (cube.idx_debug+6) * 3 * sizeof(GLfloat)             # <<<<<<<<<<<<<<
 *     glBufferSubData(GL_ARRAY_BUFFER, offset, size, &selectdata[0]) #px/
 *     #px glBufferSubData(GL_ARRAY_BUFFER, offset, size, selectdata)
 */
  __pyx_v_offset = (((__pyx_v_7_gldraw_cube.idx_debug + 6) * 3) * (sizeof(__pyx_t_2gl_GLfloat)));

  /* "_gldraw.pyx":263
 *     cdef GLintptr offset #px+
 *     offset = (cube.idx_debug+6) * 3 * sizeof(GLfloat)
 *     glBufferSubData(GL_ARRAY_BUFFER, offset, size, &selectdata[0]) #px/             # <<<<<<<<<<<<<<
 *     #px glBufferSubData(GL_ARRAY_BUFFER, offset, size, selectdata)
 * 
 */
  glBufferSubData(GL_ARRAY_BUFFER, __pyx_v_offset, __pyx_v_size, (&(__pyx_v_selectdata[0])));

  /* "_gldraw.pyx":266
 *     #px glBufferSubData(GL_ARRAY_BUFFER, offset, size, selectdata)
 * 
 *     glDisable(GL_DEPTH_TEST)             # <<<<<<<<<<<<<<
 *     glEnableVertexAttribArray(VERTEX_ATTRIB_LOCATION)
 *     glEnableVertexAttribArray(COLOR_ATTRIB_LOCATION)
 */
  glDisable(GL_DEPTH_TEST);

  /* "_gldraw.pyx":267
 * 
 *     glDisable(GL_DEPTH_TEST)
 *     glEnableVertexAttribArray(VERTEX_ATTRIB_LOCATION)             # <<<<<<<<<<<<<<
 *     glEnableVertexAttribArray(COLOR_ATTRIB_LOCATION)
 *     glDrawArrays(GL_LINES, cube.idx_debug+6, 2)
 */
  glEnableVertexAttribArray(__pyx_e_7_gldraw_VERTEX_ATTRIB_LOCATION);

  /* "_gldraw.pyx":268
 *     glDisable(GL_DEPTH_TEST)
 *     glEnableVertexAttribArray(VERTEX_ATTRIB_LOCATION)
 *     glEnableVertexAttribArray(COLOR_ATTRIB_LOCATION)             # <<<<<<<<<<<<<<
 *     glDrawArrays(GL_LINES, cube.idx_debug+6, 2)
 *     glUseProgram(prog_hud)
 */
  glEnableVertexAttribArray(__pyx_e_7_gldraw_COLOR_ATTRIB_LOCATION);

  /* "_gldraw.pyx":269
 *     glEnableVertexAttribArray(VERTEX_ATTRIB_LOCATION)
 *     glEnableVertexAttribArray(COLOR_ATTRIB_LOCATION)
 *     glDrawArrays(GL_LINES, cube.idx_debug+6, 2)             # <<<<<<<<<<<<<<
 *     glUseProgram(prog_hud)
 *     glDrawArrays(GL_POINTS, cube.idx_debug+6+2, 2)
 */
  glDrawArrays(GL_LINES, (__pyx_v_7_gldraw_cube.idx_debug + 6), 2);

  /* "_gldraw.pyx":270
 *     glEnableVertexAttribArray(COLOR_ATTRIB_LOCATION)
 *     glDrawArrays(GL_LINES, cube.idx_debug+6, 2)
 *     glUseProgram(prog_hud)             # <<<<<<<<<<<<<<
 *     glDrawArrays(GL_POINTS, cube.idx_debug+6+2, 2)
 *     glDisableVertexAttribArray(VERTEX_ATTRIB_LOCATION)
 */
  glUseProgram(__pyx_v_prog_hud);

  /* "_gldraw.pyx":271
 *     glDrawArrays(GL_LINES, cube.idx_debug+6, 2)
 *     glUseProgram(prog_hud)
 *     glDrawArrays(GL_POINTS, cube.idx_debug+6+2, 2)             # <<<<<<<<<<<<<<
 *     glDisableVertexAttribArray(VERTEX_ATTRIB_LOCATION)
 *     glDisableVertexAttribArray(COLOR_ATTRIB_LOCATION)
 */
  glDrawArrays(GL_POINTS, ((__pyx_v_7_gldraw_cube.idx_debug + 6) + 2), 2);

  /* "_gldraw.pyx":272
 *     glUseProgram(prog_hud)
 *     glDrawArrays(GL_POINTS, cube.idx_debug+6+2, 2)
 *     glDisableVertexAttribArray(VERTEX_ATTRIB_LOCATION)             # <<<<<<<<<<<<<<
 *     glDisableVertexAttribArray(COLOR_ATTRIB_LOCATION)
 *     glEnable(GL_DEPTH_TEST)
 */
  glDisableVertexAttribArray(__pyx_e_7_gldraw_VERTEX_ATTRIB_LOCATION);

  /* "_gldraw.pyx":273
 *     glDrawArrays(GL_POINTS, cube.idx_debug+6+2, 2)
 *     glDisableVertexAttribArray(VERTEX_ATTRIB_LOCATION)
 *     glDisableVertexAttribArray(COLOR_ATTRIB_LOCATION)             # <<<<<<<<<<<<<<
 *     glEnable(GL_DEPTH_TEST)
 * 
 */
  glDisableVertexAttribArray(__pyx_e_7_gldraw_COLOR_ATTRIB_LOCATION);

  /* "_gldraw.pyx":274
 *     glDisableVertexAttribArray(VERTEX_ATTRIB_LOCATION)
 *     glDisableVertexAttribArray(COLOR_ATTRIB_LOCATION)
 *     glEnable(GL_DEPTH_TEST)             # <<<<<<<<<<<<<<
 * 
 * cdef void gl_init_object_location(GLuint location): #pxd/
 */
  glEnable(GL_DEPTH_TEST);

  __Pyx_RefNannyFinishContext();
}

/* "_gldraw.pyx":276
 *     glEnable(GL_DEPTH_TEST)
 * 
 * cdef void gl_init_object_location(GLuint location): #pxd/             # <<<<<<<<<<<<<<
 * #px def gl_init_object_location(location):
 *     cube.object_location = location
 */

static void __pyx_f_7_gldraw_gl_init_object_location(__pyx_t_2gl_GLuint __pyx_v_location) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("gl_init_object_location", 0);

  /* "_gldraw.pyx":278
 * cdef void gl_init_object_location(GLuint location): #pxd/
 * #px def gl_init_object_location(location):
 *     cube.object_location = location             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_7_gldraw_cube.object_location = __pyx_v_location;

  __Pyx_RefNannyFinishContext();
}

static PyMethodDef __pyx_methods[] = {
  {__Pyx_NAMESTR("set_animation_start"), (PyCFunction)__pyx_pw_7_gldraw_5set_animation_start, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("set_animation_next"), (PyCFunction)__pyx_pw_7_gldraw_7set_animation_next, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("gl_set_data"), (PyCFunction)__pyx_pw_7_gldraw_9gl_set_data, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef __pyx_moduledef = {
    PyModuleDef_HEAD_INIT,
    __Pyx_NAMESTR("_gldraw"),
    0, /* m_doc */
    -1, /* m_size */
    __pyx_methods /* m_methods */,
    NULL, /* m_reload */
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_kp_u_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 1, 0, 0},
  {&__pyx_kp_s_12, __pyx_k_12, sizeof(__pyx_k_12), 0, 0, 1, 0},
  {&__pyx_n_u_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 1, 0, 1},
  {&__pyx_n_u_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 1, 0, 1},
  {&__pyx_n_u_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 1, 0, 1},
  {&__pyx_n_u_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 1, 0, 1},
  {&__pyx_n_u_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 1, 0, 1},
  {&__pyx_kp_u_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 1, 0, 0},
  {&__pyx_kp_u_8, __pyx_k_8, sizeof(__pyx_k_8), 0, 1, 0, 0},
  {&__pyx_kp_u_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 1, 0, 0},
  {&__pyx_n_s____all__, __pyx_k____all__, sizeof(__pyx_k____all__), 0, 0, 1, 1},
  {&__pyx_n_s____compiled, __pyx_k____compiled, sizeof(__pyx_k____compiled), 0, 0, 1, 1},
  {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
  {&__pyx_n_s____name__, __pyx_k____name__, sizeof(__pyx_k____name__), 0, 0, 1, 1},
  {&__pyx_n_s____package__, __pyx_k____package__, sizeof(__pyx_k____package__), 0, 0, 1, 1},
  {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
  {&__pyx_n_s___gldraw, __pyx_k___gldraw, sizeof(__pyx_k___gldraw), 0, 0, 1, 1},
  {&__pyx_n_s__angle_max, __pyx_k__angle_max, sizeof(__pyx_k__angle_max), 0, 0, 1, 1},
  {&__pyx_n_s__axisx, __pyx_k__axisx, sizeof(__pyx_k__axisx), 0, 0, 1, 1},
  {&__pyx_n_s__axisy, __pyx_k__axisy, sizeof(__pyx_k__axisy), 0, 0, 1, 1},
  {&__pyx_n_s__axisz, __pyx_k__axisz, sizeof(__pyx_k__axisz), 0, 0, 1, 1},
  {&__pyx_n_s__b, __pyx_k__b, sizeof(__pyx_k__b), 0, 0, 1, 1},
  {&__pyx_n_s__blocks, __pyx_k__blocks, sizeof(__pyx_k__blocks), 0, 0, 1, 1},
  {&__pyx_n_s__debug, __pyx_k__debug, sizeof(__pyx_k__debug), 0, 0, 1, 1},
  {&__pyx_n_s__enumerate, __pyx_k__enumerate, sizeof(__pyx_k__enumerate), 0, 0, 1, 1},
  {&__pyx_n_u__gl_delete_buffers, __pyx_k__gl_delete_buffers, sizeof(__pyx_k__gl_delete_buffers), 0, 1, 0, 1},
  {&__pyx_n_u__gl_draw_cube, __pyx_k__gl_draw_cube, sizeof(__pyx_k__gl_draw_cube), 0, 1, 0, 1},
  {&__pyx_n_u__gl_draw_cube_debug, __pyx_k__gl_draw_cube_debug, sizeof(__pyx_k__gl_draw_cube_debug), 0, 1, 0, 1},
  {&__pyx_n_u__gl_init_buffers, __pyx_k__gl_init_buffers, sizeof(__pyx_k__gl_init_buffers), 0, 1, 0, 1},
  {&__pyx_n_u__gl_pick_cube, __pyx_k__gl_pick_cube, sizeof(__pyx_k__gl_pick_cube), 0, 1, 0, 1},
  {&__pyx_n_s__i, __pyx_k__i, sizeof(__pyx_k__i), 0, 0, 1, 1},
  {&__pyx_n_s__init_module, __pyx_k__init_module, sizeof(__pyx_k__init_module), 0, 0, 1, 1},
  {&__pyx_n_s__j, __pyx_k__j, sizeof(__pyx_k__j), 0, 0, 1, 1},
  {&__pyx_n_s__nblocks, __pyx_k__nblocks, sizeof(__pyx_k__nblocks), 0, 0, 1, 1},
  {&__pyx_n_s__range, __pyx_k__range, sizeof(__pyx_k__range), 0, 0, 1, 1},
  {&__pyx_n_s__set_transformations, __pyx_k__set_transformations, sizeof(__pyx_k__set_transformations), 0, 0, 1, 1},
  {&__pyx_n_s__texnames, __pyx_k__texnames, sizeof(__pyx_k__texnames), 0, 0, 1, 1},
  {&__pyx_n_s__vertexdata, __pyx_k__vertexdata, sizeof(__pyx_k__vertexdata), 0, 0, 1, 1},
  {&__pyx_n_s__vertexinfo, __pyx_k__vertexinfo, sizeof(__pyx_k__vertexinfo), 0, 0, 1, 1},
  {&__pyx_n_s__vertexpointers, __pyx_k__vertexpointers, sizeof(__pyx_k__vertexpointers), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_range = __Pyx_GetName(__pyx_b, __pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_enumerate = __Pyx_GetName(__pyx_b, __pyx_n_s__enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  return 0;
  __pyx_L1_error:;
  return -1;
}

static int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "_gldraw.pyx":110
 * 
 * 
 * def init_module():             # <<<<<<<<<<<<<<
 *     cdef int i #px+
 * 
 */
  __pyx_k_tuple_10 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_10);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__i));
  PyTuple_SET_ITEM(__pyx_k_tuple_10, 0, ((PyObject *)__pyx_n_s__i));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_10));
  __pyx_k_codeobj_11 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_12, __pyx_n_s__init_module, 110, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "_gldraw.pyx":122
 *     animation.angle = animation.angle_max = 0
 * 
 * def set_transformations(blocks):             # <<<<<<<<<<<<<<
 *     cdef unsigned int b,i,j #px+
 *     for b in range(cube.number_blocks):
 */
  __pyx_k_tuple_13 = PyTuple_New(4); if (unlikely(!__pyx_k_tuple_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_13);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__blocks));
  PyTuple_SET_ITEM(__pyx_k_tuple_13, 0, ((PyObject *)__pyx_n_s__blocks));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__blocks));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__b));
  PyTuple_SET_ITEM(__pyx_k_tuple_13, 1, ((PyObject *)__pyx_n_s__b));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__b));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__i));
  PyTuple_SET_ITEM(__pyx_k_tuple_13, 2, ((PyObject *)__pyx_n_s__i));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__j));
  PyTuple_SET_ITEM(__pyx_k_tuple_13, 3, ((PyObject *)__pyx_n_s__j));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__j));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_13));
  __pyx_k_codeobj_14 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_12, __pyx_n_s__set_transformations, 122, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_InitGlobals(void) {
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  return 0;
  __pyx_L1_error:;
  return -1;
}

#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC init_gldraw(void); /*proto*/
PyMODINIT_FUNC init_gldraw(void)
#else
PyMODINIT_FUNC PyInit__gldraw(void); /*proto*/
PyMODINIT_FUNC PyInit__gldraw(void)
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannyDeclarations
  #if CYTHON_REFNANNY
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
  if (!__Pyx_RefNanny) {
      PyErr_Clear();
      __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
      if (!__Pyx_RefNanny)
          Py_FatalError("failed to import 'refnanny' module");
  }
  #endif
  __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit__gldraw(void)", 0);
  if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #ifdef __Pyx_CyFunction_USED
  if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  #ifdef WITH_THREAD /* Python build with threading support? */
  PyEval_InitThreads();
  #endif
  #endif
  /*--- Module creation code ---*/
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4(__Pyx_NAMESTR("_gldraw"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (!PyDict_GetItemString(modules, "_gldraw")) {
      if (unlikely(PyDict_SetItemString(modules, "_gldraw", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif
  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if CYTHON_COMPILING_IN_PYPY
  Py_INCREF(__pyx_b);
  #endif
  if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  /*--- Initialize various global constants etc. ---*/
  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_module_is_main__gldraw) {
    if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  }
  /*--- Builtin init code ---*/
  if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Constants init code ---*/
  if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Global init code ---*/
  /*--- Variable export code ---*/
  /*--- Function export code ---*/
  if (__Pyx_ExportFunction("gl_draw_cube", (void (*)(void))__pyx_f_7_gldraw_gl_draw_cube, "void (void)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ExportFunction("gl_pick_cube", (void (*)(void))__pyx_f_7_gldraw_gl_pick_cube, "void (void)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ExportFunction("gl_init_buffers", (void (*)(void))__pyx_f_7_gldraw_gl_init_buffers, "void (void)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ExportFunction("gl_delete_buffers", (void (*)(void))__pyx_f_7_gldraw_gl_delete_buffers, "void (void)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ExportFunction("gl_draw_cube_debug", (void (*)(void))__pyx_f_7_gldraw_gl_draw_cube_debug, "void (void)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ExportFunction("gl_draw_select_debug", (void (*)(void))__pyx_f_7_gldraw_gl_draw_select_debug, "void (__pyx_t_2gl_GLfloat *, __pyx_t_2gl_GLsizeiptr, __pyx_t_2gl_GLuint)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ExportFunction("gl_init_object_location", (void (*)(void))__pyx_f_7_gldraw_gl_init_object_location, "void (__pyx_t_2gl_GLuint)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Type init code ---*/
  /*--- Type import code ---*/
  /*--- Variable import code ---*/
  /*--- Function import code ---*/
  /*--- Execution code ---*/

  /* "_gldraw.pyx":29
 * # This line makes cython happy
 * global __name__, __package__    # pylint: disable=W0604
 * __compiled = True #px/             # <<<<<<<<<<<<<<
 * #px __compiled = False
 * 
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____compiled, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_gldraw.pyx":32
 * #px __compiled = False
 * 
 * __all__ = ['VERTEX_ATTRIB_LOCATION', 'NORMAL_ATTRIB_LOCATION', 'COLOR_ATTRIB_LOCATION', 'TEXCOORD_ATTRIB_LOCATION',             # <<<<<<<<<<<<<<
 *            'gl_draw_cube', 'gl_pick_cube', 'gl_init_buffers', 'gl_delete_buffers',
 *            'gl_draw_cube_debug', 'gl_init_object_location']
 */
  __pyx_t_1 = PyList_New(10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_n_u_2));
  PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_u_2));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_u_2));
  __Pyx_INCREF(((PyObject *)__pyx_n_u_3));
  PyList_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_n_u_3));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_u_3));
  __Pyx_INCREF(((PyObject *)__pyx_n_u_4));
  PyList_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_n_u_4));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_u_4));
  __Pyx_INCREF(((PyObject *)__pyx_n_u_5));
  PyList_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_n_u_5));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_u_5));
  __Pyx_INCREF(((PyObject *)__pyx_n_u__gl_draw_cube));
  PyList_SET_ITEM(__pyx_t_1, 4, ((PyObject *)__pyx_n_u__gl_draw_cube));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_u__gl_draw_cube));
  __Pyx_INCREF(((PyObject *)__pyx_n_u__gl_pick_cube));
  PyList_SET_ITEM(__pyx_t_1, 5, ((PyObject *)__pyx_n_u__gl_pick_cube));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_u__gl_pick_cube));
  __Pyx_INCREF(((PyObject *)__pyx_n_u__gl_init_buffers));
  PyList_SET_ITEM(__pyx_t_1, 6, ((PyObject *)__pyx_n_u__gl_init_buffers));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_u__gl_init_buffers));
  __Pyx_INCREF(((PyObject *)__pyx_n_u__gl_delete_buffers));
  PyList_SET_ITEM(__pyx_t_1, 7, ((PyObject *)__pyx_n_u__gl_delete_buffers));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_u__gl_delete_buffers));
  __Pyx_INCREF(((PyObject *)__pyx_n_u__gl_draw_cube_debug));
  PyList_SET_ITEM(__pyx_t_1, 8, ((PyObject *)__pyx_n_u__gl_draw_cube_debug));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_u__gl_draw_cube_debug));
  __Pyx_INCREF(((PyObject *)__pyx_n_u_6));
  PyList_SET_ITEM(__pyx_t_1, 9, ((PyObject *)__pyx_n_u_6));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_u_6));
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____all__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "_gldraw.pyx":36
 *            'gl_draw_cube_debug', 'gl_init_object_location']
 * 
 * from .debug import debug  # pylint: disable=W0614,W0401             # <<<<<<<<<<<<<<
 * 
 * from gl cimport * #pxd/
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__debug));
  PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__debug));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__debug));
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__debug), ((PyObject *)__pyx_t_1), 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__debug);
  if (__pyx_t_1 == NULL) {
    if (PyErr_ExceptionMatches(PyExc_AttributeError)) __Pyx_RaiseImportError(__pyx_n_s__debug);
    if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__debug, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "_gldraw.pyx":44
 * 
 * 
 * debug('Importing module:', __name__)             # <<<<<<<<<<<<<<
 * debug('  from package:', __package__)
 * debug('  compiled:', __compiled)
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__debug); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s____name__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_kp_u_7));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_u_7));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_7));
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_gldraw.pyx":45
 * 
 * debug('Importing module:', __name__)
 * debug('  from package:', __package__)             # <<<<<<<<<<<<<<
 * debug('  compiled:', __compiled)
 * 
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__debug); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s____package__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_kp_u_8));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_u_8));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_8));
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "_gldraw.pyx":46
 * debug('Importing module:', __name__)
 * debug('  from package:', __package__)
 * debug('  compiled:', __compiled)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__debug); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s____compiled); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_kp_u_9));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_u_9));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_u_9));
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "_gldraw.pyx":110
 * 
 * 
 * def init_module():             # <<<<<<<<<<<<<<
 *     cdef int i #px+
 * 
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7_gldraw_1init_module, NULL, __pyx_n_s___gldraw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__init_module, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "_gldraw.pyx":122
 *     animation.angle = animation.angle_max = 0
 * 
 * def set_transformations(blocks):             # <<<<<<<<<<<<<<
 *     cdef unsigned int b,i,j #px+
 *     for b in range(cube.number_blocks):
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7_gldraw_3set_transformations, NULL, __pyx_n_s___gldraw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__set_transformations, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "_gldraw.pyx":1
 * #-*- coding:utf-8 -*-             # <<<<<<<<<<<<<<
 * # cython: profile=False
 * 
 */
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  if (__pyx_m) {
    __Pyx_AddTraceback("init _gldraw", __pyx_clineno, __pyx_lineno, __pyx_filename);
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init _gldraw");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if PY_MAJOR_VERSION < 3
  return;
  #else
  return __pyx_m;
  #endif
}

/* Runtime support code */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule((char *)modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif /* CYTHON_REFNANNY */

static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
    PyObject *result;
    result = PyObject_GetAttr(dict, name);
    if (!result) {
        if (dict != __pyx_b) {
            PyErr_Clear();
            result = PyObject_GetAttr(__pyx_b, name);
        }
        if (!result) {
            PyErr_SetObject(PyExc_NameError, name);
        }
    }
    return result;
}

static double __Pyx__PyObject_AsDouble(PyObject* obj) {
    PyObject* float_value;
#if CYTHON_COMPILING_IN_PYPY
    float_value = PyNumber_Float(obj);
#else
    if (Py_TYPE(obj)->tp_as_number && Py_TYPE(obj)->tp_as_number->nb_float) {
        return PyFloat_AsDouble(obj);
    } else if (PyUnicode_CheckExact(obj) || PyBytes_CheckExact(obj)) {
#if PY_MAJOR_VERSION >= 3
        float_value = PyFloat_FromString(obj);
#else
        float_value = PyFloat_FromString(obj, 0);
#endif
    } else {
        PyObject* args = PyTuple_New(1);
        if (unlikely(!args)) goto bad;
        PyTuple_SET_ITEM(args, 0, obj);
        float_value = PyObject_Call((PyObject*)&PyFloat_Type, args, 0);
        PyTuple_SET_ITEM(args, 0, 0);
        Py_DECREF(args);
    }
#endif
    if (likely(float_value)) {
        double value = PyFloat_AS_DOUBLE(float_value);
        Py_DECREF(float_value);
        return value;
    }
bad:
    return (double)-1;
}

static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
    PyErr_Format(PyExc_ValueError,
                 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}

static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%s to unpack",
                 index, (index == 1) ? "" : "s");
}

static CYTHON_INLINE int __Pyx_IterFinish(void) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    PyObject* exc_type = tstate->curexc_type;
    if (unlikely(exc_type)) {
        if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
            PyObject *exc_value, *exc_tb;
            exc_value = tstate->curexc_value;
            exc_tb = tstate->curexc_traceback;
            tstate->curexc_type = 0;
            tstate->curexc_value = 0;
            tstate->curexc_traceback = 0;
            Py_DECREF(exc_type);
            Py_XDECREF(exc_value);
            Py_XDECREF(exc_tb);
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#else
    if (unlikely(PyErr_Occurred())) {
        if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
            PyErr_Clear();
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#endif
}

static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
    if (unlikely(retval)) {
        Py_DECREF(retval);
        __Pyx_RaiseTooManyValuesError(expected);
        return -1;
    } else {
        return __Pyx_IterFinish();
    }
    return 0;
}

static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *more_or_less;
    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%s() takes %s %" CYTHON_FORMAT_SSIZE_T "d positional argument%s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AsString(kw_name));
        #endif
}

static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;
    while (PyDict_Next(kwds, &pos, &key, &value)) {
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
            continue;
        }
        name = first_kw_arg;
        #if PY_MAJOR_VERSION < 3
        if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
            while (*name) {
                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
                        && _PyString_Eq(**name, key)) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    if ((**argname == key) || (
                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
                             && _PyString_Eq(**argname, key))) {
                        goto arg_passed_twice;
                    }
                    argname++;
                }
            }
        } else
        #endif
        if (likely(PyUnicode_Check(key))) {
            while (*name) {
                int cmp = (**name == key) ? 0 :
                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                    (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                #endif
                    PyUnicode_Compare(**name, key);
                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                if (cmp == 0) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    int cmp = (**argname == key) ? 0 :
                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                        (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                    #endif
                        PyUnicode_Compare(**argname, key);
                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                    if (cmp == 0) goto arg_passed_twice;
                    argname++;
                }
            }
        } else
            goto invalid_keyword_type;
        if (kwds2) {
            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
        } else {
            goto invalid_keyword;
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%s() got an unexpected keyword argument '%s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
    const char *name, int exact)
{
    if (!type) {
        PyErr_Format(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (none_allowed && obj == Py_None) return 1;
    else if (exact) {
        if (Py_TYPE(obj) == type) return 1;
    }
    else {
        if (PyObject_TypeCheck(obj, type)) return 1;
    }
    PyErr_Format(PyExc_TypeError,
        "Argument '%s' has incorrect type (expected %s, got %s)",
        name, type->tp_name, Py_TYPE(obj)->tp_name);
    return 0;
}

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, long level) {
    PyObject *py_import = 0;
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    py_import = __Pyx_GetAttrString(__pyx_b, "__import__");
    if (!py_import)
        goto bad;
    if (from_list)
        list = from_list;
    else {
        empty_list = PyList_New(0);
        if (!empty_list)
            goto bad;
        list = empty_list;
    }
    global_dict = PyModule_GetDict(__pyx_m);
    if (!global_dict)
        goto bad;
    empty_dict = PyDict_New();
    if (!empty_dict)
        goto bad;
    #if PY_VERSION_HEX >= 0x02050000
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if (strchr(__Pyx_MODULE_NAME, '.')) {
                /* try package relative import first */
                PyObject *py_level = PyInt_FromLong(1);
                if (!py_level)
                    goto bad;
                module = PyObject_CallFunctionObjArgs(py_import,
                    name, global_dict, empty_dict, list, py_level, NULL);
                Py_DECREF(py_level);
                if (!module) {
                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0; /* try absolute import on failure */
        }
        #endif
        if (!module) {
            PyObject *py_level = PyInt_FromLong(level);
            if (!py_level)
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, global_dict, empty_dict, list, py_level, NULL);
            Py_DECREF(py_level);
        }
    }
    #else
    if (level>0) {
        PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4.");
        goto bad;
    }
    module = PyObject_CallFunctionObjArgs(py_import,
        name, global_dict, empty_dict, list, NULL);
    #endif
bad:
    Py_XDECREF(empty_list);
    Py_XDECREF(py_import);
    Py_XDECREF(empty_dict);
    return module;
}

static CYTHON_INLINE void __Pyx_RaiseImportError(PyObject *name) {
#if PY_MAJOR_VERSION < 3
    PyErr_Format(PyExc_ImportError, "cannot import name %.230s",
                 PyString_AsString(name));
#else
    PyErr_Format(PyExc_ImportError, "cannot import name %S", name);
#endif
}

static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
    const unsigned char neg_one = (unsigned char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned char" :
                    "value too large to convert to unsigned char");
            }
            return (unsigned char)-1;
        }
        return (unsigned char)val;
    }
    return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
    const unsigned short neg_one = (unsigned short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned short" :
                    "value too large to convert to unsigned short");
            }
            return (unsigned short)-1;
        }
        return (unsigned short)val;
    }
    return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
    const unsigned int neg_one = (unsigned int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned int" :
                    "value too large to convert to unsigned int");
            }
            return (unsigned int)-1;
        }
        return (unsigned int)val;
    }
    return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
    const char neg_one = (char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to char" :
                    "value too large to convert to char");
            }
            return (char)-1;
        }
        return (char)val;
    }
    return (char)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
    const short neg_one = (short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to short" :
                    "value too large to convert to short");
            }
            return (short)-1;
        }
        return (short)val;
    }
    return (short)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
    const int neg_one = (int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to int" :
                    "value too large to convert to int");
            }
            return (int)-1;
        }
        return (int)val;
    }
    return (int)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
    const signed char neg_one = (signed char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed char" :
                    "value too large to convert to signed char");
            }
            return (signed char)-1;
        }
        return (signed char)val;
    }
    return (signed char)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
    const signed short neg_one = (signed short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed short" :
                    "value too large to convert to signed short");
            }
            return (signed short)-1;
        }
        return (signed short)val;
    }
    return (signed short)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
    const signed int neg_one = (signed int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed int" :
                    "value too large to convert to signed int");
            }
            return (signed int)-1;
        }
        return (signed int)val;
    }
    return (signed int)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) {
    const int neg_one = (int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to int" :
                    "value too large to convert to int");
            }
            return (int)-1;
        }
        return (int)val;
    }
    return (int)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
    const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to unsigned long");
            return (unsigned long)-1;
        }
        return (unsigned long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to unsigned long");
                return (unsigned long)-1;
            }
            return (unsigned long)PyLong_AsUnsignedLong(x);
        } else {
            return (unsigned long)PyLong_AsLong(x);
        }
    } else {
        unsigned long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (unsigned long)-1;
        val = __Pyx_PyInt_AsUnsignedLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
    const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to unsigned PY_LONG_LONG");
            return (unsigned PY_LONG_LONG)-1;
        }
        return (unsigned PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to unsigned PY_LONG_LONG");
                return (unsigned PY_LONG_LONG)-1;
            }
            return (unsigned PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
        } else {
            return (unsigned PY_LONG_LONG)PyLong_AsLongLong(x);
        }
    } else {
        unsigned PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (unsigned PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
    const long neg_one = (long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to long");
            return (long)-1;
        }
        return (long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to long");
                return (long)-1;
            }
            return (long)PyLong_AsUnsignedLong(x);
        } else {
            return (long)PyLong_AsLong(x);
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (long)-1;
        val = __Pyx_PyInt_AsLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
    const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to PY_LONG_LONG");
            return (PY_LONG_LONG)-1;
        }
        return (PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to PY_LONG_LONG");
                return (PY_LONG_LONG)-1;
            }
            return (PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
        } else {
            return (PY_LONG_LONG)PyLong_AsLongLong(x);
        }
    } else {
        PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
    const signed long neg_one = (signed long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to signed long");
            return (signed long)-1;
        }
        return (signed long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to signed long");
                return (signed long)-1;
            }
            return (signed long)PyLong_AsUnsignedLong(x);
        } else {
            return (signed long)PyLong_AsLong(x);
        }
    } else {
        signed long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (signed long)-1;
        val = __Pyx_PyInt_AsSignedLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
    const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to signed PY_LONG_LONG");
            return (signed PY_LONG_LONG)-1;
        }
        return (signed PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to signed PY_LONG_LONG");
                return (signed PY_LONG_LONG)-1;
            }
            return (signed PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
        } else {
            return (signed PY_LONG_LONG)PyLong_AsLongLong(x);
        }
    } else {
        signed PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (signed PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsSignedLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static int __Pyx_check_binary_version(void) {
    char ctversion[4], rtversion[4];
    PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
    PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
    if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compiletime version %s of module '%.100s' "
                      "does not match runtime version %s",
                      ctversion, __Pyx_MODULE_NAME, rtversion);
        #if PY_VERSION_HEX < 0x02050000
        return PyErr_Warn(NULL, message);
        #else
        return PyErr_WarnEx(NULL, message, 1);
        #endif
    }
    return 0;
}

static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) {
    PyObject *d = 0;
    PyObject *cobj = 0;
    union {
        void (*fp)(void);
        void *p;
    } tmp;
    d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__");
    if (!d) {
        PyErr_Clear();
        d = PyDict_New();
        if (!d)
            goto bad;
        Py_INCREF(d);
        if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0)
            goto bad;
    }
    tmp.fp = f;
#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0)
    cobj = PyCapsule_New(tmp.p, sig, 0);
#else
    cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0);
#endif
    if (!cobj)
        goto bad;
    if (PyDict_SetItemString(d, name, cobj) < 0)
        goto bad;
    Py_DECREF(cobj);
    Py_DECREF(d);
    return 0;
bad:
    Py_XDECREF(cobj);
    Py_XDECREF(d);
    return -1;
}

static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
    int start = 0, mid = 0, end = count - 1;
    if (end >= 0 && code_line > entries[end].code_line) {
        return count;
    }
    while (start < end) {
        mid = (start + end) / 2;
        if (code_line < entries[mid].code_line) {
            end = mid;
        } else if (code_line > entries[mid].code_line) {
             start = mid + 1;
        } else {
            return mid;
        }
    }
    if (code_line <= entries[mid].code_line) {
        return mid;
    } else {
        return mid + 1;
    }
}
static PyCodeObject *__pyx_find_code_object(int code_line) {
    PyCodeObject* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = __pyx_code_cache.entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            __pyx_code_cache.entries = entries;
            __pyx_code_cache.max_count = 64;
            __pyx_code_cache.count = 1;
            entries[0].code_line = code_line;
            entries[0].code_object = code_object;
            Py_INCREF(code_object);
        }
        return;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
        PyCodeObject* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_DECREF(tmp);
        return;
    }
    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
        int new_max = __pyx_code_cache.max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            __pyx_code_cache.entries, new_max*sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        __pyx_code_cache.entries = entries;
        __pyx_code_cache.max_count = new_max;
    }
    for (i=__pyx_code_cache.count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    __pyx_code_cache.count++;
    Py_INCREF(code_object);
}

#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    #if PY_MAJOR_VERSION < 3
    py_srcfile = PyString_FromString(filename);
    #else
    py_srcfile = PyUnicode_FromString(filename);
    #endif
    if (!py_srcfile) goto bad;
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        #else
        py_funcname = PyUnicode_FromString(funcname);
        #endif
    }
    if (!py_funcname) goto bad;
    py_code = __Pyx_PyCode_New(
        0,            /*int argcount,*/
        0,            /*int kwonlyargcount,*/
        0,            /*int nlocals,*/
        0,            /*int stacksize,*/
        0,            /*int flags,*/
        __pyx_empty_bytes, /*PyObject *code,*/
        __pyx_empty_tuple, /*PyObject *consts,*/
        __pyx_empty_tuple, /*PyObject *names,*/
        __pyx_empty_tuple, /*PyObject *varnames,*/
        __pyx_empty_tuple, /*PyObject *freevars,*/
        __pyx_empty_tuple, /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        py_line,      /*int firstlineno,*/
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    Py_DECREF(py_srcfile);
    Py_DECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyObject *py_globals = 0;
    PyFrameObject *py_frame = 0;
    py_code = __pyx_find_code_object(c_line ? c_line : py_line);
    if (!py_code) {
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) goto bad;
        __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
    }
    py_globals = PyModule_GetDict(__pyx_m);
    if (!py_globals) goto bad;
    py_frame = PyFrame_New(
        PyThreadState_GET(), /*PyThreadState *tstate,*/
        py_code,             /*PyCodeObject *code,*/
        py_globals,          /*PyObject *globals,*/
        0                    /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    py_frame->f_lineno = py_line;
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION < 3
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        #else  /* Python 3+ has unicode identifiers */
        if (t->is_unicode | t->is_str) {
            if (t->intern) {
                *t->p = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
            } else {
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        #endif
        if (!*t->p)
            return -1;
        ++t;
    }
    return 0;
}


/* Type Conversion Functions */

static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}

static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
  PyNumberMethods *m;
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_VERSION_HEX < 0x03000000
  if (PyInt_Check(x) || PyLong_Check(x))
#else
  if (PyLong_Check(x))
#endif
    return Py_INCREF(x), x;
  m = Py_TYPE(x)->tp_as_number;
#if PY_VERSION_HEX < 0x03000000
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = PyNumber_Long(x);
  }
#else
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Long(x);
  }
#endif
  if (res) {
#if PY_VERSION_HEX < 0x03000000
    if (!PyInt_Check(res) && !PyLong_Check(res)) {
#else
    if (!PyLong_Check(res)) {
#endif
      PyErr_Format(PyExc_TypeError,
                   "__%s__ returned non-%s (type %.200s)",
                   name, name, Py_TYPE(res)->tp_name);
      Py_DECREF(res);
      return NULL;
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}

static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject* x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}

static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
#if PY_VERSION_HEX < 0x02050000
   if (ival <= LONG_MAX)
       return PyInt_FromLong((long)ival);
   else {
       unsigned char *bytes = (unsigned char *) &ival;
       int one = 1; int little = (int)*(unsigned char*)&one;
       return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
   }
#else
   return PyInt_FromSize_t(ival);
#endif
}

static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
   unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
   if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) {
       return (size_t)-1;
   } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
       PyErr_SetString(PyExc_OverflowError,
                       "value too large to convert to size_t");
       return (size_t)-1;
   }
   return (size_t)val;
}


#endif /* Py_PYTHON_H */
