/* Generated by Cython 0.23.5 */

#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 < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
    #error Cython requires Python 2.6+ or Python 3.2+.
#else
#define CYTHON_ABI "0_23_5"
#include <stddef.h>
#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 !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000
#define CYTHON_USE_PYLONG_INTERNALS 1
#endif
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
#define Py_OptimizeFlag 0
#endif
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#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+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  #define __Pyx_DefaultClassType PyClass_Type
#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)
  #define __Pyx_DefaultClassType PyType_Type
#endif
#ifndef Py_TPFLAGS_CHECKTYPES
  #define Py_TPFLAGS_CHECKTYPES 0
#endif
#ifndef Py_TPFLAGS_HAVE_INDEX
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif
#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#ifndef Py_TPFLAGS_HAVE_FINALIZE
  #define Py_TPFLAGS_HAVE_FINALIZE 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_KIND(u)         PyUnicode_KIND(u)
  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
  #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_KIND(u)         (sizeof(Py_UNICODE))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
#endif
#if CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
#else
  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
  #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
#endif
#define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
#else
  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
#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_MAJOR_VERSION >= 3
  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
#else
  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
#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
  #define PyNumber_Int                 PyNumber_Long
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif
#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
  #ifndef PyUnicode_InternFromString
    #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
  #endif
#endif
#if PY_VERSION_HEX < 0x030200A4
  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
  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
#else
  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
#endif
#if PY_VERSION_HEX >= 0x030500B1
#define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
#define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
#elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
typedef struct {
    unaryfunc am_await;
    unaryfunc am_aiter;
    unaryfunc am_anext;
} __Pyx_PyAsyncMethodsStruct;
#define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
#else
#define __Pyx_PyType_AsAsync(obj) NULL
#endif
#ifndef CYTHON_RESTRICT
  #if defined(__GNUC__)
    #define CYTHON_RESTRICT __restrict__
  #elif defined(_MSC_VER) && _MSC_VER >= 1400
    #define CYTHON_RESTRICT __restrict
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_RESTRICT restrict
  #else
    #define CYTHON_RESTRICT
  #endif
#endif
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)

#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

#if defined(WIN32) || defined(MS_WINDOWS)
  #define _USE_MATH_DEFINES
#endif
#include <math.h>
#ifdef NAN
#define __PYX_NAN() ((float) NAN)
#else
static CYTHON_INLINE float __PYX_NAN() {
  float value;
  memset(&value, 0xFF, sizeof(value));
  return value;
}
#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_Divide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
#endif

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

#define __PYX_HAVE__renpy__angle__gldraw
#define __PYX_HAVE_API__renpy__angle__gldraw
#include "string.h"
#include "stdlib.h"
#include "stdint.h"
#include "stdio.h"
#include "stddef.h"
#include "SDL.h"
#include "glcompat.h"
#include "pygame_sdl2/pygame_sdl2.h"
#include "eglsupport.h"
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

#ifdef PYREX_WITHOUT_ASSERTIONS
#define CYTHON_WITHOUT_ASSERTIONS
#endif

#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
#ifndef CYTHON_NCP_UNUSED
# if CYTHON_COMPILING_IN_CPYTHON
#  define CYTHON_NCP_UNUSED
# else
#  define CYTHON_NCP_UNUSED CYTHON_UNUSED
# endif
#endif
typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
                const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;

#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
#define __PYX_DEFAULT_STRING_ENCODING ""
#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#define __Pyx_uchar_cast(c) ((unsigned char)c)
#define __Pyx_long_cast(x) ((long)x)
#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
    (sizeof(type) < sizeof(Py_ssize_t))  ||\
    (sizeof(type) > sizeof(Py_ssize_t) &&\
          likely(v < (type)PY_SSIZE_T_MAX ||\
                 v == (type)PY_SSIZE_T_MAX)  &&\
          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
                                v == (type)PY_SSIZE_T_MIN)))  ||\
    (sizeof(type) == sizeof(Py_ssize_t) &&\
          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
                               v == (type)PY_SSIZE_T_MAX)))  )
#if defined (__cplusplus) && __cplusplus >= 201103L
    #include <cstdlib>
    #define __Pyx_sst_abs(value) std::abs(value)
#elif SIZEOF_INT >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) abs(value)
#elif SIZEOF_LONG >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) labs(value)
#elif defined (_MSC_VER) && defined (_M_X64)
    #define __Pyx_sst_abs(value) _abs64(value)
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define __Pyx_sst_abs(value) llabs(value)
#elif defined (__GNUC__)
    #define __Pyx_sst_abs(value) __builtin_llabs(value)
#else
    #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
#endif
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
#define __Pyx_PyBytes_FromString        PyBytes_FromString
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#if PY_MAJOR_VERSION < 3
    #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#else
    #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
#endif
#define __Pyx_PyObject_AsSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
#define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
#define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
#define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
#if PY_MAJOR_VERSION < 3
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
{
    const Py_UNICODE *u_end = u;
    while (*u_end++) ;
    return (size_t)(u_end - u - 1);
}
#else
#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
#endif
#define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(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);
#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))
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
static int __Pyx_sys_getdefaultencoding_not_ascii;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    PyObject* ascii_chars_u = NULL;
    PyObject* ascii_chars_b = NULL;
    const char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    if (strcmp(default_encoding_c, "ascii") == 0) {
        __Pyx_sys_getdefaultencoding_not_ascii = 0;
    } else {
        char ascii_chars[128];
        int c;
        for (c = 0; c < 128; c++) {
            ascii_chars[c] = c;
        }
        __Pyx_sys_getdefaultencoding_not_ascii = 1;
        ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
        if (!ascii_chars_u) goto bad;
        ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
        if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
            PyErr_Format(
                PyExc_ValueError,
                "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
                default_encoding_c);
            goto bad;
        }
        Py_DECREF(ascii_chars_u);
        Py_DECREF(ascii_chars_b);
    }
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    Py_XDECREF(ascii_chars_u);
    Py_XDECREF(ascii_chars_b);
    return -1;
}
#endif
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
#else
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
static char* __PYX_DEFAULT_STRING_ENCODING;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
    if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
    strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    return -1;
}
#endif
#endif


/* Test for GCC > 2.95 */
#if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
  #define likely(x)   __builtin_expect(!!(x), 1)
  #define unlikely(x) __builtin_expect(!!(x), 0)
#else /* !__GNUC__ or GCC < 2.95 */
  #define likely(x)   (x)
  #define unlikely(x) (x)
#endif /* __GNUC__ */

static PyObject *__pyx_m;
static PyObject *__pyx_d;
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[] = {
  "renpy/angle/gldraw.pyx",
  "renpy/angle/gldraw.pxd",
  "renpy/display/render.pxd",
  "renpy/angle/gltexture.pxd",
};

/*--- Type declarations ---*/
struct __pyx_obj_5renpy_7display_6render_Matrix2D;
struct __pyx_obj_5renpy_7display_6render_Render;
struct __pyx_obj_5renpy_5angle_9gltexture_TextureCore;
struct __pyx_obj_5renpy_5angle_9gltexture_TextureGrid;
struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw;
struct __pyx_obj_5renpy_5angle_6gldraw_Environ;
struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct__init;
struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct_1_render_to_texture;
struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct_2_get_half;
struct __pyx_opt_args_5renpy_7display_6render_6Render_blit;
struct __pyx_opt_args_5renpy_7display_6render_6Render_subpixel_blit;
struct __pyx_opt_args_5renpy_7display_6render_6Render_absolute_blit;

/* "renpy/display/render.pxd":71
 *     cdef public bint text_input
 * 
 *     cpdef int blit(Render self, source, tuple pos, object focus=*, object main=*, object index=*)             # <<<<<<<<<<<<<<
 *     cpdef int subpixel_blit(Render self, source, tuple pos, object focus=*, object main=*, object index=*)
 *     cpdef int absolute_blit(Render self, source, tuple pos, object focus=*, object main=*, object index=*)
 */
struct __pyx_opt_args_5renpy_7display_6render_6Render_blit {
  int __pyx_n;
  PyObject *focus;
  PyObject *main;
  PyObject *index;
};

/* "renpy/display/render.pxd":72
 * 
 *     cpdef int blit(Render self, source, tuple pos, object focus=*, object main=*, object index=*)
 *     cpdef int subpixel_blit(Render self, source, tuple pos, object focus=*, object main=*, object index=*)             # <<<<<<<<<<<<<<
 *     cpdef int absolute_blit(Render self, source, tuple pos, object focus=*, object main=*, object index=*)
 * 
 */
struct __pyx_opt_args_5renpy_7display_6render_6Render_subpixel_blit {
  int __pyx_n;
  PyObject *focus;
  PyObject *main;
  PyObject *index;
};

/* "renpy/display/render.pxd":73
 *     cpdef int blit(Render self, source, tuple pos, object focus=*, object main=*, object index=*)
 *     cpdef int subpixel_blit(Render self, source, tuple pos, object focus=*, object main=*, object index=*)
 *     cpdef int absolute_blit(Render self, source, tuple pos, object focus=*, object main=*, object index=*)             # <<<<<<<<<<<<<<
 * 
 * 
 */
struct __pyx_opt_args_5renpy_7display_6render_6Render_absolute_blit {
  int __pyx_n;
  PyObject *focus;
  PyObject *main;
  PyObject *index;
};

/* "renpy/display/render.pxd":22
 * # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 * 
 * cdef class Matrix2D:             # <<<<<<<<<<<<<<
 *     cdef public double xdx
 *     cdef public double xdy
 */
struct __pyx_obj_5renpy_7display_6render_Matrix2D {
  PyObject_HEAD
  struct __pyx_vtabstruct_5renpy_7display_6render_Matrix2D *__pyx_vtab;
  double xdx;
  double xdy;
  double ydx;
  double ydy;
};


/* "renpy/display/render.pxd":31
 *     cpdef bint is_unit_aligned(Matrix2D self)
 * 
 * cdef class Render:             # <<<<<<<<<<<<<<
 * 
 *     cdef public bint mark, cache_killed
 */
struct __pyx_obj_5renpy_7display_6render_Render {
  PyObject_HEAD
  struct __pyx_vtabstruct_5renpy_7display_6render_Render *__pyx_vtab;
  int mark;
  int cache_killed;
  float width;
  float height;
  PyObject *layer_name;
  PyObject *children;
  PyObject *parents;
  PyObject *depends_on_list;
  int operation;
  double operation_complete;
  int operation_alpha;
  PyObject *operation_parameter;
  struct __pyx_obj_5renpy_7display_6render_Matrix2D *forward;
  struct __pyx_obj_5renpy_7display_6render_Matrix2D *reverse;
  double alpha;
  double over;
  PyObject *nearest;
  PyObject *focuses;
  PyObject *pass_focuses;
  PyObject *focus_screen;
  PyObject *draw_func;
  PyObject *render_of;
  int opaque;
  PyObject *visible_children;
  int xclipping;
  int yclipping;
  PyObject *surface;
  PyObject *alpha_surface;
  PyObject *half_cache;
  int modal;
  int text_input;
};


/* "gltexture.pxd":28
 * from gldraw cimport Environ
 * 
 * cdef class TextureCore:             # <<<<<<<<<<<<<<
 *     cdef public int width
 *     cdef public int height
 */
struct __pyx_obj_5renpy_5angle_9gltexture_TextureCore {
  PyObject_HEAD
  struct __pyx_vtabstruct_5renpy_5angle_9gltexture_TextureCore *__pyx_vtab;
  int width;
  int height;
  int generation;
  unsigned int number;
  int format;
  double xmul;
  double xadd;
  double ymul;
  double yadd;
  PyObject *premult;
  PyObject *premult_size;
  int premult_left;
  int premult_right;
  int premult_top;
  int premult_bottom;
  int nearest;
  PyObject *free_list;
  PyObject *debug;
};


/* "gltexture.pxd":54
 *     cdef public object debug
 * 
 * cdef class TextureGrid:             # <<<<<<<<<<<<<<
 * 
 *     cdef public int width
 */
struct __pyx_obj_5renpy_5angle_9gltexture_TextureGrid {
  PyObject_HEAD
  struct __pyx_vtabstruct_5renpy_5angle_9gltexture_TextureGrid *__pyx_vtab;
  int width;
  int height;
  PyObject *rows;
  PyObject *columns;
  PyObject *tiles;
  struct __pyx_obj_5renpy_5angle_9gltexture_TextureGrid *half_cache;
  PyObject *debug;
};


/* "renpy/angle/gldraw.pxd":29
 * cdef class Environ
 * 
 * cdef class GLDraw:             # <<<<<<<<<<<<<<
 * 
 *     cdef bint did_init
 */
struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw {
  PyObject_HEAD
  struct __pyx_vtabstruct_5renpy_5angle_6gldraw_GLDraw *__pyx_vtab;
  int did_init;
  int did_texture_test;
  struct __pyx_obj_5renpy_5angle_6gldraw_Environ *environ;
  PyObject *rtt;
  PyObject *window;
  PyObject *virtual_size;
  PyObject *physical_size;
  PyObject *drawable_size;
  PyObject *virtual_box;
  PyObject *physical_box;
  PyObject *mouse_old_visible;
  PyObject *mouse_info;
  PyObject *texture_cache;
  double last_redraw_time;
  double redraw_period;
  PyObject *info;
  PyObject *old_fullscreen;
  PyObject *fullscreen_surface;
  PyObject *display_info;
  PyObject *clip_cache;
  int fast_dissolve;
  int always_opaque;
  int allow_fixed;
  PyObject *default_clip;
  int did_render_to_texture;
  float dpi_scale;
  PyObject *clip_rtt_box;
  PyObject *draw_per_virt;
  struct __pyx_obj_5renpy_7display_6render_Matrix2D *virt_to_draw;
  struct __pyx_obj_5renpy_7display_6render_Matrix2D *draw_to_virt;
};


/* "renpy/angle/gldraw.pxd":27
 * cimport renpy.display.render as render
 * 
 * cdef class Environ             # <<<<<<<<<<<<<<
 * 
 * cdef class GLDraw:
 */
struct __pyx_obj_5renpy_5angle_6gldraw_Environ {
  PyObject_HEAD
  struct __pyx_vtabstruct_5renpy_5angle_6gldraw_Environ *__pyx_vtab;
};


/* "renpy/angle/gldraw.pyx":438
 *         self.old_fullscreen = None
 * 
 *     def init(self):             # <<<<<<<<<<<<<<
 *         """
 *         This does the first-time initialization of OpenGL, deciding
 */
struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct__init {
  PyObject_HEAD
  PyObject *__pyx_v_extensions;
};


/* "renpy/angle/gldraw.pyx":1043
 *         return 0
 * 
 *     def render_to_texture(self, what, alpha):             # <<<<<<<<<<<<<<
 * 
 *         width = int(what.width * self.draw_per_virt)
 */
struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct_1_render_to_texture {
  PyObject_HEAD
  PyObject *__pyx_v_alpha;
  PyObject *__pyx_v_height;
  struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self;
  PyObject *__pyx_v_what;
  PyObject *__pyx_v_width;
};


/* "renpy/angle/gldraw.pyx":1120
 * 
 * 
 *     def get_half(self, what):             # <<<<<<<<<<<<<<
 *         """
 *         Gets a texture grid that's half the size of what..
 */
struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct_2_get_half {
  PyObject_HEAD
  struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_draw;
  PyObject *__pyx_v_height;
  PyObject *__pyx_v_reverse;
  PyObject *__pyx_v_what;
  PyObject *__pyx_v_width;
};



/* "renpy/display/render.pxd":22
 * # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 * 
 * cdef class Matrix2D:             # <<<<<<<<<<<<<<
 *     cdef public double xdx
 *     cdef public double xdy
 */

struct __pyx_vtabstruct_5renpy_7display_6render_Matrix2D {
  PyObject *(*transform)(struct __pyx_obj_5renpy_7display_6render_Matrix2D *, double, double, int __pyx_skip_dispatch);
  int (*is_unit_aligned)(struct __pyx_obj_5renpy_7display_6render_Matrix2D *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_5renpy_7display_6render_Matrix2D *__pyx_vtabptr_5renpy_7display_6render_Matrix2D;


/* "renpy/display/render.pxd":31
 *     cpdef bint is_unit_aligned(Matrix2D self)
 * 
 * cdef class Render:             # <<<<<<<<<<<<<<
 * 
 *     cdef public bint mark, cache_killed
 */

struct __pyx_vtabstruct_5renpy_7display_6render_Render {
  int (*blit)(struct __pyx_obj_5renpy_7display_6render_Render *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_5renpy_7display_6render_6Render_blit *__pyx_optional_args);
  int (*subpixel_blit)(struct __pyx_obj_5renpy_7display_6render_Render *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_5renpy_7display_6render_6Render_subpixel_blit *__pyx_optional_args);
  int (*absolute_blit)(struct __pyx_obj_5renpy_7display_6render_Render *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_5renpy_7display_6render_6Render_absolute_blit *__pyx_optional_args);
};
static struct __pyx_vtabstruct_5renpy_7display_6render_Render *__pyx_vtabptr_5renpy_7display_6render_Render;


/* "gltexture.pxd":28
 * from gldraw cimport Environ
 * 
 * cdef class TextureCore:             # <<<<<<<<<<<<<<
 *     cdef public int width
 *     cdef public int height
 */

struct __pyx_vtabstruct_5renpy_5angle_9gltexture_TextureCore {
  void (*make_ready)(struct __pyx_obj_5renpy_5angle_9gltexture_TextureCore *);
  void (*make_nearest)(struct __pyx_obj_5renpy_5angle_9gltexture_TextureCore *);
  void (*make_linear)(struct __pyx_obj_5renpy_5angle_9gltexture_TextureCore *);
  int (*allocate)(struct __pyx_obj_5renpy_5angle_9gltexture_TextureCore *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_5renpy_5angle_9gltexture_TextureCore *__pyx_vtabptr_5renpy_5angle_9gltexture_TextureCore;


/* "gltexture.pxd":54
 *     cdef public object debug
 * 
 * cdef class TextureGrid:             # <<<<<<<<<<<<<<
 * 
 *     cdef public int width
 */

struct __pyx_vtabstruct_5renpy_5angle_9gltexture_TextureGrid {
  void (*make_ready)(struct __pyx_obj_5renpy_5angle_9gltexture_TextureGrid *, int);
};
static struct __pyx_vtabstruct_5renpy_5angle_9gltexture_TextureGrid *__pyx_vtabptr_5renpy_5angle_9gltexture_TextureGrid;


/* "renpy/angle/gldraw.pyx":1366
 * 
 * 
 * cdef class Environ(object):             # <<<<<<<<<<<<<<
 * 
 *     cdef void blit(self):
 */

struct __pyx_vtabstruct_5renpy_5angle_6gldraw_Environ {
  void (*blit)(struct __pyx_obj_5renpy_5angle_6gldraw_Environ *);
  void (*blend)(struct __pyx_obj_5renpy_5angle_6gldraw_Environ *, double);
  void (*imageblend)(struct __pyx_obj_5renpy_5angle_6gldraw_Environ *, double, int);
  void (*set_vertex)(struct __pyx_obj_5renpy_5angle_6gldraw_Environ *, float *);
  void (*set_texture)(struct __pyx_obj_5renpy_5angle_6gldraw_Environ *, int, float *);
  void (*set_color)(struct __pyx_obj_5renpy_5angle_6gldraw_Environ *, float, float, float, float);
  void (*set_clip)(struct __pyx_obj_5renpy_5angle_6gldraw_Environ *, PyObject *, struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *);
  void (*unset_clip)(struct __pyx_obj_5renpy_5angle_6gldraw_Environ *, struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *);
  void (*ortho)(struct __pyx_obj_5renpy_5angle_6gldraw_Environ *, double, double, double, double, double, double);
  void (*viewport)(struct __pyx_obj_5renpy_5angle_6gldraw_Environ *, int, int, int, int);
};
static struct __pyx_vtabstruct_5renpy_5angle_6gldraw_Environ *__pyx_vtabptr_5renpy_5angle_6gldraw_Environ;


/* "renpy/angle/gldraw.pyx":86
 * frame_times = [ ]
 * 
 * cdef class GLDraw:             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, allow_fixed=True):
 */

struct __pyx_vtabstruct_5renpy_5angle_6gldraw_GLDraw {
  PyObject *(*set_clip)(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *, PyObject *, int __pyx_skip_dispatch);
  int (*draw_render_textures)(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *, PyObject *, int, int __pyx_skip_dispatch);
  int (*draw_transformed)(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *, PyObject *, PyObject *, double, double, double, double, struct __pyx_obj_5renpy_7display_6render_Matrix2D *, int, int, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_5renpy_5angle_6gldraw_GLDraw *__pyx_vtabptr_5renpy_5angle_6gldraw_GLDraw;

/* --- Runtime support code (head) --- */
#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);
  #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
#define __Pyx_XDECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; __Pyx_XDECREF(tmp);\
    } while (0)
#define __Pyx_DECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; __Pyx_DECREF(tmp);\
    } while (0)
#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)

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro))
        return tp->tp_getattro(obj, attr_name);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_getattr))
        return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
#endif
    return PyObject_GetAttr(obj, attr_name);
}
#else
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif

static PyObject *__Pyx_GetBuiltinName(PyObject *name);

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

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

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

static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
#else
#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
#endif

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif

static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
#else
#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
#endif

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

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

#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
#else
#define __Pyx_PyInt_SubtractObjC(op1, op2, intval, inplace)\
    (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2))
#endif

#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
    (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
               __Pyx_GetItemInt_Generic(o, to_py_func(i))))
#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
    (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck);
#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
    (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck);
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
                                                     int is_list, int wraparound, int boundscheck);

static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb);
static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb);

static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);

#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyFloat_DivideObjC(PyObject *op1, PyObject *op2, double floatval, int inplace);
#else
#define __Pyx_PyFloat_DivideObjC(op1, op2, floatval, inplace)\
    ((inplace ? __Pyx_PyNumber_InPlaceDivide(op1, op2) : __Pyx_PyNumber_Divide(op1, op2)))
    #endif

#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyFloat_DivideCObj(PyObject *op1, PyObject *op2, double floatval, int inplace);
#else
#define __Pyx_PyFloat_DivideCObj(op1, op2, floatval, inplace)\
    ((inplace ? __Pyx_PyNumber_InPlaceDivide(op1, op2) : __Pyx_PyNumber_Divide(op1, op2)))
    #endif

#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
    PyObject *value;
    value = PyDict_GetItemWithError(d, key);
    if (unlikely(!value)) {
        if (!PyErr_Occurred()) {
            PyObject* args = PyTuple_Pack(1, key);
            if (likely(args))
                PyErr_SetObject(PyExc_KeyError, args);
            Py_XDECREF(args);
        }
        return NULL;
    }
    Py_INCREF(value);
    return value;
}
#else
    #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
#endif

static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
    int result = PySequence_Contains(seq, item);
    return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
}

#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL)
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_setattro))
        return tp->tp_setattro(obj, attr_name, value);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_setattr))
        return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
#endif
    return PyObject_SetAttr(obj, attr_name, value);
}
#else
#define __Pyx_PyObject_DelAttrStr(o,n)   PyObject_DelAttr(o,n)
#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
#endif

static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname);

static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);

#define __Pyx_CyFunction_USED 1
#include <structmember.h>
#define __Pyx_CYFUNCTION_STATICMETHOD  0x01
#define __Pyx_CYFUNCTION_CLASSMETHOD   0x02
#define __Pyx_CYFUNCTION_CCLASS        0x04
#define __Pyx_CyFunction_GetClosure(f)\
    (((__pyx_CyFunctionObject *) (f))->func_closure)
#define __Pyx_CyFunction_GetClassObj(f)\
    (((__pyx_CyFunctionObject *) (f))->func_classobj)
#define __Pyx_CyFunction_Defaults(type, f)\
    ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
    ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
typedef struct {
    PyCFunctionObject func;
#if PY_VERSION_HEX < 0x030500A0
    PyObject *func_weakreflist;
#endif
    PyObject *func_dict;
    PyObject *func_name;
    PyObject *func_qualname;
    PyObject *func_doc;
    PyObject *func_globals;
    PyObject *func_code;
    PyObject *func_closure;
    PyObject *func_classobj;
    void *defaults;
    int defaults_pyobjects;
    int flags;
    PyObject *defaults_tuple;
    PyObject *defaults_kwdict;
    PyObject *(*defaults_getter)(PyObject *);
    PyObject *func_annotations;
} __pyx_CyFunctionObject;
static PyTypeObject *__pyx_CyFunctionType = 0;
#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\
    __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code)
static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml,
                                      int flags, PyObject* qualname,
                                      PyObject *self,
                                      PyObject *module, PyObject *globals,
                                      PyObject* code);
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
                                                         size_t size,
                                                         int pyobjects);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
                                                            PyObject *tuple);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
                                                             PyObject *dict);
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
                                                              PyObject *dict);
static int __pyx_CyFunction_init(void);

static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);

#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
#else
#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\
    (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
#endif

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

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
    PyListObject* L = (PyListObject*) list;
    Py_ssize_t len = Py_SIZE(list);
    if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
        Py_INCREF(x);
        PyList_SET_ITEM(list, len, x);
        Py_SIZE(list) = len+1;
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
#endif

static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);

static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x);

static PyObject* __Pyx__PyObject_PopNewIndex(PyObject* L, PyObject* py_ix);
static PyObject* __Pyx__PyObject_PopIndex(PyObject* L, PyObject* py_ix);
#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx__PyList_PopIndex(PyObject* L, PyObject* py_ix, Py_ssize_t ix);
#define __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\
    (likely(PyList_CheckExact(L) && __Pyx_fits_Py_ssize_t(ix, type, is_signed))) ?\
        __Pyx__PyList_PopIndex(L, py_ix, ix) : (\
        (unlikely(py_ix == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\
            __Pyx__PyObject_PopIndex(L, py_ix)))
#define __Pyx_PyList_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\
    __Pyx_fits_Py_ssize_t(ix, type, is_signed) ?\
        __Pyx__PyList_PopIndex(L, py_ix, ix) : (\
        (unlikely(py_ix == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\
            __Pyx__PyObject_PopIndex(L, py_ix)))
#else
#define __Pyx_PyList_PopIndex(L, py_ix, ix, is_signed, type, to_py_func)\
    __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func)
#define __Pyx_PyObject_PopIndex(L, py_ix, ix, is_signed, type, to_py_func) (\
    (unlikely(py_ix == Py_None)) ? __Pyx__PyObject_PopNewIndex(L, to_py_func(ix)) :\
        __Pyx__PyObject_PopIndex(L, py_ix))
#endif

static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb);
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb);

static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);

static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);

static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);

static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);

#include <string.h>

static int __Pyx_SetVtable(PyObject *dict, void *vtable);

static void* __Pyx_GetVtable(PyObject *dict);

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);

static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);

static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
                                           PyObject *mkw, PyObject *modname, PyObject *doc);
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
                                      PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);

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

static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_GLint(GLint value);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);

static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_char(unsigned char value);

#ifndef __PYX_FORCE_INIT_THREADS
  #define __PYX_FORCE_INIT_THREADS 0
#endif

static int __Pyx_check_binary_version(void);

#if !defined(__Pyx_PyIdentifier_FromString)
#if PY_MAJOR_VERSION < 3
  #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
#else
  #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
#endif
#endif

static PyObject *__Pyx_ImportModule(const char *name);

static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);

static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig);

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);

static PyObject *__pyx_f_5renpy_5angle_6gldraw_6GLDraw_set_clip(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_clip, int __pyx_skip_dispatch); /* proto*/
static int __pyx_f_5renpy_5angle_6gldraw_6GLDraw_draw_render_textures(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_what, int __pyx_v_non_aligned, int __pyx_skip_dispatch); /* proto*/
static int __pyx_f_5renpy_5angle_6gldraw_6GLDraw_draw_transformed(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_what, PyObject *__pyx_v_clip, double __pyx_v_xo, double __pyx_v_yo, double __pyx_v_alpha, double __pyx_v_over, struct __pyx_obj_5renpy_7display_6render_Matrix2D *__pyx_v_reverse, int __pyx_v_nearest, int __pyx_v_subpixel, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_5renpy_5angle_6gldraw_7Environ_blit(CYTHON_UNUSED struct __pyx_obj_5renpy_5angle_6gldraw_Environ *__pyx_v_self); /* proto*/
static void __pyx_f_5renpy_5angle_6gldraw_7Environ_blend(CYTHON_UNUSED struct __pyx_obj_5renpy_5angle_6gldraw_Environ *__pyx_v_self, CYTHON_UNUSED double __pyx_v_fraction); /* proto*/
static void __pyx_f_5renpy_5angle_6gldraw_7Environ_imageblend(CYTHON_UNUSED struct __pyx_obj_5renpy_5angle_6gldraw_Environ *__pyx_v_self, CYTHON_UNUSED double __pyx_v_fraction, CYTHON_UNUSED int __pyx_v_ramp); /* proto*/
static void __pyx_f_5renpy_5angle_6gldraw_7Environ_set_vertex(CYTHON_UNUSED struct __pyx_obj_5renpy_5angle_6gldraw_Environ *__pyx_v_self, CYTHON_UNUSED float *__pyx_v_vertices); /* proto*/
static void __pyx_f_5renpy_5angle_6gldraw_7Environ_set_texture(CYTHON_UNUSED struct __pyx_obj_5renpy_5angle_6gldraw_Environ *__pyx_v_self, CYTHON_UNUSED int __pyx_v_unit, CYTHON_UNUSED float *__pyx_v_coords); /* proto*/
static void __pyx_f_5renpy_5angle_6gldraw_7Environ_set_color(CYTHON_UNUSED struct __pyx_obj_5renpy_5angle_6gldraw_Environ *__pyx_v_self, CYTHON_UNUSED float __pyx_v_r, CYTHON_UNUSED float __pyx_v_g, CYTHON_UNUSED float __pyx_v_b, CYTHON_UNUSED float __pyx_v_a); /* proto*/
static void __pyx_f_5renpy_5angle_6gldraw_7Environ_set_clip(CYTHON_UNUSED struct __pyx_obj_5renpy_5angle_6gldraw_Environ *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_clip_box, CYTHON_UNUSED struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_draw); /* proto*/
static void __pyx_f_5renpy_5angle_6gldraw_7Environ_unset_clip(CYTHON_UNUSED struct __pyx_obj_5renpy_5angle_6gldraw_Environ *__pyx_v_self, CYTHON_UNUSED struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_draw); /* proto*/
static void __pyx_f_5renpy_5angle_6gldraw_7Environ_ortho(CYTHON_UNUSED struct __pyx_obj_5renpy_5angle_6gldraw_Environ *__pyx_v_self, CYTHON_UNUSED double __pyx_v_left, CYTHON_UNUSED double __pyx_v_right, CYTHON_UNUSED double __pyx_v_bottom, CYTHON_UNUSED double __pyx_v_top, CYTHON_UNUSED double __pyx_v_near, CYTHON_UNUSED double __pyx_v_far); /* proto*/
static void __pyx_f_5renpy_5angle_6gldraw_7Environ_viewport(CYTHON_UNUSED struct __pyx_obj_5renpy_5angle_6gldraw_Environ *__pyx_v_self, CYTHON_UNUSED int __pyx_v_x, CYTHON_UNUSED int __pyx_v_y, CYTHON_UNUSED int __pyx_v_w, CYTHON_UNUSED int __pyx_v_h); /* proto*/

/* Module declarations from 'renpy.display.render' */
static PyTypeObject *__pyx_ptype_5renpy_7display_6render_Matrix2D = 0;
static PyTypeObject *__pyx_ptype_5renpy_7display_6render_Render = 0;

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

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

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

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

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

/* Module declarations from 'sdl2' */

/* Module declarations from 'renpy.angle.gl' */
static int (*__pyx_f_5renpy_5angle_2gl_glBlendFunc)(GLenum, GLenum); /*proto*/
static int (*__pyx_f_5renpy_5angle_2gl_glClear)(GLbitfield); /*proto*/
static int (*__pyx_f_5renpy_5angle_2gl_glClearColor)(GLclampf, GLclampf, GLclampf, GLclampf); /*proto*/
static int (*__pyx_f_5renpy_5angle_2gl_glEnable)(GLenum); /*proto*/
static int (*__pyx_f_5renpy_5angle_2gl_glFinish)(void); /*proto*/
static int (*__pyx_f_5renpy_5angle_2gl_glGetIntegerv)(GLenum, GLint *); /*proto*/
static GLchar *(*__pyx_f_5renpy_5angle_2gl_glGetString)(GLenum); /*proto*/
static int (*__pyx_f_5renpy_5angle_2gl_glReadPixels)(GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, GLubyte *); /*proto*/

/* Module declarations from 'pygame_sdl2' */

/* Module declarations from 'renpy.angle.gltexture' */
static PyTypeObject *__pyx_ptype_5renpy_5angle_9gltexture_TextureCore = 0;
static PyTypeObject *__pyx_ptype_5renpy_5angle_9gltexture_TextureGrid = 0;
static PyObject *(*__pyx_f_5renpy_5angle_9gltexture_blit)(struct __pyx_obj_5renpy_5angle_9gltexture_TextureGrid *, double, double, struct __pyx_obj_5renpy_7display_6render_Matrix2D *, double, double, struct __pyx_obj_5renpy_5angle_6gldraw_Environ *, int, int __pyx_skip_dispatch); /*proto*/
static PyObject *(*__pyx_f_5renpy_5angle_9gltexture_blend)(struct __pyx_obj_5renpy_5angle_9gltexture_TextureGrid *, struct __pyx_obj_5renpy_5angle_9gltexture_TextureGrid *, double, double, struct __pyx_obj_5renpy_7display_6render_Matrix2D *, double, double, double, struct __pyx_obj_5renpy_5angle_6gldraw_Environ *, int, int __pyx_skip_dispatch); /*proto*/
static PyObject *(*__pyx_f_5renpy_5angle_9gltexture_imageblend)(struct __pyx_obj_5renpy_5angle_9gltexture_TextureGrid *, struct __pyx_obj_5renpy_5angle_9gltexture_TextureGrid *, struct __pyx_obj_5renpy_5angle_9gltexture_TextureGrid *, double, double, struct __pyx_obj_5renpy_7display_6render_Matrix2D *, double, double, double, int, struct __pyx_obj_5renpy_5angle_6gldraw_Environ *, int, int __pyx_skip_dispatch); /*proto*/

/* Module declarations from 'renpy.angle.gldraw' */
static PyTypeObject *__pyx_ptype_5renpy_5angle_6gldraw_Environ = 0;
static PyTypeObject *__pyx_ptype_5renpy_5angle_6gldraw_GLDraw = 0;
static PyTypeObject *__pyx_ptype_5renpy_5angle_6gldraw___pyx_scope_struct__init = 0;
static PyTypeObject *__pyx_ptype_5renpy_5angle_6gldraw___pyx_scope_struct_1_render_to_texture = 0;
static PyTypeObject *__pyx_ptype_5renpy_5angle_6gldraw___pyx_scope_struct_2_get_half = 0;
static int __pyx_v_5renpy_5angle_6gldraw_EGL;
static int __pyx_v_5renpy_5angle_6gldraw_DISSOLVE;
static int __pyx_v_5renpy_5angle_6gldraw_IMAGEDISSOLVE;
static int __pyx_v_5renpy_5angle_6gldraw_PIXELLATE;
static PyObject *__pyx_v_5renpy_5angle_6gldraw_IDENTITY = 0;
#define __Pyx_MODULE_NAME "renpy.angle.gldraw"
int __pyx_module_is_main_renpy__angle__gldraw = 0;

/* Implementation of 'renpy.angle.gldraw' */
static PyObject *__pyx_builtin_object;
static PyObject *__pyx_builtin_ImportError;
static PyObject *__pyx_builtin_round;
static PyObject *__pyx_builtin_Exception;
static PyObject *__pyx_builtin_sum;
static PyObject *__pyx_builtin_range;
static char __pyx_k_1[] = "1";
static char __pyx_k_h[] = "h";
static char __pyx_k_i[] = "i";
static char __pyx_k_s[] = "    %s";
static char __pyx_k_w[] = "w";
static char __pyx_k_x[] = "x";
static char __pyx_k_y[] = "y";
static char __pyx_k__3[] = "";
static char __pyx_k_os[] = "os";
static char __pyx_k_xo[] = "xo";
static char __pyx_k_yo[] = "yo";
static char __pyx_k_Rtt[] = "Rtt";
static char __pyx_k__14[] = " ";
static char __pyx_k_doc[] = "__doc__";
static char __pyx_k_fbo[] = "fbo";
static char __pyx_k_get[] = "get";
static char __pyx_k_ios[] = "ios";
static char __pyx_k_log[] = "log";
static char __pyx_k_pop[] = "pop";
static char __pyx_k_pos[] = "pos";
static char __pyx_k_rtt[] = "rtt";
static char __pyx_k_sum[] = "sum";
static char __pyx_k_clip[] = "clip";
static char __pyx_k_copy[] = "copy";
static char __pyx_k_fill[] = "fill";
static char __pyx_k_flip[] = "flip";
static char __pyx_k_game[] = "game";
static char __pyx_k_init[] = "init";
static char __pyx_k_kill[] = "kill";
static char __pyx_k_main[] = "__main__";
static char __pyx_k_over[] = "over";
static char __pyx_k_quit[] = "quit";
static char __pyx_k_self[] = "self";
static char __pyx_k_surf[] = "surf";
static char __pyx_k_test[] = "__test__";
static char __pyx_k_time[] = "time";
static char __pyx_k_what[] = "what";
static char __pyx_k_alpha[] = "alpha";
static char __pyx_k_angle[] = "angle";
static char __pyx_k_array[] = "array";
static char __pyx_k_clear[] = "clear";
static char __pyx_k_color[] = "color";
static char __pyx_k_error[] = "error";
static char __pyx_k_fixed[] = "fixed";
static char __pyx_k_mouse[] = "mouse";
static char __pyx_k_movie[] = "movie";
static char __pyx_k_range[] = "range";
static char __pyx_k_renpy[] = "renpy";
static char __pyx_k_round[] = "round";
static char __pyx_k_sleep[] = "sleep";
static char __pyx_k_split[] = "split";
static char __pyx_k_upper[] = "upper";
static char __pyx_k_value[] = "value";
static char __pyx_k_video[] = "video";
static char __pyx_k_vsync[] = "vsync";
static char __pyx_k_width[] = "width";
static char __pyx_k_write[] = "write";
static char __pyx_k_FboRtt[] = "FboRtt";
static char __pyx_k_append[] = "append";
static char __pyx_k_config[] = "config";
static char __pyx_k_deinit[] = "deinit";
static char __pyx_k_envval[] = "envval";
static char __pyx_k_envvar[] = "envvar";
static char __pyx_k_format[] = "format";
static char __pyx_k_height[] = "height";
static char __pyx_k_import[] = "__import__";
static char __pyx_k_mobile[] = "mobile";
static char __pyx_k_module[] = "module";
static char __pyx_k_object[] = "object";
static char __pyx_k_pygame[] = "pygame";
static char __pyx_k_render[] = "render";
static char __pyx_k_shader[] = "shader";
static char __pyx_k_use_gl[] = "use_gl";
static char __pyx_k_CopyRtt[] = "CopyRtt";
static char __pyx_k_Surface[] = "Surface";
static char __pyx_k_android[] = "android";
static char __pyx_k_cleanup[] = "cleanup";
static char __pyx_k_display[] = "display";
static char __pyx_k_environ[] = "environ";
static char __pyx_k_get_pos[] = "get_pos";
static char __pyx_k_gl_size[] = "gl_size";
static char __pyx_k_limited[] = "limited";
static char __pyx_k_nearest[] = "nearest";
static char __pyx_k_os_path[] = "os.path";
static char __pyx_k_prepare[] = "__prepare__";
static char __pyx_k_req_ext[] = "req_ext";
static char __pyx_k_reverse[] = "reverse";
static char __pyx_k_set_pos[] = "set_pos";
static char __pyx_k_surface[] = "surface";
static char __pyx_k_texture[] = "texture";
static char __pyx_k_weakref[] = "weakref";
static char __pyx_k_windows[] = "windows";
static char __pyx_k_DISSOLVE[] = "DISSOLVE";
static char __pyx_k_IDENTITY[] = "IDENTITY";
static char __pyx_k_Matrix2D[] = "Matrix2D";
static char __pyx_k_Rtt_init[] = "Rtt.init";
static char __pyx_k_Vendor_r[] = "Vendor: %r";
static char __pyx_k_additive[] = "additive";
static char __pyx_k_emulator[] = "emulator";
static char __pyx_k_get_half[] = "get_half";
static char __pyx_k_get_info[] = "get_info";
static char __pyx_k_get_size[] = "get_size";
static char __pyx_k_module_2[] = "__module__";
static char __pyx_k_pgrender[] = "pgrender";
static char __pyx_k_qualname[] = "__qualname__";
static char __pyx_k_renderer[] = "renderer";
static char __pyx_k_set_clip[] = "set_clip";
static char __pyx_k_set_mode[] = "set_mode";
static char __pyx_k_subpixel[] = "subpixel";
static char __pyx_k_surftree[] = "surftree";
static char __pyx_k_use_gles[] = "use_gles";
static char __pyx_k_BLACKLIST[] = "BLACKLIST";
static char __pyx_k_DOUBLEBUF[] = "DOUBLEBUF";
static char __pyx_k_Exception[] = "Exception";
static char __pyx_k_PIXELLATE[] = "PIXELLATE";
static char __pyx_k_RESIZABLE[] = "RESIZABLE";
static char __pyx_k_Version_r[] = "Version: %r";
static char __pyx_k_current_h[] = "current_h";
static char __pyx_k_current_w[] = "current_w";
static char __pyx_k_dimension[] = "dimension";
static char __pyx_k_dpi_scale[] = "dpi_scale";
static char __pyx_k_draw_func[] = "draw_func";
static char __pyx_k_exception[] = "exception";
static char __pyx_k_gl_enable[] = "gl_enable";
static char __pyx_k_glrtt_fbo[] = "glrtt_fbo";
static char __pyx_k_gltexture[] = "gltexture";
static char __pyx_k_interface[] = "interface";
static char __pyx_k_is_opaque[] = "is_opaque";
static char __pyx_k_metaclass[] = "__metaclass__";
static char __pyx_k_post_init[] = "post_init";
static char __pyx_k_resizable[] = "resizable";
static char __pyx_k_text_rect[] = "text_rect";
static char __pyx_k_transient[] = "transient";
static char __pyx_k_Extensions[] = "Extensions:";
static char __pyx_k_RENPY_FAIL[] = "RENPY_FAIL_";
static char __pyx_k_Renderer_r[] = "Renderer: %r";
static char __pyx_k_Rtt_deinit[] = "Rtt.deinit";
static char __pyx_k_Rtt_render[] = "Rtt.render";
static char __pyx_k_draw_mouse[] = "draw_mouse";
static char __pyx_k_first_pass[] = "first_pass";
static char __pyx_k_flip_times[] = "flip_times";
static char __pyx_k_fullscreen[] = "fullscreen";
static char __pyx_k_glrtt_copy[] = "glrtt_copy";
static char __pyx_k_half_cache[] = "half_cache";
static char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
static char __pyx_k_subsurface[] = "subsurface";
static char __pyx_k_GL_Disabled[] = "GL Disabled.";
static char __pyx_k_ImportError[] = "ImportError";
static char __pyx_k_allow_fixed[] = "allow_fixed";
static char __pyx_k_draw_screen[] = "draw_screen";
static char __pyx_k_frame_times[] = "frame_times";
static char __pyx_k_glblacklist[] = "glblacklist";
static char __pyx_k_non_aligned[] = "non_aligned";
static char __pyx_k_pygame_sdl2[] = "pygame_sdl2";
static char __pyx_k_screen_rect[] = "screen_rect";
static char __pyx_k_set_visible[] = "set_visible";
static char __pyx_k_RENPY_GL_RTT[] = "RENPY_GL_RTT";
static char __pyx_k_load_texture[] = "load_texture";
static char __pyx_k_needs_redraw[] = "needs_redraw";
static char __pyx_k_render_movie[] = "render_movie";
static char __pyx_k_virtual_size[] = "virtual_size";
static char __pyx_k_GL_ALPHA_SIZE[] = "GL_ALPHA_SIZE";
static char __pyx_k_IMAGEDISSOLVE[] = "IMAGEDISSOLVE";
static char __pyx_k_ShaderEnviron[] = "ShaderEnviron";
static char __pyx_k_Using_FBO_RTT[] = "Using FBO RTT.";
static char __pyx_k_Windowed_mode[] = "Windowed mode.";
static char __pyx_k_always_opaque[] = "always_opaque";
static char __pyx_k_clip_mode_rtt[] = "clip_mode_rtt";
static char __pyx_k_flip_unscaled[] = "flip_unscaled";
static char __pyx_k_kill_textures[] = "kill_textures";
static char __pyx_k_physical_size[] = "physical_size";
static char __pyx_k_texture_count[] = "texture_count";
static char __pyx_k_use_subsystem[] = "use_subsystem";
static char __pyx_k_Display_Info_s[] = "Display Info: %s";
static char __pyx_k_LimitedEnviron[] = "LimitedEnviron";
static char __pyx_k_RENPY_GL_VSYNC[] = "RENPY_GL_VSYNC";
static char __pyx_k_Using_copy_RTT[] = "Using copy RTT.";
static char __pyx_k_get_mouse_info[] = "get_mouse_info";
static char __pyx_k_get_size_limit[] = "get_size_limit";
static char __pyx_k_set_rgba_masks[] = "set_rgba_masks";
static char __pyx_k_Fullscreen_mode[] = "Fullscreen mode.";
static char __pyx_k_GL_SWAP_CONTROL[] = "GL_SWAP_CONTROL";
static char __pyx_k_Not_implemented[] = "Not implemented.";
static char __pyx_k_glenviron_fixed[] = "glenviron_fixed";
static char __pyx_k_operation_alpha[] = "operation_alpha";
static char __pyx_k_translate_point[] = "translate_point";
static char __pyx_k_RENPY_GL_ENVIRON[] = "RENPY_GL_ENVIRON";
static char __pyx_k_Using_0_renderer[] = "Using {0} renderer.";
static char __pyx_k_adjust_view_size[] = "adjust_view_size";
static char __pyx_k_clip_mode_screen[] = "clip_mode_screen";
static char __pyx_k_dealloc_textures[] = "dealloc_textures";
static char __pyx_k_draw_transformed[] = "draw_transformed";
static char __pyx_k_fullscreen_video[] = "fullscreen_video";
static char __pyx_k_gl_set_attribute[] = "gl_set_attribute";
static char __pyx_k_glenviron_shader[] = "glenviron_shader";
static char __pyx_k_nearest_neighbor[] = "nearest_neighbor";
static char __pyx_k_surface_unscaled[] = "surface_unscaled";
static char __pyx_k_WeakKeyDictionary[] = "WeakKeyDictionary";
static char __pyx_k_get_drawable_size[] = "get_drawable_size";
static char __pyx_k_glenviron_limited[] = "glenviron_limited";
static char __pyx_k_render_to_texture[] = "render_to_texture";
static char __pyx_k_untranslate_point[] = "untranslate_point";
static char __pyx_k_Glew_init_failed_s[] = "Glew init failed: %s";
static char __pyx_k_Initializing_EGL_s[] = "Initializing EGL: %s";
static char __pyx_k_Rtt_get_size_limit[] = "Rtt.get_size_limit";
static char __pyx_k_get_display_bounds[] = "get_display_bounds";
static char __pyx_k_operation_complete[] = "operation_complete";
static char __pyx_k_renpy_angle_gldraw[] = "renpy.angle.gldraw";
static char __pyx_k_test_texture_sizes[] = "test_texture_sizes";
static char __pyx_k_total_texture_size[] = "total_texture_size";
static char __pyx_k_FixedFunctionEnviron[] = "FixedFunctionEnviron";
static char __pyx_k_GL_ARB_vertex_shader[] = "GL_ARB_vertex_shader";
static char __pyx_k_Unknown_drawing_type[] = "Unknown drawing type. ";
static char __pyx_k_draw_render_textures[] = "draw_render_textures";
static char __pyx_k_RENPY_bogus_extension[] = "RENPY_bogus_extension";
static char __pyx_k_GL_ARB_fragment_shader[] = "GL_ARB_fragment_shader";
static char __pyx_k_Shaders_are_blacklisted[] = "Shaders are blacklisted.";
static char __pyx_k_use_drawable_resolution[] = "use_drawable_resolution";
static char __pyx_k_Using_shader_environment[] = "Using shader environment.";
static char __pyx_k_primary_display_bounds_r[] = "primary display bounds: %r";
static char __pyx_k_Can_t_find_a_workable_rtt[] = "Can't find a workable rtt.";
static char __pyx_k_GL_is_totally_blacklisted[] = "GL is totally blacklisted.";
static char __pyx_k_Number_of_texture_units_d[] = "Number of texture units: %d";
static char __pyx_k_Using_limited_environment[] = "Using limited environment.";
static char __pyx_k_WINDOW_FULLSCREEN_DESKTOP[] = "WINDOW_FULLSCREEN_DESKTOP";
static char __pyx_k_get_half_locals_draw_func[] = "get_half.<locals>.draw_func";
static char __pyx_k_init_locals_use_subsystem[] = "init.<locals>.use_subsystem";
static char __pyx_k_texture_grid_from_drawing[] = "texture_grid_from_drawing";
static char __pyx_k_texture_grid_from_surface[] = "texture_grid_from_surface";
static char __pyx_k_GL_ARB_texture_env_combine[] = "GL_ARB_texture_env_combine";
static char __pyx_k_GL_NV_texture_env_combine4[] = "GL_NV_texture_env_combine4";
static char __pyx_k_GL_ARB_texture_env_crossbar[] = "GL_ARB_texture_env_crossbar";
static char __pyx_k_Could_not_get_pygame_screen_r[] = "Could not get pygame screen: %r";
static char __pyx_k_Fixed_function_is_blacklisted[] = "Fixed-function is blacklisted.";
static char __pyx_k_Opening_in_fullscreen_failed_r[] = "Opening in fullscreen failed: %r";
static char __pyx_k_Initializing_shader_environment[] = "Initializing shader environment failed:";
static char __pyx_k_Screen_sizes_virtual_r_physical[] = "Screen sizes: virtual=%r physical=%r drawable=%r";
static char __pyx_k_Subclasses_of_this_class_handle[] = "\n    Subclasses of this class handle rendering to a texture.\n    ";
static char __pyx_k_home_tom_ab_renpy_renpy_angle_g[] = "/home/tom/ab/renpy/renpy/angle/gldraw.pyx";
static char __pyx_k_Can_t_find_a_workable_environmen[] = "Can't find a workable environment.";
static char __pyx_k_Using_fixed_function_environment[] = "Using fixed-function environment (clause 1).";
static char __pyx_k_render_to_texture_locals_draw_fu[] = "render_to_texture.<locals>.draw_func";
static char __pyx_k_Using_fixed_function_environment_2[] = "Using fixed-function environment (clause 2).";
static PyObject *__pyx_kp_s_1;
static PyObject *__pyx_n_s_BLACKLIST;
static PyObject *__pyx_kp_s_Can_t_find_a_workable_environmen;
static PyObject *__pyx_kp_s_Can_t_find_a_workable_rtt;
static PyObject *__pyx_n_s_CopyRtt;
static PyObject *__pyx_kp_s_Could_not_get_pygame_screen_r;
static PyObject *__pyx_n_s_DISSOLVE;
static PyObject *__pyx_n_s_DOUBLEBUF;
static PyObject *__pyx_kp_s_Display_Info_s;
static PyObject *__pyx_n_s_Exception;
static PyObject *__pyx_kp_s_Extensions;
static PyObject *__pyx_n_s_FboRtt;
static PyObject *__pyx_n_s_FixedFunctionEnviron;
static PyObject *__pyx_kp_s_Fixed_function_is_blacklisted;
static PyObject *__pyx_kp_s_Fullscreen_mode;
static PyObject *__pyx_n_s_GL_ALPHA_SIZE;
static PyObject *__pyx_n_s_GL_ARB_fragment_shader;
static PyObject *__pyx_n_s_GL_ARB_texture_env_combine;
static PyObject *__pyx_n_s_GL_ARB_texture_env_crossbar;
static PyObject *__pyx_n_s_GL_ARB_vertex_shader;
static PyObject *__pyx_kp_s_GL_Disabled;
static PyObject *__pyx_n_s_GL_NV_texture_env_combine4;
static PyObject *__pyx_n_s_GL_SWAP_CONTROL;
static PyObject *__pyx_kp_s_GL_is_totally_blacklisted;
static PyObject *__pyx_kp_s_Glew_init_failed_s;
static PyObject *__pyx_n_s_IDENTITY;
static PyObject *__pyx_n_s_IMAGEDISSOLVE;
static PyObject *__pyx_n_s_ImportError;
static PyObject *__pyx_kp_s_Initializing_EGL_s;
static PyObject *__pyx_kp_s_Initializing_shader_environment;
static PyObject *__pyx_n_s_LimitedEnviron;
static PyObject *__pyx_n_s_Matrix2D;
static PyObject *__pyx_kp_s_Not_implemented;
static PyObject *__pyx_kp_s_Number_of_texture_units_d;
static PyObject *__pyx_kp_s_Opening_in_fullscreen_failed_r;
static PyObject *__pyx_n_s_PIXELLATE;
static PyObject *__pyx_n_s_RENPY_FAIL;
static PyObject *__pyx_n_s_RENPY_GL_ENVIRON;
static PyObject *__pyx_n_s_RENPY_GL_RTT;
static PyObject *__pyx_n_s_RENPY_GL_VSYNC;
static PyObject *__pyx_n_s_RENPY_bogus_extension;
static PyObject *__pyx_n_s_RESIZABLE;
static PyObject *__pyx_kp_s_Renderer_r;
static PyObject *__pyx_n_s_Rtt;
static PyObject *__pyx_n_s_Rtt_deinit;
static PyObject *__pyx_n_s_Rtt_get_size_limit;
static PyObject *__pyx_n_s_Rtt_init;
static PyObject *__pyx_n_s_Rtt_render;
static PyObject *__pyx_kp_s_Screen_sizes_virtual_r_physical;
static PyObject *__pyx_n_s_ShaderEnviron;
static PyObject *__pyx_kp_s_Shaders_are_blacklisted;
static PyObject *__pyx_kp_s_Subclasses_of_this_class_handle;
static PyObject *__pyx_n_s_Surface;
static PyObject *__pyx_kp_s_Unknown_drawing_type;
static PyObject *__pyx_kp_s_Using_0_renderer;
static PyObject *__pyx_kp_s_Using_FBO_RTT;
static PyObject *__pyx_kp_s_Using_copy_RTT;
static PyObject *__pyx_kp_s_Using_fixed_function_environment;
static PyObject *__pyx_kp_s_Using_fixed_function_environment_2;
static PyObject *__pyx_kp_s_Using_limited_environment;
static PyObject *__pyx_kp_s_Using_shader_environment;
static PyObject *__pyx_kp_s_Vendor_r;
static PyObject *__pyx_kp_s_Version_r;
static PyObject *__pyx_n_s_WINDOW_FULLSCREEN_DESKTOP;
static PyObject *__pyx_n_s_WeakKeyDictionary;
static PyObject *__pyx_kp_s_Windowed_mode;
static PyObject *__pyx_kp_s__14;
static PyObject *__pyx_kp_s__3;
static PyObject *__pyx_n_s_additive;
static PyObject *__pyx_n_s_adjust_view_size;
static PyObject *__pyx_n_s_allow_fixed;
static PyObject *__pyx_n_s_alpha;
static PyObject *__pyx_n_s_always_opaque;
static PyObject *__pyx_n_s_android;
static PyObject *__pyx_n_s_angle;
static PyObject *__pyx_n_s_append;
static PyObject *__pyx_n_s_array;
static PyObject *__pyx_n_s_cleanup;
static PyObject *__pyx_n_s_clear;
static PyObject *__pyx_n_s_clip;
static PyObject *__pyx_n_s_clip_mode_rtt;
static PyObject *__pyx_n_s_clip_mode_screen;
static PyObject *__pyx_n_s_color;
static PyObject *__pyx_n_s_config;
static PyObject *__pyx_n_s_copy;
static PyObject *__pyx_n_s_current_h;
static PyObject *__pyx_n_s_current_w;
static PyObject *__pyx_n_s_dealloc_textures;
static PyObject *__pyx_n_s_deinit;
static PyObject *__pyx_n_s_dimension;
static PyObject *__pyx_n_s_display;
static PyObject *__pyx_n_s_doc;
static PyObject *__pyx_n_s_dpi_scale;
static PyObject *__pyx_n_s_draw_func;
static PyObject *__pyx_n_s_draw_mouse;
static PyObject *__pyx_n_s_draw_render_textures;
static PyObject *__pyx_n_s_draw_screen;
static PyObject *__pyx_n_s_draw_transformed;
static PyObject *__pyx_n_s_emulator;
static PyObject *__pyx_n_s_environ;
static PyObject *__pyx_n_s_envval;
static PyObject *__pyx_n_s_envvar;
static PyObject *__pyx_n_s_error;
static PyObject *__pyx_n_s_exception;
static PyObject *__pyx_n_s_fbo;
static PyObject *__pyx_n_s_fill;
static PyObject *__pyx_n_s_first_pass;
static PyObject *__pyx_n_s_fixed;
static PyObject *__pyx_n_s_flip;
static PyObject *__pyx_n_s_flip_times;
static PyObject *__pyx_n_s_flip_unscaled;
static PyObject *__pyx_n_s_format;
static PyObject *__pyx_n_s_frame_times;
static PyObject *__pyx_n_s_fullscreen;
static PyObject *__pyx_n_s_fullscreen_video;
static PyObject *__pyx_n_s_game;
static PyObject *__pyx_n_s_get;
static PyObject *__pyx_n_s_get_display_bounds;
static PyObject *__pyx_n_s_get_drawable_size;
static PyObject *__pyx_n_s_get_half;
static PyObject *__pyx_n_s_get_half_locals_draw_func;
static PyObject *__pyx_n_s_get_info;
static PyObject *__pyx_n_s_get_mouse_info;
static PyObject *__pyx_n_s_get_pos;
static PyObject *__pyx_n_s_get_size;
static PyObject *__pyx_n_s_get_size_limit;
static PyObject *__pyx_n_s_gl_enable;
static PyObject *__pyx_n_s_gl_set_attribute;
static PyObject *__pyx_n_s_gl_size;
static PyObject *__pyx_n_s_glblacklist;
static PyObject *__pyx_n_s_glenviron_fixed;
static PyObject *__pyx_n_s_glenviron_limited;
static PyObject *__pyx_n_s_glenviron_shader;
static PyObject *__pyx_n_s_glrtt_copy;
static PyObject *__pyx_n_s_glrtt_fbo;
static PyObject *__pyx_n_s_gltexture;
static PyObject *__pyx_n_s_h;
static PyObject *__pyx_n_s_half_cache;
static PyObject *__pyx_n_s_height;
static PyObject *__pyx_kp_s_home_tom_ab_renpy_renpy_angle_g;
static PyObject *__pyx_n_s_i;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_init;
static PyObject *__pyx_n_s_init_locals_use_subsystem;
static PyObject *__pyx_n_s_interface;
static PyObject *__pyx_n_s_ios;
static PyObject *__pyx_n_s_is_opaque;
static PyObject *__pyx_n_s_kill;
static PyObject *__pyx_n_s_kill_textures;
static PyObject *__pyx_n_s_limited;
static PyObject *__pyx_n_s_load_texture;
static PyObject *__pyx_n_s_log;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_metaclass;
static PyObject *__pyx_n_s_mobile;
static PyObject *__pyx_n_s_module;
static PyObject *__pyx_n_s_module_2;
static PyObject *__pyx_n_s_mouse;
static PyObject *__pyx_n_s_movie;
static PyObject *__pyx_n_s_nearest;
static PyObject *__pyx_n_s_nearest_neighbor;
static PyObject *__pyx_n_s_needs_redraw;
static PyObject *__pyx_n_s_non_aligned;
static PyObject *__pyx_n_s_object;
static PyObject *__pyx_n_s_operation_alpha;
static PyObject *__pyx_n_s_operation_complete;
static PyObject *__pyx_n_s_os;
static PyObject *__pyx_n_s_os_path;
static PyObject *__pyx_n_s_over;
static PyObject *__pyx_n_s_pgrender;
static PyObject *__pyx_n_s_physical_size;
static PyObject *__pyx_n_s_pop;
static PyObject *__pyx_n_s_pos;
static PyObject *__pyx_n_s_post_init;
static PyObject *__pyx_n_s_prepare;
static PyObject *__pyx_kp_s_primary_display_bounds_r;
static PyObject *__pyx_n_s_pygame;
static PyObject *__pyx_n_s_pygame_sdl2;
static PyObject *__pyx_n_s_pyx_vtable;
static PyObject *__pyx_n_s_qualname;
static PyObject *__pyx_n_s_quit;
static PyObject *__pyx_n_s_range;
static PyObject *__pyx_n_s_render;
static PyObject *__pyx_n_s_render_movie;
static PyObject *__pyx_n_s_render_to_texture;
static PyObject *__pyx_n_s_render_to_texture_locals_draw_fu;
static PyObject *__pyx_n_s_renderer;
static PyObject *__pyx_n_s_renpy;
static PyObject *__pyx_n_s_renpy_angle_gldraw;
static PyObject *__pyx_n_s_req_ext;
static PyObject *__pyx_n_s_resizable;
static PyObject *__pyx_n_s_reverse;
static PyObject *__pyx_n_s_round;
static PyObject *__pyx_n_s_rtt;
static PyObject *__pyx_kp_s_s;
static PyObject *__pyx_n_s_screen_rect;
static PyObject *__pyx_n_s_self;
static PyObject *__pyx_n_s_set_clip;
static PyObject *__pyx_n_s_set_mode;
static PyObject *__pyx_n_s_set_pos;
static PyObject *__pyx_n_s_set_rgba_masks;
static PyObject *__pyx_n_s_set_visible;
static PyObject *__pyx_n_s_shader;
static PyObject *__pyx_n_s_sleep;
static PyObject *__pyx_n_s_split;
static PyObject *__pyx_n_s_subpixel;
static PyObject *__pyx_n_s_subsurface;
static PyObject *__pyx_n_s_sum;
static PyObject *__pyx_n_s_surf;
static PyObject *__pyx_n_s_surface;
static PyObject *__pyx_n_s_surface_unscaled;
static PyObject *__pyx_n_s_surftree;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_s_test_texture_sizes;
static PyObject *__pyx_n_s_text_rect;
static PyObject *__pyx_n_s_texture;
static PyObject *__pyx_n_s_texture_count;
static PyObject *__pyx_n_s_texture_grid_from_drawing;
static PyObject *__pyx_n_s_texture_grid_from_surface;
static PyObject *__pyx_n_s_time;
static PyObject *__pyx_n_s_total_texture_size;
static PyObject *__pyx_n_s_transient;
static PyObject *__pyx_n_s_translate_point;
static PyObject *__pyx_n_s_untranslate_point;
static PyObject *__pyx_n_s_upper;
static PyObject *__pyx_n_s_use_drawable_resolution;
static PyObject *__pyx_n_s_use_gl;
static PyObject *__pyx_n_s_use_gles;
static PyObject *__pyx_n_s_use_subsystem;
static PyObject *__pyx_n_s_value;
static PyObject *__pyx_n_s_video;
static PyObject *__pyx_n_s_virtual_size;
static PyObject *__pyx_n_s_vsync;
static PyObject *__pyx_n_s_w;
static PyObject *__pyx_n_s_weakref;
static PyObject *__pyx_n_s_what;
static PyObject *__pyx_n_s_width;
static PyObject *__pyx_n_s_windows;
static PyObject *__pyx_n_s_write;
static PyObject *__pyx_n_s_x;
static PyObject *__pyx_n_s_xo;
static PyObject *__pyx_n_s_y;
static PyObject *__pyx_n_s_yo;
static int __pyx_pf_5renpy_5angle_6gldraw_6GLDraw___init__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_allow_fixed); /* proto */
static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_2get_texture_size(CYTHON_UNUSED struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_4set_mode(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_virtual_size, PyObject *__pyx_v_physical_size, PyObject *__pyx_v_fullscreen); /* proto */
static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_6deinit(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_8quit(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_4init_use_subsystem(PyObject *__pyx_self, PyObject *__pyx_v_module, PyObject *__pyx_v_envvar, PyObject *__pyx_v_envval, PyObject *__pyx_v_req_ext); /* proto */
static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_10init(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_12should_redraw(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_needs_redraw, PyObject *__pyx_v_first_pass); /* proto */
static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_14mutated_surface(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_surf); /* proto */
static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_16load_texture(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_surf, PyObject *__pyx_v_transient); /* proto */
static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_18solid_texture(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_w, PyObject *__pyx_v_h, PyObject *__pyx_v_color); /* proto */
static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_20clip_mode_screen(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_22clip_mode_rtt(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_w, PyObject *__pyx_v_h); /* proto */
static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_24set_clip(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_clip); /* proto */
static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_26draw_screen(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_surftree, CYTHON_UNUSED PyObject *__pyx_v_fullscreen_video, PyObject *__pyx_v_flip); /* proto */
static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_28draw_render_textures(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_what, int __pyx_v_non_aligned); /* proto */
static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_30draw_transformed(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_what, PyObject *__pyx_v_clip, double __pyx_v_xo, double __pyx_v_yo, double __pyx_v_alpha, double __pyx_v_over, struct __pyx_obj_5renpy_7display_6render_Matrix2D *__pyx_v_reverse, int __pyx_v_nearest, int __pyx_v_subpixel); /* proto */
static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_17render_to_texture_draw_func(PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_w, PyObject *__pyx_v_h); /* proto */
static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_32render_to_texture(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_what, PyObject *__pyx_v_alpha); /* proto */
static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_34is_pixel_opaque(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_what, PyObject *__pyx_v_x, PyObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_8get_half_draw_func(PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_w, PyObject *__pyx_v_h); /* proto */
static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_36get_half(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_what); /* proto */
static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_38translate_point(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_40untranslate_point(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_42update_mouse(CYTHON_UNUSED struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_44mouse_event(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_ev); /* proto */
static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_46get_mouse_pos(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_48set_mouse_pos(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_50draw_mouse(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_52screenshot(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_surftree, PyObject *__pyx_v_fullscreen_video); /* proto */
static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_54free_memory(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_56event_peek_sleep(CYTHON_UNUSED struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_58get_physical_size(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_3rtt___get__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self); /* proto */
static int __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_3rtt_2__set__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_3rtt_4__del__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_13physical_size___get__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self); /* proto */
static int __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_13physical_size_2__set__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_13physical_size_4__del__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_13drawable_size___get__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self); /* proto */
static int __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_13drawable_size_2__set__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_13drawable_size_4__del__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_11virtual_box___get__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self); /* proto */
static int __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_11virtual_box_2__set__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_11virtual_box_4__del__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_12physical_box___get__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self); /* proto */
static int __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_12physical_box_2__set__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_12physical_box_4__del__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_4info___get__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self); /* proto */
static int __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_4info_2__set__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_4info_4__del__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_18fullscreen_surface___get__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self); /* proto */
static int __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_18fullscreen_surface_2__set__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_18fullscreen_surface_4__del__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_12clip_rtt_box___get__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self); /* proto */
static int __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_12clip_rtt_box_2__set__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_12clip_rtt_box_4__del__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_13draw_per_virt___get__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self); /* proto */
static int __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_13draw_per_virt_2__set__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_13draw_per_virt_4__del__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_12virt_to_draw___get__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self); /* proto */
static int __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_12virt_to_draw_2__set__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_12virt_to_draw_4__del__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_12draw_to_virt___get__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self); /* proto */
static int __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_12draw_to_virt_2__set__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_12draw_to_virt_4__del__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5renpy_5angle_6gldraw_3Rtt_init(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5renpy_5angle_6gldraw_3Rtt_2deinit(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5renpy_5angle_6gldraw_3Rtt_4render(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_texture, CYTHON_UNUSED PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_y, CYTHON_UNUSED PyObject *__pyx_v_w, CYTHON_UNUSED PyObject *__pyx_v_h, CYTHON_UNUSED PyObject *__pyx_v_draw_func); /* proto */
static PyObject *__pyx_pf_5renpy_5angle_6gldraw_3Rtt_6get_size_limit(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_dimension); /* proto */
static PyObject *__pyx_tp_new_5renpy_5angle_6gldraw_Environ(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5renpy_5angle_6gldraw_GLDraw(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5renpy_5angle_6gldraw___pyx_scope_struct__init(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5renpy_5angle_6gldraw___pyx_scope_struct_1_render_to_texture(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_5renpy_5angle_6gldraw___pyx_scope_struct_2_get_half(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_float__5;
static PyObject *__pyx_float_0_5;
static PyObject *__pyx_float_1_0;
static PyObject *__pyx_float_2_0;
static PyObject *__pyx_float__001;
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_2;
static PyObject *__pyx_int_4;
static PyObject *__pyx_int_6;
static PyObject *__pyx_int_8;
static PyObject *__pyx_int_102;
static PyObject *__pyx_int_255;
static PyObject *__pyx_tuple_;
static PyObject *__pyx_tuple__2;
static PyObject *__pyx_tuple__4;
static PyObject *__pyx_tuple__5;
static PyObject *__pyx_tuple__6;
static PyObject *__pyx_tuple__7;
static PyObject *__pyx_tuple__8;
static PyObject *__pyx_tuple__9;
static PyObject *__pyx_tuple__10;
static PyObject *__pyx_tuple__11;
static PyObject *__pyx_tuple__12;
static PyObject *__pyx_tuple__13;
static PyObject *__pyx_tuple__15;
static PyObject *__pyx_tuple__16;
static PyObject *__pyx_tuple__17;
static PyObject *__pyx_tuple__19;
static PyObject *__pyx_tuple__20;
static PyObject *__pyx_tuple__21;
static PyObject *__pyx_tuple__22;
static PyObject *__pyx_tuple__23;
static PyObject *__pyx_tuple__24;
static PyObject *__pyx_tuple__25;
static PyObject *__pyx_tuple__26;
static PyObject *__pyx_tuple__27;
static PyObject *__pyx_tuple__28;
static PyObject *__pyx_tuple__29;
static PyObject *__pyx_tuple__30;
static PyObject *__pyx_tuple__31;
static PyObject *__pyx_tuple__33;
static PyObject *__pyx_tuple__34;
static PyObject *__pyx_tuple__35;
static PyObject *__pyx_tuple__36;
static PyObject *__pyx_tuple__38;
static PyObject *__pyx_tuple__39;
static PyObject *__pyx_tuple__40;
static PyObject *__pyx_tuple__42;
static PyObject *__pyx_tuple__44;
static PyObject *__pyx_tuple__46;
static PyObject *__pyx_codeobj__18;
static PyObject *__pyx_codeobj__32;
static PyObject *__pyx_codeobj__37;
static PyObject *__pyx_codeobj__41;
static PyObject *__pyx_codeobj__43;
static PyObject *__pyx_codeobj__45;
static PyObject *__pyx_codeobj__47;

/* "renpy/angle/gldraw.pyx":88
 * cdef class GLDraw:
 * 
 *     def __init__(self, allow_fixed=True):             # <<<<<<<<<<<<<<
 * 
 *         # Did we do the first-time init?
 */

/* Python wrapper */
static int __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_allow_fixed = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_allow_fixed,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_True);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        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 (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_allow_fixed);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_allow_fixed = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw___init__(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self), __pyx_v_allow_fixed);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_5angle_6gldraw_6GLDraw___init__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_allow_fixed) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  float __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "renpy/angle/gldraw.pyx":91
 * 
 *         # Did we do the first-time init?
 *         self.did_init = False             # <<<<<<<<<<<<<<
 * 
 *         # The GL environment to use.
 */
  __pyx_v_self->did_init = 0;

  /* "renpy/angle/gldraw.pyx":94
 * 
 *         # The GL environment to use.
 *         self.environ = None             # <<<<<<<<<<<<<<
 * 
 *         # The GL render-to-texture to use.
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->environ);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->environ));
  __pyx_v_self->environ = ((struct __pyx_obj_5renpy_5angle_6gldraw_Environ *)Py_None);

  /* "renpy/angle/gldraw.pyx":97
 * 
 *         # The GL render-to-texture to use.
 *         self.rtt = None             # <<<<<<<<<<<<<<
 * 
 *         # The screen.
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->rtt);
  __Pyx_DECREF(__pyx_v_self->rtt);
  __pyx_v_self->rtt = Py_None;

  /* "renpy/angle/gldraw.pyx":100
 * 
 *         # The screen.
 *         self.window = None             # <<<<<<<<<<<<<<
 * 
 *         # The virtual size of the screen, as requested by the game.
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->window);
  __Pyx_DECREF(__pyx_v_self->window);
  __pyx_v_self->window = Py_None;

  /* "renpy/angle/gldraw.pyx":103
 * 
 *         # The virtual size of the screen, as requested by the game.
 *         self.virtual_size = None             # <<<<<<<<<<<<<<
 * 
 *         # The physical size of the window we got.
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->virtual_size);
  __Pyx_DECREF(__pyx_v_self->virtual_size);
  __pyx_v_self->virtual_size = ((PyObject*)Py_None);

  /* "renpy/angle/gldraw.pyx":106
 * 
 *         # The physical size of the window we got.
 *         self.physical_size = None             # <<<<<<<<<<<<<<
 * 
 *         # Is the mouse currently visible?
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->physical_size);
  __Pyx_DECREF(__pyx_v_self->physical_size);
  __pyx_v_self->physical_size = ((PyObject*)Py_None);

  /* "renpy/angle/gldraw.pyx":109
 * 
 *         # Is the mouse currently visible?
 *         self.mouse_old_visible = None             # <<<<<<<<<<<<<<
 * 
 *         # The (x, y) and texture of the software mouse.
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->mouse_old_visible);
  __Pyx_DECREF(__pyx_v_self->mouse_old_visible);
  __pyx_v_self->mouse_old_visible = Py_None;

  /* "renpy/angle/gldraw.pyx":112
 * 
 *         # The (x, y) and texture of the software mouse.
 *         self.mouse_info = (0, 0, None)             # <<<<<<<<<<<<<<
 * 
 *         # This is used to cache the surface->texture operation.
 */
  __Pyx_INCREF(__pyx_tuple_);
  __Pyx_GIVEREF(__pyx_tuple_);
  __Pyx_GOTREF(__pyx_v_self->mouse_info);
  __Pyx_DECREF(__pyx_v_self->mouse_info);
  __pyx_v_self->mouse_info = __pyx_tuple_;

  /* "renpy/angle/gldraw.pyx":115
 * 
 *         # This is used to cache the surface->texture operation.
 *         self.texture_cache = weakref.WeakKeyDictionary()             # <<<<<<<<<<<<<<
 * 
 *         # The time of the last redraw.
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_weakref); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_WeakKeyDictionary); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->texture_cache);
  __Pyx_DECREF(__pyx_v_self->texture_cache);
  __pyx_v_self->texture_cache = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "renpy/angle/gldraw.pyx":118
 * 
 *         # The time of the last redraw.
 *         self.last_redraw_time = 0             # <<<<<<<<<<<<<<
 * 
 *         # The time between redraws.
 */
  __pyx_v_self->last_redraw_time = 0.0;

  /* "renpy/angle/gldraw.pyx":121
 * 
 *         # The time between redraws.
 *         self.redraw_period = .2             # <<<<<<<<<<<<<<
 * 
 *         # Info.
 */
  __pyx_v_self->redraw_period = .2;

  /* "renpy/angle/gldraw.pyx":124
 * 
 *         # Info.
 *         self.info = { "resizable" : True, "additive" : True }             # <<<<<<<<<<<<<<
 * 
 *         if not ANGLE:
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_resizable, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_additive, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->info);
  __Pyx_DECREF(__pyx_v_self->info);
  __pyx_v_self->info = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "renpy/angle/gldraw.pyx":129
 *             self.info["renderer"] = "gl"
 *         else:
 *             self.info["renderer"] = "angle"             # <<<<<<<<<<<<<<
 * 
 *         # Old value of fullscreen.
 */
  if (unlikely(__pyx_v_self->info == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  if (unlikely(PyDict_SetItem(__pyx_v_self->info, __pyx_n_s_renderer, __pyx_n_s_angle) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/angle/gldraw.pyx":132
 * 
 *         # Old value of fullscreen.
 *         self.old_fullscreen = None             # <<<<<<<<<<<<<<
 * 
 *         # We don't use a fullscreen surface, so this needs to be set
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->old_fullscreen);
  __Pyx_DECREF(__pyx_v_self->old_fullscreen);
  __pyx_v_self->old_fullscreen = Py_None;

  /* "renpy/angle/gldraw.pyx":136
 *         # We don't use a fullscreen surface, so this needs to be set
 *         # to None at all times.
 *         self.fullscreen_surface = None             # <<<<<<<<<<<<<<
 * 
 *         # The display info, from pygame.
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->fullscreen_surface);
  __Pyx_DECREF(__pyx_v_self->fullscreen_surface);
  __pyx_v_self->fullscreen_surface = Py_None;

  /* "renpy/angle/gldraw.pyx":139
 * 
 *         # The display info, from pygame.
 *         self.display_info = None             # <<<<<<<<<<<<<<
 * 
 *         # Should we use the fast (but incorrect) dissolve mode?
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->display_info);
  __Pyx_DECREF(__pyx_v_self->display_info);
  __pyx_v_self->display_info = Py_None;

  /* "renpy/angle/gldraw.pyx":142
 * 
 *         # Should we use the fast (but incorrect) dissolve mode?
 *         self.fast_dissolve = False # renpy.android             # <<<<<<<<<<<<<<
 * 
 *         # Should we always report pixels as being always opaque?
 */
  __pyx_v_self->fast_dissolve = 0;

  /* "renpy/angle/gldraw.pyx":145
 * 
 *         # Should we always report pixels as being always opaque?
 *         self.always_opaque = renpy.android             # <<<<<<<<<<<<<<
 * 
 *         # Should we allow the fixed-function environment?
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); 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_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_android); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_self->always_opaque = __pyx_t_4;

  /* "renpy/angle/gldraw.pyx":148
 * 
 *         # Should we allow the fixed-function environment?
 *         self.allow_fixed = allow_fixed             # <<<<<<<<<<<<<<
 * 
 *         # Did we do the texture test at least once?
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_allow_fixed); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->allow_fixed = __pyx_t_4;

  /* "renpy/angle/gldraw.pyx":151
 * 
 *         # Did we do the texture test at least once?
 *         self.did_texture_test = False             # <<<<<<<<<<<<<<
 * 
 *         # Did we do a render_to_texture?
 */
  __pyx_v_self->did_texture_test = 0;

  /* "renpy/angle/gldraw.pyx":154
 * 
 *         # Did we do a render_to_texture?
 *         self.did_render_to_texture = False             # <<<<<<<<<<<<<<
 * 
 *         # The DPI scale factor.
 */
  __pyx_v_self->did_render_to_texture = 0;

  /* "renpy/angle/gldraw.pyx":157
 * 
 *         # The DPI scale factor.
 *         self.dpi_scale = renpy.display.interface.dpi_scale             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_display); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_interface); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_dpi_scale); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->dpi_scale = __pyx_t_5;

  /* "renpy/angle/gldraw.pyx":88
 * cdef class GLDraw:
 * 
 *     def __init__(self, allow_fixed=True):             # <<<<<<<<<<<<<<
 * 
 *         # Did we do the first-time init?
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/angle/gldraw.pyx":160
 * 
 * 
 *     def get_texture_size(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the amount of memory locked up in textures.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_3get_texture_size(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5renpy_5angle_6gldraw_6GLDraw_2get_texture_size[] = "\n        Returns the amount of memory locked up in textures.\n        ";
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_3get_texture_size(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_texture_size (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_2get_texture_size(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_2get_texture_size(CYTHON_UNUSED struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_texture_size", 0);

  /* "renpy/angle/gldraw.pyx":165
 *         """
 * 
 *         return gltexture.total_texture_size, gltexture.texture_count             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_gltexture); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_total_texture_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_gltexture); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_texture_count); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "renpy/angle/gldraw.pyx":160
 * 
 * 
 *     def get_texture_size(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the amount of memory locked up in textures.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.get_texture_size", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/angle/gldraw.pyx":168
 * 
 * 
 *     def set_mode(self, virtual_size, physical_size, fullscreen):             # <<<<<<<<<<<<<<
 *         """
 *         This changes the video mode. It also initializes OpenGL, if it
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_5set_mode(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5renpy_5angle_6gldraw_6GLDraw_4set_mode[] = "\n        This changes the video mode. It also initializes OpenGL, if it\n        can. It returns True if it was successful, or False if OpenGL isn't\n        working for some reason.\n        ";
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_5set_mode(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_virtual_size = 0;
  PyObject *__pyx_v_physical_size = 0;
  PyObject *__pyx_v_fullscreen = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_mode (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_virtual_size,&__pyx_n_s_physical_size,&__pyx_n_s_fullscreen,0};
    PyObject* values[3] = {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  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_virtual_size)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_physical_size)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_mode", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fullscreen)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_mode", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __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_mode") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      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);
    }
    __pyx_v_virtual_size = values[0];
    __pyx_v_physical_size = values[1];
    __pyx_v_fullscreen = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_mode", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.set_mode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_4set_mode(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self), __pyx_v_virtual_size, __pyx_v_physical_size, __pyx_v_fullscreen);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_4set_mode(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_virtual_size, PyObject *__pyx_v_physical_size, PyObject *__pyx_v_fullscreen) {
  char *__pyx_v_egl_error;
  PyObject *__pyx_v_vwidth = NULL;
  PyObject *__pyx_v_vheight = NULL;
  PyObject *__pyx_v_pwidth = NULL;
  PyObject *__pyx_v_pheight = NULL;
  PyObject *__pyx_v_virtual_ar = NULL;
  PyObject *__pyx_v_window_args = NULL;
  PyObject *__pyx_v_info = NULL;
  PyObject *__pyx_v_visible_w = NULL;
  PyObject *__pyx_v_visible_h = NULL;
  PyObject *__pyx_v_bounds = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_head_full_w = NULL;
  PyObject *__pyx_v_head_w = NULL;
  PyObject *__pyx_v_head_h = NULL;
  long __pyx_v_opengl;
  PyObject *__pyx_v_resizable = NULL;
  PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_v_view_width = NULL;
  PyObject *__pyx_v_view_height = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_physical_ar = NULL;
  PyObject *__pyx_v_ratio = NULL;
  PyObject *__pyx_v_px_padding = NULL;
  PyObject *__pyx_v_py_padding = NULL;
  PyObject *__pyx_v_x_padding = NULL;
  PyObject *__pyx_v_y_padding = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  long __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_mode", 0);
  __Pyx_INCREF(__pyx_v_fullscreen);

  /* "renpy/angle/gldraw.pyx":179
 *         cdef char *egl_error
 * 
 *         if not renpy.config.gl_enable:             # <<<<<<<<<<<<<<
 *             renpy.display.log.write("GL Disabled.")
 *             return False
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_config); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_gl_enable); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = ((!__pyx_t_3) != 0);
  if (__pyx_t_4) {

    /* "renpy/angle/gldraw.pyx":180
 * 
 *         if not renpy.config.gl_enable:
 *             renpy.display.log.write("GL Disabled.")             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_display); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_log); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "renpy/angle/gldraw.pyx":181
 *         if not renpy.config.gl_enable:
 *             renpy.display.log.write("GL Disabled.")
 *             return False             # <<<<<<<<<<<<<<
 * 
 *         if self.did_init:
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;

    /* "renpy/angle/gldraw.pyx":179
 *         cdef char *egl_error
 * 
 *         if not renpy.config.gl_enable:             # <<<<<<<<<<<<<<
 *             renpy.display.log.write("GL Disabled.")
 *             return False
 */
  }

  /* "renpy/angle/gldraw.pyx":183
 *             return False
 * 
 *         if self.did_init:             # <<<<<<<<<<<<<<
 *             self.deinit()
 * 
 */
  __pyx_t_4 = (__pyx_v_self->did_init != 0);
  if (__pyx_t_4) {

    /* "renpy/angle/gldraw.pyx":184
 * 
 *         if self.did_init:
 *             self.deinit()             # <<<<<<<<<<<<<<
 * 
 *         if renpy.android:
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_deinit); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (__pyx_t_5) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "renpy/angle/gldraw.pyx":183
 *             return False
 * 
 *         if self.did_init:             # <<<<<<<<<<<<<<
 *             self.deinit()
 * 
 */
  }

  /* "renpy/angle/gldraw.pyx":186
 *             self.deinit()
 * 
 *         if renpy.android:             # <<<<<<<<<<<<<<
 *             fullscreen = False
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_android); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_4) {

    /* "renpy/angle/gldraw.pyx":187
 * 
 *         if renpy.android:
 *             fullscreen = False             # <<<<<<<<<<<<<<
 * 
 *         if fullscreen != self.old_fullscreen:
 */
    __Pyx_INCREF(Py_False);
    __Pyx_DECREF_SET(__pyx_v_fullscreen, Py_False);

    /* "renpy/angle/gldraw.pyx":186
 *             self.deinit()
 * 
 *         if renpy.android:             # <<<<<<<<<<<<<<
 *             fullscreen = False
 * 
 */
  }

  /* "renpy/angle/gldraw.pyx":189
 *             fullscreen = False
 * 
 *         if fullscreen != self.old_fullscreen:             # <<<<<<<<<<<<<<
 * 
 *             self.did_init = False
 */
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_fullscreen, __pyx_v_self->old_fullscreen, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_4) {

    /* "renpy/angle/gldraw.pyx":191
 *         if fullscreen != self.old_fullscreen:
 * 
 *             self.did_init = False             # <<<<<<<<<<<<<<
 * 
 *             if self.old_fullscreen is not None:
 */
    __pyx_v_self->did_init = 0;

    /* "renpy/angle/gldraw.pyx":193
 *             self.did_init = False
 * 
 *             if self.old_fullscreen is not None:             # <<<<<<<<<<<<<<
 *                 pygame.display.quit()
 * 
 */
    __pyx_t_4 = (__pyx_v_self->old_fullscreen != Py_None);
    __pyx_t_3 = (__pyx_t_4 != 0);
    if (__pyx_t_3) {

      /* "renpy/angle/gldraw.pyx":194
 * 
 *             if self.old_fullscreen is not None:
 *                 pygame.display.quit()             # <<<<<<<<<<<<<<
 * 
 *             pygame.display.init()
 */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_display); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_quit); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      if (__pyx_t_5) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "renpy/angle/gldraw.pyx":193
 *             self.did_init = False
 * 
 *             if self.old_fullscreen is not None:             # <<<<<<<<<<<<<<
 *                 pygame.display.quit()
 * 
 */
    }

    /* "renpy/angle/gldraw.pyx":196
 *                 pygame.display.quit()
 * 
 *             pygame.display.init()             # <<<<<<<<<<<<<<
 * 
 *             if self.display_info is None:
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_display); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (__pyx_t_5) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "renpy/angle/gldraw.pyx":198
 *             pygame.display.init()
 * 
 *             if self.display_info is None:             # <<<<<<<<<<<<<<
 *                 self.display_info = renpy.display.get_info()
 * 
 */
    __pyx_t_3 = (__pyx_v_self->display_info == Py_None);
    __pyx_t_4 = (__pyx_t_3 != 0);
    if (__pyx_t_4) {

      /* "renpy/angle/gldraw.pyx":199
 * 
 *             if self.display_info is None:
 *                 self.display_info = renpy.display.get_info()             # <<<<<<<<<<<<<<
 * 
 *             self.old_fullscreen = fullscreen
 */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_display); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_get_info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      if (__pyx_t_5) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_v_self->display_info);
      __Pyx_DECREF(__pyx_v_self->display_info);
      __pyx_v_self->display_info = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "renpy/angle/gldraw.pyx":198
 *             pygame.display.init()
 * 
 *             if self.display_info is None:             # <<<<<<<<<<<<<<
 *                 self.display_info = renpy.display.get_info()
 * 
 */
    }

    /* "renpy/angle/gldraw.pyx":201
 *                 self.display_info = renpy.display.get_info()
 * 
 *             self.old_fullscreen = fullscreen             # <<<<<<<<<<<<<<
 * 
 *             renpy.display.interface.post_init()
 */
    __Pyx_INCREF(__pyx_v_fullscreen);
    __Pyx_GIVEREF(__pyx_v_fullscreen);
    __Pyx_GOTREF(__pyx_v_self->old_fullscreen);
    __Pyx_DECREF(__pyx_v_self->old_fullscreen);
    __pyx_v_self->old_fullscreen = __pyx_v_fullscreen;

    /* "renpy/angle/gldraw.pyx":203
 *             self.old_fullscreen = fullscreen
 * 
 *             renpy.display.interface.post_init()             # <<<<<<<<<<<<<<
 * 
 *         renpy.display.log.write("")
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_display); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_interface); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_post_init); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (__pyx_t_1) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "renpy/angle/gldraw.pyx":189
 *             fullscreen = False
 * 
 *         if fullscreen != self.old_fullscreen:             # <<<<<<<<<<<<<<
 * 
 *             self.did_init = False
 */
  }

  /* "renpy/angle/gldraw.pyx":205
 *             renpy.display.interface.post_init()
 * 
 *         renpy.display.log.write("")             # <<<<<<<<<<<<<<
 * 
 *         self.virtual_size = virtual_size
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_display); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_log); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "renpy/angle/gldraw.pyx":207
 *         renpy.display.log.write("")
 * 
 *         self.virtual_size = virtual_size             # <<<<<<<<<<<<<<
 * 
 *         vwidth, vheight = virtual_size
 */
  if (!(likely(PyTuple_CheckExact(__pyx_v_virtual_size))||((__pyx_v_virtual_size) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_virtual_size)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __pyx_v_virtual_size;
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->virtual_size);
  __Pyx_DECREF(__pyx_v_self->virtual_size);
  __pyx_v_self->virtual_size = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "renpy/angle/gldraw.pyx":209
 *         self.virtual_size = virtual_size
 * 
 *         vwidth, vheight = virtual_size             # <<<<<<<<<<<<<<
 *         pwidth, pheight = physical_size
 * 
 */
  if ((likely(PyTuple_CheckExact(__pyx_v_virtual_size))) || (PyList_CheckExact(__pyx_v_virtual_size))) {
    PyObject* sequence = __pyx_v_virtual_size;
    #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 = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_5);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    #endif
  } else {
    Py_ssize_t index = -1;
    __pyx_t_1 = PyObject_GetIter(__pyx_v_virtual_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_1); if (unlikely(!__pyx_t_2)) goto __pyx_L9_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_5 = __pyx_t_6(__pyx_t_1); if (unlikely(!__pyx_t_5)) goto __pyx_L9_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_1), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = NULL;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L10_unpacking_done;
    __pyx_L9_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L10_unpacking_done:;
  }
  __pyx_v_vwidth = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_vheight = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "renpy/angle/gldraw.pyx":210
 * 
 *         vwidth, vheight = virtual_size
 *         pwidth, pheight = physical_size             # <<<<<<<<<<<<<<
 * 
 *         if pwidth is None:
 */
  if ((likely(PyTuple_CheckExact(__pyx_v_physical_size))) || (PyList_CheckExact(__pyx_v_physical_size))) {
    PyObject* sequence = __pyx_v_physical_size;
    #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 = 210; __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_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    #endif
  } else {
    Py_ssize_t index = -1;
    __pyx_t_1 = PyObject_GetIter(__pyx_v_physical_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext;
    index = 0; __pyx_t_5 = __pyx_t_6(__pyx_t_1); if (unlikely(!__pyx_t_5)) goto __pyx_L11_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    index = 1; __pyx_t_2 = __pyx_t_6(__pyx_t_1); if (unlikely(!__pyx_t_2)) goto __pyx_L11_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_1), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = NULL;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L12_unpacking_done;
    __pyx_L11_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L12_unpacking_done:;
  }
  __pyx_v_pwidth = __pyx_t_5;
  __pyx_t_5 = 0;
  __pyx_v_pheight = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "renpy/angle/gldraw.pyx":212
 *         pwidth, pheight = physical_size
 * 
 *         if pwidth is None:             # <<<<<<<<<<<<<<
 *             pwidth = vwidth
 *             pheight = vheight
 */
  __pyx_t_4 = (__pyx_v_pwidth == Py_None);
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "renpy/angle/gldraw.pyx":213
 * 
 *         if pwidth is None:
 *             pwidth = vwidth             # <<<<<<<<<<<<<<
 *             pheight = vheight
 * 
 */
    __Pyx_INCREF(__pyx_v_vwidth);
    __Pyx_DECREF_SET(__pyx_v_pwidth, __pyx_v_vwidth);

    /* "renpy/angle/gldraw.pyx":214
 *         if pwidth is None:
 *             pwidth = vwidth
 *             pheight = vheight             # <<<<<<<<<<<<<<
 * 
 *         virtual_ar = 1.0 * vwidth / vheight
 */
    __Pyx_INCREF(__pyx_v_vheight);
    __Pyx_DECREF_SET(__pyx_v_pheight, __pyx_v_vheight);

    /* "renpy/angle/gldraw.pyx":212
 *         pwidth, pheight = physical_size
 * 
 *         if pwidth is None:             # <<<<<<<<<<<<<<
 *             pwidth = vwidth
 *             pheight = vheight
 */
  }

  /* "renpy/angle/gldraw.pyx":216
 *             pheight = vheight
 * 
 *         virtual_ar = 1.0 * vwidth / vheight             # <<<<<<<<<<<<<<
 * 
 *         pwidth *= self.dpi_scale
 */
  __pyx_t_2 = PyNumber_Multiply(__pyx_float_1_0, __pyx_v_vwidth); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_v_vheight); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_virtual_ar = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "renpy/angle/gldraw.pyx":218
 *         virtual_ar = 1.0 * vwidth / vheight
 * 
 *         pwidth *= self.dpi_scale             # <<<<<<<<<<<<<<
 *         pheight *= self.dpi_scale
 * 
 */
  __pyx_t_5 = PyFloat_FromDouble(__pyx_v_self->dpi_scale); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = PyNumber_InPlaceMultiply(__pyx_v_pwidth, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF_SET(__pyx_v_pwidth, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "renpy/angle/gldraw.pyx":219
 * 
 *         pwidth *= self.dpi_scale
 *         pheight *= self.dpi_scale             # <<<<<<<<<<<<<<
 * 
 *         pwidth = max(vwidth / 2, pwidth)
 */
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->dpi_scale); 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_t_5 = PyNumber_InPlaceMultiply(__pyx_v_pheight, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_pheight, __pyx_t_5);
  __pyx_t_5 = 0;

  /* "renpy/angle/gldraw.pyx":221
 *         pheight *= self.dpi_scale
 * 
 *         pwidth = max(vwidth / 2, pwidth)             # <<<<<<<<<<<<<<
 *         pheight = max(vheight / 2, pheight)
 * 
 */
  __Pyx_INCREF(__pyx_v_pwidth);
  __pyx_t_5 = __pyx_v_pwidth;
  __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_v_vwidth, __pyx_int_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = PyObject_RichCompare(__pyx_t_5, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__pyx_t_3) {
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_1 = __pyx_t_5;
  } else {
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __pyx_t_1;
  __Pyx_INCREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF_SET(__pyx_v_pwidth, __pyx_t_5);
  __pyx_t_5 = 0;

  /* "renpy/angle/gldraw.pyx":222
 * 
 *         pwidth = max(vwidth / 2, pwidth)
 *         pheight = max(vheight / 2, pheight)             # <<<<<<<<<<<<<<
 * 
 *         window_args = { }
 */
  __Pyx_INCREF(__pyx_v_pheight);
  __pyx_t_5 = __pyx_v_pheight;
  __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_v_vheight, __pyx_int_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = PyObject_RichCompare(__pyx_t_5, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__pyx_t_3) {
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_2 = __pyx_t_5;
  } else {
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = __pyx_t_1;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __pyx_t_2;
  __Pyx_INCREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_pheight, __pyx_t_5);
  __pyx_t_5 = 0;

  /* "renpy/angle/gldraw.pyx":224
 *         pheight = max(vheight / 2, pheight)
 * 
 *         window_args = { }             # <<<<<<<<<<<<<<
 * 
 *         if not renpy.mobile:
 */
  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_v_window_args = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "renpy/angle/gldraw.pyx":226
 *         window_args = { }
 * 
 *         if not renpy.mobile:             # <<<<<<<<<<<<<<
 *             info = renpy.display.get_info()
 * 
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_mobile); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = ((!__pyx_t_3) != 0);
  if (__pyx_t_4) {

    /* "renpy/angle/gldraw.pyx":227
 * 
 *         if not renpy.mobile:
 *             info = renpy.display.get_info()             # <<<<<<<<<<<<<<
 * 
 *             visible_w = info.current_w
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_display); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_get_info); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (__pyx_t_1) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_info = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "renpy/angle/gldraw.pyx":229
 *             info = renpy.display.get_info()
 * 
 *             visible_w = info.current_w             # <<<<<<<<<<<<<<
 *             visible_h = info.current_h
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_info, __pyx_n_s_current_w); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_visible_w = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "renpy/angle/gldraw.pyx":230
 * 
 *             visible_w = info.current_w
 *             visible_h = info.current_h             # <<<<<<<<<<<<<<
 * 
 *             if renpy.windows and renpy.windows <= (6, 1):
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_info, __pyx_n_s_current_h); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_visible_h = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "renpy/angle/gldraw.pyx":232
 *             visible_h = info.current_h
 * 
 *             if renpy.windows and renpy.windows <= (6, 1):             # <<<<<<<<<<<<<<
 *                 visible_h -= 102
 * 
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_windows); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_3) {
    } else {
      __pyx_t_4 = __pyx_t_3;
      goto __pyx_L16_bool_binop_done;
    }
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_windows); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_tuple__5, Py_LE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_4 = __pyx_t_3;
    __pyx_L16_bool_binop_done:;
    if (__pyx_t_4) {

      /* "renpy/angle/gldraw.pyx":233
 * 
 *             if renpy.windows and renpy.windows <= (6, 1):
 *                 visible_h -= 102             # <<<<<<<<<<<<<<
 * 
 *             bounds = pygame.display.get_display_bounds(0)
 */
      __pyx_t_5 = __Pyx_PyInt_SubtractObjC(__pyx_v_visible_h, __pyx_int_102, 0x66, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF_SET(__pyx_v_visible_h, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "renpy/angle/gldraw.pyx":232
 *             visible_h = info.current_h
 * 
 *             if renpy.windows and renpy.windows <= (6, 1):             # <<<<<<<<<<<<<<
 *                 visible_h -= 102
 * 
 */
    }

    /* "renpy/angle/gldraw.pyx":235
 *                 visible_h -= 102
 * 
 *             bounds = pygame.display.get_display_bounds(0)             # <<<<<<<<<<<<<<
 * 
 *             renpy.display.log.write("primary display bounds: %r", bounds)
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_display); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get_display_bounds); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_bounds = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "renpy/angle/gldraw.pyx":237
 *             bounds = pygame.display.get_display_bounds(0)
 * 
 *             renpy.display.log.write("primary display bounds: %r", bounds)             # <<<<<<<<<<<<<<
 * 
 *             head_full_w = bounds[2]
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_display); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_log); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_8 = 1;
      }
    }
    __pyx_t_7 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_INCREF(__pyx_kp_s_primary_display_bounds_r);
    __Pyx_GIVEREF(__pyx_kp_s_primary_display_bounds_r);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_kp_s_primary_display_bounds_r);
    __Pyx_INCREF(__pyx_v_bounds);
    __Pyx_GIVEREF(__pyx_v_bounds);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_v_bounds);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "renpy/angle/gldraw.pyx":239
 *             renpy.display.log.write("primary display bounds: %r", bounds)
 * 
 *             head_full_w = bounds[2]             # <<<<<<<<<<<<<<
 *             head_w = bounds[2] - 102
 *             head_h = bounds[3] - 102
 */
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_bounds, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_head_full_w = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "renpy/angle/gldraw.pyx":240
 * 
 *             head_full_w = bounds[2]
 *             head_w = bounds[2] - 102             # <<<<<<<<<<<<<<
 *             head_h = bounds[3] - 102
 * 
 */
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_bounds, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_t_2, __pyx_int_102, 0x66, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_head_w = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "renpy/angle/gldraw.pyx":241
 *             head_full_w = bounds[2]
 *             head_w = bounds[2] - 102
 *             head_h = bounds[3] - 102             # <<<<<<<<<<<<<<
 * 
 *             pwidth = min(visible_w, pwidth)
 */
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_bounds, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_t_1, __pyx_int_102, 0x66, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_head_h = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "renpy/angle/gldraw.pyx":243
 *             head_h = bounds[3] - 102
 * 
 *             pwidth = min(visible_w, pwidth)             # <<<<<<<<<<<<<<
 *             pheight = min(visible_h, pheight)
 * 
 */
    __Pyx_INCREF(__pyx_v_pwidth);
    __pyx_t_2 = __pyx_v_pwidth;
    __Pyx_INCREF(__pyx_v_visible_w);
    __pyx_t_1 = __pyx_v_visible_w;
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_4) {
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_7 = __pyx_t_2;
    } else {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_7 = __pyx_t_1;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __pyx_t_7;
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF_SET(__pyx_v_pwidth, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "renpy/angle/gldraw.pyx":244
 * 
 *             pwidth = min(visible_w, pwidth)
 *             pheight = min(visible_h, pheight)             # <<<<<<<<<<<<<<
 * 
 *             # The first time through.
 */
    __Pyx_INCREF(__pyx_v_pheight);
    __pyx_t_2 = __pyx_v_pheight;
    __Pyx_INCREF(__pyx_v_visible_h);
    __pyx_t_7 = __pyx_v_visible_h;
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_7, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_4) {
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_1 = __pyx_t_2;
    } else {
      __Pyx_INCREF(__pyx_t_7);
      __pyx_t_1 = __pyx_t_7;
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __pyx_t_1;
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_pheight, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "renpy/angle/gldraw.pyx":247
 * 
 *             # The first time through.
 *             if not self.did_init:             # <<<<<<<<<<<<<<
 *                 pwidth = min(pwidth, head_w)
 *                 pheight = min(pheight, head_h)
 */
    __pyx_t_4 = ((!(__pyx_v_self->did_init != 0)) != 0);
    if (__pyx_t_4) {

      /* "renpy/angle/gldraw.pyx":248
 *             # The first time through.
 *             if not self.did_init:
 *                 pwidth = min(pwidth, head_w)             # <<<<<<<<<<<<<<
 *                 pheight = min(pheight, head_h)
 * 
 */
      __Pyx_INCREF(__pyx_v_head_w);
      __pyx_t_2 = __pyx_v_head_w;
      __Pyx_INCREF(__pyx_v_pwidth);
      __pyx_t_1 = __pyx_v_pwidth;
      __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_4) {
        __Pyx_INCREF(__pyx_t_2);
        __pyx_t_7 = __pyx_t_2;
      } else {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_7 = __pyx_t_1;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __pyx_t_7;
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF_SET(__pyx_v_pwidth, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "renpy/angle/gldraw.pyx":249
 *             if not self.did_init:
 *                 pwidth = min(pwidth, head_w)
 *                 pheight = min(pheight, head_h)             # <<<<<<<<<<<<<<
 * 
 *                 pwidth, pheight = min(pheight * virtual_ar, pwidth), min(pwidth / virtual_ar, pheight)
 */
      __Pyx_INCREF(__pyx_v_head_h);
      __pyx_t_2 = __pyx_v_head_h;
      __Pyx_INCREF(__pyx_v_pheight);
      __pyx_t_7 = __pyx_v_pheight;
      __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_7, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_4) {
        __Pyx_INCREF(__pyx_t_2);
        __pyx_t_1 = __pyx_t_2;
      } else {
        __Pyx_INCREF(__pyx_t_7);
        __pyx_t_1 = __pyx_t_7;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __pyx_t_1;
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF_SET(__pyx_v_pheight, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "renpy/angle/gldraw.pyx":251
 *                 pheight = min(pheight, head_h)
 * 
 *                 pwidth, pheight = min(pheight * virtual_ar, pwidth), min(pwidth / virtual_ar, pheight)             # <<<<<<<<<<<<<<
 * 
 *         pwidth = int(round(pwidth))
 */
      __Pyx_INCREF(__pyx_v_pwidth);
      __pyx_t_2 = __pyx_v_pwidth;
      __pyx_t_1 = PyNumber_Multiply(__pyx_v_pheight, __pyx_v_virtual_ar); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_4) {
        __Pyx_INCREF(__pyx_t_2);
        __pyx_t_7 = __pyx_t_2;
      } else {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_7 = __pyx_t_1;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __pyx_t_7;
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_INCREF(__pyx_v_pheight);
      __pyx_t_7 = __pyx_v_pheight;
      __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_v_pwidth, __pyx_v_virtual_ar); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_9 = PyObject_RichCompare(__pyx_t_7, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (__pyx_t_4) {
        __Pyx_INCREF(__pyx_t_7);
        __pyx_t_5 = __pyx_t_7;
      } else {
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_5 = __pyx_t_1;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __pyx_t_5;
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF_SET(__pyx_v_pwidth, __pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF_SET(__pyx_v_pheight, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "renpy/angle/gldraw.pyx":247
 * 
 *             # The first time through.
 *             if not self.did_init:             # <<<<<<<<<<<<<<
 *                 pwidth = min(pwidth, head_w)
 *                 pheight = min(pheight, head_h)
 */
    }

    /* "renpy/angle/gldraw.pyx":226
 *         window_args = { }
 * 
 *         if not renpy.mobile:             # <<<<<<<<<<<<<<
 *             info = renpy.display.get_info()
 * 
 */
  }

  /* "renpy/angle/gldraw.pyx":253
 *                 pwidth, pheight = min(pheight * virtual_ar, pwidth), min(pwidth / virtual_ar, pheight)
 * 
 *         pwidth = int(round(pwidth))             # <<<<<<<<<<<<<<
 *         pheight = int(round(pheight))
 * 
 */
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(__pyx_v_pwidth);
  __Pyx_GIVEREF(__pyx_v_pwidth);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_pwidth);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_pwidth, __pyx_t_7);
  __pyx_t_7 = 0;

  /* "renpy/angle/gldraw.pyx":254
 * 
 *         pwidth = int(round(pwidth))
 *         pheight = int(round(pheight))             # <<<<<<<<<<<<<<
 * 
 *         pwidth = max(pwidth, 256)
 */
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(__pyx_v_pheight);
  __Pyx_GIVEREF(__pyx_v_pheight);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_pheight);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_pheight, __pyx_t_7);
  __pyx_t_7 = 0;

  /* "renpy/angle/gldraw.pyx":256
 *         pheight = int(round(pheight))
 * 
 *         pwidth = max(pwidth, 256)             # <<<<<<<<<<<<<<
 *         pheight = max(pheight, 256)
 * 
 */
  __pyx_t_10 = 0x100;
  __Pyx_INCREF(__pyx_v_pwidth);
  __pyx_t_7 = __pyx_v_pwidth;
  __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_10); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_t_7, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_t_10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_t_1;
    __pyx_t_1 = 0;
  } else {
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_2 = __pyx_t_7;
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __pyx_t_2;
  __Pyx_INCREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_pwidth, __pyx_t_7);
  __pyx_t_7 = 0;

  /* "renpy/angle/gldraw.pyx":257
 * 
 *         pwidth = max(pwidth, 256)
 *         pheight = max(pheight, 256)             # <<<<<<<<<<<<<<
 * 
 *         # Handle swap control.
 */
  __pyx_t_10 = 0x100;
  __Pyx_INCREF(__pyx_v_pheight);
  __pyx_t_7 = __pyx_v_pheight;
  __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_t_10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_7, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_4) {
    __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_10); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __pyx_t_5;
    __pyx_t_5 = 0;
  } else {
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_2 = __pyx_t_7;
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __pyx_t_2;
  __Pyx_INCREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_pheight, __pyx_t_7);
  __pyx_t_7 = 0;

  /* "renpy/angle/gldraw.pyx":260
 * 
 *         # Handle swap control.
 *         vsync = int(os.environ.get("RENPY_GL_VSYNC", "1"))             # <<<<<<<<<<<<<<
 * 
 *         if ANGLE:
 */
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_environ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_vsync, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "renpy/angle/gldraw.pyx":263
 * 
 *         if ANGLE:
 *             opengl = 0             # <<<<<<<<<<<<<<
 *             resizable = pygame.RESIZABLE
 * 
 */
  __pyx_v_opengl = 0;

  /* "renpy/angle/gldraw.pyx":264
 *         if ANGLE:
 *             opengl = 0
 *             resizable = pygame.RESIZABLE             # <<<<<<<<<<<<<<
 * 
 *         elif EGL:
 */
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_RESIZABLE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_v_resizable = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "renpy/angle/gldraw.pyx":298
 *                 resizable = 0
 * 
 *         if opengl:             # <<<<<<<<<<<<<<
 *             pygame.display.gl_set_attribute(pygame.GL_SWAP_CONTROL, vsync)
 *             pygame.display.gl_set_attribute(pygame.GL_ALPHA_SIZE, 8)
 */
  __pyx_t_4 = (__pyx_v_opengl != 0);
  if (__pyx_t_4) {

    /* "renpy/angle/gldraw.pyx":299
 * 
 *         if opengl:
 *             pygame.display.gl_set_attribute(pygame.GL_SWAP_CONTROL, vsync)             # <<<<<<<<<<<<<<
 *             pygame.display.gl_set_attribute(pygame.GL_ALPHA_SIZE, 8)
 * 
 */
    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_display); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_gl_set_attribute); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_GL_SWAP_CONTROL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_vsync); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_9 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
        __pyx_t_8 = 1;
      }
    }
    __pyx_t_11 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    if (__pyx_t_9) {
      __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_8, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_8, __pyx_t_5);
    __pyx_t_1 = 0;
    __pyx_t_5 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "renpy/angle/gldraw.pyx":300
 *         if opengl:
 *             pygame.display.gl_set_attribute(pygame.GL_SWAP_CONTROL, vsync)
 *             pygame.display.gl_set_attribute(pygame.GL_ALPHA_SIZE, 8)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_display); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_gl_set_attribute); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_GL_ALPHA_SIZE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_11 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_11)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_11);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
        __pyx_t_8 = 1;
      }
    }
    __pyx_t_1 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (__pyx_t_11) {
      __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_11); __pyx_t_11 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_8, __pyx_t_5);
    __Pyx_INCREF(__pyx_int_8);
    __Pyx_GIVEREF(__pyx_int_8);
    PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_8, __pyx_int_8);
    __pyx_t_5 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "renpy/angle/gldraw.pyx":298
 *                 resizable = 0
 * 
 *         if opengl:             # <<<<<<<<<<<<<<
 *             pygame.display.gl_set_attribute(pygame.GL_SWAP_CONTROL, vsync)
 *             pygame.display.gl_set_attribute(pygame.GL_ALPHA_SIZE, 8)
 */
  }

  /* "renpy/angle/gldraw.pyx":303
 * 
 * 
 *         self.window = None             # <<<<<<<<<<<<<<
 * 
 *         if fullscreen:
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->window);
  __Pyx_DECREF(__pyx_v_self->window);
  __pyx_v_self->window = Py_None;

  /* "renpy/angle/gldraw.pyx":305
 *         self.window = None
 * 
 *         if fullscreen:             # <<<<<<<<<<<<<<
 *             try:
 *                 renpy.display.log.write("Fullscreen mode.")
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_fullscreen); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_4) {

    /* "renpy/angle/gldraw.pyx":306
 * 
 *         if fullscreen:
 *             try:             # <<<<<<<<<<<<<<
 *                 renpy.display.log.write("Fullscreen mode.")
 *                 self.window = pygame.display.set_mode((0, 0), pygame.WINDOW_FULLSCREEN_DESKTOP | opengl | pygame.DOUBLEBUF)
 */
    {
      __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
      __Pyx_XGOTREF(__pyx_t_12);
      __Pyx_XGOTREF(__pyx_t_13);
      __Pyx_XGOTREF(__pyx_t_14);
      /*try:*/ {

        /* "renpy/angle/gldraw.pyx":307
 *         if fullscreen:
 *             try:
 *                 renpy.display.log.write("Fullscreen mode.")             # <<<<<<<<<<<<<<
 *                 self.window = pygame.display.set_mode((0, 0), pygame.WINDOW_FULLSCREEN_DESKTOP | opengl | pygame.DOUBLEBUF)
 *             except pygame.error as e:
 */
        __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L21_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_display); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L21_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_log); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L21_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_write); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L21_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L21_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "renpy/angle/gldraw.pyx":308
 *             try:
 *                 renpy.display.log.write("Fullscreen mode.")
 *                 self.window = pygame.display.set_mode((0, 0), pygame.WINDOW_FULLSCREEN_DESKTOP | opengl | pygame.DOUBLEBUF)             # <<<<<<<<<<<<<<
 *             except pygame.error as e:
 *                 renpy.display.log.write("Opening in fullscreen failed: %r", e)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L21_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_display); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L21_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_set_mode); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L21_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L21_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_WINDOW_FULLSCREEN_DESKTOP); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L21_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_opengl); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L21_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_11 = PyNumber_Or(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L21_error;}
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L21_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_DOUBLEBUF); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L21_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = PyNumber_Or(__pyx_t_11, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L21_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = NULL;
        __pyx_t_8 = 0;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_7, function);
            __pyx_t_8 = 1;
          }
        }
        __pyx_t_11 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L21_error;}
        __Pyx_GOTREF(__pyx_t_11);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_tuple__9);
        __Pyx_GIVEREF(__pyx_tuple__9);
        PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_8, __pyx_tuple__9);
        __Pyx_GIVEREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_8, __pyx_t_1);
        __pyx_t_1 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L21_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GIVEREF(__pyx_t_2);
        __Pyx_GOTREF(__pyx_v_self->window);
        __Pyx_DECREF(__pyx_v_self->window);
        __pyx_v_self->window = __pyx_t_2;
        __pyx_t_2 = 0;

        /* "renpy/angle/gldraw.pyx":306
 * 
 *         if fullscreen:
 *             try:             # <<<<<<<<<<<<<<
 *                 renpy.display.log.write("Fullscreen mode.")
 *                 self.window = pygame.display.set_mode((0, 0), pygame.WINDOW_FULLSCREEN_DESKTOP | opengl | pygame.DOUBLEBUF)
 */
      }
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      goto __pyx_L28_try_end;
      __pyx_L21_error:;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "renpy/angle/gldraw.pyx":309
 *                 renpy.display.log.write("Fullscreen mode.")
 *                 self.window = pygame.display.set_mode((0, 0), pygame.WINDOW_FULLSCREEN_DESKTOP | opengl | pygame.DOUBLEBUF)
 *             except pygame.error as e:             # <<<<<<<<<<<<<<
 *                 renpy.display.log.write("Opening in fullscreen failed: %r", e)
 *                 self.window = None
 */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L23_except_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L23_except_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_15 = PyErr_ExceptionMatches(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (__pyx_t_15) {
        __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.set_mode", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_2, &__pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L23_except_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_INCREF(__pyx_t_2);
        __pyx_v_e = __pyx_t_2;

        /* "renpy/angle/gldraw.pyx":310
 *                 self.window = pygame.display.set_mode((0, 0), pygame.WINDOW_FULLSCREEN_DESKTOP | opengl | pygame.DOUBLEBUF)
 *             except pygame.error as e:
 *                 renpy.display.log.write("Opening in fullscreen failed: %r", e)             # <<<<<<<<<<<<<<
 *                 self.window = None
 * 
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L23_except_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_display); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L23_except_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_log); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L23_except_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_write); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L23_except_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = NULL;
        __pyx_t_8 = 0;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_9))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_9, function);
            __pyx_t_8 = 1;
          }
        }
        __pyx_t_16 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L23_except_error;}
        __Pyx_GOTREF(__pyx_t_16);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_kp_s_Opening_in_fullscreen_failed_r);
        __Pyx_GIVEREF(__pyx_kp_s_Opening_in_fullscreen_failed_r);
        PyTuple_SET_ITEM(__pyx_t_16, 0+__pyx_t_8, __pyx_kp_s_Opening_in_fullscreen_failed_r);
        __Pyx_INCREF(__pyx_v_e);
        __Pyx_GIVEREF(__pyx_v_e);
        PyTuple_SET_ITEM(__pyx_t_16, 1+__pyx_t_8, __pyx_v_e);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_16, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L23_except_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "renpy/angle/gldraw.pyx":311
 *             except pygame.error as e:
 *                 renpy.display.log.write("Opening in fullscreen failed: %r", e)
 *                 self.window = None             # <<<<<<<<<<<<<<
 * 
 *         if self.window is None:
 */
        __Pyx_INCREF(Py_None);
        __Pyx_GIVEREF(Py_None);
        __Pyx_GOTREF(__pyx_v_self->window);
        __Pyx_DECREF(__pyx_v_self->window);
        __pyx_v_self->window = Py_None;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        goto __pyx_L22_exception_handled;
      }
      goto __pyx_L23_except_error;
      __pyx_L23_except_error:;

      /* "renpy/angle/gldraw.pyx":306
 * 
 *         if fullscreen:
 *             try:             # <<<<<<<<<<<<<<
 *                 renpy.display.log.write("Fullscreen mode.")
 *                 self.window = pygame.display.set_mode((0, 0), pygame.WINDOW_FULLSCREEN_DESKTOP | opengl | pygame.DOUBLEBUF)
 */
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_XGIVEREF(__pyx_t_14);
      __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
      goto __pyx_L1_error;
      __pyx_L22_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_XGIVEREF(__pyx_t_14);
      __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
      __pyx_L28_try_end:;
    }

    /* "renpy/angle/gldraw.pyx":305
 *         self.window = None
 * 
 *         if fullscreen:             # <<<<<<<<<<<<<<
 *             try:
 *                 renpy.display.log.write("Fullscreen mode.")
 */
  }

  /* "renpy/angle/gldraw.pyx":313
 *                 self.window = None
 * 
 *         if self.window is None:             # <<<<<<<<<<<<<<
 *             try:
 *                 renpy.display.log.write("Windowed mode.")
 */
  __pyx_t_4 = (__pyx_v_self->window == Py_None);
  __pyx_t_3 = (__pyx_t_4 != 0);
  if (__pyx_t_3) {

    /* "renpy/angle/gldraw.pyx":314
 * 
 *         if self.window is None:
 *             try:             # <<<<<<<<<<<<<<
 *                 renpy.display.log.write("Windowed mode.")
 *                 self.window = pygame.display.set_mode((pwidth, pheight), resizable | opengl | pygame.DOUBLEBUF, **window_args)
 */
    {
      __Pyx_ExceptionSave(&__pyx_t_14, &__pyx_t_13, &__pyx_t_12);
      __Pyx_XGOTREF(__pyx_t_14);
      __Pyx_XGOTREF(__pyx_t_13);
      __Pyx_XGOTREF(__pyx_t_12);
      /*try:*/ {

        /* "renpy/angle/gldraw.pyx":315
 *         if self.window is None:
 *             try:
 *                 renpy.display.log.write("Windowed mode.")             # <<<<<<<<<<<<<<
 *                 self.window = pygame.display.set_mode((pwidth, pheight), resizable | opengl | pygame.DOUBLEBUF, **window_args)
 * 
 */
        __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L32_error;}
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_display); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L32_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_log); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L32_error;}
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L32_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L32_error;}
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

        /* "renpy/angle/gldraw.pyx":316
 *             try:
 *                 renpy.display.log.write("Windowed mode.")
 *                 self.window = pygame.display.set_mode((pwidth, pheight), resizable | opengl | pygame.DOUBLEBUF, **window_args)             # <<<<<<<<<<<<<<
 * 
 *             except pygame.error, e:
 */
        __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L32_error;}
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_display); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L32_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_set_mode); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L32_error;}
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L32_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_v_pwidth);
        __Pyx_GIVEREF(__pyx_v_pwidth);
        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_pwidth);
        __Pyx_INCREF(__pyx_v_pheight);
        __Pyx_GIVEREF(__pyx_v_pheight);
        PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_pheight);
        __pyx_t_7 = __Pyx_PyInt_From_long(__pyx_v_opengl); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L32_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_1 = PyNumber_Or(__pyx_v_resizable, __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L32_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L32_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_DOUBLEBUF); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L32_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = PyNumber_Or(__pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L32_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L32_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_7);
        PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7);
        __pyx_t_2 = 0;
        __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_9, __pyx_v_window_args); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L32_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_GIVEREF(__pyx_t_7);
        __Pyx_GOTREF(__pyx_v_self->window);
        __Pyx_DECREF(__pyx_v_self->window);
        __pyx_v_self->window = __pyx_t_7;
        __pyx_t_7 = 0;

        /* "renpy/angle/gldraw.pyx":314
 * 
 *         if self.window is None:
 *             try:             # <<<<<<<<<<<<<<
 *                 renpy.display.log.write("Windowed mode.")
 *                 self.window = pygame.display.set_mode((pwidth, pheight), resizable | opengl | pygame.DOUBLEBUF, **window_args)
 */
      }
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      goto __pyx_L39_try_end;
      __pyx_L32_error:;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "renpy/angle/gldraw.pyx":318
 *                 self.window = pygame.display.set_mode((pwidth, pheight), resizable | opengl | pygame.DOUBLEBUF, **window_args)
 * 
 *             except pygame.error, e:             # <<<<<<<<<<<<<<
 *                 renpy.display.log.write("Could not get pygame screen: %r", e)
 *                 return False
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L34_except_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_error); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L34_except_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_15 = PyErr_ExceptionMatches(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (__pyx_t_15) {
        __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.set_mode", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_7, &__pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L34_except_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_XDECREF_SET(__pyx_v_e, __pyx_t_7);

        /* "renpy/angle/gldraw.pyx":319
 * 
 *             except pygame.error, e:
 *                 renpy.display.log.write("Could not get pygame screen: %r", e)             # <<<<<<<<<<<<<<
 *                 return False
 * 
 */
        __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L34_except_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_display); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L34_except_error;}
        __Pyx_GOTREF(__pyx_t_16);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_log); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L34_except_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_write); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L34_except_error;}
        __Pyx_GOTREF(__pyx_t_16);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = NULL;
        __pyx_t_8 = 0;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_16))) {
          __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_16);
          if (likely(__pyx_t_1)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16);
            __Pyx_INCREF(__pyx_t_1);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_16, function);
            __pyx_t_8 = 1;
          }
        }
        __pyx_t_5 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L34_except_error;}
        __Pyx_GOTREF(__pyx_t_5);
        if (__pyx_t_1) {
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = NULL;
        }
        __Pyx_INCREF(__pyx_kp_s_Could_not_get_pygame_screen_r);
        __Pyx_GIVEREF(__pyx_kp_s_Could_not_get_pygame_screen_r);
        PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_8, __pyx_kp_s_Could_not_get_pygame_screen_r);
        __Pyx_INCREF(__pyx_v_e);
        __Pyx_GIVEREF(__pyx_v_e);
        PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_8, __pyx_v_e);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_16, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L34_except_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "renpy/angle/gldraw.pyx":320
 *             except pygame.error, e:
 *                 renpy.display.log.write("Could not get pygame screen: %r", e)
 *                 return False             # <<<<<<<<<<<<<<
 * 
 *         # Use EGL to get the OpenGL ES 2 context, if necessary.
 */
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(Py_False);
        __pyx_r = Py_False;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        goto __pyx_L35_except_return;
      }
      goto __pyx_L34_except_error;
      __pyx_L34_except_error:;

      /* "renpy/angle/gldraw.pyx":314
 * 
 *         if self.window is None:
 *             try:             # <<<<<<<<<<<<<<
 *                 renpy.display.log.write("Windowed mode.")
 *                 self.window = pygame.display.set_mode((pwidth, pheight), resizable | opengl | pygame.DOUBLEBUF, **window_args)
 */
      __Pyx_XGIVEREF(__pyx_t_14);
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_13, __pyx_t_12);
      goto __pyx_L1_error;
      __pyx_L35_except_return:;
      __Pyx_XGIVEREF(__pyx_t_14);
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_13, __pyx_t_12);
      goto __pyx_L0;
      __pyx_L39_try_end:;
    }

    /* "renpy/angle/gldraw.pyx":313
 *                 self.window = None
 * 
 *         if self.window is None:             # <<<<<<<<<<<<<<
 *             try:
 *                 renpy.display.log.write("Windowed mode.")
 */
  }

  /* "renpy/angle/gldraw.pyx":323
 * 
 *         # Use EGL to get the OpenGL ES 2 context, if necessary.
 *         if EGL:             # <<<<<<<<<<<<<<
 * 
 *             # This ensures the display is shown.
 */
  __pyx_t_3 = (__pyx_v_5renpy_5angle_6gldraw_EGL != 0);
  if (__pyx_t_3) {

    /* "renpy/angle/gldraw.pyx":326
 * 
 *             # This ensures the display is shown.
 *             pygame.display.flip()             # <<<<<<<<<<<<<<
 * 
 *             egl_error = egl_init(PyWindow_AsWindow(None), vsync)
 */
    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_display); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_flip); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    if (__pyx_t_9) {
      __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_9); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    } else {
      __pyx_t_11 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

    /* "renpy/angle/gldraw.pyx":328
 *             pygame.display.flip()
 * 
 *             egl_error = egl_init(PyWindow_AsWindow(None), vsync)             # <<<<<<<<<<<<<<
 * 
 *             if egl_error is not NULL:
 */
    __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_vsync); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_11); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_v_egl_error = egl_init(PyWindow_AsWindow(Py_None), __pyx_t_15);

    /* "renpy/angle/gldraw.pyx":330
 *             egl_error = egl_init(PyWindow_AsWindow(None), vsync)
 * 
 *             if egl_error is not NULL:             # <<<<<<<<<<<<<<
 *                 renpy.display.log.write("Initializing EGL: %s" % egl_error)
 *                 return False
 */
    __pyx_t_3 = ((__pyx_v_egl_error != NULL) != 0);
    if (__pyx_t_3) {

      /* "renpy/angle/gldraw.pyx":331
 * 
 *             if egl_error is not NULL:
 *                 renpy.display.log.write("Initializing EGL: %s" % egl_error)             # <<<<<<<<<<<<<<
 *                 return False
 * 
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_display); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_log); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_write); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyBytes_FromString(__pyx_v_egl_error); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Initializing_EGL_s, __pyx_t_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
        }
      }
      if (!__pyx_t_7) {
        __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_GOTREF(__pyx_t_11);
      } else {
        __pyx_t_16 = PyTuple_New(1+1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_16);
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_7); __pyx_t_7 = NULL;
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_16, 0+1, __pyx_t_2);
        __pyx_t_2 = 0;
        __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_16, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      }
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

      /* "renpy/angle/gldraw.pyx":332
 *             if egl_error is not NULL:
 *                 renpy.display.log.write("Initializing EGL: %s" % egl_error)
 *                 return False             # <<<<<<<<<<<<<<
 * 
 *         # Get the size of the created screen.
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      goto __pyx_L0;

      /* "renpy/angle/gldraw.pyx":330
 *             egl_error = egl_init(PyWindow_AsWindow(None), vsync)
 * 
 *             if egl_error is not NULL:             # <<<<<<<<<<<<<<
 *                 renpy.display.log.write("Initializing EGL: %s" % egl_error)
 *                 return False
 */
    }

    /* "renpy/angle/gldraw.pyx":323
 * 
 *         # Use EGL to get the OpenGL ES 2 context, if necessary.
 *         if EGL:             # <<<<<<<<<<<<<<
 * 
 *             # This ensures the display is shown.
 */
  }

  /* "renpy/angle/gldraw.pyx":335
 * 
 *         # Get the size of the created screen.
 *         pwidth, pheight = self.window.get_size()             # <<<<<<<<<<<<<<
 * 
 *         self.physical_size = (pwidth, pheight)
 */
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->window, __pyx_n_s_get_size); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_16 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_9);
    if (likely(__pyx_t_16)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_16);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_9, function);
    }
  }
  if (__pyx_t_16) {
    __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_16); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  } else {
    __pyx_t_11 = __Pyx_PyObject_CallNoArg(__pyx_t_9); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_11))) || (PyList_CheckExact(__pyx_t_11))) {
    PyObject* sequence = __pyx_t_11;
    #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 = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_16 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_9 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_16 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_9);
    __Pyx_INCREF(__pyx_t_16);
    #else
    __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_16 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_16);
    #endif
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_2 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext;
    index = 0; __pyx_t_9 = __pyx_t_6(__pyx_t_2); if (unlikely(!__pyx_t_9)) goto __pyx_L44_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_9);
    index = 1; __pyx_t_16 = __pyx_t_6(__pyx_t_2); if (unlikely(!__pyx_t_16)) goto __pyx_L44_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_16);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_2), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = NULL;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L45_unpacking_done;
    __pyx_L44_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L45_unpacking_done:;
  }
  __Pyx_DECREF_SET(__pyx_v_pwidth, __pyx_t_9);
  __pyx_t_9 = 0;
  __Pyx_DECREF_SET(__pyx_v_pheight, __pyx_t_16);
  __pyx_t_16 = 0;

  /* "renpy/angle/gldraw.pyx":337
 *         pwidth, pheight = self.window.get_size()
 * 
 *         self.physical_size = (pwidth, pheight)             # <<<<<<<<<<<<<<
 *         self.drawable_size = pygame.display.get_drawable_size()
 * 
 */
  __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_INCREF(__pyx_v_pwidth);
  __Pyx_GIVEREF(__pyx_v_pwidth);
  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_pwidth);
  __Pyx_INCREF(__pyx_v_pheight);
  __Pyx_GIVEREF(__pyx_v_pheight);
  PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_v_pheight);
  __Pyx_GIVEREF(__pyx_t_11);
  __Pyx_GOTREF(__pyx_v_self->physical_size);
  __Pyx_DECREF(__pyx_v_self->physical_size);
  __pyx_v_self->physical_size = ((PyObject*)__pyx_t_11);
  __pyx_t_11 = 0;

  /* "renpy/angle/gldraw.pyx":338
 * 
 *         self.physical_size = (pwidth, pheight)
 *         self.drawable_size = pygame.display.get_drawable_size()             # <<<<<<<<<<<<<<
 * 
 *         renpy.display.log.write("Screen sizes: virtual=%r physical=%r drawable=%r" % (self.virtual_size, self.physical_size, self.drawable_size))
 */
  __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_display); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_get_drawable_size); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_16))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_16);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_16, function);
    }
  }
  if (__pyx_t_9) {
    __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_t_16, __pyx_t_9); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  } else {
    __pyx_t_11 = __Pyx_PyObject_CallNoArg(__pyx_t_16); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  if (!(likely(PyTuple_CheckExact(__pyx_t_11))||((__pyx_t_11) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_11)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GIVEREF(__pyx_t_11);
  __Pyx_GOTREF(__pyx_v_self->drawable_size);
  __Pyx_DECREF(__pyx_v_self->drawable_size);
  __pyx_v_self->drawable_size = ((PyObject*)__pyx_t_11);
  __pyx_t_11 = 0;

  /* "renpy/angle/gldraw.pyx":340
 *         self.drawable_size = pygame.display.get_drawable_size()
 * 
 *         renpy.display.log.write("Screen sizes: virtual=%r physical=%r drawable=%r" % (self.virtual_size, self.physical_size, self.drawable_size))             # <<<<<<<<<<<<<<
 * 
 *         if renpy.config.adjust_view_size is not None:
 */
  __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_display); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_log); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_write); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_t_16 = PyTuple_New(3); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_INCREF(__pyx_v_self->virtual_size);
  __Pyx_GIVEREF(__pyx_v_self->virtual_size);
  PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_v_self->virtual_size);
  __Pyx_INCREF(__pyx_v_self->physical_size);
  __Pyx_GIVEREF(__pyx_v_self->physical_size);
  PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_v_self->physical_size);
  __Pyx_INCREF(__pyx_v_self->drawable_size);
  __Pyx_GIVEREF(__pyx_v_self->drawable_size);
  PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_v_self->drawable_size);
  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Screen_sizes_virtual_r_physical, __pyx_t_16); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_t_16 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_9);
    if (likely(__pyx_t_16)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_16);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_9, function);
    }
  }
  if (!__pyx_t_16) {
    __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_11);
  } else {
    __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_16); __pyx_t_16 = NULL;
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_7, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "renpy/angle/gldraw.pyx":342
 *         renpy.display.log.write("Screen sizes: virtual=%r physical=%r drawable=%r" % (self.virtual_size, self.physical_size, self.drawable_size))
 * 
 *         if renpy.config.adjust_view_size is not None:             # <<<<<<<<<<<<<<
 *             view_width, view_height = renpy.config.adjust_view_size(pwidth, pheight)
 *         else:
 */
  __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_config); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_adjust_view_size); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_3 = (__pyx_t_11 != Py_None);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "renpy/angle/gldraw.pyx":343
 * 
 *         if renpy.config.adjust_view_size is not None:
 *             view_width, view_height = renpy.config.adjust_view_size(pwidth, pheight)             # <<<<<<<<<<<<<<
 *         else:
 * 
 */
    __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_config); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_adjust_view_size); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_9);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_9, function);
        __pyx_t_8 = 1;
      }
    }
    __pyx_t_2 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (__pyx_t_7) {
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7); __pyx_t_7 = NULL;
    }
    __Pyx_INCREF(__pyx_v_pwidth);
    __Pyx_GIVEREF(__pyx_v_pwidth);
    PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_8, __pyx_v_pwidth);
    __Pyx_INCREF(__pyx_v_pheight);
    __Pyx_GIVEREF(__pyx_v_pheight);
    PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_8, __pyx_v_pheight);
    __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_2, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_11))) || (PyList_CheckExact(__pyx_t_11))) {
      PyObject* sequence = __pyx_t_11;
      #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 = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_9 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_2);
      #else
      __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      #endif
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_6 = Py_TYPE(__pyx_t_7)->tp_iternext;
      index = 0; __pyx_t_9 = __pyx_t_6(__pyx_t_7); if (unlikely(!__pyx_t_9)) goto __pyx_L47_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_9);
      index = 1; __pyx_t_2 = __pyx_t_6(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L47_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_2);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_6 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L48_unpacking_done;
      __pyx_L47_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_6 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L48_unpacking_done:;
    }
    __pyx_v_view_width = __pyx_t_9;
    __pyx_t_9 = 0;
    __pyx_v_view_height = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "renpy/angle/gldraw.pyx":342
 *         renpy.display.log.write("Screen sizes: virtual=%r physical=%r drawable=%r" % (self.virtual_size, self.physical_size, self.drawable_size))
 * 
 *         if renpy.config.adjust_view_size is not None:             # <<<<<<<<<<<<<<
 *             view_width, view_height = renpy.config.adjust_view_size(pwidth, pheight)
 *         else:
 */
    goto __pyx_L46;
  }

  /* "renpy/angle/gldraw.pyx":348
 *             # Figure out the virtual box, which includes padding around
 *             # the borders.
 *             physical_ar = 1.0 * pwidth / pheight             # <<<<<<<<<<<<<<
 * 
 *             ratio = min(1.0 * pwidth / vwidth, 1.0 * pheight / vheight)
 */
  /*else*/ {
    __pyx_t_11 = PyNumber_Multiply(__pyx_float_1_0, __pyx_v_pwidth); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_11, __pyx_v_pheight); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_v_physical_ar = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "renpy/angle/gldraw.pyx":350
 *             physical_ar = 1.0 * pwidth / pheight
 * 
 *             ratio = min(1.0 * pwidth / vwidth, 1.0 * pheight / vheight)             # <<<<<<<<<<<<<<
 * 
 *             view_width = max(int(vwidth * ratio), 1)
 */
    __pyx_t_2 = PyNumber_Multiply(__pyx_float_1_0, __pyx_v_pheight); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_11 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_v_vheight); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_Multiply(__pyx_float_1_0, __pyx_v_pwidth); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_v_vwidth); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = PyObject_RichCompare(__pyx_t_11, __pyx_t_9, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (__pyx_t_4) {
      __Pyx_INCREF(__pyx_t_11);
      __pyx_t_2 = __pyx_t_11;
    } else {
      __Pyx_INCREF(__pyx_t_9);
      __pyx_t_2 = __pyx_t_9;
    }
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_11 = __pyx_t_2;
    __Pyx_INCREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_ratio = __pyx_t_11;
    __pyx_t_11 = 0;

    /* "renpy/angle/gldraw.pyx":352
 *             ratio = min(1.0 * pwidth / vwidth, 1.0 * pheight / vheight)
 * 
 *             view_width = max(int(vwidth * ratio), 1)             # <<<<<<<<<<<<<<
 *             view_height = max(int(vheight * ratio), 1)
 * 
 */
    __pyx_t_10 = 1;
    __pyx_t_11 = PyNumber_Multiply(__pyx_v_vwidth, __pyx_v_ratio); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_2 = PyNumber_Int(__pyx_t_11); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_9 = __Pyx_PyInt_From_long(__pyx_t_10); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_7 = PyObject_RichCompare(__pyx_t_9, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (__pyx_t_4) {
      __pyx_t_7 = __Pyx_PyInt_From_long(__pyx_t_10); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_11 = __pyx_t_7;
      __pyx_t_7 = 0;
    } else {
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_11 = __pyx_t_2;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __pyx_t_11;
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_v_view_width = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "renpy/angle/gldraw.pyx":353
 * 
 *             view_width = max(int(vwidth * ratio), 1)
 *             view_height = max(int(vheight * ratio), 1)             # <<<<<<<<<<<<<<
 * 
 *         px_padding = pwidth - view_width
 */
    __pyx_t_10 = 1;
    __pyx_t_2 = PyNumber_Multiply(__pyx_v_vheight, __pyx_v_ratio); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_11 = PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = __Pyx_PyInt_From_long(__pyx_t_10); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = PyObject_RichCompare(__pyx_t_7, __pyx_t_11, Py_GT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (__pyx_t_4) {
      __pyx_t_9 = __Pyx_PyInt_From_long(__pyx_t_10); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_2 = __pyx_t_9;
      __pyx_t_9 = 0;
    } else {
      __Pyx_INCREF(__pyx_t_11);
      __pyx_t_2 = __pyx_t_11;
    }
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_11 = __pyx_t_2;
    __Pyx_INCREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_view_height = __pyx_t_11;
    __pyx_t_11 = 0;
  }
  __pyx_L46:;

  /* "renpy/angle/gldraw.pyx":355
 *             view_height = max(int(vheight * ratio), 1)
 * 
 *         px_padding = pwidth - view_width             # <<<<<<<<<<<<<<
 *         py_padding = pheight - view_height
 * 
 */
  __pyx_t_11 = PyNumber_Subtract(__pyx_v_pwidth, __pyx_v_view_width); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_v_px_padding = __pyx_t_11;
  __pyx_t_11 = 0;

  /* "renpy/angle/gldraw.pyx":356
 * 
 *         px_padding = pwidth - view_width
 *         py_padding = pheight - view_height             # <<<<<<<<<<<<<<
 * 
 *         x_padding = px_padding * vwidth / view_width
 */
  __pyx_t_11 = PyNumber_Subtract(__pyx_v_pheight, __pyx_v_view_height); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_v_py_padding = __pyx_t_11;
  __pyx_t_11 = 0;

  /* "renpy/angle/gldraw.pyx":358
 *         py_padding = pheight - view_height
 * 
 *         x_padding = px_padding * vwidth / view_width             # <<<<<<<<<<<<<<
 *         y_padding = py_padding * vheight / view_height
 * 
 */
  __pyx_t_11 = PyNumber_Multiply(__pyx_v_px_padding, __pyx_v_vwidth); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_11, __pyx_v_view_width); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_v_x_padding = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "renpy/angle/gldraw.pyx":359
 * 
 *         x_padding = px_padding * vwidth / view_width
 *         y_padding = py_padding * vheight / view_height             # <<<<<<<<<<<<<<
 * 
 *         # The position of the physical screen, in virtual pixels
 */
  __pyx_t_2 = PyNumber_Multiply(__pyx_v_py_padding, __pyx_v_vheight); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_11 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_v_view_height); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_y_padding = __pyx_t_11;
  __pyx_t_11 = 0;

  /* "renpy/angle/gldraw.pyx":366
 *         # screen.
 *         self.virtual_box = (
 *             -x_padding / 2.0,             # <<<<<<<<<<<<<<
 *             -y_padding / 2.0,
 *              vwidth + x_padding,
 */
  __pyx_t_11 = PyNumber_Negative(__pyx_v_x_padding); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_2 = __Pyx_PyFloat_DivideObjC(__pyx_t_11, __pyx_float_2_0, 2.0, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "renpy/angle/gldraw.pyx":367
 *         self.virtual_box = (
 *             -x_padding / 2.0,
 *             -y_padding / 2.0,             # <<<<<<<<<<<<<<
 *              vwidth + x_padding,
 *              vheight + y_padding)
 */
  __pyx_t_11 = PyNumber_Negative(__pyx_v_y_padding); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_9 = __Pyx_PyFloat_DivideObjC(__pyx_t_11, __pyx_float_2_0, 2.0, 0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "renpy/angle/gldraw.pyx":368
 *             -x_padding / 2.0,
 *             -y_padding / 2.0,
 *              vwidth + x_padding,             # <<<<<<<<<<<<<<
 *              vheight + y_padding)
 * 
 */
  __pyx_t_11 = PyNumber_Add(__pyx_v_vwidth, __pyx_v_x_padding); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);

  /* "renpy/angle/gldraw.pyx":369
 *             -y_padding / 2.0,
 *              vwidth + x_padding,
 *              vheight + y_padding)             # <<<<<<<<<<<<<<
 * 
 *         # The location of the virtual screen on the physical screen, in
 */
  __pyx_t_7 = PyNumber_Add(__pyx_v_vheight, __pyx_v_y_padding); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);

  /* "renpy/angle/gldraw.pyx":366
 *         # screen.
 *         self.virtual_box = (
 *             -x_padding / 2.0,             # <<<<<<<<<<<<<<
 *             -y_padding / 2.0,
 *              vwidth + x_padding,
 */
  __pyx_t_16 = PyTuple_New(4); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_9);
  PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_11);
  PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_t_11);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_16, 3, __pyx_t_7);
  __pyx_t_2 = 0;
  __pyx_t_9 = 0;
  __pyx_t_11 = 0;
  __pyx_t_7 = 0;

  /* "renpy/angle/gldraw.pyx":365
 *         # the virtual screen, the corners are often off the virtual
 *         # screen.
 *         self.virtual_box = (             # <<<<<<<<<<<<<<
 *             -x_padding / 2.0,
 *             -y_padding / 2.0,
 */
  __Pyx_GIVEREF(__pyx_t_16);
  __Pyx_GOTREF(__pyx_v_self->virtual_box);
  __Pyx_DECREF(__pyx_v_self->virtual_box);
  __pyx_v_self->virtual_box = ((PyObject*)__pyx_t_16);
  __pyx_t_16 = 0;

  /* "renpy/angle/gldraw.pyx":375
 *         # enough for screenshots.)
 *         self.physical_box = (
 *             int(px_padding / 2),             # <<<<<<<<<<<<<<
 *             int(py_padding / 2),
 *             pwidth - int(px_padding),
 */
  __pyx_t_16 = __Pyx_PyNumber_Divide(__pyx_v_px_padding, __pyx_int_2); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_7 = PyNumber_Int(__pyx_t_16); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "renpy/angle/gldraw.pyx":376
 *         self.physical_box = (
 *             int(px_padding / 2),
 *             int(py_padding / 2),             # <<<<<<<<<<<<<<
 *             pwidth - int(px_padding),
 *             pheight - int(py_padding),
 */
  __pyx_t_16 = __Pyx_PyNumber_Divide(__pyx_v_py_padding, __pyx_int_2); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_11 = PyNumber_Int(__pyx_t_16); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "renpy/angle/gldraw.pyx":377
 *             int(px_padding / 2),
 *             int(py_padding / 2),
 *             pwidth - int(px_padding),             # <<<<<<<<<<<<<<
 *             pheight - int(py_padding),
 *             )
 */
  __pyx_t_16 = PyNumber_Int(__pyx_v_px_padding); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_9 = PyNumber_Subtract(__pyx_v_pwidth, __pyx_t_16); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "renpy/angle/gldraw.pyx":378
 *             int(py_padding / 2),
 *             pwidth - int(px_padding),
 *             pheight - int(py_padding),             # <<<<<<<<<<<<<<
 *             )
 * 
 */
  __pyx_t_16 = PyNumber_Int(__pyx_v_py_padding); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_2 = PyNumber_Subtract(__pyx_v_pheight, __pyx_t_16); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "renpy/angle/gldraw.pyx":375
 *         # enough for screenshots.)
 *         self.physical_box = (
 *             int(px_padding / 2),             # <<<<<<<<<<<<<<
 *             int(py_padding / 2),
 *             pwidth - int(px_padding),
 */
  __pyx_t_16 = PyTuple_New(4); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_11);
  PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_11);
  __Pyx_GIVEREF(__pyx_t_9);
  PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_16, 3, __pyx_t_2);
  __pyx_t_7 = 0;
  __pyx_t_11 = 0;
  __pyx_t_9 = 0;
  __pyx_t_2 = 0;

  /* "renpy/angle/gldraw.pyx":374
 *         # physical pixels. (May not be 100% accurate, but it's good
 *         # enough for screenshots.)
 *         self.physical_box = (             # <<<<<<<<<<<<<<
 *             int(px_padding / 2),
 *             int(py_padding / 2),
 */
  __Pyx_GIVEREF(__pyx_t_16);
  __Pyx_GOTREF(__pyx_v_self->physical_box);
  __Pyx_DECREF(__pyx_v_self->physical_box);
  __pyx_v_self->physical_box = ((PyObject*)__pyx_t_16);
  __pyx_t_16 = 0;

  /* "renpy/angle/gldraw.pyx":382
 * 
 *         # Scale from the rtt size to the virtual size.
 *         if renpy.config.use_drawable_resolution:             # <<<<<<<<<<<<<<
 *             self.draw_per_virt = (1.0 * self.drawable_size[0] / pwidth) * (1.0 * view_width / vwidth)
 *         else:
 */
  __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_config); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_use_drawable_resolution); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_16); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  if (__pyx_t_4) {

    /* "renpy/angle/gldraw.pyx":383
 *         # Scale from the rtt size to the virtual size.
 *         if renpy.config.use_drawable_resolution:
 *             self.draw_per_virt = (1.0 * self.drawable_size[0] / pwidth) * (1.0 * view_width / vwidth)             # <<<<<<<<<<<<<<
 *         else:
 *             self.draw_per_virt = 1.0
 */
    if (unlikely(__pyx_v_self->drawable_size == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_16 = __Pyx_GetItemInt_Tuple(__pyx_v_self->drawable_size, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_16 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_16);
    __pyx_t_2 = PyNumber_Multiply(__pyx_float_1_0, __pyx_t_16); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    __pyx_t_16 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_v_pwidth); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_16);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_Multiply(__pyx_float_1_0, __pyx_v_view_width); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_v_vwidth); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_Multiply(__pyx_t_16, __pyx_t_9); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_GOTREF(__pyx_v_self->draw_per_virt);
    __Pyx_DECREF(__pyx_v_self->draw_per_virt);
    __pyx_v_self->draw_per_virt = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "renpy/angle/gldraw.pyx":382
 * 
 *         # Scale from the rtt size to the virtual size.
 *         if renpy.config.use_drawable_resolution:             # <<<<<<<<<<<<<<
 *             self.draw_per_virt = (1.0 * self.drawable_size[0] / pwidth) * (1.0 * view_width / vwidth)
 *         else:
 */
    goto __pyx_L49;
  }

  /* "renpy/angle/gldraw.pyx":385
 *             self.draw_per_virt = (1.0 * self.drawable_size[0] / pwidth) * (1.0 * view_width / vwidth)
 *         else:
 *             self.draw_per_virt = 1.0             # <<<<<<<<<<<<<<
 * 
 *         self.virt_to_draw = render.Matrix2D(self.draw_per_virt, 0, 0, self.draw_per_virt)
 */
  /*else*/ {
    __Pyx_INCREF(__pyx_float_1_0);
    __Pyx_GIVEREF(__pyx_float_1_0);
    __Pyx_GOTREF(__pyx_v_self->draw_per_virt);
    __Pyx_DECREF(__pyx_v_self->draw_per_virt);
    __pyx_v_self->draw_per_virt = __pyx_float_1_0;
  }
  __pyx_L49:;

  /* "renpy/angle/gldraw.pyx":387
 *             self.draw_per_virt = 1.0
 * 
 *         self.virt_to_draw = render.Matrix2D(self.draw_per_virt, 0, 0, self.draw_per_virt)             # <<<<<<<<<<<<<<
 *         self.draw_to_virt = render.Matrix2D(1.0 / self.draw_per_virt, 0, 0, 1.0 / self.draw_per_virt)
 * 
 */
  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_self->draw_per_virt);
  __Pyx_GIVEREF(__pyx_v_self->draw_per_virt);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->draw_per_virt);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_int_0);
  __Pyx_INCREF(__pyx_v_self->draw_per_virt);
  __Pyx_GIVEREF(__pyx_v_self->draw_per_virt);
  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_self->draw_per_virt);
  __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5renpy_7display_6render_Matrix2D), __pyx_t_2, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_9);
  __Pyx_GOTREF(__pyx_v_self->virt_to_draw);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->virt_to_draw));
  __pyx_v_self->virt_to_draw = ((struct __pyx_obj_5renpy_7display_6render_Matrix2D *)__pyx_t_9);
  __pyx_t_9 = 0;

  /* "renpy/angle/gldraw.pyx":388
 * 
 *         self.virt_to_draw = render.Matrix2D(self.draw_per_virt, 0, 0, self.draw_per_virt)
 *         self.draw_to_virt = render.Matrix2D(1.0 / self.draw_per_virt, 0, 0, 1.0 / self.draw_per_virt)             # <<<<<<<<<<<<<<
 * 
 *         if not self.did_init:
 */
  __pyx_t_9 = __Pyx_PyFloat_DivideCObj(__pyx_float_1_0, __pyx_v_self->draw_per_virt, 1.0, 0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_2 = __Pyx_PyFloat_DivideCObj(__pyx_float_1_0, __pyx_v_self->draw_per_virt, 1.0, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_16 = PyTuple_New(4); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_GIVEREF(__pyx_t_9);
  PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_9);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_int_0);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_16, 3, __pyx_t_2);
  __pyx_t_9 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5renpy_7display_6render_Matrix2D), __pyx_t_16, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->draw_to_virt);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->draw_to_virt));
  __pyx_v_self->draw_to_virt = ((struct __pyx_obj_5renpy_7display_6render_Matrix2D *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "renpy/angle/gldraw.pyx":390
 *         self.draw_to_virt = render.Matrix2D(1.0 / self.draw_per_virt, 0, 0, 1.0 / self.draw_per_virt)
 * 
 *         if not self.did_init:             # <<<<<<<<<<<<<<
 *             if not self.init():
 *                 return False
 */
  __pyx_t_4 = ((!(__pyx_v_self->did_init != 0)) != 0);
  if (__pyx_t_4) {

    /* "renpy/angle/gldraw.pyx":391
 * 
 *         if not self.did_init:
 *             if not self.init():             # <<<<<<<<<<<<<<
 *                 return False
 * 
 */
    __pyx_t_16 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_16);
    __pyx_t_9 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_16))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_16);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_16, function);
      }
    }
    if (__pyx_t_9) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_16, __pyx_t_9); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_16); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_3 = ((!__pyx_t_4) != 0);
    if (__pyx_t_3) {

      /* "renpy/angle/gldraw.pyx":392
 *         if not self.did_init:
 *             if not self.init():
 *                 return False             # <<<<<<<<<<<<<<
 * 
 *         if "RENPY_FAIL_" + self.info["renderer"].upper() in os.environ:
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      goto __pyx_L0;

      /* "renpy/angle/gldraw.pyx":391
 * 
 *         if not self.did_init:
 *             if not self.init():             # <<<<<<<<<<<<<<
 *                 return False
 * 
 */
    }

    /* "renpy/angle/gldraw.pyx":390
 *         self.draw_to_virt = render.Matrix2D(1.0 / self.draw_per_virt, 0, 0, 1.0 / self.draw_per_virt)
 * 
 *         if not self.did_init:             # <<<<<<<<<<<<<<
 *             if not self.init():
 *                 return False
 */
  }

  /* "renpy/angle/gldraw.pyx":394
 *                 return False
 * 
 *         if "RENPY_FAIL_" + self.info["renderer"].upper() in os.environ:             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
  if (unlikely(__pyx_v_self->info == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_16 = __Pyx_PyDict_GetItem(__pyx_v_self->info, __pyx_n_s_renderer); if (unlikely(__pyx_t_16 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_upper); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_t_16 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_9);
    if (likely(__pyx_t_16)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_16);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_9, function);
    }
  }
  if (__pyx_t_16) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_16); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_9); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = PyNumber_Add(__pyx_n_s_RENPY_FAIL, __pyx_t_2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_environ); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_t_9, __pyx_t_16, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "renpy/angle/gldraw.pyx":395
 * 
 *         if "RENPY_FAIL_" + self.info["renderer"].upper() in os.environ:
 *             return False             # <<<<<<<<<<<<<<
 * 
 *         self.did_init = True
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;

    /* "renpy/angle/gldraw.pyx":394
 *                 return False
 * 
 *         if "RENPY_FAIL_" + self.info["renderer"].upper() in os.environ:             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
  }

  /* "renpy/angle/gldraw.pyx":397
 *             return False
 * 
 *         self.did_init = True             # <<<<<<<<<<<<<<
 * 
 *         # Set some default settings.
 */
  __pyx_v_self->did_init = 1;

  /* "renpy/angle/gldraw.pyx":400
 * 
 *         # Set some default settings.
 *         glEnable(GL_BLEND)             # <<<<<<<<<<<<<<
 *         glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA)
 * 
 */
  __pyx_t_15 = __pyx_f_5renpy_5angle_2gl_glEnable(GL_BLEND); if (unlikely(__pyx_t_15 == 0 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/angle/gldraw.pyx":401
 *         # Set some default settings.
 *         glEnable(GL_BLEND)
 *         glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA)             # <<<<<<<<<<<<<<
 * 
 *         # Prepare a mouse display.
 */
  __pyx_t_15 = __pyx_f_5renpy_5angle_2gl_glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); if (unlikely(__pyx_t_15 == 0 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/angle/gldraw.pyx":404
 * 
 *         # Prepare a mouse display.
 *         self.mouse_old_visible = None             # <<<<<<<<<<<<<<
 * 
 *         self.environ.init()
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->mouse_old_visible);
  __Pyx_DECREF(__pyx_v_self->mouse_old_visible);
  __pyx_v_self->mouse_old_visible = Py_None;

  /* "renpy/angle/gldraw.pyx":406
 *         self.mouse_old_visible = None
 * 
 *         self.environ.init()             # <<<<<<<<<<<<<<
 *         self.rtt.init()
 * 
 */
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->environ), __pyx_n_s_init); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_9);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_9, function);
    }
  }
  if (__pyx_t_2) {
    __pyx_t_16 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_2); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __pyx_t_16 = __Pyx_PyObject_CallNoArg(__pyx_t_9); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "renpy/angle/gldraw.pyx":407
 * 
 *         self.environ.init()
 *         self.rtt.init()             # <<<<<<<<<<<<<<
 * 
 *         return True
 */
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->rtt, __pyx_n_s_init); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_9);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_9, function);
    }
  }
  if (__pyx_t_2) {
    __pyx_t_16 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_2); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __pyx_t_16 = __Pyx_PyObject_CallNoArg(__pyx_t_9); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

  /* "renpy/angle/gldraw.pyx":409
 *         self.rtt.init()
 * 
 *         return True             # <<<<<<<<<<<<<<
 * 
 *     def deinit(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_True);
  __pyx_r = Py_True;
  goto __pyx_L0;

  /* "renpy/angle/gldraw.pyx":168
 * 
 * 
 *     def set_mode(self, virtual_size, physical_size, fullscreen):             # <<<<<<<<<<<<<<
 *         """
 *         This changes the video mode. It also initializes OpenGL, if it
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.set_mode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_vwidth);
  __Pyx_XDECREF(__pyx_v_vheight);
  __Pyx_XDECREF(__pyx_v_pwidth);
  __Pyx_XDECREF(__pyx_v_pheight);
  __Pyx_XDECREF(__pyx_v_virtual_ar);
  __Pyx_XDECREF(__pyx_v_window_args);
  __Pyx_XDECREF(__pyx_v_info);
  __Pyx_XDECREF(__pyx_v_visible_w);
  __Pyx_XDECREF(__pyx_v_visible_h);
  __Pyx_XDECREF(__pyx_v_bounds);
  __Pyx_XDECREF(__pyx_v_head_full_w);
  __Pyx_XDECREF(__pyx_v_head_w);
  __Pyx_XDECREF(__pyx_v_head_h);
  __Pyx_XDECREF(__pyx_v_resizable);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XDECREF(__pyx_v_view_width);
  __Pyx_XDECREF(__pyx_v_view_height);
  __Pyx_XDECREF(__pyx_v_physical_ar);
  __Pyx_XDECREF(__pyx_v_ratio);
  __Pyx_XDECREF(__pyx_v_px_padding);
  __Pyx_XDECREF(__pyx_v_py_padding);
  __Pyx_XDECREF(__pyx_v_x_padding);
  __Pyx_XDECREF(__pyx_v_y_padding);
  __Pyx_XDECREF(__pyx_v_fullscreen);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/angle/gldraw.pyx":411
 *         return True
 * 
 *     def deinit(self):             # <<<<<<<<<<<<<<
 *         """
 *         De-initializes the system in preparation for a restart, or
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_7deinit(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5renpy_5angle_6gldraw_6GLDraw_6deinit[] = "\n        De-initializes the system in preparation for a restart, or\n        quit. Flushes out all the textures while it's at it.\n        ";
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_7deinit(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("deinit (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_6deinit(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_6deinit(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("deinit", 0);

  /* "renpy/angle/gldraw.pyx":417
 *         """
 * 
 *         renpy.display.interface.kill_textures()             # <<<<<<<<<<<<<<
 * 
 *         self.texture_cache.clear()
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_display); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_interface); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_kill_textures); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "renpy/angle/gldraw.pyx":419
 *         renpy.display.interface.kill_textures()
 * 
 *         self.texture_cache.clear()             # <<<<<<<<<<<<<<
 * 
 *         gltexture.dealloc_textures()
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->texture_cache, __pyx_n_s_clear); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "renpy/angle/gldraw.pyx":421
 *         self.texture_cache.clear()
 * 
 *         gltexture.dealloc_textures()             # <<<<<<<<<<<<<<
 * 
 *         if self.rtt:
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gltexture); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_dealloc_textures); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "renpy/angle/gldraw.pyx":423
 *         gltexture.dealloc_textures()
 * 
 *         if self.rtt:             # <<<<<<<<<<<<<<
 *             self.rtt.deinit()
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_self->rtt); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_4) {

    /* "renpy/angle/gldraw.pyx":424
 * 
 *         if self.rtt:
 *             self.rtt.deinit()             # <<<<<<<<<<<<<<
 * 
 *         if self.environ:
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->rtt, __pyx_n_s_deinit); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "renpy/angle/gldraw.pyx":423
 *         gltexture.dealloc_textures()
 * 
 *         if self.rtt:             # <<<<<<<<<<<<<<
 *             self.rtt.deinit()
 * 
 */
  }

  /* "renpy/angle/gldraw.pyx":426
 *             self.rtt.deinit()
 * 
 *         if self.environ:             # <<<<<<<<<<<<<<
 *             self.environ.deinit()
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->environ)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_4) {

    /* "renpy/angle/gldraw.pyx":427
 * 
 *         if self.environ:
 *             self.environ.deinit()             # <<<<<<<<<<<<<<
 * 
 *     def quit(self):
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->environ), __pyx_n_s_deinit); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "renpy/angle/gldraw.pyx":426
 *             self.rtt.deinit()
 * 
 *         if self.environ:             # <<<<<<<<<<<<<<
 *             self.environ.deinit()
 * 
 */
  }

  /* "renpy/angle/gldraw.pyx":411
 *         return True
 * 
 *     def deinit(self):             # <<<<<<<<<<<<<<
 *         """
 *         De-initializes the system in preparation for a restart, or
 */

  /* function exit code */
  __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_AddTraceback("renpy.angle.gldraw.GLDraw.deinit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/angle/gldraw.pyx":429
 *             self.environ.deinit()
 * 
 *     def quit(self):             # <<<<<<<<<<<<<<
 * 
 *         if not self.old_fullscreen:
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_9quit(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_9quit(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("quit (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_8quit(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_8quit(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("quit", 0);

  /* "renpy/angle/gldraw.pyx":431
 *     def quit(self):
 * 
 *         if not self.old_fullscreen:             # <<<<<<<<<<<<<<
 *             renpy.display.gl_size = self.physical_size
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->old_fullscreen); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = ((!__pyx_t_1) != 0);
  if (__pyx_t_2) {

    /* "renpy/angle/gldraw.pyx":432
 * 
 *         if not self.old_fullscreen:
 *             renpy.display.gl_size = self.physical_size             # <<<<<<<<<<<<<<
 * 
 *         gltexture.dealloc_textures()
 */
    __pyx_t_3 = __pyx_v_self->physical_size;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_display); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__Pyx_PyObject_SetAttrStr(__pyx_t_5, __pyx_n_s_gl_size, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "renpy/angle/gldraw.pyx":431
 *     def quit(self):
 * 
 *         if not self.old_fullscreen:             # <<<<<<<<<<<<<<
 *             renpy.display.gl_size = self.physical_size
 * 
 */
  }

  /* "renpy/angle/gldraw.pyx":434
 *             renpy.display.gl_size = self.physical_size
 * 
 *         gltexture.dealloc_textures()             # <<<<<<<<<<<<<<
 * 
 *         self.old_fullscreen = None
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gltexture); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_dealloc_textures); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "renpy/angle/gldraw.pyx":436
 *         gltexture.dealloc_textures()
 * 
 *         self.old_fullscreen = None             # <<<<<<<<<<<<<<
 * 
 *     def init(self):
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->old_fullscreen);
  __Pyx_DECREF(__pyx_v_self->old_fullscreen);
  __pyx_v_self->old_fullscreen = Py_None;

  /* "renpy/angle/gldraw.pyx":429
 *             self.environ.deinit()
 * 
 *     def quit(self):             # <<<<<<<<<<<<<<
 * 
 *         if not self.old_fullscreen:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.quit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/angle/gldraw.pyx":438
 *         self.old_fullscreen = None
 * 
 *     def init(self):             # <<<<<<<<<<<<<<
 *         """
 *         This does the first-time initialization of OpenGL, deciding
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_11init(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5renpy_5angle_6gldraw_6GLDraw_10init[] = "\n        This does the first-time initialization of OpenGL, deciding\n        which subsystems to use.\n        ";
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_11init(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_10init(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/angle/gldraw.pyx":500
 *             renpy.display.log.write("    %s", i)
 * 
 *         def use_subsystem(module, envvar, envval, *req_ext):             # <<<<<<<<<<<<<<
 *             """
 *             Decides if we should used a particular subsystem, based on
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_4init_1use_subsystem(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5renpy_5angle_6gldraw_6GLDraw_4init_use_subsystem[] = "\n            Decides if we should used a particular subsystem, based on\n            environment variables and/or extensions. If the `envvar`\n            environment variable exists, this will return true iff\n            its value is `envval`. Otherwise, this will return true if\n            all of the required extensions are present, and false\n            otherwise.\n            ";
static PyMethodDef __pyx_mdef_5renpy_5angle_6gldraw_6GLDraw_4init_1use_subsystem = {"use_subsystem", (PyCFunction)__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_4init_1use_subsystem, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5renpy_5angle_6gldraw_6GLDraw_4init_use_subsystem};
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_4init_1use_subsystem(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_module = 0;
  PyObject *__pyx_v_envvar = 0;
  PyObject *__pyx_v_envval = 0;
  PyObject *__pyx_v_req_ext = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("use_subsystem (wrapper)", 0);
  if (PyTuple_GET_SIZE(__pyx_args) > 3) {
    __pyx_v_req_ext = PyTuple_GetSlice(__pyx_args, 3, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_req_ext)) {
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_req_ext);
  } else {
    __pyx_v_req_ext = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_module,&__pyx_n_s_envvar,&__pyx_n_s_envval,0};
    PyObject* values[3] = {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) {
        default:
        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;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_module)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_envvar)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("use_subsystem", 0, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_envval)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("use_subsystem", 0, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 3) ? pos_args : 3;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "use_subsystem") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 3) {
      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);
    }
    __pyx_v_module = values[0];
    __pyx_v_envvar = values[1];
    __pyx_v_envval = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("use_subsystem", 0, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_req_ext); __pyx_v_req_ext = 0;
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.init.use_subsystem", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_4init_use_subsystem(__pyx_self, __pyx_v_module, __pyx_v_envvar, __pyx_v_envval, __pyx_v_req_ext);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_req_ext);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_4init_use_subsystem(PyObject *__pyx_self, PyObject *__pyx_v_module, PyObject *__pyx_v_envvar, PyObject *__pyx_v_envval, PyObject *__pyx_v_req_ext) {
  struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct__init *__pyx_cur_scope;
  struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct__init *__pyx_outer_scope;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("use_subsystem", 0);
  __pyx_outer_scope = (struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct__init *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "renpy/angle/gldraw.pyx":510
 *             """
 * 
 *             if module is None:             # <<<<<<<<<<<<<<
 *                 return False
 * 
 */
  __pyx_t_1 = (__pyx_v_module == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "renpy/angle/gldraw.pyx":511
 * 
 *             if module is None:
 *                 return False             # <<<<<<<<<<<<<<
 * 
 *             value = os.environ.get(envvar, "")
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;

    /* "renpy/angle/gldraw.pyx":510
 *             """
 * 
 *             if module is None:             # <<<<<<<<<<<<<<
 *                 return False
 * 
 */
  }

  /* "renpy/angle/gldraw.pyx":513
 *                 return False
 * 
 *             value = os.environ.get(envvar, "")             # <<<<<<<<<<<<<<
 *             if value:
 *                 if value == envval:
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_environ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_6 = 1;
    }
  }
  __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  if (__pyx_t_5) {
    __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
  }
  __Pyx_INCREF(__pyx_v_envvar);
  __Pyx_GIVEREF(__pyx_v_envvar);
  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_envvar);
  __Pyx_INCREF(__pyx_kp_s__3);
  __Pyx_GIVEREF(__pyx_kp_s__3);
  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_kp_s__3);
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_value = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "renpy/angle/gldraw.pyx":514
 * 
 *             value = os.environ.get(envvar, "")
 *             if value:             # <<<<<<<<<<<<<<
 *                 if value == envval:
 *                     return True
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {

    /* "renpy/angle/gldraw.pyx":515
 *             value = os.environ.get(envvar, "")
 *             if value:
 *                 if value == envval:             # <<<<<<<<<<<<<<
 *                     return True
 *                 else:
 */
    __pyx_t_3 = PyObject_RichCompare(__pyx_v_value, __pyx_v_envval, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_2) {

      /* "renpy/angle/gldraw.pyx":516
 *             if value:
 *                 if value == envval:
 *                     return True             # <<<<<<<<<<<<<<
 *                 else:
 *                     return False
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_True);
      __pyx_r = Py_True;
      goto __pyx_L0;

      /* "renpy/angle/gldraw.pyx":515
 *             value = os.environ.get(envvar, "")
 *             if value:
 *                 if value == envval:             # <<<<<<<<<<<<<<
 *                     return True
 *                 else:
 */
    }

    /* "renpy/angle/gldraw.pyx":518
 *                     return True
 *                 else:
 *                     return False             # <<<<<<<<<<<<<<
 * 
 *             for i in req_ext:
 */
    /*else*/ {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      goto __pyx_L0;
    }

    /* "renpy/angle/gldraw.pyx":514
 * 
 *             value = os.environ.get(envvar, "")
 *             if value:             # <<<<<<<<<<<<<<
 *                 if value == envval:
 *                     return True
 */
  }

  /* "renpy/angle/gldraw.pyx":520
 *                     return False
 * 
 *             for i in req_ext:             # <<<<<<<<<<<<<<
 *                 if i not in extensions:
 *                     return False
 */
  __pyx_t_3 = __pyx_v_req_ext; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0;
  for (;;) {
    if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
    #if CYTHON_COMPILING_IN_CPYTHON
    __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    #else
    __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "renpy/angle/gldraw.pyx":521
 * 
 *             for i in req_ext:
 *                 if i not in extensions:             # <<<<<<<<<<<<<<
 *                     return False
 * 
 */
    if (unlikely(!__pyx_cur_scope->__pyx_v_extensions)) { __Pyx_RaiseClosureNameError("extensions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_i, __pyx_cur_scope->__pyx_v_extensions, Py_NE)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "renpy/angle/gldraw.pyx":522
 *             for i in req_ext:
 *                 if i not in extensions:
 *                     return False             # <<<<<<<<<<<<<<
 * 
 *             return True
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "renpy/angle/gldraw.pyx":521
 * 
 *             for i in req_ext:
 *                 if i not in extensions:             # <<<<<<<<<<<<<<
 *                     return False
 * 
 */
    }

    /* "renpy/angle/gldraw.pyx":520
 *                     return False
 * 
 *             for i in req_ext:             # <<<<<<<<<<<<<<
 *                 if i not in extensions:
 *                     return False
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "renpy/angle/gldraw.pyx":524
 *                     return False
 * 
 *             return True             # <<<<<<<<<<<<<<
 * 
 *         # Count the number of texture units.
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_True);
  __pyx_r = Py_True;
  goto __pyx_L0;

  /* "renpy/angle/gldraw.pyx":500
 *             renpy.display.log.write("    %s", i)
 * 
 *         def use_subsystem(module, envvar, envval, *req_ext):             # <<<<<<<<<<<<<<
 *             """
 *             Decides if we should used a particular subsystem, based on
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.init.use_subsystem", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/angle/gldraw.pyx":438
 *         self.old_fullscreen = None
 * 
 *     def init(self):             # <<<<<<<<<<<<<<
 *         """
 *         This does the first-time initialization of OpenGL, deciding
 */

static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_10init(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self) {
  struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct__init *__pyx_cur_scope;
  GLenum __pyx_v_err;
  char *__pyx_v_renderer;
  char *__pyx_v_version;
  PyObject *__pyx_v_allow_shader = NULL;
  PyObject *__pyx_v_allow_fixed = NULL;
  PyObject *__pyx_v_r = NULL;
  PyObject *__pyx_v_v = NULL;
  PyObject *__pyx_v_allow_shader_ = NULL;
  PyObject *__pyx_v_allow_fixed_ = NULL;
  char *__pyx_v_extensions_string;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_use_subsystem = 0;
  GLint __pyx_v_texture_units;
  CYTHON_UNUSED PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_v_use_fbo = NULL;
  PyObject *__pyx_v_rv = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  GLchar *__pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *(*__pyx_t_12)(PyObject *);
  int __pyx_t_13;
  int __pyx_t_14;
  int __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  int __pyx_t_17;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init", 0);
  __pyx_cur_scope = (struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct__init *)__pyx_tp_new_5renpy_5angle_6gldraw___pyx_scope_struct__init(__pyx_ptype_5renpy_5angle_6gldraw___pyx_scope_struct__init, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);

  /* "renpy/angle/gldraw.pyx":444
 *         """
 * 
 *         if not EGL:             # <<<<<<<<<<<<<<
 * 
 *             # Init glew.
 */
  __pyx_t_1 = ((!(__pyx_v_5renpy_5angle_6gldraw_EGL != 0)) != 0);
  if (__pyx_t_1) {

    /* "renpy/angle/gldraw.pyx":447
 * 
 *             # Init glew.
 *             err = glewInit()             # <<<<<<<<<<<<<<
 * 
 *             if err != GLEW_OK:
 */
    __pyx_v_err = glewInit();

    /* "renpy/angle/gldraw.pyx":449
 *             err = glewInit()
 * 
 *             if err != GLEW_OK:             # <<<<<<<<<<<<<<
 *                 renpy.display.log.write("Glew init failed: %s" % <char *> glewGetErrorString(err))
 *                 return False
 */
    __pyx_t_1 = ((__pyx_v_err != GLEW_OK) != 0);
    if (__pyx_t_1) {

      /* "renpy/angle/gldraw.pyx":450
 * 
 *             if err != GLEW_OK:
 *                 renpy.display.log.write("Glew init failed: %s" % <char *> glewGetErrorString(err))             # <<<<<<<<<<<<<<
 *                 return False
 * 
 */
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_display); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_log); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyBytes_FromString(((char *)glewGetErrorString(__pyx_v_err))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Glew_init_failed_s, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (!__pyx_t_3) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
        __Pyx_GIVEREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "renpy/angle/gldraw.pyx":451
 *             if err != GLEW_OK:
 *                 renpy.display.log.write("Glew init failed: %s" % <char *> glewGetErrorString(err))
 *                 return False             # <<<<<<<<<<<<<<
 * 
 *         # Log the GL version.
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      goto __pyx_L0;

      /* "renpy/angle/gldraw.pyx":449
 *             err = glewInit()
 * 
 *             if err != GLEW_OK:             # <<<<<<<<<<<<<<
 *                 renpy.display.log.write("Glew init failed: %s" % <char *> glewGetErrorString(err))
 *                 return False
 */
    }

    /* "renpy/angle/gldraw.pyx":444
 *         """
 * 
 *         if not EGL:             # <<<<<<<<<<<<<<
 * 
 *             # Init glew.
 */
  }

  /* "renpy/angle/gldraw.pyx":454
 * 
 *         # Log the GL version.
 *         renderer = <char *> glGetString(GL_RENDERER)             # <<<<<<<<<<<<<<
 *         version = <char *> glGetString(GL_VERSION)
 * 
 */
  __pyx_t_7 = __pyx_f_5renpy_5angle_2gl_glGetString(GL_RENDERER); if (unlikely(__pyx_t_7 == NULL && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_renderer = ((char *)__pyx_t_7);

  /* "renpy/angle/gldraw.pyx":455
 *         # Log the GL version.
 *         renderer = <char *> glGetString(GL_RENDERER)
 *         version = <char *> glGetString(GL_VERSION)             # <<<<<<<<<<<<<<
 * 
 *         renpy.display.log.write("Vendor: %r", str(<char *> glGetString(GL_VENDOR)))
 */
  __pyx_t_7 = __pyx_f_5renpy_5angle_2gl_glGetString(GL_VERSION); if (unlikely(__pyx_t_7 == NULL && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_version = ((char *)__pyx_t_7);

  /* "renpy/angle/gldraw.pyx":457
 *         version = <char *> glGetString(GL_VERSION)
 * 
 *         renpy.display.log.write("Vendor: %r", str(<char *> glGetString(GL_VENDOR)))             # <<<<<<<<<<<<<<
 *         renpy.display.log.write("Renderer: %r", renderer)
 *         renpy.display.log.write("Version: %r", version)
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_display); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_log); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_write); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_7 = __pyx_f_5renpy_5angle_2gl_glGetString(GL_VENDOR); if (unlikely(__pyx_t_7 == NULL && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = __Pyx_PyBytes_FromString(((char *)__pyx_t_7)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  __pyx_t_8 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
      __pyx_t_8 = 1;
    }
  }
  __pyx_t_3 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (__pyx_t_5) {
    __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL;
  }
  __Pyx_INCREF(__pyx_kp_s_Vendor_r);
  __Pyx_GIVEREF(__pyx_kp_s_Vendor_r);
  PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_8, __pyx_kp_s_Vendor_r);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_8, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "renpy/angle/gldraw.pyx":458
 * 
 *         renpy.display.log.write("Vendor: %r", str(<char *> glGetString(GL_VENDOR)))
 *         renpy.display.log.write("Renderer: %r", renderer)             # <<<<<<<<<<<<<<
 *         renpy.display.log.write("Version: %r", version)
 *         renpy.display.log.write("Display Info: %s", self.display_info)
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_display); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_log); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_write); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_renderer); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = NULL;
  __pyx_t_8 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_8 = 1;
    }
  }
  __pyx_t_5 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_4) {
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
  }
  __Pyx_INCREF(__pyx_kp_s_Renderer_r);
  __Pyx_GIVEREF(__pyx_kp_s_Renderer_r);
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_8, __pyx_kp_s_Renderer_r);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_8, __pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "renpy/angle/gldraw.pyx":459
 *         renpy.display.log.write("Vendor: %r", str(<char *> glGetString(GL_VENDOR)))
 *         renpy.display.log.write("Renderer: %r", renderer)
 *         renpy.display.log.write("Version: %r", version)             # <<<<<<<<<<<<<<
 *         renpy.display.log.write("Display Info: %s", self.display_info)
 * 
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_display); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_log); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_version); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = NULL;
  __pyx_t_8 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_8 = 1;
    }
  }
  __pyx_t_4 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (__pyx_t_6) {
    __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL;
  }
  __Pyx_INCREF(__pyx_kp_s_Version_r);
  __Pyx_GIVEREF(__pyx_kp_s_Version_r);
  PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_8, __pyx_kp_s_Version_r);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_8, __pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "renpy/angle/gldraw.pyx":460
 *         renpy.display.log.write("Renderer: %r", renderer)
 *         renpy.display.log.write("Version: %r", version)
 *         renpy.display.log.write("Display Info: %s", self.display_info)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_display); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_log); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  __pyx_t_8 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_8 = 1;
    }
  }
  __pyx_t_3 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (__pyx_t_5) {
    __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL;
  }
  __Pyx_INCREF(__pyx_kp_s_Display_Info_s);
  __Pyx_GIVEREF(__pyx_kp_s_Display_Info_s);
  PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_8, __pyx_kp_s_Display_Info_s);
  __Pyx_INCREF(__pyx_v_self->display_info);
  __Pyx_GIVEREF(__pyx_v_self->display_info);
  PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_8, __pyx_v_self->display_info);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "renpy/angle/gldraw.pyx":463
 * 
 * 
 *         allow_shader = True             # <<<<<<<<<<<<<<
 *         allow_fixed = self.allow_fixed
 * 
 */
  __Pyx_INCREF(Py_True);
  __pyx_v_allow_shader = Py_True;

  /* "renpy/angle/gldraw.pyx":464
 * 
 *         allow_shader = True
 *         allow_fixed = self.allow_fixed             # <<<<<<<<<<<<<<
 * 
 *         for r, v, allow_shader_, allow_fixed_ in glblacklist.BLACKLIST:
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->allow_fixed); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_allow_fixed = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "renpy/angle/gldraw.pyx":466
 *         allow_fixed = self.allow_fixed
 * 
 *         for r, v, allow_shader_, allow_fixed_ in glblacklist.BLACKLIST:             # <<<<<<<<<<<<<<
 *             if r in renderer and v in version:
 *                 allow_shader = allow_shader and allow_shader_
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_glblacklist); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_BLACKLIST); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
    __pyx_t_2 = __pyx_t_4; __Pyx_INCREF(__pyx_t_2); __pyx_t_8 = 0;
    __pyx_t_9 = NULL;
  } else {
    __pyx_t_8 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  for (;;) {
    if (likely(!__pyx_t_9)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_9(__pyx_t_2);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __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 != 4)) {
        if (size > 4) __Pyx_RaiseTooManyValuesError(4);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __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_5 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); 
        __pyx_t_10 = PyTuple_GET_ITEM(sequence, 3); 
      } else {
        __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_6 = PyList_GET_ITEM(sequence, 2); 
        __pyx_t_10 = PyList_GET_ITEM(sequence, 3); 
      }
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_10);
      #else
      {
        Py_ssize_t i;
        PyObject** temps[4] = {&__pyx_t_3,&__pyx_t_5,&__pyx_t_6,&__pyx_t_10};
        for (i=0; i < 4; i++) {
          PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(item);
          *(temps[i]) = item;
        }
      }
      #endif
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      Py_ssize_t index = -1;
      PyObject** temps[4] = {&__pyx_t_3,&__pyx_t_5,&__pyx_t_6,&__pyx_t_10};
      __pyx_t_11 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext;
      for (index=0; index < 4; index++) {
        PyObject* item = __pyx_t_12(__pyx_t_11); if (unlikely(!item)) goto __pyx_L7_unpacking_failed;
        __Pyx_GOTREF(item);
        *(temps[index]) = item;
      }
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_12 = NULL;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      goto __pyx_L8_unpacking_done;
      __pyx_L7_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_12 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L8_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_r, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_allow_shader_, __pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_XDECREF_SET(__pyx_v_allow_fixed_, __pyx_t_10);
    __pyx_t_10 = 0;

    /* "renpy/angle/gldraw.pyx":467
 * 
 *         for r, v, allow_shader_, allow_fixed_ in glblacklist.BLACKLIST:
 *             if r in renderer and v in version:             # <<<<<<<<<<<<<<
 *                 allow_shader = allow_shader and allow_shader_
 *                 allow_fixed = allow_fixed and allow_fixed_
 */
    __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_renderer); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_13 = (__Pyx_PySequence_ContainsTF(__pyx_v_r, __pyx_t_4, Py_EQ)); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_14 = (__pyx_t_13 != 0);
    if (__pyx_t_14) {
    } else {
      __pyx_t_1 = __pyx_t_14;
      goto __pyx_L10_bool_binop_done;
    }
    __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_version); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_14 = (__Pyx_PySequence_ContainsTF(__pyx_v_v, __pyx_t_4, Py_EQ)); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_13 = (__pyx_t_14 != 0);
    __pyx_t_1 = __pyx_t_13;
    __pyx_L10_bool_binop_done:;
    if (__pyx_t_1) {

      /* "renpy/angle/gldraw.pyx":468
 *         for r, v, allow_shader_, allow_fixed_ in glblacklist.BLACKLIST:
 *             if r in renderer and v in version:
 *                 allow_shader = allow_shader and allow_shader_             # <<<<<<<<<<<<<<
 *                 allow_fixed = allow_fixed and allow_fixed_
 *                 break
 */
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_allow_shader); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (__pyx_t_1) {
      } else {
        __Pyx_INCREF(__pyx_v_allow_shader);
        __pyx_t_4 = __pyx_v_allow_shader;
        goto __pyx_L12_bool_binop_done;
      }
      __Pyx_INCREF(__pyx_v_allow_shader_);
      __pyx_t_4 = __pyx_v_allow_shader_;
      __pyx_L12_bool_binop_done:;
      __Pyx_DECREF_SET(__pyx_v_allow_shader, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "renpy/angle/gldraw.pyx":469
 *             if r in renderer and v in version:
 *                 allow_shader = allow_shader and allow_shader_
 *                 allow_fixed = allow_fixed and allow_fixed_             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_allow_fixed); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (__pyx_t_1) {
      } else {
        __Pyx_INCREF(__pyx_v_allow_fixed);
        __pyx_t_4 = __pyx_v_allow_fixed;
        goto __pyx_L14_bool_binop_done;
      }
      __Pyx_INCREF(__pyx_v_allow_fixed_);
      __pyx_t_4 = __pyx_v_allow_fixed_;
      __pyx_L14_bool_binop_done:;
      __Pyx_DECREF_SET(__pyx_v_allow_fixed, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "renpy/angle/gldraw.pyx":470
 *                 allow_shader = allow_shader and allow_shader_
 *                 allow_fixed = allow_fixed and allow_fixed_
 *                 break             # <<<<<<<<<<<<<<
 * 
 *         if not allow_shader:
 */
      goto __pyx_L6_break;

      /* "renpy/angle/gldraw.pyx":467
 * 
 *         for r, v, allow_shader_, allow_fixed_ in glblacklist.BLACKLIST:
 *             if r in renderer and v in version:             # <<<<<<<<<<<<<<
 *                 allow_shader = allow_shader and allow_shader_
 *                 allow_fixed = allow_fixed and allow_fixed_
 */
    }

    /* "renpy/angle/gldraw.pyx":466
 *         allow_fixed = self.allow_fixed
 * 
 *         for r, v, allow_shader_, allow_fixed_ in glblacklist.BLACKLIST:             # <<<<<<<<<<<<<<
 *             if r in renderer and v in version:
 *                 allow_shader = allow_shader and allow_shader_
 */
  }
  __pyx_L6_break:;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "renpy/angle/gldraw.pyx":472
 *                 break
 * 
 *         if not allow_shader:             # <<<<<<<<<<<<<<
 *             renpy.display.log.write("Shaders are blacklisted.")
 *         if not allow_fixed:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_allow_shader); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_13 = ((!__pyx_t_1) != 0);
  if (__pyx_t_13) {

    /* "renpy/angle/gldraw.pyx":473
 * 
 *         if not allow_shader:
 *             renpy.display.log.write("Shaders are blacklisted.")             # <<<<<<<<<<<<<<
 *         if not allow_fixed:
 *             renpy.display.log.write("Fixed-function is blacklisted.")
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_display); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_log); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "renpy/angle/gldraw.pyx":472
 *                 break
 * 
 *         if not allow_shader:             # <<<<<<<<<<<<<<
 *             renpy.display.log.write("Shaders are blacklisted.")
 *         if not allow_fixed:
 */
  }

  /* "renpy/angle/gldraw.pyx":474
 *         if not allow_shader:
 *             renpy.display.log.write("Shaders are blacklisted.")
 *         if not allow_fixed:             # <<<<<<<<<<<<<<
 *             renpy.display.log.write("Fixed-function is blacklisted.")
 * 
 */
  __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_allow_fixed); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = ((!__pyx_t_13) != 0);
  if (__pyx_t_1) {

    /* "renpy/angle/gldraw.pyx":475
 *             renpy.display.log.write("Shaders are blacklisted.")
 *         if not allow_fixed:
 *             renpy.display.log.write("Fixed-function is blacklisted.")             # <<<<<<<<<<<<<<
 * 
 *         if not allow_shader and not allow_fixed:
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_display); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_log); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "renpy/angle/gldraw.pyx":474
 *         if not allow_shader:
 *             renpy.display.log.write("Shaders are blacklisted.")
 *         if not allow_fixed:             # <<<<<<<<<<<<<<
 *             renpy.display.log.write("Fixed-function is blacklisted.")
 * 
 */
  }

  /* "renpy/angle/gldraw.pyx":477
 *             renpy.display.log.write("Fixed-function is blacklisted.")
 * 
 *         if not allow_shader and not allow_fixed:             # <<<<<<<<<<<<<<
 *             renpy.display.log.write("GL is totally blacklisted.")
 *             return False
 */
  __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_allow_shader); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_14 = ((!__pyx_t_13) != 0);
  if (__pyx_t_14) {
  } else {
    __pyx_t_1 = __pyx_t_14;
    goto __pyx_L19_bool_binop_done;
  }
  __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_v_allow_fixed); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_13 = ((!__pyx_t_14) != 0);
  __pyx_t_1 = __pyx_t_13;
  __pyx_L19_bool_binop_done:;
  if (__pyx_t_1) {

    /* "renpy/angle/gldraw.pyx":478
 * 
 *         if not allow_shader and not allow_fixed:
 *             renpy.display.log.write("GL is totally blacklisted.")             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_display); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_log); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "renpy/angle/gldraw.pyx":479
 *         if not allow_shader and not allow_fixed:
 *             renpy.display.log.write("GL is totally blacklisted.")
 *             return False             # <<<<<<<<<<<<<<
 * 
 *         if EGL:
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;

    /* "renpy/angle/gldraw.pyx":477
 *             renpy.display.log.write("Fixed-function is blacklisted.")
 * 
 *         if not allow_shader and not allow_fixed:             # <<<<<<<<<<<<<<
 *             renpy.display.log.write("GL is totally blacklisted.")
 *             return False
 */
  }

  /* "renpy/angle/gldraw.pyx":481
 *             return False
 * 
 *         if EGL:             # <<<<<<<<<<<<<<
 *             gltexture.use_gles()
 * 
 */
  __pyx_t_1 = (__pyx_v_5renpy_5angle_6gldraw_EGL != 0);
  if (__pyx_t_1) {

    /* "renpy/angle/gldraw.pyx":482
 * 
 *         if EGL:
 *             gltexture.use_gles()             # <<<<<<<<<<<<<<
 * 
 *         elif renpy.android or renpy.ios:
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gltexture); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_use_gles); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
      }
    }
    if (__pyx_t_4) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "renpy/angle/gldraw.pyx":481
 *             return False
 * 
 *         if EGL:             # <<<<<<<<<<<<<<
 *             gltexture.use_gles()
 * 
 */
    goto __pyx_L21;
  }

  /* "renpy/angle/gldraw.pyx":484
 *             gltexture.use_gles()
 * 
 *         elif renpy.android or renpy.ios:             # <<<<<<<<<<<<<<
 *             self.redraw_period = 1.0
 *             self.always_opaque = True
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_android); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (!__pyx_t_13) {
  } else {
    __pyx_t_1 = __pyx_t_13;
    goto __pyx_L22_bool_binop_done;
  }
  __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_ios); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_1 = __pyx_t_13;
  __pyx_L22_bool_binop_done:;
  if (__pyx_t_1) {

    /* "renpy/angle/gldraw.pyx":485
 * 
 *         elif renpy.android or renpy.ios:
 *             self.redraw_period = 1.0             # <<<<<<<<<<<<<<
 *             self.always_opaque = True
 *             gltexture.use_gles()
 */
    __pyx_v_self->redraw_period = 1.0;

    /* "renpy/angle/gldraw.pyx":486
 *         elif renpy.android or renpy.ios:
 *             self.redraw_period = 1.0
 *             self.always_opaque = True             # <<<<<<<<<<<<<<
 *             gltexture.use_gles()
 * 
 */
    __pyx_v_self->always_opaque = 1;

    /* "renpy/angle/gldraw.pyx":487
 *             self.redraw_period = 1.0
 *             self.always_opaque = True
 *             gltexture.use_gles()             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_gltexture); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_use_gles); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (__pyx_t_10) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "renpy/angle/gldraw.pyx":484
 *             gltexture.use_gles()
 * 
 *         elif renpy.android or renpy.ios:             # <<<<<<<<<<<<<<
 *             self.redraw_period = 1.0
 *             self.always_opaque = True
 */
    goto __pyx_L21;
  }

  /* "renpy/angle/gldraw.pyx":490
 * 
 *         else:
 *             gltexture.use_gl()             # <<<<<<<<<<<<<<
 * 
 *         extensions_string = <char *> glGetString(GL_EXTENSIONS)
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gltexture); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_use_gl); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
      }
    }
    if (__pyx_t_4) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L21:;

  /* "renpy/angle/gldraw.pyx":492
 *             gltexture.use_gl()
 * 
 *         extensions_string = <char *> glGetString(GL_EXTENSIONS)             # <<<<<<<<<<<<<<
 *         extensions = set(extensions_string.split(" "))
 * 
 */
  __pyx_t_7 = __pyx_f_5renpy_5angle_2gl_glGetString(GL_EXTENSIONS); if (unlikely(__pyx_t_7 == NULL && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_extensions_string = ((char *)__pyx_t_7);

  /* "renpy/angle/gldraw.pyx":493
 * 
 *         extensions_string = <char *> glGetString(GL_EXTENSIONS)
 *         extensions = set(extensions_string.split(" "))             # <<<<<<<<<<<<<<
 * 
 *         renpy.display.log.write("Extensions:")
 */
  __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_extensions_string); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_split); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = PySet_New(__pyx_t_2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_10);
  __pyx_cur_scope->__pyx_v_extensions = ((PyObject*)__pyx_t_10);
  __pyx_t_10 = 0;

  /* "renpy/angle/gldraw.pyx":495
 *         extensions = set(extensions_string.split(" "))
 * 
 *         renpy.display.log.write("Extensions:")             # <<<<<<<<<<<<<<
 * 
 *         for i in sorted(extensions):
 */
  __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_display); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_log); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "renpy/angle/gldraw.pyx":497
 *         renpy.display.log.write("Extensions:")
 * 
 *         for i in sorted(extensions):             # <<<<<<<<<<<<<<
 *             renpy.display.log.write("    %s", i)
 * 
 */
  __pyx_t_2 = __pyx_cur_scope->__pyx_v_extensions;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_4 = PySequence_List(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_10 = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_15 = PyList_Sort(__pyx_t_10); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(__pyx_t_10 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = __pyx_t_10; __Pyx_INCREF(__pyx_t_4); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  for (;;) {
    if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_4)) break;
    #if CYTHON_COMPILING_IN_CPYTHON
    __pyx_t_10 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    #else
    __pyx_t_10 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_10);
    __pyx_t_10 = 0;

    /* "renpy/angle/gldraw.pyx":498
 * 
 *         for i in sorted(extensions):
 *             renpy.display.log.write("    %s", i)             # <<<<<<<<<<<<<<
 * 
 *         def use_subsystem(module, envvar, envval, *req_ext):
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_display); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_log); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_write); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    __pyx_t_16 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_16 = 1;
      }
    }
    __pyx_t_5 = PyTuple_New(2+__pyx_t_16); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_kp_s_s);
    __Pyx_GIVEREF(__pyx_kp_s_s);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_16, __pyx_kp_s_s);
    __Pyx_INCREF(__pyx_v_i);
    __Pyx_GIVEREF(__pyx_v_i);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_16, __pyx_v_i);
    __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

    /* "renpy/angle/gldraw.pyx":497
 *         renpy.display.log.write("Extensions:")
 * 
 *         for i in sorted(extensions):             # <<<<<<<<<<<<<<
 *             renpy.display.log.write("    %s", i)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "renpy/angle/gldraw.pyx":500
 *             renpy.display.log.write("    %s", i)
 * 
 *         def use_subsystem(module, envvar, envval, *req_ext):             # <<<<<<<<<<<<<<
 *             """
 *             Decides if we should used a particular subsystem, based on
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5renpy_5angle_6gldraw_6GLDraw_4init_1use_subsystem, 0, __pyx_n_s_init_locals_use_subsystem, ((PyObject*)__pyx_cur_scope), __pyx_n_s_renpy_angle_gldraw, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_use_subsystem = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "renpy/angle/gldraw.pyx":527
 * 
 *         # Count the number of texture units.
 *         cdef GLint texture_units = 0             # <<<<<<<<<<<<<<
 *         glGetIntegerv(GL_MAX_TEXTURE_UNITS, &texture_units)
 * 
 */
  __pyx_v_texture_units = 0;

  /* "renpy/angle/gldraw.pyx":528
 *         # Count the number of texture units.
 *         cdef GLint texture_units = 0
 *         glGetIntegerv(GL_MAX_TEXTURE_UNITS, &texture_units)             # <<<<<<<<<<<<<<
 * 
 *         renpy.display.log.write("Number of texture units: %d", texture_units)
 */
  __pyx_t_17 = __pyx_f_5renpy_5angle_2gl_glGetIntegerv(GL_MAX_TEXTURE_UNITS, (&__pyx_v_texture_units)); if (unlikely(__pyx_t_17 == 0 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/angle/gldraw.pyx":530
 *         glGetIntegerv(GL_MAX_TEXTURE_UNITS, &texture_units)
 * 
 *         renpy.display.log.write("Number of texture units: %d", texture_units)             # <<<<<<<<<<<<<<
 * 
 *         # Pick a texture environment subsystem.
 */
  __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_display); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_log); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyInt_From_GLint(__pyx_v_texture_units); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_5 = NULL;
  __pyx_t_8 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
      __pyx_t_8 = 1;
    }
  }
  __pyx_t_2 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (__pyx_t_5) {
    __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); __pyx_t_5 = NULL;
  }
  __Pyx_INCREF(__pyx_kp_s_Number_of_texture_units_d);
  __Pyx_GIVEREF(__pyx_kp_s_Number_of_texture_units_d);
  PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_8, __pyx_kp_s_Number_of_texture_units_d);
  __Pyx_GIVEREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_8, __pyx_t_10);
  __pyx_t_10 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "renpy/angle/gldraw.pyx":534
 *         # Pick a texture environment subsystem.
 * 
 *         if EGL or renpy.android or renpy.ios or (allow_shader and use_subsystem(             # <<<<<<<<<<<<<<
 *             glenviron_shader,
 *             "RENPY_GL_ENVIRON",
 */
  __pyx_t_13 = (__pyx_v_5renpy_5angle_6gldraw_EGL != 0);
  if (!__pyx_t_13) {
  } else {
    __pyx_t_1 = __pyx_t_13;
    goto __pyx_L27_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_android); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (!__pyx_t_13) {
  } else {
    __pyx_t_1 = __pyx_t_13;
    goto __pyx_L27_bool_binop_done;
  }
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_ios); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (!__pyx_t_13) {
  } else {
    __pyx_t_1 = __pyx_t_13;
    goto __pyx_L27_bool_binop_done;
  }
  __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_allow_shader); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_13) {
  } else {
    __pyx_t_1 = __pyx_t_13;
    goto __pyx_L27_bool_binop_done;
  }

  /* "renpy/angle/gldraw.pyx":535
 * 
 *         if EGL or renpy.android or renpy.ios or (allow_shader and use_subsystem(
 *             glenviron_shader,             # <<<<<<<<<<<<<<
 *             "RENPY_GL_ENVIRON",
 *             "shader",
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_glenviron_shader); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);

  /* "renpy/angle/gldraw.pyx":534
 *         # Pick a texture environment subsystem.
 * 
 *         if EGL or renpy.android or renpy.ios or (allow_shader and use_subsystem(             # <<<<<<<<<<<<<<
 *             glenviron_shader,
 *             "RENPY_GL_ENVIRON",
 */
  __pyx_t_6 = PyTuple_New(5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
  __Pyx_INCREF(__pyx_n_s_RENPY_GL_ENVIRON);
  __Pyx_GIVEREF(__pyx_n_s_RENPY_GL_ENVIRON);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_s_RENPY_GL_ENVIRON);
  __Pyx_INCREF(__pyx_n_s_shader);
  __Pyx_GIVEREF(__pyx_n_s_shader);
  PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_n_s_shader);
  __Pyx_INCREF(__pyx_n_s_GL_ARB_vertex_shader);
  __Pyx_GIVEREF(__pyx_n_s_GL_ARB_vertex_shader);
  PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_n_s_GL_ARB_vertex_shader);
  __Pyx_INCREF(__pyx_n_s_GL_ARB_fragment_shader);
  __Pyx_GIVEREF(__pyx_n_s_GL_ARB_fragment_shader);
  PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_n_s_GL_ARB_fragment_shader);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_use_subsystem, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __pyx_t_13;
  __pyx_L27_bool_binop_done:;
  if (__pyx_t_1) {

    /* "renpy/angle/gldraw.pyx":541
 *             "GL_ARB_fragment_shader")):
 * 
 *             try:             # <<<<<<<<<<<<<<
 *                 renpy.display.log.write("Using shader environment.")
 *                 self.environ = glenviron_shader.ShaderEnviron()
 */
    {
      __Pyx_ExceptionSave(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
      __Pyx_XGOTREF(__pyx_t_18);
      __Pyx_XGOTREF(__pyx_t_19);
      __Pyx_XGOTREF(__pyx_t_20);
      /*try:*/ {

        /* "renpy/angle/gldraw.pyx":542
 * 
 *             try:
 *                 renpy.display.log.write("Using shader environment.")             # <<<<<<<<<<<<<<
 *                 self.environ = glenviron_shader.ShaderEnviron()
 *                 self.info["environ"] = "shader"
 */
        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L32_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_display); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L32_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_log); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L32_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_write); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L32_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L32_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "renpy/angle/gldraw.pyx":543
 *             try:
 *                 renpy.display.log.write("Using shader environment.")
 *                 self.environ = glenviron_shader.ShaderEnviron()             # <<<<<<<<<<<<<<
 *                 self.info["environ"] = "shader"
 *                 self.environ.init()
 */
        __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_glenviron_shader); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L32_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_ShaderEnviron); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L32_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
          }
        }
        if (__pyx_t_6) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L32_error;}
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        } else {
          __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L32_error;}
        }
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5renpy_5angle_6gldraw_Environ))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L32_error;}
        __Pyx_GIVEREF(__pyx_t_4);
        __Pyx_GOTREF(__pyx_v_self->environ);
        __Pyx_DECREF(((PyObject *)__pyx_v_self->environ));
        __pyx_v_self->environ = ((struct __pyx_obj_5renpy_5angle_6gldraw_Environ *)__pyx_t_4);
        __pyx_t_4 = 0;

        /* "renpy/angle/gldraw.pyx":544
 *                 renpy.display.log.write("Using shader environment.")
 *                 self.environ = glenviron_shader.ShaderEnviron()
 *                 self.info["environ"] = "shader"             # <<<<<<<<<<<<<<
 *                 self.environ.init()
 * 
 */
        if (unlikely(__pyx_v_self->info == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L32_error;}
        }
        if (unlikely(PyDict_SetItem(__pyx_v_self->info, __pyx_n_s_environ, __pyx_n_s_shader) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L32_error;}

        /* "renpy/angle/gldraw.pyx":545
 *                 self.environ = glenviron_shader.ShaderEnviron()
 *                 self.info["environ"] = "shader"
 *                 self.environ.init()             # <<<<<<<<<<<<<<
 * 
 *             except Exception, e:
 */
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->environ), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L32_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_6 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
          }
        }
        if (__pyx_t_6) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L32_error;}
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        } else {
          __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L32_error;}
        }
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "renpy/angle/gldraw.pyx":541
 *             "GL_ARB_fragment_shader")):
 * 
 *             try:             # <<<<<<<<<<<<<<
 *                 renpy.display.log.write("Using shader environment.")
 *                 self.environ = glenviron_shader.ShaderEnviron()
 */
      }
      __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
      __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
      __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
      goto __pyx_L39_try_end;
      __pyx_L32_error:;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "renpy/angle/gldraw.pyx":547
 *                 self.environ.init()
 * 
 *             except Exception, e:             # <<<<<<<<<<<<<<
 *                 renpy.display.log.write("Initializing shader environment failed:")
 *                 renpy.display.log.exception()
 */
      __pyx_t_17 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
      if (__pyx_t_17) {
        __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_2, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L34_except_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_2);
        __pyx_v_e = __pyx_t_2;

        /* "renpy/angle/gldraw.pyx":548
 * 
 *             except Exception, e:
 *                 renpy.display.log.write("Initializing shader environment failed:")             # <<<<<<<<<<<<<<
 *                 renpy.display.log.exception()
 *                 self.environ = None
 */
        __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L34_except_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_display); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L34_except_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_log); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L34_except_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L34_except_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L34_except_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

        /* "renpy/angle/gldraw.pyx":549
 *             except Exception, e:
 *                 renpy.display.log.write("Initializing shader environment failed:")
 *                 renpy.display.log.exception()             # <<<<<<<<<<<<<<
 *                 self.environ = None
 * 
 */
        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L34_except_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_display); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L34_except_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_log); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L34_except_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_exception); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L34_except_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_5)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_5);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        if (__pyx_t_5) {
          __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L34_except_error;}
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        } else {
          __pyx_t_10 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L34_except_error;}
        }
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

        /* "renpy/angle/gldraw.pyx":550
 *                 renpy.display.log.write("Initializing shader environment failed:")
 *                 renpy.display.log.exception()
 *                 self.environ = None             # <<<<<<<<<<<<<<
 * 
 *         if self.environ is None:
 */
        __Pyx_INCREF(Py_None);
        __Pyx_GIVEREF(Py_None);
        __Pyx_GOTREF(__pyx_v_self->environ);
        __Pyx_DECREF(((PyObject *)__pyx_v_self->environ));
        __pyx_v_self->environ = ((struct __pyx_obj_5renpy_5angle_6gldraw_Environ *)Py_None);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        goto __pyx_L33_exception_handled;
      }
      goto __pyx_L34_except_error;
      __pyx_L34_except_error:;

      /* "renpy/angle/gldraw.pyx":541
 *             "GL_ARB_fragment_shader")):
 * 
 *             try:             # <<<<<<<<<<<<<<
 *                 renpy.display.log.write("Using shader environment.")
 *                 self.environ = glenviron_shader.ShaderEnviron()
 */
      __Pyx_XGIVEREF(__pyx_t_18);
      __Pyx_XGIVEREF(__pyx_t_19);
      __Pyx_XGIVEREF(__pyx_t_20);
      __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
      goto __pyx_L1_error;
      __pyx_L33_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_18);
      __Pyx_XGIVEREF(__pyx_t_19);
      __Pyx_XGIVEREF(__pyx_t_20);
      __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
      __pyx_L39_try_end:;
    }

    /* "renpy/angle/gldraw.pyx":534
 *         # Pick a texture environment subsystem.
 * 
 *         if EGL or renpy.android or renpy.ios or (allow_shader and use_subsystem(             # <<<<<<<<<<<<<<
 *             glenviron_shader,
 *             "RENPY_GL_ENVIRON",
 */
  }

  /* "renpy/angle/gldraw.pyx":552
 *                 self.environ = None
 * 
 *         if self.environ is None:             # <<<<<<<<<<<<<<
 * 
 *             if allow_fixed and use_subsystem(
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_self->environ) == Py_None);
  __pyx_t_13 = (__pyx_t_1 != 0);
  if (__pyx_t_13) {

    /* "renpy/angle/gldraw.pyx":554
 *         if self.environ is None:
 * 
 *             if allow_fixed and use_subsystem(             # <<<<<<<<<<<<<<
 *                 glenviron_fixed,
 *                 "RENPY_GL_ENVIRON",
 */
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_allow_fixed); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_1) {
    } else {
      __pyx_t_13 = __pyx_t_1;
      goto __pyx_L44_bool_binop_done;
    }

    /* "renpy/angle/gldraw.pyx":555
 * 
 *             if allow_fixed and use_subsystem(
 *                 glenviron_fixed,             # <<<<<<<<<<<<<<
 *                 "RENPY_GL_ENVIRON",
 *                 "fixed",
 */
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_glenviron_fixed); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);

    /* "renpy/angle/gldraw.pyx":554
 *         if self.environ is None:
 * 
 *             if allow_fixed and use_subsystem(             # <<<<<<<<<<<<<<
 *                 glenviron_fixed,
 *                 "RENPY_GL_ENVIRON",
 */
    __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6);
    __Pyx_INCREF(__pyx_n_s_RENPY_GL_ENVIRON);
    __Pyx_GIVEREF(__pyx_n_s_RENPY_GL_ENVIRON);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_RENPY_GL_ENVIRON);
    __Pyx_INCREF(__pyx_n_s_fixed);
    __Pyx_GIVEREF(__pyx_n_s_fixed);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_fixed);
    __Pyx_INCREF(__pyx_n_s_GL_ARB_texture_env_crossbar);
    __Pyx_GIVEREF(__pyx_n_s_GL_ARB_texture_env_crossbar);
    PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_n_s_GL_ARB_texture_env_crossbar);
    __Pyx_INCREF(__pyx_n_s_GL_ARB_texture_env_combine);
    __Pyx_GIVEREF(__pyx_n_s_GL_ARB_texture_env_combine);
    PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_n_s_GL_ARB_texture_env_combine);
    __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_use_subsystem, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_13 = __pyx_t_1;
    __pyx_L44_bool_binop_done:;
    if (__pyx_t_13) {

      /* "renpy/angle/gldraw.pyx":561
 *                 "GL_ARB_texture_env_combine"):
 * 
 *                 renpy.display.log.write("Using fixed-function environment (clause 1).")             # <<<<<<<<<<<<<<
 *                 self.environ = glenviron_fixed.FixedFunctionEnviron()
 *                 self.info["environ"] = "fixed"
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_display); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_log); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "renpy/angle/gldraw.pyx":562
 * 
 *                 renpy.display.log.write("Using fixed-function environment (clause 1).")
 *                 self.environ = glenviron_fixed.FixedFunctionEnviron()             # <<<<<<<<<<<<<<
 *                 self.info["environ"] = "fixed"
 *                 self.environ.init()
 */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_glenviron_fixed); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_FixedFunctionEnviron); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (__pyx_t_2) {
        __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      } else {
        __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5renpy_5angle_6gldraw_Environ))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GIVEREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_v_self->environ);
      __Pyx_DECREF(((PyObject *)__pyx_v_self->environ));
      __pyx_v_self->environ = ((struct __pyx_obj_5renpy_5angle_6gldraw_Environ *)__pyx_t_6);
      __pyx_t_6 = 0;

      /* "renpy/angle/gldraw.pyx":563
 *                 renpy.display.log.write("Using fixed-function environment (clause 1).")
 *                 self.environ = glenviron_fixed.FixedFunctionEnviron()
 *                 self.info["environ"] = "fixed"             # <<<<<<<<<<<<<<
 *                 self.environ.init()
 * 
 */
      if (unlikely(__pyx_v_self->info == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      if (unlikely(PyDict_SetItem(__pyx_v_self->info, __pyx_n_s_environ, __pyx_n_s_fixed) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "renpy/angle/gldraw.pyx":564
 *                 self.environ = glenviron_fixed.FixedFunctionEnviron()
 *                 self.info["environ"] = "fixed"
 *                 self.environ.init()             # <<<<<<<<<<<<<<
 * 
 *             elif allow_fixed and use_subsystem(
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->environ), __pyx_n_s_init); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_2 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (__pyx_t_2) {
        __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      } else {
        __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "renpy/angle/gldraw.pyx":554
 *         if self.environ is None:
 * 
 *             if allow_fixed and use_subsystem(             # <<<<<<<<<<<<<<
 *                 glenviron_fixed,
 *                 "RENPY_GL_ENVIRON",
 */
      goto __pyx_L43;
    }

    /* "renpy/angle/gldraw.pyx":566
 *                 self.environ.init()
 * 
 *             elif allow_fixed and use_subsystem(             # <<<<<<<<<<<<<<
 *                 glenviron_fixed,
 *                 "RENPY_GL_ENVIRON",
 */
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_allow_fixed); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_1) {
    } else {
      __pyx_t_13 = __pyx_t_1;
      goto __pyx_L46_bool_binop_done;
    }

    /* "renpy/angle/gldraw.pyx":567
 * 
 *             elif allow_fixed and use_subsystem(
 *                 glenviron_fixed,             # <<<<<<<<<<<<<<
 *                 "RENPY_GL_ENVIRON",
 *                 "fixed",
 */
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_glenviron_fixed); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);

    /* "renpy/angle/gldraw.pyx":566
 *                 self.environ.init()
 * 
 *             elif allow_fixed and use_subsystem(             # <<<<<<<<<<<<<<
 *                 glenviron_fixed,
 *                 "RENPY_GL_ENVIRON",
 */
    __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
    __Pyx_INCREF(__pyx_n_s_RENPY_GL_ENVIRON);
    __Pyx_GIVEREF(__pyx_n_s_RENPY_GL_ENVIRON);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_n_s_RENPY_GL_ENVIRON);
    __Pyx_INCREF(__pyx_n_s_fixed);
    __Pyx_GIVEREF(__pyx_n_s_fixed);
    PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_n_s_fixed);
    __Pyx_INCREF(__pyx_n_s_GL_NV_texture_env_combine4);
    __Pyx_GIVEREF(__pyx_n_s_GL_NV_texture_env_combine4);
    PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_n_s_GL_NV_texture_env_combine4);
    __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_use_subsystem, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_13 = __pyx_t_1;
    __pyx_L46_bool_binop_done:;
    if (__pyx_t_13) {

      /* "renpy/angle/gldraw.pyx":572
 *                 "GL_NV_texture_env_combine4"):
 * 
 *                 renpy.display.log.write("Using fixed-function environment (clause 2).")             # <<<<<<<<<<<<<<
 *                 self.environ = glenviron_fixed.FixedFunctionEnviron()
 *                 self.info["environ"] = "fixed"
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_display); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_log); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "renpy/angle/gldraw.pyx":573
 * 
 *                 renpy.display.log.write("Using fixed-function environment (clause 2).")
 *                 self.environ = glenviron_fixed.FixedFunctionEnviron()             # <<<<<<<<<<<<<<
 *                 self.info["environ"] = "fixed"
 *                 self.environ.init()
 */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_glenviron_fixed); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_FixedFunctionEnviron); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5renpy_5angle_6gldraw_Environ))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GIVEREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_v_self->environ);
      __Pyx_DECREF(((PyObject *)__pyx_v_self->environ));
      __pyx_v_self->environ = ((struct __pyx_obj_5renpy_5angle_6gldraw_Environ *)__pyx_t_6);
      __pyx_t_6 = 0;

      /* "renpy/angle/gldraw.pyx":574
 *                 renpy.display.log.write("Using fixed-function environment (clause 2).")
 *                 self.environ = glenviron_fixed.FixedFunctionEnviron()
 *                 self.info["environ"] = "fixed"             # <<<<<<<<<<<<<<
 *                 self.environ.init()
 * 
 */
      if (unlikely(__pyx_v_self->info == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      if (unlikely(PyDict_SetItem(__pyx_v_self->info, __pyx_n_s_environ, __pyx_n_s_fixed) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "renpy/angle/gldraw.pyx":575
 *                 self.environ = glenviron_fixed.FixedFunctionEnviron()
 *                 self.info["environ"] = "fixed"
 *                 self.environ.init()             # <<<<<<<<<<<<<<
 * 
 *             elif use_subsystem(
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->environ), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "renpy/angle/gldraw.pyx":566
 *                 self.environ.init()
 * 
 *             elif allow_fixed and use_subsystem(             # <<<<<<<<<<<<<<
 *                 glenviron_fixed,
 *                 "RENPY_GL_ENVIRON",
 */
      goto __pyx_L43;
    }

    /* "renpy/angle/gldraw.pyx":578
 * 
 *             elif use_subsystem(
 *                 glenviron_limited,             # <<<<<<<<<<<<<<
 *                 "RENPY_GL_ENVIRON",
 *                 "limited",
 */
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_glenviron_limited); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);

    /* "renpy/angle/gldraw.pyx":577
 *                 self.environ.init()
 * 
 *             elif use_subsystem(             # <<<<<<<<<<<<<<
 *                 glenviron_limited,
 *                 "RENPY_GL_ENVIRON",
 */
    __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6);
    __Pyx_INCREF(__pyx_n_s_RENPY_GL_ENVIRON);
    __Pyx_GIVEREF(__pyx_n_s_RENPY_GL_ENVIRON);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_RENPY_GL_ENVIRON);
    __Pyx_INCREF(__pyx_n_s_limited);
    __Pyx_GIVEREF(__pyx_n_s_limited);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_limited);
    __Pyx_INCREF(__pyx_n_s_RENPY_bogus_extension);
    __Pyx_GIVEREF(__pyx_n_s_RENPY_bogus_extension);
    PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_n_s_RENPY_bogus_extension);
    __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_use_subsystem, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_13) {

      /* "renpy/angle/gldraw.pyx":583
 *                 "RENPY_bogus_extension"):
 * 
 *                 renpy.display.log.write("Using limited environment.")             # <<<<<<<<<<<<<<
 *                 self.environ = glenviron_limited.LimitedEnviron()
 *                 self.info["environ"] = "limited"
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_display); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_log); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "renpy/angle/gldraw.pyx":584
 * 
 *                 renpy.display.log.write("Using limited environment.")
 *                 self.environ = glenviron_limited.LimitedEnviron()             # <<<<<<<<<<<<<<
 *                 self.info["environ"] = "limited"
 *                 self.environ.init()
 */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_glenviron_limited); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_LimitedEnviron); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (__pyx_t_2) {
        __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      } else {
        __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5renpy_5angle_6gldraw_Environ))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GIVEREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_v_self->environ);
      __Pyx_DECREF(((PyObject *)__pyx_v_self->environ));
      __pyx_v_self->environ = ((struct __pyx_obj_5renpy_5angle_6gldraw_Environ *)__pyx_t_6);
      __pyx_t_6 = 0;

      /* "renpy/angle/gldraw.pyx":585
 *                 renpy.display.log.write("Using limited environment.")
 *                 self.environ = glenviron_limited.LimitedEnviron()
 *                 self.info["environ"] = "limited"             # <<<<<<<<<<<<<<
 *                 self.environ.init()
 * 
 */
      if (unlikely(__pyx_v_self->info == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      if (unlikely(PyDict_SetItem(__pyx_v_self->info, __pyx_n_s_environ, __pyx_n_s_limited) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "renpy/angle/gldraw.pyx":586
 *                 self.environ = glenviron_limited.LimitedEnviron()
 *                 self.info["environ"] = "limited"
 *                 self.environ.init()             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->environ), __pyx_n_s_init); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_2 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (__pyx_t_2) {
        __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      } else {
        __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "renpy/angle/gldraw.pyx":577
 *                 self.environ.init()
 * 
 *             elif use_subsystem(             # <<<<<<<<<<<<<<
 *                 glenviron_limited,
 *                 "RENPY_GL_ENVIRON",
 */
      goto __pyx_L43;
    }

    /* "renpy/angle/gldraw.pyx":589
 * 
 *             else:
 *                 renpy.display.log.write("Can't find a workable environment.")             # <<<<<<<<<<<<<<
 *                 return False
 * 
 */
    /*else*/ {
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_display); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_log); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "renpy/angle/gldraw.pyx":590
 *             else:
 *                 renpy.display.log.write("Can't find a workable environment.")
 *                 return False             # <<<<<<<<<<<<<<
 * 
 *         # Pick a Render-to-texture method.
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_False);
      __pyx_r = Py_False;
      goto __pyx_L0;
    }
    __pyx_L43:;

    /* "renpy/angle/gldraw.pyx":552
 *                 self.environ = None
 * 
 *         if self.environ is None:             # <<<<<<<<<<<<<<
 * 
 *             if allow_fixed and use_subsystem(
 */
  }

  /* "renpy/angle/gldraw.pyx":598
 * 
 *         use_fbo = (
 *             renpy.ios or renpy.android or (EGL and not ANGLE) or             # <<<<<<<<<<<<<<
 *             use_subsystem(
 *                 glrtt_fbo,
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ios); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (!__pyx_t_13) {
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_6 = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L48_bool_binop_done;
  }
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_android); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (!__pyx_t_13) {
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_6 = __pyx_t_4;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L48_bool_binop_done;
  }
  if (!__pyx_v_5renpy_5angle_6gldraw_EGL) {
    goto __pyx_L51_next_or;
  } else {
  }
  if (!0) {
  } else {
    __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L48_bool_binop_done;
  }
  __pyx_L51_next_or:;

  /* "renpy/angle/gldraw.pyx":600
 *             renpy.ios or renpy.android or (EGL and not ANGLE) or
 *             use_subsystem(
 *                 glrtt_fbo,             # <<<<<<<<<<<<<<
 *                 "RENPY_GL_RTT",
 *                 "fbo",
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_glrtt_fbo); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);

  /* "renpy/angle/gldraw.pyx":599
 *         use_fbo = (
 *             renpy.ios or renpy.android or (EGL and not ANGLE) or
 *             use_subsystem(             # <<<<<<<<<<<<<<
 *                 glrtt_fbo,
 *                 "RENPY_GL_RTT",
 */
  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
  __Pyx_INCREF(__pyx_n_s_RENPY_GL_RTT);
  __Pyx_GIVEREF(__pyx_n_s_RENPY_GL_RTT);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_RENPY_GL_RTT);
  __Pyx_INCREF(__pyx_n_s_fbo);
  __Pyx_GIVEREF(__pyx_n_s_fbo);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_fbo);
  __Pyx_INCREF(__pyx_n_s_RENPY_bogus_extension);
  __Pyx_GIVEREF(__pyx_n_s_RENPY_bogus_extension);
  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_n_s_RENPY_bogus_extension);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_use_subsystem, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_6 = __pyx_t_4;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_L48_bool_binop_done:;
  __pyx_v_use_fbo = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "renpy/angle/gldraw.pyx":606
 *                 "RENPY_bogus_extension"))
 * 
 *         if use_fbo:             # <<<<<<<<<<<<<<
 *             renpy.display.log.write("Using FBO RTT.")
 *             self.rtt = glrtt_fbo.FboRtt()
 */
  __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_use_fbo); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_13) {

    /* "renpy/angle/gldraw.pyx":607
 * 
 *         if use_fbo:
 *             renpy.display.log.write("Using FBO RTT.")             # <<<<<<<<<<<<<<
 *             self.rtt = glrtt_fbo.FboRtt()
 *             self.info["rtt"] = "fbo"
 */
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_display); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_log); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "renpy/angle/gldraw.pyx":608
 *         if use_fbo:
 *             renpy.display.log.write("Using FBO RTT.")
 *             self.rtt = glrtt_fbo.FboRtt()             # <<<<<<<<<<<<<<
 *             self.info["rtt"] = "fbo"
 *             self.rtt.init()
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_glrtt_fbo); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_FboRtt); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (__pyx_t_4) {
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GIVEREF(__pyx_t_6);
    __Pyx_GOTREF(__pyx_v_self->rtt);
    __Pyx_DECREF(__pyx_v_self->rtt);
    __pyx_v_self->rtt = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "renpy/angle/gldraw.pyx":609
 *             renpy.display.log.write("Using FBO RTT.")
 *             self.rtt = glrtt_fbo.FboRtt()
 *             self.info["rtt"] = "fbo"             # <<<<<<<<<<<<<<
 *             self.rtt.init()
 * 
 */
    if (unlikely(__pyx_v_self->info == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (unlikely(PyDict_SetItem(__pyx_v_self->info, __pyx_n_s_rtt, __pyx_n_s_fbo) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "renpy/angle/gldraw.pyx":610
 *             self.rtt = glrtt_fbo.FboRtt()
 *             self.info["rtt"] = "fbo"
 *             self.rtt.init()             # <<<<<<<<<<<<<<
 * 
 *         elif glrtt_copy:
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->rtt, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (__pyx_t_4) {
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "renpy/angle/gldraw.pyx":606
 *                 "RENPY_bogus_extension"))
 * 
 *         if use_fbo:             # <<<<<<<<<<<<<<
 *             renpy.display.log.write("Using FBO RTT.")
 *             self.rtt = glrtt_fbo.FboRtt()
 */
    goto __pyx_L53;
  }

  /* "renpy/angle/gldraw.pyx":612
 *             self.rtt.init()
 * 
 *         elif glrtt_copy:             # <<<<<<<<<<<<<<
 *             renpy.display.log.write("Using copy RTT.")
 *             self.rtt = glrtt_copy.CopyRtt()
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_glrtt_copy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__pyx_t_13) {

    /* "renpy/angle/gldraw.pyx":613
 * 
 *         elif glrtt_copy:
 *             renpy.display.log.write("Using copy RTT.")             # <<<<<<<<<<<<<<
 *             self.rtt = glrtt_copy.CopyRtt()
 *             self.info["rtt"] = "copy"
 */
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_display); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_log); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "renpy/angle/gldraw.pyx":614
 *         elif glrtt_copy:
 *             renpy.display.log.write("Using copy RTT.")
 *             self.rtt = glrtt_copy.CopyRtt()             # <<<<<<<<<<<<<<
 *             self.info["rtt"] = "copy"
 *             self.rtt.init()
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_glrtt_copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_CopyRtt); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (__pyx_t_2) {
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GIVEREF(__pyx_t_6);
    __Pyx_GOTREF(__pyx_v_self->rtt);
    __Pyx_DECREF(__pyx_v_self->rtt);
    __pyx_v_self->rtt = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "renpy/angle/gldraw.pyx":615
 *             renpy.display.log.write("Using copy RTT.")
 *             self.rtt = glrtt_copy.CopyRtt()
 *             self.info["rtt"] = "copy"             # <<<<<<<<<<<<<<
 *             self.rtt.init()
 * 
 */
    if (unlikely(__pyx_v_self->info == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (unlikely(PyDict_SetItem(__pyx_v_self->info, __pyx_n_s_rtt, __pyx_n_s_copy) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "renpy/angle/gldraw.pyx":616
 *             self.rtt = glrtt_copy.CopyRtt()
 *             self.info["rtt"] = "copy"
 *             self.rtt.init()             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->rtt, __pyx_n_s_init); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (__pyx_t_2) {
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "renpy/angle/gldraw.pyx":612
 *             self.rtt.init()
 * 
 *         elif glrtt_copy:             # <<<<<<<<<<<<<<
 *             renpy.display.log.write("Using copy RTT.")
 *             self.rtt = glrtt_copy.CopyRtt()
 */
    goto __pyx_L53;
  }

  /* "renpy/angle/gldraw.pyx":619
 * 
 *         else:
 *             renpy.display.log.write("Can't find a workable rtt.")             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
  /*else*/ {
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_display); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_log); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "renpy/angle/gldraw.pyx":620
 *         else:
 *             renpy.display.log.write("Can't find a workable rtt.")
 *             return False             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;
  }
  __pyx_L53:;

  /* "renpy/angle/gldraw.pyx":623
 * 
 * 
 *         renpy.display.log.write("Using {0} renderer.".format(self.info["renderer"]))             # <<<<<<<<<<<<<<
 * 
 *         # Figure out the sizes of texture that render properly.
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_display); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_log); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Using_0_renderer, __pyx_n_s_format); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  if (unlikely(__pyx_v_self->info == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_self->info, __pyx_n_s_renderer); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_10))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_10);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_10, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_5); __pyx_t_5 = NULL;
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  }
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_10)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_10) {
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_6);
  } else {
    __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = NULL;
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "renpy/angle/gldraw.pyx":626
 * 
 *         # Figure out the sizes of texture that render properly.
 *         if not self.did_texture_test:             # <<<<<<<<<<<<<<
 *             rv = gltexture.test_texture_sizes(self.environ, self)
 *         else:
 */
  __pyx_t_13 = ((!(__pyx_v_self->did_texture_test != 0)) != 0);
  if (__pyx_t_13) {

    /* "renpy/angle/gldraw.pyx":627
 *         # Figure out the sizes of texture that render properly.
 *         if not self.did_texture_test:
 *             rv = gltexture.test_texture_sizes(self.environ, self)             # <<<<<<<<<<<<<<
 *         else:
 *             rv = True
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_gltexture); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_test_texture_sizes); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_11))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_11);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_11, function);
        __pyx_t_8 = 1;
      }
    }
    __pyx_t_4 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(((PyObject *)__pyx_v_self->environ));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self->environ));
    PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_8, ((PyObject *)__pyx_v_self->environ));
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_8, ((PyObject *)__pyx_v_self));
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_v_rv = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "renpy/angle/gldraw.pyx":626
 * 
 *         # Figure out the sizes of texture that render properly.
 *         if not self.did_texture_test:             # <<<<<<<<<<<<<<
 *             rv = gltexture.test_texture_sizes(self.environ, self)
 *         else:
 */
    goto __pyx_L54;
  }

  /* "renpy/angle/gldraw.pyx":629
 *             rv = gltexture.test_texture_sizes(self.environ, self)
 *         else:
 *             rv = True             # <<<<<<<<<<<<<<
 * 
 *         self.rtt.deinit()
 */
  /*else*/ {
    __Pyx_INCREF(Py_True);
    __pyx_v_rv = Py_True;
  }
  __pyx_L54:;

  /* "renpy/angle/gldraw.pyx":631
 *             rv = True
 * 
 *         self.rtt.deinit()             # <<<<<<<<<<<<<<
 *         self.environ.deinit()
 * 
 */
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->rtt, __pyx_n_s_deinit); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_11))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_11);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_11, function);
    }
  }
  if (__pyx_t_4) {
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_11); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "renpy/angle/gldraw.pyx":632
 * 
 *         self.rtt.deinit()
 *         self.environ.deinit()             # <<<<<<<<<<<<<<
 * 
 *         if not rv:
 */
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->environ), __pyx_n_s_deinit); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_11))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_11);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_11, function);
    }
  }
  if (__pyx_t_4) {
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_11); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "renpy/angle/gldraw.pyx":634
 *         self.environ.deinit()
 * 
 *         if not rv:             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
  __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_rv); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = ((!__pyx_t_13) != 0);
  if (__pyx_t_1) {

    /* "renpy/angle/gldraw.pyx":635
 * 
 *         if not rv:
 *             return False             # <<<<<<<<<<<<<<
 * 
 *         self.did_texture_test = True
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;

    /* "renpy/angle/gldraw.pyx":634
 *         self.environ.deinit()
 * 
 *         if not rv:             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
  }

  /* "renpy/angle/gldraw.pyx":637
 *             return False
 * 
 *         self.did_texture_test = True             # <<<<<<<<<<<<<<
 * 
 *         # Do additional setup needed.
 */
  __pyx_v_self->did_texture_test = 1;

  /* "renpy/angle/gldraw.pyx":640
 * 
 *         # Do additional setup needed.
 *         renpy.display.pgrender.set_rgba_masks()             # <<<<<<<<<<<<<<
 * 
 *         return True
 */
  __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_display); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_pgrender); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_set_rgba_masks); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_11)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_11);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (__pyx_t_11) {
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_11); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  } else {
    __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "renpy/angle/gldraw.pyx":642
 *         renpy.display.pgrender.set_rgba_masks()
 * 
 *         return True             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_True);
  __pyx_r = Py_True;
  goto __pyx_L0;

  /* "renpy/angle/gldraw.pyx":438
 *         self.old_fullscreen = None
 * 
 *     def init(self):             # <<<<<<<<<<<<<<
 *         """
 *         This does the first-time initialization of OpenGL, deciding
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_allow_shader);
  __Pyx_XDECREF(__pyx_v_allow_fixed);
  __Pyx_XDECREF(__pyx_v_r);
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_XDECREF(__pyx_v_allow_shader_);
  __Pyx_XDECREF(__pyx_v_allow_fixed_);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_use_subsystem);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XDECREF(__pyx_v_use_fbo);
  __Pyx_XDECREF(__pyx_v_rv);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/angle/gldraw.pyx":645
 * 
 * 
 *     def should_redraw(self, needs_redraw, first_pass):             # <<<<<<<<<<<<<<
 *         """
 *         Redraw whenever the screen needs it, but at least once every
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_13should_redraw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5renpy_5angle_6gldraw_6GLDraw_12should_redraw[] = "\n        Redraw whenever the screen needs it, but at least once every\n        .2 seconds. We rely on VSYNC to slow down our maximum\n        draw speed.\n        ";
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_13should_redraw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_needs_redraw = 0;
  PyObject *__pyx_v_first_pass = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("should_redraw (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_needs_redraw,&__pyx_n_s_first_pass,0};
    PyObject* values[2] = {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  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_needs_redraw)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_first_pass)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("should_redraw", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "should_redraw") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_needs_redraw = values[0];
    __pyx_v_first_pass = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("should_redraw", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.should_redraw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_12should_redraw(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self), __pyx_v_needs_redraw, __pyx_v_first_pass);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_12should_redraw(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_needs_redraw, PyObject *__pyx_v_first_pass) {
  int __pyx_v_rv;
  PyObject *__pyx_v_mx = NULL;
  PyObject *__pyx_v_my = NULL;
  PyObject *__pyx_v_tex = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *(*__pyx_t_7)(PyObject *);
  int __pyx_t_8;
  double __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("should_redraw", 0);

  /* "renpy/angle/gldraw.pyx":652
 *         """
 * 
 *         rv = False             # <<<<<<<<<<<<<<
 * 
 *         if needs_redraw:
 */
  __pyx_v_rv = 0;

  /* "renpy/angle/gldraw.pyx":654
 *         rv = False
 * 
 *         if needs_redraw:             # <<<<<<<<<<<<<<
 *             rv = True
 *         elif first_pass:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_needs_redraw); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "renpy/angle/gldraw.pyx":655
 * 
 *         if needs_redraw:
 *             rv = True             # <<<<<<<<<<<<<<
 *         elif first_pass:
 *             rv = True
 */
    __pyx_v_rv = 1;

    /* "renpy/angle/gldraw.pyx":654
 *         rv = False
 * 
 *         if needs_redraw:             # <<<<<<<<<<<<<<
 *             rv = True
 *         elif first_pass:
 */
    goto __pyx_L3;
  }

  /* "renpy/angle/gldraw.pyx":656
 *         if needs_redraw:
 *             rv = True
 *         elif first_pass:             # <<<<<<<<<<<<<<
 *             rv = True
 *         elif time.time() > self.last_redraw_time + self.redraw_period:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_first_pass); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "renpy/angle/gldraw.pyx":657
 *             rv = True
 *         elif first_pass:
 *             rv = True             # <<<<<<<<<<<<<<
 *         elif time.time() > self.last_redraw_time + self.redraw_period:
 *             rv = True
 */
    __pyx_v_rv = 1;

    /* "renpy/angle/gldraw.pyx":656
 *         if needs_redraw:
 *             rv = True
 *         elif first_pass:             # <<<<<<<<<<<<<<
 *             rv = True
 *         elif time.time() > self.last_redraw_time + self.redraw_period:
 */
    goto __pyx_L3;
  }

  /* "renpy/angle/gldraw.pyx":658
 *         elif first_pass:
 *             rv = True
 *         elif time.time() > self.last_redraw_time + self.redraw_period:             # <<<<<<<<<<<<<<
 *             rv = True
 *         else:
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyFloat_FromDouble((__pyx_v_self->last_redraw_time + __pyx_v_self->redraw_period)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_1) {

    /* "renpy/angle/gldraw.pyx":659
 *             rv = True
 *         elif time.time() > self.last_redraw_time + self.redraw_period:
 *             rv = True             # <<<<<<<<<<<<<<
 *         else:
 *             # Redraw if the mouse moves.
 */
    __pyx_v_rv = 1;

    /* "renpy/angle/gldraw.pyx":658
 *         elif first_pass:
 *             rv = True
 *         elif time.time() > self.last_redraw_time + self.redraw_period:             # <<<<<<<<<<<<<<
 *             rv = True
 *         else:
 */
    goto __pyx_L3;
  }

  /* "renpy/angle/gldraw.pyx":662
 *         else:
 *             # Redraw if the mouse moves.
 *             mx, my, tex = self.mouse_info             # <<<<<<<<<<<<<<
 *             if tex and (mx, my) != pygame.mouse.get_pos():
 *                 rv = True
 */
  /*else*/ {
    __pyx_t_3 = __pyx_v_self->mouse_info;
    __Pyx_INCREF(__pyx_t_3);
    if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
      PyObject* sequence = __pyx_t_3;
      #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 = 662; __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_2 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2); 
      } else {
        __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_5 = PyList_GET_ITEM(sequence, 2); 
      }
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      #else
      __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
      index = 0; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      index = 1; __pyx_t_2 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_2);
      index = 2; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_7 = NULL;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L5_unpacking_done;
      __pyx_L4_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L5_unpacking_done:;
    }
    __pyx_v_mx = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_v_my = __pyx_t_2;
    __pyx_t_2 = 0;
    __pyx_v_tex = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "renpy/angle/gldraw.pyx":663
 *             # Redraw if the mouse moves.
 *             mx, my, tex = self.mouse_info
 *             if tex and (mx, my) != pygame.mouse.get_pos():             # <<<<<<<<<<<<<<
 *                 rv = True
 * 
 */
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_tex); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_8) {
    } else {
      __pyx_t_1 = __pyx_t_8;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_mx);
    __Pyx_GIVEREF(__pyx_v_mx);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_mx);
    __Pyx_INCREF(__pyx_v_my);
    __Pyx_GIVEREF(__pyx_v_my);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_my);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_mouse); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_get_pos); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (__pyx_t_4) {
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_1 = __pyx_t_8;
    __pyx_L7_bool_binop_done:;
    if (__pyx_t_1) {

      /* "renpy/angle/gldraw.pyx":664
 *             mx, my, tex = self.mouse_info
 *             if tex and (mx, my) != pygame.mouse.get_pos():
 *                 rv = True             # <<<<<<<<<<<<<<
 * 
 *         # Store the redraw time.
 */
      __pyx_v_rv = 1;

      /* "renpy/angle/gldraw.pyx":663
 *             # Redraw if the mouse moves.
 *             mx, my, tex = self.mouse_info
 *             if tex and (mx, my) != pygame.mouse.get_pos():             # <<<<<<<<<<<<<<
 *                 rv = True
 * 
 */
    }
  }
  __pyx_L3:;

  /* "renpy/angle/gldraw.pyx":667
 * 
 *         # Store the redraw time.
 *         if rv:             # <<<<<<<<<<<<<<
 *             self.last_redraw_time = time.time()
 *             return True
 */
  __pyx_t_1 = (__pyx_v_rv != 0);
  if (__pyx_t_1) {

    /* "renpy/angle/gldraw.pyx":668
 *         # Store the redraw time.
 *         if rv:
 *             self.last_redraw_time = time.time()             # <<<<<<<<<<<<<<
 *             return True
 *         else:
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_time); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_5) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_self->last_redraw_time = __pyx_t_9;

    /* "renpy/angle/gldraw.pyx":669
 *         if rv:
 *             self.last_redraw_time = time.time()
 *             return True             # <<<<<<<<<<<<<<
 *         else:
 *             return False
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    goto __pyx_L0;

    /* "renpy/angle/gldraw.pyx":667
 * 
 *         # Store the redraw time.
 *         if rv:             # <<<<<<<<<<<<<<
 *             self.last_redraw_time = time.time()
 *             return True
 */
  }

  /* "renpy/angle/gldraw.pyx":671
 *             return True
 *         else:
 *             return False             # <<<<<<<<<<<<<<
 * 
 *     def mutated_surface(self, surf):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;
  }

  /* "renpy/angle/gldraw.pyx":645
 * 
 * 
 *     def should_redraw(self, needs_redraw, first_pass):             # <<<<<<<<<<<<<<
 *         """
 *         Redraw whenever the screen needs it, but at least once every
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.should_redraw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_mx);
  __Pyx_XDECREF(__pyx_v_my);
  __Pyx_XDECREF(__pyx_v_tex);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/angle/gldraw.pyx":673
 *             return False
 * 
 *     def mutated_surface(self, surf):             # <<<<<<<<<<<<<<
 *         if surf in self.texture_cache:
 *             del self.texture_cache[surf]
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_15mutated_surface(PyObject *__pyx_v_self, PyObject *__pyx_v_surf); /*proto*/
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_15mutated_surface(PyObject *__pyx_v_self, PyObject *__pyx_v_surf) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mutated_surface (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_14mutated_surface(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self), ((PyObject *)__pyx_v_surf));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_14mutated_surface(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_surf) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mutated_surface", 0);

  /* "renpy/angle/gldraw.pyx":674
 * 
 *     def mutated_surface(self, surf):
 *         if surf in self.texture_cache:             # <<<<<<<<<<<<<<
 *             del self.texture_cache[surf]
 * 
 */
  __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_surf, __pyx_v_self->texture_cache, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "renpy/angle/gldraw.pyx":675
 *     def mutated_surface(self, surf):
 *         if surf in self.texture_cache:
 *             del self.texture_cache[surf]             # <<<<<<<<<<<<<<
 * 
 *     def load_texture(self, surf, transient=False):
 */
    if (PyObject_DelItem(__pyx_v_self->texture_cache, __pyx_v_surf) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "renpy/angle/gldraw.pyx":674
 * 
 *     def mutated_surface(self, surf):
 *         if surf in self.texture_cache:             # <<<<<<<<<<<<<<
 *             del self.texture_cache[surf]
 * 
 */
  }

  /* "renpy/angle/gldraw.pyx":673
 *             return False
 * 
 *     def mutated_surface(self, surf):             # <<<<<<<<<<<<<<
 *         if surf in self.texture_cache:
 *             del self.texture_cache[surf]
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.mutated_surface", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/angle/gldraw.pyx":677
 *             del self.texture_cache[surf]
 * 
 *     def load_texture(self, surf, transient=False):             # <<<<<<<<<<<<<<
 *         """
 *         Loads a texture into memory.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_17load_texture(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5renpy_5angle_6gldraw_6GLDraw_16load_texture[] = "\n        Loads a texture into memory.\n        ";
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_17load_texture(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_surf = 0;
  PyObject *__pyx_v_transient = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("load_texture (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surf,&__pyx_n_s_transient,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        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_surf)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_transient);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "load_texture") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_surf = values[0];
    __pyx_v_transient = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("load_texture", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.load_texture", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_16load_texture(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self), __pyx_v_surf, __pyx_v_transient);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_16load_texture(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_surf, PyObject *__pyx_v_transient) {
  PyObject *__pyx_v_rv = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("load_texture", 0);

  /* "renpy/angle/gldraw.pyx":684
 *         # Turn a surface into a texture grid.
 * 
 *         rv = self.texture_cache.get(surf, None)             # <<<<<<<<<<<<<<
 * 
 *         if rv is None:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->texture_cache, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_3) {
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_INCREF(__pyx_v_surf);
  __Pyx_GIVEREF(__pyx_v_surf);
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_surf);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, Py_None);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_rv = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "renpy/angle/gldraw.pyx":686
 *         rv = self.texture_cache.get(surf, None)
 * 
 *         if rv is None:             # <<<<<<<<<<<<<<
 *             rv = gltexture.texture_grid_from_surface(surf, transient)
 *             self.texture_cache[surf] = rv
 */
  __pyx_t_6 = (__pyx_v_rv == Py_None);
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "renpy/angle/gldraw.pyx":687
 * 
 *         if rv is None:
 *             rv = gltexture.texture_grid_from_surface(surf, transient)             # <<<<<<<<<<<<<<
 *             self.texture_cache[surf] = rv
 * 
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_gltexture); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_texture_grid_from_surface); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_4 = 1;
      }
    }
    __pyx_t_3 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_v_surf);
    __Pyx_GIVEREF(__pyx_v_surf);
    PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_4, __pyx_v_surf);
    __Pyx_INCREF(__pyx_v_transient);
    __Pyx_GIVEREF(__pyx_v_transient);
    PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_4, __pyx_v_transient);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_rv, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "renpy/angle/gldraw.pyx":688
 *         if rv is None:
 *             rv = gltexture.texture_grid_from_surface(surf, transient)
 *             self.texture_cache[surf] = rv             # <<<<<<<<<<<<<<
 * 
 *         return rv
 */
    if (unlikely(PyObject_SetItem(__pyx_v_self->texture_cache, __pyx_v_surf, __pyx_v_rv) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "renpy/angle/gldraw.pyx":686
 *         rv = self.texture_cache.get(surf, None)
 * 
 *         if rv is None:             # <<<<<<<<<<<<<<
 *             rv = gltexture.texture_grid_from_surface(surf, transient)
 *             self.texture_cache[surf] = rv
 */
  }

  /* "renpy/angle/gldraw.pyx":690
 *             self.texture_cache[surf] = rv
 * 
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     def solid_texture(self, w, h, color):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_rv);
  __pyx_r = __pyx_v_rv;
  goto __pyx_L0;

  /* "renpy/angle/gldraw.pyx":677
 *             del self.texture_cache[surf]
 * 
 *     def load_texture(self, surf, transient=False):             # <<<<<<<<<<<<<<
 *         """
 *         Loads a texture into memory.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.load_texture", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_rv);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/angle/gldraw.pyx":692
 *         return rv
 * 
 *     def solid_texture(self, w, h, color):             # <<<<<<<<<<<<<<
 *         surf = renpy.display.pgrender.surface((w + 4, h + 4), True)
 *         surf.fill(color)
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_19solid_texture(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_19solid_texture(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_w = 0;
  PyObject *__pyx_v_h = 0;
  PyObject *__pyx_v_color = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("solid_texture (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_w,&__pyx_n_s_h,&__pyx_n_s_color,0};
    PyObject* values[3] = {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  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_w)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("solid_texture", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 692; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("solid_texture", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 692; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "solid_texture") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 692; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      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);
    }
    __pyx_v_w = values[0];
    __pyx_v_h = values[1];
    __pyx_v_color = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("solid_texture", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 692; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.solid_texture", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_18solid_texture(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self), __pyx_v_w, __pyx_v_h, __pyx_v_color);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_18solid_texture(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_w, PyObject *__pyx_v_h, PyObject *__pyx_v_color) {
  PyObject *__pyx_v_surf = NULL;
  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 = NULL;
  Py_ssize_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("solid_texture", 0);

  /* "renpy/angle/gldraw.pyx":693
 * 
 *     def solid_texture(self, w, h, color):
 *         surf = renpy.display.pgrender.surface((w + 4, h + 4), True)             # <<<<<<<<<<<<<<
 *         surf.fill(color)
 *         surf = surf.subsurface((2, 2, w, h))
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_display); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_pgrender); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_surface); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_w, __pyx_int_4, 4, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_h, __pyx_int_4, 4, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
  __pyx_t_2 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_6 = 1;
    }
  }
  __pyx_t_2 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (__pyx_t_4) {
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); __pyx_t_4 = NULL;
  }
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_6, __pyx_t_5);
  __Pyx_INCREF(Py_True);
  __Pyx_GIVEREF(Py_True);
  PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_6, Py_True);
  __pyx_t_5 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_surf = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "renpy/angle/gldraw.pyx":694
 *     def solid_texture(self, w, h, color):
 *         surf = renpy.display.pgrender.surface((w + 4, h + 4), True)
 *         surf.fill(color)             # <<<<<<<<<<<<<<
 *         surf = surf.subsurface((2, 2, w, h))
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_surf, __pyx_n_s_fill); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_color); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
    __Pyx_INCREF(__pyx_v_color);
    __Pyx_GIVEREF(__pyx_v_color);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_color);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "renpy/angle/gldraw.pyx":695
 *         surf = renpy.display.pgrender.surface((w + 4, h + 4), True)
 *         surf.fill(color)
 *         surf = surf.subsurface((2, 2, w, h))             # <<<<<<<<<<<<<<
 * 
 *         return self.load_texture(surf)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_surf, __pyx_n_s_subsurface); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_int_2);
  __Pyx_GIVEREF(__pyx_int_2);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_int_2);
  __Pyx_INCREF(__pyx_int_2);
  __Pyx_GIVEREF(__pyx_int_2);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_2);
  __Pyx_INCREF(__pyx_v_w);
  __Pyx_GIVEREF(__pyx_v_w);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_w);
  __Pyx_INCREF(__pyx_v_h);
  __Pyx_GIVEREF(__pyx_v_h);
  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_v_h);
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL;
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF_SET(__pyx_v_surf, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "renpy/angle/gldraw.pyx":697
 *         surf = surf.subsurface((2, 2, w, h))
 * 
 *         return self.load_texture(surf)             # <<<<<<<<<<<<<<
 * 
 *     # private
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_load_texture); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_surf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_INCREF(__pyx_v_surf);
    __Pyx_GIVEREF(__pyx_v_surf);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_surf);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "renpy/angle/gldraw.pyx":692
 *         return rv
 * 
 *     def solid_texture(self, w, h, color):             # <<<<<<<<<<<<<<
 *         surf = renpy.display.pgrender.surface((w + 4, h + 4), True)
 *         surf.fill(color)
 */

  /* function exit code */
  __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_5);
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.solid_texture", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_surf);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/angle/gldraw.pyx":700
 * 
 *     # private
 *     def clip_mode_screen(self):             # <<<<<<<<<<<<<<
 *         """
 *         This does two things. First, it shuts down clipping, and clears
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_21clip_mode_screen(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5renpy_5angle_6gldraw_6GLDraw_20clip_mode_screen[] = "\n        This does two things. First, it shuts down clipping, and clears\n        the cache so it will be reset by the next call to set_clip. Then\n        it flags that we are in the screen clip mode, which control how\n        coordinates are mapped to the scissor box.\n        ";
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_21clip_mode_screen(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clip_mode_screen (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_20clip_mode_screen(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_20clip_mode_screen(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clip_mode_screen", 0);

  /* "renpy/angle/gldraw.pyx":708
 *         """
 * 
 *         self.clip_cache = None             # <<<<<<<<<<<<<<
 *         self.clip_rtt_box = None
 * 
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->clip_cache);
  __Pyx_DECREF(__pyx_v_self->clip_cache);
  __pyx_v_self->clip_cache = ((PyObject*)Py_None);

  /* "renpy/angle/gldraw.pyx":709
 * 
 *         self.clip_cache = None
 *         self.clip_rtt_box = None             # <<<<<<<<<<<<<<
 * 
 *         self.environ.unset_clip(self)
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->clip_rtt_box);
  __Pyx_DECREF(__pyx_v_self->clip_rtt_box);
  __pyx_v_self->clip_rtt_box = ((PyObject*)Py_None);

  /* "renpy/angle/gldraw.pyx":711
 *         self.clip_rtt_box = None
 * 
 *         self.environ.unset_clip(self)             # <<<<<<<<<<<<<<
 * 
 *     # private
 */
  ((struct __pyx_vtabstruct_5renpy_5angle_6gldraw_Environ *)__pyx_v_self->environ->__pyx_vtab)->unset_clip(__pyx_v_self->environ, __pyx_v_self);

  /* "renpy/angle/gldraw.pyx":700
 * 
 *     # private
 *     def clip_mode_screen(self):             # <<<<<<<<<<<<<<
 *         """
 *         This does two things. First, it shuts down clipping, and clears
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/angle/gldraw.pyx":714
 * 
 *     # private
 *     def clip_mode_rtt(self, x, y, w, h):             # <<<<<<<<<<<<<<
 *         """
 *         The same thing, except the screen is projected in RTT mode.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_23clip_mode_rtt(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5renpy_5angle_6gldraw_6GLDraw_22clip_mode_rtt[] = "\n        The same thing, except the screen is projected in RTT mode.\n        ";
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_23clip_mode_rtt(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_x = 0;
  PyObject *__pyx_v_y = 0;
  PyObject *__pyx_v_w = 0;
  PyObject *__pyx_v_h = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clip_mode_rtt (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_w,&__pyx_n_s_h,0};
    PyObject* values[4] = {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  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_x)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("clip_mode_rtt", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("clip_mode_rtt", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("clip_mode_rtt", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "clip_mode_rtt") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      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);
    }
    __pyx_v_x = values[0];
    __pyx_v_y = values[1];
    __pyx_v_w = values[2];
    __pyx_v_h = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("clip_mode_rtt", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.clip_mode_rtt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_22clip_mode_rtt(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self), __pyx_v_x, __pyx_v_y, __pyx_v_w, __pyx_v_h);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_22clip_mode_rtt(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_w, PyObject *__pyx_v_h) {
  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("clip_mode_rtt", 0);

  /* "renpy/angle/gldraw.pyx":719
 *         """
 * 
 *         self.clip_cache = None             # <<<<<<<<<<<<<<
 *         self.clip_rtt_box = (x, y, w, h)
 * 
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->clip_cache);
  __Pyx_DECREF(__pyx_v_self->clip_cache);
  __pyx_v_self->clip_cache = ((PyObject*)Py_None);

  /* "renpy/angle/gldraw.pyx":720
 * 
 *         self.clip_cache = None
 *         self.clip_rtt_box = (x, y, w, h)             # <<<<<<<<<<<<<<
 * 
 *         self.environ.unset_clip(self)
 */
  __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_x);
  __Pyx_GIVEREF(__pyx_v_x);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_x);
  __Pyx_INCREF(__pyx_v_y);
  __Pyx_GIVEREF(__pyx_v_y);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_y);
  __Pyx_INCREF(__pyx_v_w);
  __Pyx_GIVEREF(__pyx_v_w);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_w);
  __Pyx_INCREF(__pyx_v_h);
  __Pyx_GIVEREF(__pyx_v_h);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_h);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->clip_rtt_box);
  __Pyx_DECREF(__pyx_v_self->clip_rtt_box);
  __pyx_v_self->clip_rtt_box = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "renpy/angle/gldraw.pyx":722
 *         self.clip_rtt_box = (x, y, w, h)
 * 
 *         self.environ.unset_clip(self)             # <<<<<<<<<<<<<<
 * 
 *     # private
 */
  ((struct __pyx_vtabstruct_5renpy_5angle_6gldraw_Environ *)__pyx_v_self->environ->__pyx_vtab)->unset_clip(__pyx_v_self->environ, __pyx_v_self);

  /* "renpy/angle/gldraw.pyx":714
 * 
 *     # private
 *     def clip_mode_rtt(self, x, y, w, h):             # <<<<<<<<<<<<<<
 *         """
 *         The same thing, except the screen is projected in RTT mode.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.clip_mode_rtt", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/angle/gldraw.pyx":725
 * 
 *     # private
 *     cpdef set_clip(GLDraw self, tuple clip):             # <<<<<<<<<<<<<<
 * 
 *         if self.clip_cache == clip:
 */

static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_25set_clip(PyObject *__pyx_v_self, PyObject *__pyx_v_clip); /*proto*/
static PyObject *__pyx_f_5renpy_5angle_6gldraw_6GLDraw_set_clip(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_clip, int __pyx_skip_dispatch) {
  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 = NULL;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_clip", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_clip); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_25set_clip)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_clip); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
        __Pyx_INCREF(__pyx_v_clip);
        __Pyx_GIVEREF(__pyx_v_clip);
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_clip);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "renpy/angle/gldraw.pyx":727
 *     cpdef set_clip(GLDraw self, tuple clip):
 * 
 *         if self.clip_cache == clip:             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_self->clip_cache, __pyx_v_clip, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_6) {

    /* "renpy/angle/gldraw.pyx":728
 * 
 *         if self.clip_cache == clip:
 *             return             # <<<<<<<<<<<<<<
 * 
 *         self.clip_cache = clip
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "renpy/angle/gldraw.pyx":727
 *     cpdef set_clip(GLDraw self, tuple clip):
 * 
 *         if self.clip_cache == clip:             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  }

  /* "renpy/angle/gldraw.pyx":730
 *             return
 * 
 *         self.clip_cache = clip             # <<<<<<<<<<<<<<
 * 
 *         self.environ.set_clip(clip, self)
 */
  __Pyx_INCREF(__pyx_v_clip);
  __Pyx_GIVEREF(__pyx_v_clip);
  __Pyx_GOTREF(__pyx_v_self->clip_cache);
  __Pyx_DECREF(__pyx_v_self->clip_cache);
  __pyx_v_self->clip_cache = __pyx_v_clip;

  /* "renpy/angle/gldraw.pyx":732
 *         self.clip_cache = clip
 * 
 *         self.environ.set_clip(clip, self)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  ((struct __pyx_vtabstruct_5renpy_5angle_6gldraw_Environ *)__pyx_v_self->environ->__pyx_vtab)->set_clip(__pyx_v_self->environ, __pyx_v_clip, __pyx_v_self);

  /* "renpy/angle/gldraw.pyx":725
 * 
 *     # private
 *     cpdef set_clip(GLDraw self, tuple clip):             # <<<<<<<<<<<<<<
 * 
 *         if self.clip_cache == clip:
 */

  /* function exit code */
  __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_5);
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.set_clip", __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_5renpy_5angle_6gldraw_6GLDraw_25set_clip(PyObject *__pyx_v_self, PyObject *__pyx_v_clip); /*proto*/
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_25set_clip(PyObject *__pyx_v_self, PyObject *__pyx_v_clip) {
  CYTHON_UNUSED int __pyx_lineno = 0;
  CYTHON_UNUSED const char *__pyx_filename = NULL;
  CYTHON_UNUSED int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_clip (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_clip), (&PyTuple_Type), 1, "clip", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_24set_clip(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self), ((PyObject*)__pyx_v_clip));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_24set_clip(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_clip) {
  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_clip", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_5renpy_5angle_6gldraw_6GLDraw_set_clip(__pyx_v_self, __pyx_v_clip, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.set_clip", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/angle/gldraw.pyx":735
 * 
 * 
 *     def draw_screen(self, surftree, fullscreen_video, flip=True):             # <<<<<<<<<<<<<<
 *         """
 *         Draws the screen.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_27draw_screen(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5renpy_5angle_6gldraw_6GLDraw_26draw_screen[] = "\n        Draws the screen.\n        ";
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_27draw_screen(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_surftree = 0;
  CYTHON_UNUSED PyObject *__pyx_v_fullscreen_video = 0;
  PyObject *__pyx_v_flip = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw_screen (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surftree,&__pyx_n_s_fullscreen_video,&__pyx_n_s_flip,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)Py_True);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        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_surftree)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fullscreen_video)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("draw_screen", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flip);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "draw_screen") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_surftree = values[0];
    __pyx_v_fullscreen_video = values[1];
    __pyx_v_flip = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("draw_screen", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.draw_screen", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_26draw_screen(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self), __pyx_v_surftree, __pyx_v_fullscreen_video, __pyx_v_flip);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_26draw_screen(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_surftree, CYTHON_UNUSED PyObject *__pyx_v_fullscreen_video, PyObject *__pyx_v_flip) {
  PyObject *__pyx_v_reverse = NULL;
  PyObject *__pyx_v_xmul = NULL;
  PyObject *__pyx_v_ymul = NULL;
  PyObject *__pyx_v_xsize = NULL;
  PyObject *__pyx_v_ysize = NULL;
  PyObject *__pyx_v_clip = NULL;
  PyObject *__pyx_v_surf = NULL;
  PyObject *__pyx_v_start = NULL;
  PyObject *__pyx_v_end = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  double __pyx_t_9;
  double __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  Py_ssize_t __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  int __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("draw_screen", 0);

  /* "renpy/angle/gldraw.pyx":740
 *         """
 * 
 *         if renpy.config.use_drawable_resolution:             # <<<<<<<<<<<<<<
 *             reverse = self.virt_to_draw
 *         else:
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_config); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_use_drawable_resolution); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "renpy/angle/gldraw.pyx":741
 * 
 *         if renpy.config.use_drawable_resolution:
 *             reverse = self.virt_to_draw             # <<<<<<<<<<<<<<
 *         else:
 *             reverse = IDENTITY
 */
    __pyx_t_1 = ((PyObject *)__pyx_v_self->virt_to_draw);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_v_reverse = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "renpy/angle/gldraw.pyx":740
 *         """
 * 
 *         if renpy.config.use_drawable_resolution:             # <<<<<<<<<<<<<<
 *             reverse = self.virt_to_draw
 *         else:
 */
    goto __pyx_L3;
  }

  /* "renpy/angle/gldraw.pyx":743
 *             reverse = self.virt_to_draw
 *         else:
 *             reverse = IDENTITY             # <<<<<<<<<<<<<<
 * 
 *         surftree.is_opaque()
 */
  /*else*/ {
    __Pyx_INCREF(__pyx_v_5renpy_5angle_6gldraw_IDENTITY);
    __pyx_v_reverse = __pyx_v_5renpy_5angle_6gldraw_IDENTITY;
  }
  __pyx_L3:;

  /* "renpy/angle/gldraw.pyx":745
 *             reverse = IDENTITY
 * 
 *         surftree.is_opaque()             # <<<<<<<<<<<<<<
 * 
 *         self.draw_render_textures(surftree, 0)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_surftree, __pyx_n_s_is_opaque); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "renpy/angle/gldraw.pyx":747
 *         surftree.is_opaque()
 * 
 *         self.draw_render_textures(surftree, 0)             # <<<<<<<<<<<<<<
 * 
 *         xmul = 1.0 * self.drawable_size[0] / self.physical_size[0]
 */
  __pyx_t_5 = ((struct __pyx_vtabstruct_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self->__pyx_vtab)->draw_render_textures(__pyx_v_self, __pyx_v_surftree, 0, 0); if (unlikely(__pyx_t_5 == 1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/angle/gldraw.pyx":749
 *         self.draw_render_textures(surftree, 0)
 * 
 *         xmul = 1.0 * self.drawable_size[0] / self.physical_size[0]             # <<<<<<<<<<<<<<
 *         ymul = 1.0 * self.drawable_size[1] / self.physical_size[1]
 * 
 */
  if (unlikely(__pyx_v_self->drawable_size == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_self->drawable_size, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Multiply(__pyx_float_1_0, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_v_self->physical_size == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_self->physical_size, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_xmul = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "renpy/angle/gldraw.pyx":750
 * 
 *         xmul = 1.0 * self.drawable_size[0] / self.physical_size[0]
 *         ymul = 1.0 * self.drawable_size[1] / self.physical_size[1]             # <<<<<<<<<<<<<<
 * 
 *         if reverse != IDENTITY:
 */
  if (unlikely(__pyx_v_self->drawable_size == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_self->drawable_size, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyNumber_Multiply(__pyx_float_1_0, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(__pyx_v_self->physical_size == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_self->physical_size, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_ymul = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "renpy/angle/gldraw.pyx":752
 *         ymul = 1.0 * self.drawable_size[1] / self.physical_size[1]
 * 
 *         if reverse != IDENTITY:             # <<<<<<<<<<<<<<
 *             xsize = xmul * self.physical_box[2]
 *             ysize = ymul * self.physical_box[3]
 */
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_reverse, __pyx_v_5renpy_5angle_6gldraw_IDENTITY, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "renpy/angle/gldraw.pyx":753
 * 
 *         if reverse != IDENTITY:
 *             xsize = xmul * self.physical_box[2]             # <<<<<<<<<<<<<<
 *             ysize = ymul * self.physical_box[3]
 *         else:
 */
    if (unlikely(__pyx_v_self->physical_box == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_GetItemInt_Tuple(__pyx_v_self->physical_box, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyNumber_Multiply(__pyx_v_xmul, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_xsize = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "renpy/angle/gldraw.pyx":754
 *         if reverse != IDENTITY:
 *             xsize = xmul * self.physical_box[2]
 *             ysize = ymul * self.physical_box[3]             # <<<<<<<<<<<<<<
 *         else:
 *             xsize = self.virtual_size[0]
 */
    if (unlikely(__pyx_v_self->physical_box == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_self->physical_box, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PyNumber_Multiply(__pyx_v_ymul, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_ysize = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "renpy/angle/gldraw.pyx":752
 *         ymul = 1.0 * self.drawable_size[1] / self.physical_size[1]
 * 
 *         if reverse != IDENTITY:             # <<<<<<<<<<<<<<
 *             xsize = xmul * self.physical_box[2]
 *             ysize = ymul * self.physical_box[3]
 */
    goto __pyx_L4;
  }

  /* "renpy/angle/gldraw.pyx":756
 *             ysize = ymul * self.physical_box[3]
 *         else:
 *             xsize = self.virtual_size[0]             # <<<<<<<<<<<<<<
 *             ysize = self.virtual_size[1]
 * 
 */
  /*else*/ {
    if (unlikely(__pyx_v_self->virtual_size == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_GetItemInt_Tuple(__pyx_v_self->virtual_size, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_xsize = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "renpy/angle/gldraw.pyx":757
 *         else:
 *             xsize = self.virtual_size[0]
 *             ysize = self.virtual_size[1]             # <<<<<<<<<<<<<<
 * 
 *         self.environ.viewport(xmul * self.physical_box[0], ymul * self.physical_box[1], xmul * self.physical_box[2], ymul * self.physical_box[3])
 */
    if (unlikely(__pyx_v_self->virtual_size == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_GetItemInt_Tuple(__pyx_v_self->virtual_size, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_ysize = __pyx_t_2;
    __pyx_t_2 = 0;
  }
  __pyx_L4:;

  /* "renpy/angle/gldraw.pyx":759
 *             ysize = self.virtual_size[1]
 * 
 *         self.environ.viewport(xmul * self.physical_box[0], ymul * self.physical_box[1], xmul * self.physical_box[2], ymul * self.physical_box[3])             # <<<<<<<<<<<<<<
 *         self.environ.ortho(0, xsize, ysize, 0, -1.0, 1.0)
 * 
 */
  if (unlikely(__pyx_v_self->physical_box == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_2 = __Pyx_GetItemInt_Tuple(__pyx_v_self->physical_box, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyNumber_Multiply(__pyx_v_xmul, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(__pyx_v_self->physical_box == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_self->physical_box, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyNumber_Multiply(__pyx_v_ymul, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(__pyx_v_self->physical_box == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_2 = __Pyx_GetItemInt_Tuple(__pyx_v_self->physical_box, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyNumber_Multiply(__pyx_v_xmul, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(__pyx_v_self->physical_box == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_self->physical_box, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyNumber_Multiply(__pyx_v_ymul, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  ((struct __pyx_vtabstruct_5renpy_5angle_6gldraw_Environ *)__pyx_v_self->environ->__pyx_vtab)->viewport(__pyx_v_self->environ, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8);

  /* "renpy/angle/gldraw.pyx":760
 * 
 *         self.environ.viewport(xmul * self.physical_box[0], ymul * self.physical_box[1], xmul * self.physical_box[2], ymul * self.physical_box[3])
 *         self.environ.ortho(0, xsize, ysize, 0, -1.0, 1.0)             # <<<<<<<<<<<<<<
 * 
 *         self.clip_mode_screen()
 */
  __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_xsize); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_ysize); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  ((struct __pyx_vtabstruct_5renpy_5angle_6gldraw_Environ *)__pyx_v_self->environ->__pyx_vtab)->ortho(__pyx_v_self->environ, 0.0, __pyx_t_9, __pyx_t_10, 0.0, -1.0, 1.0);

  /* "renpy/angle/gldraw.pyx":762
 *         self.environ.ortho(0, xsize, ysize, 0, -1.0, 1.0)
 * 
 *         self.clip_mode_screen()             # <<<<<<<<<<<<<<
 * 
 *         glClearColor(0.0, 0.0, 0.0, 1.0)
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_clip_mode_screen); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (__pyx_t_1) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "renpy/angle/gldraw.pyx":764
 *         self.clip_mode_screen()
 * 
 *         glClearColor(0.0, 0.0, 0.0, 1.0)             # <<<<<<<<<<<<<<
 *         glClear(GL_COLOR_BUFFER_BIT)
 * 
 */
  __pyx_t_8 = __pyx_f_5renpy_5angle_2gl_glClearColor(0.0, 0.0, 0.0, 1.0); if (unlikely(__pyx_t_8 == 0 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/angle/gldraw.pyx":765
 * 
 *         glClearColor(0.0, 0.0, 0.0, 1.0)
 *         glClear(GL_COLOR_BUFFER_BIT)             # <<<<<<<<<<<<<<
 * 
 *         self.default_clip = (0, 0, xsize, ysize)
 */
  __pyx_t_8 = __pyx_f_5renpy_5angle_2gl_glClear(GL_COLOR_BUFFER_BIT); if (unlikely(__pyx_t_8 == 0 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/angle/gldraw.pyx":767
 *         glClear(GL_COLOR_BUFFER_BIT)
 * 
 *         self.default_clip = (0, 0, xsize, ysize)             # <<<<<<<<<<<<<<
 *         clip = self.default_clip
 * 
 */
  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_0);
  __Pyx_INCREF(__pyx_v_xsize);
  __Pyx_GIVEREF(__pyx_v_xsize);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_xsize);
  __Pyx_INCREF(__pyx_v_ysize);
  __Pyx_GIVEREF(__pyx_v_ysize);
  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_ysize);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->default_clip);
  __Pyx_DECREF(__pyx_v_self->default_clip);
  __pyx_v_self->default_clip = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "renpy/angle/gldraw.pyx":768
 * 
 *         self.default_clip = (0, 0, xsize, ysize)
 *         clip = self.default_clip             # <<<<<<<<<<<<<<
 * 
 *         if renpy.display.video.fullscreen:
 */
  __pyx_t_2 = __pyx_v_self->default_clip;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_v_clip = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "renpy/angle/gldraw.pyx":770
 *         clip = self.default_clip
 * 
 *         if renpy.display.video.fullscreen:             # <<<<<<<<<<<<<<
 *             surf = renpy.display.video.render_movie("movie", self.virtual_size[0], self.virtual_size[1])
 *             if surf is not None:
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_display); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_video); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_fullscreen); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_3) {

    /* "renpy/angle/gldraw.pyx":771
 * 
 *         if renpy.display.video.fullscreen:
 *             surf = renpy.display.video.render_movie("movie", self.virtual_size[0], self.virtual_size[1])             # <<<<<<<<<<<<<<
 *             if surf is not None:
 *                 self.draw_transformed(surf, clip, 0, 0, 1.0, 1.0, reverse, renpy.config.nearest_neighbor, False)
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_display); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_video); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_render_movie); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(__pyx_v_self->virtual_size == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_GetItemInt_Tuple(__pyx_v_self->virtual_size, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely(__pyx_v_self->virtual_size == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_11 = __Pyx_GetItemInt_Tuple(__pyx_v_self->virtual_size, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_12 = NULL;
    __pyx_t_13 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_12)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_12);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_13 = 1;
      }
    }
    __pyx_t_14 = PyTuple_New(3+__pyx_t_13); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);
    if (__pyx_t_12) {
      __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_12); __pyx_t_12 = NULL;
    }
    __Pyx_INCREF(__pyx_n_s_movie);
    __Pyx_GIVEREF(__pyx_n_s_movie);
    PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_13, __pyx_n_s_movie);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_13, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_11);
    PyTuple_SET_ITEM(__pyx_t_14, 2+__pyx_t_13, __pyx_t_11);
    __pyx_t_2 = 0;
    __pyx_t_11 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_14, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_surf = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "renpy/angle/gldraw.pyx":772
 *         if renpy.display.video.fullscreen:
 *             surf = renpy.display.video.render_movie("movie", self.virtual_size[0], self.virtual_size[1])
 *             if surf is not None:             # <<<<<<<<<<<<<<
 *                 self.draw_transformed(surf, clip, 0, 0, 1.0, 1.0, reverse, renpy.config.nearest_neighbor, False)
 * 
 */
    __pyx_t_3 = (__pyx_v_surf != Py_None);
    __pyx_t_15 = (__pyx_t_3 != 0);
    if (__pyx_t_15) {

      /* "renpy/angle/gldraw.pyx":773
 *             surf = renpy.display.video.render_movie("movie", self.virtual_size[0], self.virtual_size[1])
 *             if surf is not None:
 *                 self.draw_transformed(surf, clip, 0, 0, 1.0, 1.0, reverse, renpy.config.nearest_neighbor, False)             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      if (!(likely(((__pyx_v_reverse) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_reverse, __pyx_ptype_5renpy_7display_6render_Matrix2D))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_config); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_nearest_neighbor); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_8 = ((struct __pyx_vtabstruct_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self->__pyx_vtab)->draw_transformed(__pyx_v_self, __pyx_v_surf, __pyx_v_clip, 0.0, 0.0, 1.0, 1.0, ((struct __pyx_obj_5renpy_7display_6render_Matrix2D *)__pyx_v_reverse), __pyx_t_15, 0, 0); if (unlikely(__pyx_t_8 == 1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "renpy/angle/gldraw.pyx":772
 *         if renpy.display.video.fullscreen:
 *             surf = renpy.display.video.render_movie("movie", self.virtual_size[0], self.virtual_size[1])
 *             if surf is not None:             # <<<<<<<<<<<<<<
 *                 self.draw_transformed(surf, clip, 0, 0, 1.0, 1.0, reverse, renpy.config.nearest_neighbor, False)
 * 
 */
    }

    /* "renpy/angle/gldraw.pyx":770
 *         clip = self.default_clip
 * 
 *         if renpy.display.video.fullscreen:             # <<<<<<<<<<<<<<
 *             surf = renpy.display.video.render_movie("movie", self.virtual_size[0], self.virtual_size[1])
 *             if surf is not None:
 */
    goto __pyx_L5;
  }

  /* "renpy/angle/gldraw.pyx":776
 * 
 *         else:
 *             self.draw_transformed(surftree, clip, 0, 0, 1.0, 1.0, reverse, renpy.config.nearest_neighbor, False)             # <<<<<<<<<<<<<<
 * 
 *         if flip:
 */
  /*else*/ {
    if (!(likely(((__pyx_v_reverse) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_reverse, __pyx_ptype_5renpy_7display_6render_Matrix2D))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_config); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_nearest_neighbor); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_8 = ((struct __pyx_vtabstruct_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self->__pyx_vtab)->draw_transformed(__pyx_v_self, __pyx_v_surftree, __pyx_v_clip, 0.0, 0.0, 1.0, 1.0, ((struct __pyx_obj_5renpy_7display_6render_Matrix2D *)__pyx_v_reverse), __pyx_t_15, 0, 0); if (unlikely(__pyx_t_8 == 1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L5:;

  /* "renpy/angle/gldraw.pyx":778
 *             self.draw_transformed(surftree, clip, 0, 0, 1.0, 1.0, reverse, renpy.config.nearest_neighbor, False)
 * 
 *         if flip:             # <<<<<<<<<<<<<<
 * 
 *             self.draw_mouse()
 */
  __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_v_flip); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_15) {

    /* "renpy/angle/gldraw.pyx":780
 *         if flip:
 * 
 *             self.draw_mouse()             # <<<<<<<<<<<<<<
 * 
 *             start = time.time()
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_draw_mouse); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_14 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_14)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_14);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (__pyx_t_14) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_14); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    } else {
      __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "renpy/angle/gldraw.pyx":782
 *             self.draw_mouse()
 * 
 *             start = time.time()             # <<<<<<<<<<<<<<
 * 
 *             if EGL:
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_time); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_14))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_14);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_14, function);
      }
    }
    if (__pyx_t_1) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_14); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_v_start = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "renpy/angle/gldraw.pyx":784
 *             start = time.time()
 * 
 *             if EGL:             # <<<<<<<<<<<<<<
 *                 egl_swap()
 *             else:
 */
    __pyx_t_15 = (__pyx_v_5renpy_5angle_6gldraw_EGL != 0);
    if (__pyx_t_15) {

      /* "renpy/angle/gldraw.pyx":785
 * 
 *             if EGL:
 *                 egl_swap()             # <<<<<<<<<<<<<<
 *             else:
 *                 pygame.display.flip()
 */
      egl_swap();

      /* "renpy/angle/gldraw.pyx":784
 *             start = time.time()
 * 
 *             if EGL:             # <<<<<<<<<<<<<<
 *                 egl_swap()
 *             else:
 */
      goto __pyx_L8;
    }

    /* "renpy/angle/gldraw.pyx":787
 *                 egl_swap()
 *             else:
 *                 pygame.display.flip()             # <<<<<<<<<<<<<<
 * 
 *             end = time.time()
 */
    /*else*/ {
      __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_display); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_flip); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_14))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_14);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_14, function);
        }
      }
      if (__pyx_t_1) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      } else {
        __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_14); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __pyx_L8:;

    /* "renpy/angle/gldraw.pyx":789
 *                 pygame.display.flip()
 * 
 *             end = time.time()             # <<<<<<<<<<<<<<
 * 
 *             if vsync:
 */
    __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_t_14 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_14)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_14);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (__pyx_t_14) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_14); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    } else {
      __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_end = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "renpy/angle/gldraw.pyx":791
 *             end = time.time()
 * 
 *             if vsync:             # <<<<<<<<<<<<<<
 * 
 *                 # When the window is covered or
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_vsync); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_15) {

      /* "renpy/angle/gldraw.pyx":795
 *                 # When the window is covered or
 * 
 *                 flip_times.append(end - start)             # <<<<<<<<<<<<<<
 *                 frame_times.append(end)
 * 
 */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_flip_times); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = PyNumber_Subtract(__pyx_v_end, __pyx_v_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_16 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_16 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "renpy/angle/gldraw.pyx":796
 * 
 *                 flip_times.append(end - start)
 *                 frame_times.append(end)             # <<<<<<<<<<<<<<
 * 
 *                 if len(flip_times) > 10:
 */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_frame_times); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_16 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_v_end); if (unlikely(__pyx_t_16 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "renpy/angle/gldraw.pyx":798
 *                 frame_times.append(end)
 * 
 *                 if len(flip_times) > 10:             # <<<<<<<<<<<<<<
 *                     flip_times.pop(0)
 *                     frame_times.pop(0)
 */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_flip_times); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_13 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_15 = ((__pyx_t_13 > 10) != 0);
      if (__pyx_t_15) {

        /* "renpy/angle/gldraw.pyx":799
 * 
 *                 if len(flip_times) > 10:
 *                     flip_times.pop(0)             # <<<<<<<<<<<<<<
 *                     frame_times.pop(0)
 * 
 */
        __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_flip_times); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_4 = __Pyx_PyObject_PopIndex(__pyx_t_1, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "renpy/angle/gldraw.pyx":800
 *                 if len(flip_times) > 10:
 *                     flip_times.pop(0)
 *                     frame_times.pop(0)             # <<<<<<<<<<<<<<
 * 
 *                     # If we're running at over 1000 fps, vsync is broken.
 */
        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_frame_times); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_1 = __Pyx_PyObject_PopIndex(__pyx_t_4, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "renpy/angle/gldraw.pyx":803
 * 
 *                     # If we're running at over 1000 fps, vsync is broken.
 *                     if (frame_times[-1] - frame_times[0] < .06 * 10) and (sum(flip_times) / len(flip_times) < .001):             # <<<<<<<<<<<<<<
 *                         time.sleep(1.0 / 60.0)
 * 
 */
        __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_frame_times); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_frame_times); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_14 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_14 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = PyNumber_Subtract(__pyx_t_4, __pyx_t_14); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_t_14 = PyFloat_FromDouble((.06 * 10.0)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_14, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (__pyx_t_3) {
        } else {
          __pyx_t_15 = __pyx_t_3;
          goto __pyx_L12_bool_binop_done;
        }
        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_flip_times); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_14, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_flip_times); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_13 = PyObject_Length(__pyx_t_14); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_t_14 = PyInt_FromSsize_t(__pyx_t_13); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_t_14); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_t_14 = PyObject_RichCompare(__pyx_t_1, __pyx_float__001, Py_LT); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_t_15 = __pyx_t_3;
        __pyx_L12_bool_binop_done:;
        if (__pyx_t_15) {

          /* "renpy/angle/gldraw.pyx":804
 *                     # If we're running at over 1000 fps, vsync is broken.
 *                     if (frame_times[-1] - frame_times[0] < .06 * 10) and (sum(flip_times) / len(flip_times) < .001):
 *                         time.sleep(1.0 / 60.0)             # <<<<<<<<<<<<<<
 * 
 *         gltexture.cleanup()
 */
          __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sleep); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_1 = PyFloat_FromDouble((1.0 / 60.0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_11 = NULL;
          if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_4);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_4, function);
            }
          }
          if (!__pyx_t_11) {
            __pyx_t_14 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_GOTREF(__pyx_t_14);
          } else {
            __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_11); __pyx_t_11 = NULL;
            __Pyx_GIVEREF(__pyx_t_1);
            PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_1);
            __pyx_t_1 = 0;
            __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_14);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          }
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

          /* "renpy/angle/gldraw.pyx":803
 * 
 *                     # If we're running at over 1000 fps, vsync is broken.
 *                     if (frame_times[-1] - frame_times[0] < .06 * 10) and (sum(flip_times) / len(flip_times) < .001):             # <<<<<<<<<<<<<<
 *                         time.sleep(1.0 / 60.0)
 * 
 */
        }

        /* "renpy/angle/gldraw.pyx":798
 *                 frame_times.append(end)
 * 
 *                 if len(flip_times) > 10:             # <<<<<<<<<<<<<<
 *                     flip_times.pop(0)
 *                     frame_times.pop(0)
 */
      }

      /* "renpy/angle/gldraw.pyx":791
 *             end = time.time()
 * 
 *             if vsync:             # <<<<<<<<<<<<<<
 * 
 *                 # When the window is covered or
 */
    }

    /* "renpy/angle/gldraw.pyx":778
 *             self.draw_transformed(surftree, clip, 0, 0, 1.0, 1.0, reverse, renpy.config.nearest_neighbor, False)
 * 
 *         if flip:             # <<<<<<<<<<<<<<
 * 
 *             self.draw_mouse()
 */
  }

  /* "renpy/angle/gldraw.pyx":806
 *                         time.sleep(1.0 / 60.0)
 * 
 *         gltexture.cleanup()             # <<<<<<<<<<<<<<
 * 
 *     cpdef int draw_render_textures(GLDraw self, what, bint non_aligned) except 1:
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gltexture); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_cleanup); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_4) {
    __pyx_t_14 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    __pyx_t_14 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "renpy/angle/gldraw.pyx":735
 * 
 * 
 *     def draw_screen(self, surftree, fullscreen_video, flip=True):             # <<<<<<<<<<<<<<
 *         """
 *         Draws the screen.
 */

  /* function exit code */
  __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_4);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.draw_screen", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_reverse);
  __Pyx_XDECREF(__pyx_v_xmul);
  __Pyx_XDECREF(__pyx_v_ymul);
  __Pyx_XDECREF(__pyx_v_xsize);
  __Pyx_XDECREF(__pyx_v_ysize);
  __Pyx_XDECREF(__pyx_v_clip);
  __Pyx_XDECREF(__pyx_v_surf);
  __Pyx_XDECREF(__pyx_v_start);
  __Pyx_XDECREF(__pyx_v_end);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/angle/gldraw.pyx":808
 *         gltexture.cleanup()
 * 
 *     cpdef int draw_render_textures(GLDraw self, what, bint non_aligned) except 1:             # <<<<<<<<<<<<<<
 *         """
 *         This is responsible for rendering things to textures,
 */

static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_29draw_render_textures(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_5renpy_5angle_6gldraw_6GLDraw_draw_render_textures(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_what, int __pyx_v_non_aligned, int __pyx_skip_dispatch) {
  struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_rend = 0;
  int __pyx_v_render_what;
  int __pyx_v_first;
  PyObject *__pyx_v_child = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_cxo = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_cyo = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_focus = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_main = NULL;
  PyObject *__pyx_v_p = NULL;
  PyObject *__pyx_v_pc = NULL;
  int __pyx_r;
  __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 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *(*__pyx_t_13)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("draw_render_textures", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_draw_render_textures); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_29draw_render_textures)) {
      __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_non_aligned); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_6 = 1;
        }
      }
      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_5) {
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
      }
      __Pyx_INCREF(__pyx_v_what);
      __Pyx_GIVEREF(__pyx_v_what);
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_what);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_8;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "renpy/angle/gldraw.pyx":817
 *         cdef bint render_what
 * 
 *         if not isinstance(what, render.Render):             # <<<<<<<<<<<<<<
 *             return 0
 * 
 */
  __pyx_t_9 = __Pyx_TypeCheck(__pyx_v_what, __pyx_ptype_5renpy_7display_6render_Render); 
  __pyx_t_10 = ((!(__pyx_t_9 != 0)) != 0);
  if (__pyx_t_10) {

    /* "renpy/angle/gldraw.pyx":818
 * 
 *         if not isinstance(what, render.Render):
 *             return 0             # <<<<<<<<<<<<<<
 * 
 *         rend = <render.Render> what
 */
    __pyx_r = 0;
    goto __pyx_L0;

    /* "renpy/angle/gldraw.pyx":817
 *         cdef bint render_what
 * 
 *         if not isinstance(what, render.Render):             # <<<<<<<<<<<<<<
 *             return 0
 * 
 */
  }

  /* "renpy/angle/gldraw.pyx":820
 *             return 0
 * 
 *         rend = <render.Render> what             # <<<<<<<<<<<<<<
 * 
 *         render_what = False
 */
  __pyx_t_1 = __pyx_v_what;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_rend = ((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "renpy/angle/gldraw.pyx":822
 *         rend = <render.Render> what
 * 
 *         render_what = False             # <<<<<<<<<<<<<<
 * 
 *         if (rend.xclipping or rend.yclipping) and non_aligned:
 */
  __pyx_v_render_what = 0;

  /* "renpy/angle/gldraw.pyx":824
 *         render_what = False
 * 
 *         if (rend.xclipping or rend.yclipping) and non_aligned:             # <<<<<<<<<<<<<<
 *             if rend.forward.xdy != 0 or rend.forward.ydx != 0:
 *                 render_what = True
 */
  __pyx_t_9 = (__pyx_v_rend->xclipping != 0);
  if (!__pyx_t_9) {
  } else {
    goto __pyx_L6_next_and;
  }
  __pyx_t_9 = (__pyx_v_rend->yclipping != 0);
  if (__pyx_t_9) {
  } else {
    __pyx_t_10 = __pyx_t_9;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_L6_next_and:;
  __pyx_t_9 = (__pyx_v_non_aligned != 0);
  __pyx_t_10 = __pyx_t_9;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_10) {

    /* "renpy/angle/gldraw.pyx":825
 * 
 *         if (rend.xclipping or rend.yclipping) and non_aligned:
 *             if rend.forward.xdy != 0 or rend.forward.ydx != 0:             # <<<<<<<<<<<<<<
 *                 render_what = True
 *                 non_aligned = False
 */
    __pyx_t_9 = ((__pyx_v_rend->forward->xdy != 0.0) != 0);
    if (!__pyx_t_9) {
    } else {
      __pyx_t_10 = __pyx_t_9;
      goto __pyx_L9_bool_binop_done;
    }
    __pyx_t_9 = ((__pyx_v_rend->forward->ydx != 0.0) != 0);
    __pyx_t_10 = __pyx_t_9;
    __pyx_L9_bool_binop_done:;
    if (__pyx_t_10) {

      /* "renpy/angle/gldraw.pyx":826
 *         if (rend.xclipping or rend.yclipping) and non_aligned:
 *             if rend.forward.xdy != 0 or rend.forward.ydx != 0:
 *                 render_what = True             # <<<<<<<<<<<<<<
 *                 non_aligned = False
 * 
 */
      __pyx_v_render_what = 1;

      /* "renpy/angle/gldraw.pyx":827
 *             if rend.forward.xdy != 0 or rend.forward.ydx != 0:
 *                 render_what = True
 *                 non_aligned = False             # <<<<<<<<<<<<<<
 * 
 *         first = True
 */
      __pyx_v_non_aligned = 0;

      /* "renpy/angle/gldraw.pyx":825
 * 
 *         if (rend.xclipping or rend.yclipping) and non_aligned:
 *             if rend.forward.xdy != 0 or rend.forward.ydx != 0:             # <<<<<<<<<<<<<<
 *                 render_what = True
 *                 non_aligned = False
 */
    }

    /* "renpy/angle/gldraw.pyx":824
 *         render_what = False
 * 
 *         if (rend.xclipping or rend.yclipping) and non_aligned:             # <<<<<<<<<<<<<<
 *             if rend.forward.xdy != 0 or rend.forward.ydx != 0:
 *                 render_what = True
 */
  }

  /* "renpy/angle/gldraw.pyx":829
 *                 non_aligned = False
 * 
 *         first = True             # <<<<<<<<<<<<<<
 * 
 *         if rend.forward:
 */
  __pyx_v_first = 1;

  /* "renpy/angle/gldraw.pyx":831
 *         first = True
 * 
 *         if rend.forward:             # <<<<<<<<<<<<<<
 *             non_aligned |= (rend.forward.xdy != 0)
 *             non_aligned |= (rend.forward.ydy != 0)
 */
  __pyx_t_10 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_rend->forward)); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_10) {

    /* "renpy/angle/gldraw.pyx":832
 * 
 *         if rend.forward:
 *             non_aligned |= (rend.forward.xdy != 0)             # <<<<<<<<<<<<<<
 *             non_aligned |= (rend.forward.ydy != 0)
 * 
 */
    __pyx_v_non_aligned = (__pyx_v_non_aligned | (__pyx_v_rend->forward->xdy != 0.0));

    /* "renpy/angle/gldraw.pyx":833
 *         if rend.forward:
 *             non_aligned |= (rend.forward.xdy != 0)
 *             non_aligned |= (rend.forward.ydy != 0)             # <<<<<<<<<<<<<<
 * 
 *         for child, cxo, cyo, focus, main in rend.visible_children:
 */
    __pyx_v_non_aligned = (__pyx_v_non_aligned | (__pyx_v_rend->forward->ydy != 0.0));

    /* "renpy/angle/gldraw.pyx":831
 *         first = True
 * 
 *         if rend.forward:             # <<<<<<<<<<<<<<
 *             non_aligned |= (rend.forward.xdy != 0)
 *             non_aligned |= (rend.forward.ydy != 0)
 */
  }

  /* "renpy/angle/gldraw.pyx":835
 *             non_aligned |= (rend.forward.ydy != 0)
 * 
 *         for child, cxo, cyo, focus, main in rend.visible_children:             # <<<<<<<<<<<<<<
 * 
 *             self.draw_render_textures(child, non_aligned)
 */
  if (unlikely(__pyx_v_rend->visible_children == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = __pyx_v_rend->visible_children; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
  for (;;) {
    if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_COMPILING_IN_CPYTHON
    __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    #else
    __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
      PyObject* sequence = __pyx_t_2;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 5)) {
        if (size > 5) __Pyx_RaiseTooManyValuesError(5);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __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_7 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); 
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 3); 
        __pyx_t_11 = PyTuple_GET_ITEM(sequence, 4); 
      } else {
        __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_3 = PyList_GET_ITEM(sequence, 2); 
        __pyx_t_5 = PyList_GET_ITEM(sequence, 3); 
        __pyx_t_11 = PyList_GET_ITEM(sequence, 4); 
      }
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_11);
      #else
      {
        Py_ssize_t i;
        PyObject** temps[5] = {&__pyx_t_4,&__pyx_t_7,&__pyx_t_3,&__pyx_t_5,&__pyx_t_11};
        for (i=0; i < 5; i++) {
          PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(item);
          *(temps[i]) = item;
        }
      }
      #endif
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      Py_ssize_t index = -1;
      PyObject** temps[5] = {&__pyx_t_4,&__pyx_t_7,&__pyx_t_3,&__pyx_t_5,&__pyx_t_11};
      __pyx_t_12 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext;
      for (index=0; index < 5; index++) {
        PyObject* item = __pyx_t_13(__pyx_t_12); if (unlikely(!item)) goto __pyx_L14_unpacking_failed;
        __Pyx_GOTREF(item);
        *(temps[index]) = item;
      }
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_13 = NULL;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      goto __pyx_L15_unpacking_done;
      __pyx_L14_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_13 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L15_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_child, __pyx_t_4);
    __pyx_t_4 = 0;
    __Pyx_XDECREF_SET(__pyx_v_cxo, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_XDECREF_SET(__pyx_v_cyo, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_focus, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_main, __pyx_t_11);
    __pyx_t_11 = 0;

    /* "renpy/angle/gldraw.pyx":837
 *         for child, cxo, cyo, focus, main in rend.visible_children:
 * 
 *             self.draw_render_textures(child, non_aligned)             # <<<<<<<<<<<<<<
 * 
 *             if rend.operation == DISSOLVE:
 */
    __pyx_t_8 = ((struct __pyx_vtabstruct_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self->__pyx_vtab)->draw_render_textures(__pyx_v_self, __pyx_v_child, __pyx_v_non_aligned, 0); if (unlikely(__pyx_t_8 == 1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "renpy/angle/gldraw.pyx":839
 *             self.draw_render_textures(child, non_aligned)
 * 
 *             if rend.operation == DISSOLVE:             # <<<<<<<<<<<<<<
 *                 if not self.fast_dissolve:
 *                     child.render_to_texture(what.operation_alpha)
 */
    __pyx_t_10 = ((__pyx_v_rend->operation == __pyx_v_5renpy_5angle_6gldraw_DISSOLVE) != 0);
    if (__pyx_t_10) {

      /* "renpy/angle/gldraw.pyx":840
 * 
 *             if rend.operation == DISSOLVE:
 *                 if not self.fast_dissolve:             # <<<<<<<<<<<<<<
 *                     child.render_to_texture(what.operation_alpha)
 * 
 */
      __pyx_t_10 = ((!(__pyx_v_self->fast_dissolve != 0)) != 0);
      if (__pyx_t_10) {

        /* "renpy/angle/gldraw.pyx":841
 *             if rend.operation == DISSOLVE:
 *                 if not self.fast_dissolve:
 *                     child.render_to_texture(what.operation_alpha)             # <<<<<<<<<<<<<<
 * 
 *             elif rend.operation == IMAGEDISSOLVE:
 */
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_child, __pyx_n_s_render_to_texture); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_what, __pyx_n_s_operation_alpha); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_3 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_11))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_11);
          if (likely(__pyx_t_3)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_11, function);
          }
        }
        if (!__pyx_t_3) {
          __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else {
          __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL;
          __Pyx_GIVEREF(__pyx_t_5);
          PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5);
          __pyx_t_5 = 0;
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "renpy/angle/gldraw.pyx":840
 * 
 *             if rend.operation == DISSOLVE:
 *                 if not self.fast_dissolve:             # <<<<<<<<<<<<<<
 *                     child.render_to_texture(what.operation_alpha)
 * 
 */
      }

      /* "renpy/angle/gldraw.pyx":839
 *             self.draw_render_textures(child, non_aligned)
 * 
 *             if rend.operation == DISSOLVE:             # <<<<<<<<<<<<<<
 *                 if not self.fast_dissolve:
 *                     child.render_to_texture(what.operation_alpha)
 */
      goto __pyx_L16;
    }

    /* "renpy/angle/gldraw.pyx":843
 *                     child.render_to_texture(what.operation_alpha)
 * 
 *             elif rend.operation == IMAGEDISSOLVE:             # <<<<<<<<<<<<<<
 *                 child.render_to_texture(first or what.operation_alpha)
 *                 first = False
 */
    __pyx_t_10 = ((__pyx_v_rend->operation == __pyx_v_5renpy_5angle_6gldraw_IMAGEDISSOLVE) != 0);
    if (__pyx_t_10) {

      /* "renpy/angle/gldraw.pyx":844
 * 
 *             elif rend.operation == IMAGEDISSOLVE:
 *                 child.render_to_texture(first or what.operation_alpha)             # <<<<<<<<<<<<<<
 *                 first = False
 * 
 */
      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_child, __pyx_n_s_render_to_texture); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      if (!__pyx_v_first) {
      } else {
        __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_first); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_7 = __pyx_t_5;
        __pyx_t_5 = 0;
        goto __pyx_L18_bool_binop_done;
      }
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_what, __pyx_n_s_operation_alpha); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_7 = __pyx_t_5;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_L18_bool_binop_done:;
      __pyx_t_5 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_11))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_11);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_11, function);
        }
      }
      if (!__pyx_t_5) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL;
        __Pyx_GIVEREF(__pyx_t_7);
        PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_7);
        __pyx_t_7 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "renpy/angle/gldraw.pyx":845
 *             elif rend.operation == IMAGEDISSOLVE:
 *                 child.render_to_texture(first or what.operation_alpha)
 *                 first = False             # <<<<<<<<<<<<<<
 * 
 *             elif rend.operation == PIXELLATE:
 */
      __pyx_v_first = 0;

      /* "renpy/angle/gldraw.pyx":843
 *                     child.render_to_texture(what.operation_alpha)
 * 
 *             elif rend.operation == IMAGEDISSOLVE:             # <<<<<<<<<<<<<<
 *                 child.render_to_texture(first or what.operation_alpha)
 *                 first = False
 */
      goto __pyx_L16;
    }

    /* "renpy/angle/gldraw.pyx":847
 *                 first = False
 * 
 *             elif rend.operation == PIXELLATE:             # <<<<<<<<<<<<<<
 *                 p = rend.operation_parameter
 *                 pc = child
 */
    __pyx_t_10 = ((__pyx_v_rend->operation == __pyx_v_5renpy_5angle_6gldraw_PIXELLATE) != 0);
    if (__pyx_t_10) {

      /* "renpy/angle/gldraw.pyx":848
 * 
 *             elif rend.operation == PIXELLATE:
 *                 p = rend.operation_parameter             # <<<<<<<<<<<<<<
 *                 pc = child
 * 
 */
      __pyx_t_2 = __pyx_v_rend->operation_parameter;
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_v_p, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "renpy/angle/gldraw.pyx":849
 *             elif rend.operation == PIXELLATE:
 *                 p = rend.operation_parameter
 *                 pc = child             # <<<<<<<<<<<<<<
 * 
 *                 while p > 1:
 */
      __Pyx_INCREF(__pyx_v_child);
      __Pyx_XDECREF_SET(__pyx_v_pc, __pyx_v_child);

      /* "renpy/angle/gldraw.pyx":851
 *                 pc = child
 * 
 *                 while p > 1:             # <<<<<<<<<<<<<<
 *                     p /= 2
 *                     pc = self.get_half(pc)
 */
      while (1) {
        __pyx_t_2 = PyObject_RichCompare(__pyx_v_p, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (!__pyx_t_10) break;

        /* "renpy/angle/gldraw.pyx":852
 * 
 *                 while p > 1:
 *                     p /= 2             # <<<<<<<<<<<<<<
 *                     pc = self.get_half(pc)
 * 
 */
        __pyx_t_2 = __Pyx_PyNumber_InPlaceDivide(__pyx_v_p, __pyx_int_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF_SET(__pyx_v_p, __pyx_t_2);
        __pyx_t_2 = 0;

        /* "renpy/angle/gldraw.pyx":853
 *                 while p > 1:
 *                     p /= 2
 *                     pc = self.get_half(pc)             # <<<<<<<<<<<<<<
 * 
 *         if render_what:
 */
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_half); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_3 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_11))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_11);
          if (likely(__pyx_t_3)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_11, function);
          }
        }
        if (!__pyx_t_3) {
          __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_v_pc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
        } else {
          __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL;
          __Pyx_INCREF(__pyx_v_pc);
          __Pyx_GIVEREF(__pyx_v_pc);
          PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_pc);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF_SET(__pyx_v_pc, __pyx_t_2);
        __pyx_t_2 = 0;
      }

      /* "renpy/angle/gldraw.pyx":847
 *                 first = False
 * 
 *             elif rend.operation == PIXELLATE:             # <<<<<<<<<<<<<<
 *                 p = rend.operation_parameter
 *                 pc = child
 */
    }
    __pyx_L16:;

    /* "renpy/angle/gldraw.pyx":835
 *             non_aligned |= (rend.forward.ydy != 0)
 * 
 *         for child, cxo, cyo, focus, main in rend.visible_children:             # <<<<<<<<<<<<<<
 * 
 *             self.draw_render_textures(child, non_aligned)
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "renpy/angle/gldraw.pyx":855
 *                     pc = self.get_half(pc)
 * 
 *         if render_what:             # <<<<<<<<<<<<<<
 *             what.render_to_texture(True)
 * 
 */
  __pyx_t_10 = (__pyx_v_render_what != 0);
  if (__pyx_t_10) {

    /* "renpy/angle/gldraw.pyx":856
 * 
 *         if render_what:
 *             what.render_to_texture(True)             # <<<<<<<<<<<<<<
 * 
 *     cpdef int draw_transformed(
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_what, __pyx_n_s_render_to_texture); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "renpy/angle/gldraw.pyx":855
 *                     pc = self.get_half(pc)
 * 
 *         if render_what:             # <<<<<<<<<<<<<<
 *             what.render_to_texture(True)
 * 
 */
  }

  /* "renpy/angle/gldraw.pyx":808
 *         gltexture.cleanup()
 * 
 *     cpdef int draw_render_textures(GLDraw self, what, bint non_aligned) except 1:             # <<<<<<<<<<<<<<
 *         """
 *         This is responsible for rendering things to textures,
 */

  /* function exit code */
  __pyx_r = 0;
  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_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.draw_render_textures", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 1;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_rend);
  __Pyx_XDECREF(__pyx_v_child);
  __Pyx_XDECREF(__pyx_v_cxo);
  __Pyx_XDECREF(__pyx_v_cyo);
  __Pyx_XDECREF(__pyx_v_focus);
  __Pyx_XDECREF(__pyx_v_main);
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_XDECREF(__pyx_v_pc);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_29draw_render_textures(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5renpy_5angle_6gldraw_6GLDraw_28draw_render_textures[] = "\n        This is responsible for rendering things to textures,\n        as necessary.\n        ";
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_29draw_render_textures(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_what = 0;
  int __pyx_v_non_aligned;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw_render_textures (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_what,&__pyx_n_s_non_aligned,0};
    PyObject* values[2] = {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  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_what)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_non_aligned)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("draw_render_textures", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "draw_render_textures") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_what = values[0];
    __pyx_v_non_aligned = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_non_aligned == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("draw_render_textures", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.draw_render_textures", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_28draw_render_textures(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self), __pyx_v_what, __pyx_v_non_aligned);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_28draw_render_textures(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_what, int __pyx_v_non_aligned) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("draw_render_textures", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_5renpy_5angle_6gldraw_6GLDraw_draw_render_textures(__pyx_v_self, __pyx_v_what, __pyx_v_non_aligned, 1); if (unlikely(__pyx_t_1 == 1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.draw_render_textures", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/angle/gldraw.pyx":858
 *             what.render_to_texture(True)
 * 
 *     cpdef int draw_transformed(             # <<<<<<<<<<<<<<
 *         GLDraw self,
 *         object what,
 */

static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_31draw_transformed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_5renpy_5angle_6gldraw_6GLDraw_draw_transformed(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_what, PyObject *__pyx_v_clip, double __pyx_v_xo, double __pyx_v_yo, double __pyx_v_alpha, double __pyx_v_over, struct __pyx_obj_5renpy_7display_6render_Matrix2D *__pyx_v_reverse, int __pyx_v_nearest, int __pyx_v_subpixel, int __pyx_skip_dispatch) {
  struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_rend = 0;
  double __pyx_v_cxo;
  double __pyx_v_cyo;
  double __pyx_v_tcxo;
  double __pyx_v_tcyo;
  struct __pyx_obj_5renpy_7display_6render_Matrix2D *__pyx_v_child_reverse = 0;
  PyObject *__pyx_v_tex = NULL;
  PyObject *__pyx_v_p = NULL;
  PyObject *__pyx_v_pc = NULL;
  PyObject *__pyx_v_minx = NULL;
  PyObject *__pyx_v_miny = NULL;
  PyObject *__pyx_v_maxx = NULL;
  PyObject *__pyx_v_maxy = NULL;
  PyObject *__pyx_v_tw = NULL;
  PyObject *__pyx_v_th = NULL;
  PyObject *__pyx_v_child = NULL;
  PyObject *__pyx_v_cx = NULL;
  PyObject *__pyx_v_cy = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_focus = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_main = NULL;
  int __pyx_r;
  __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 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_t_14;
  int __pyx_t_15;
  double __pyx_t_16;
  double __pyx_t_17;
  int __pyx_t_18;
  PyObject *(*__pyx_t_19)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("draw_transformed", 0);
  __Pyx_INCREF(__pyx_v_clip);
  __Pyx_INCREF((PyObject *)__pyx_v_reverse);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_draw_transformed); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_31draw_transformed)) {
      __pyx_t_3 = PyFloat_FromDouble(__pyx_v_xo); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyFloat_FromDouble(__pyx_v_yo); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyFloat_FromDouble(__pyx_v_alpha); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PyFloat_FromDouble(__pyx_v_over); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_nearest); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_subpixel); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_9 = __pyx_t_1; __pyx_t_10 = NULL;
      __pyx_t_11 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
          __pyx_t_11 = 1;
        }
      }
      __pyx_t_12 = PyTuple_New(9+__pyx_t_11); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      if (__pyx_t_10) {
        __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); __pyx_t_10 = NULL;
      }
      __Pyx_INCREF(__pyx_v_what);
      __Pyx_GIVEREF(__pyx_v_what);
      PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_11, __pyx_v_what);
      __Pyx_INCREF(__pyx_v_clip);
      __Pyx_GIVEREF(__pyx_v_clip);
      PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_v_clip);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_12, 2+__pyx_t_11, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_12, 3+__pyx_t_11, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_12, 4+__pyx_t_11, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_12, 5+__pyx_t_11, __pyx_t_6);
      __Pyx_INCREF(((PyObject *)__pyx_v_reverse));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_reverse));
      PyTuple_SET_ITEM(__pyx_t_12, 6+__pyx_t_11, ((PyObject *)__pyx_v_reverse));
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_12, 7+__pyx_t_11, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_12, 8+__pyx_t_11, __pyx_t_8);
      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_t_5 = 0;
      __pyx_t_6 = 0;
      __pyx_t_7 = 0;
      __pyx_t_8 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_13;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "renpy/angle/gldraw.pyx":874
 *         cdef render.Matrix2D child_reverse
 * 
 *         if not isinstance(what, render.Render):             # <<<<<<<<<<<<<<
 * 
 *             if isinstance(what, gltexture.TextureGrid):
 */
  __pyx_t_14 = __Pyx_TypeCheck(__pyx_v_what, __pyx_ptype_5renpy_7display_6render_Render); 
  __pyx_t_15 = ((!(__pyx_t_14 != 0)) != 0);
  if (__pyx_t_15) {

    /* "renpy/angle/gldraw.pyx":876
 *         if not isinstance(what, render.Render):
 * 
 *             if isinstance(what, gltexture.TextureGrid):             # <<<<<<<<<<<<<<
 * 
 *                 if (not subpixel) and reverse.is_unit_aligned():
 */
    __pyx_t_15 = __Pyx_TypeCheck(__pyx_v_what, __pyx_ptype_5renpy_5angle_9gltexture_TextureGrid); 
    __pyx_t_14 = (__pyx_t_15 != 0);
    if (__pyx_t_14) {

      /* "renpy/angle/gldraw.pyx":878
 *             if isinstance(what, gltexture.TextureGrid):
 * 
 *                 if (not subpixel) and reverse.is_unit_aligned():             # <<<<<<<<<<<<<<
 *                     xo = round(xo)
 *                     yo = round(yo)
 */
      __pyx_t_15 = ((!(__pyx_v_subpixel != 0)) != 0);
      if (__pyx_t_15) {
      } else {
        __pyx_t_14 = __pyx_t_15;
        goto __pyx_L6_bool_binop_done;
      }
      __pyx_t_15 = (((struct __pyx_vtabstruct_5renpy_7display_6render_Matrix2D *)__pyx_v_reverse->__pyx_vtab)->is_unit_aligned(__pyx_v_reverse, 0) != 0);
      __pyx_t_14 = __pyx_t_15;
      __pyx_L6_bool_binop_done:;
      if (__pyx_t_14) {

        /* "renpy/angle/gldraw.pyx":879
 * 
 *                 if (not subpixel) and reverse.is_unit_aligned():
 *                     xo = round(xo)             # <<<<<<<<<<<<<<
 *                     yo = round(yo)
 * 
 */
        __pyx_t_1 = PyFloat_FromDouble(__pyx_v_xo); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
        __pyx_t_1 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_16 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_v_xo = __pyx_t_16;

        /* "renpy/angle/gldraw.pyx":880
 *                 if (not subpixel) and reverse.is_unit_aligned():
 *                     xo = round(xo)
 *                     yo = round(yo)             # <<<<<<<<<<<<<<
 * 
 *                 self.set_clip(clip)
 */
        __pyx_t_1 = PyFloat_FromDouble(__pyx_v_yo); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
        __pyx_t_1 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_16 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_v_yo = __pyx_t_16;

        /* "renpy/angle/gldraw.pyx":878
 *             if isinstance(what, gltexture.TextureGrid):
 * 
 *                 if (not subpixel) and reverse.is_unit_aligned():             # <<<<<<<<<<<<<<
 *                     xo = round(xo)
 *                     yo = round(yo)
 */
      }

      /* "renpy/angle/gldraw.pyx":882
 *                     yo = round(yo)
 * 
 *                 self.set_clip(clip)             # <<<<<<<<<<<<<<
 * 
 *                 gltexture.blit(
 */
      __pyx_t_1 = ((struct __pyx_vtabstruct_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self->__pyx_vtab)->set_clip(__pyx_v_self, __pyx_v_clip, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "renpy/angle/gldraw.pyx":891
 *                     alpha,
 *                     over,
 *                     self.environ,             # <<<<<<<<<<<<<<
 *                     nearest)
 * 
 */
      __pyx_t_1 = ((PyObject *)__pyx_v_self->environ);
      __Pyx_INCREF(__pyx_t_1);

      /* "renpy/angle/gldraw.pyx":884
 *                 self.set_clip(clip)
 * 
 *                 gltexture.blit(             # <<<<<<<<<<<<<<
 *                     <gltexture.TextureGrid> what,
 *                     xo,
 */
      __pyx_t_2 = __pyx_f_5renpy_5angle_9gltexture_blit(((struct __pyx_obj_5renpy_5angle_9gltexture_TextureGrid *)__pyx_v_what), __pyx_v_xo, __pyx_v_yo, __pyx_v_reverse, __pyx_v_alpha, __pyx_v_over, ((struct __pyx_obj_5renpy_5angle_6gldraw_Environ *)__pyx_t_1), __pyx_v_nearest, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "renpy/angle/gldraw.pyx":894
 *                     nearest)
 * 
 *                 return 0             # <<<<<<<<<<<<<<
 * 
 *             if isinstance(what, pygame.Surface):
 */
      __pyx_r = 0;
      goto __pyx_L0;

      /* "renpy/angle/gldraw.pyx":876
 *         if not isinstance(what, render.Render):
 * 
 *             if isinstance(what, gltexture.TextureGrid):             # <<<<<<<<<<<<<<
 * 
 *                 if (not subpixel) and reverse.is_unit_aligned():
 */
    }

    /* "renpy/angle/gldraw.pyx":896
 *                 return 0
 * 
 *             if isinstance(what, pygame.Surface):             # <<<<<<<<<<<<<<
 * 
 *                 tex = self.load_texture(what)
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Surface); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_14 = PyObject_IsInstance(__pyx_v_what, __pyx_t_1); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_15 = (__pyx_t_14 != 0);
    if (__pyx_t_15) {

      /* "renpy/angle/gldraw.pyx":898
 *             if isinstance(what, pygame.Surface):
 * 
 *                 tex = self.load_texture(what)             # <<<<<<<<<<<<<<
 *                 self.draw_transformed(tex, clip, xo, yo, alpha, over, reverse, nearest, subpixel)
 *                 return 0
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_load_texture); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_9 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_9)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_9) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_what); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_9); __pyx_t_9 = NULL;
        __Pyx_INCREF(__pyx_v_what);
        __Pyx_GIVEREF(__pyx_v_what);
        PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_v_what);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_12, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_tex = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "renpy/angle/gldraw.pyx":899
 * 
 *                 tex = self.load_texture(what)
 *                 self.draw_transformed(tex, clip, xo, yo, alpha, over, reverse, nearest, subpixel)             # <<<<<<<<<<<<<<
 *                 return 0
 * 
 */
      __pyx_t_13 = ((struct __pyx_vtabstruct_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self->__pyx_vtab)->draw_transformed(__pyx_v_self, __pyx_v_tex, __pyx_v_clip, __pyx_v_xo, __pyx_v_yo, __pyx_v_alpha, __pyx_v_over, __pyx_v_reverse, __pyx_v_nearest, __pyx_v_subpixel, 0); if (unlikely(__pyx_t_13 == 1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "renpy/angle/gldraw.pyx":900
 *                 tex = self.load_texture(what)
 *                 self.draw_transformed(tex, clip, xo, yo, alpha, over, reverse, nearest, subpixel)
 *                 return 0             # <<<<<<<<<<<<<<
 * 
 *             raise Exception("Unknown drawing type. " + repr(what))
 */
      __pyx_r = 0;
      goto __pyx_L0;

      /* "renpy/angle/gldraw.pyx":896
 *                 return 0
 * 
 *             if isinstance(what, pygame.Surface):             # <<<<<<<<<<<<<<
 * 
 *                 tex = self.load_texture(what)
 */
    }

    /* "renpy/angle/gldraw.pyx":902
 *                 return 0
 * 
 *             raise Exception("Unknown drawing type. " + repr(what))             # <<<<<<<<<<<<<<
 * 
 *         rend = what
 */
    __pyx_t_1 = PyObject_Repr(__pyx_v_what); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Unknown_drawing_type, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "renpy/angle/gldraw.pyx":874
 *         cdef render.Matrix2D child_reverse
 * 
 *         if not isinstance(what, render.Render):             # <<<<<<<<<<<<<<
 * 
 *             if isinstance(what, gltexture.TextureGrid):
 */
  }

  /* "renpy/angle/gldraw.pyx":904
 *             raise Exception("Unknown drawing type. " + repr(what))
 * 
 *         rend = what             # <<<<<<<<<<<<<<
 * 
 *         if rend.text_input:
 */
  if (!(likely(((__pyx_v_what) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_what, __pyx_ptype_5renpy_7display_6render_Render))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __pyx_v_what;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_v_rend = ((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "renpy/angle/gldraw.pyx":906
 *         rend = what
 * 
 *         if rend.text_input:             # <<<<<<<<<<<<<<
 *             renpy.display.interface.text_rect = rend.screen_rect(xo, yo, reverse)
 * 
 */
  __pyx_t_15 = (__pyx_v_rend->text_input != 0);
  if (__pyx_t_15) {

    /* "renpy/angle/gldraw.pyx":907
 * 
 *         if rend.text_input:
 *             renpy.display.interface.text_rect = rend.screen_rect(xo, yo, reverse)             # <<<<<<<<<<<<<<
 * 
 *         # Other draw modes.
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_rend), __pyx_n_s_screen_rect); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_12 = PyFloat_FromDouble(__pyx_v_xo); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_9 = PyFloat_FromDouble(__pyx_v_yo); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_8 = NULL;
    __pyx_t_11 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_11 = 1;
      }
    }
    __pyx_t_7 = PyTuple_New(3+__pyx_t_11); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_8) {
      __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8); __pyx_t_8 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_12);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_11, __pyx_t_12);
    __Pyx_GIVEREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_11, __pyx_t_9);
    __Pyx_INCREF(((PyObject *)__pyx_v_reverse));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_reverse));
    PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_11, ((PyObject *)__pyx_v_reverse));
    __pyx_t_12 = 0;
    __pyx_t_9 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_display); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_interface); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (__Pyx_PyObject_SetAttrStr(__pyx_t_1, __pyx_n_s_text_rect, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "renpy/angle/gldraw.pyx":906
 *         rend = what
 * 
 *         if rend.text_input:             # <<<<<<<<<<<<<<
 *             renpy.display.interface.text_rect = rend.screen_rect(xo, yo, reverse)
 * 
 */
  }

  /* "renpy/angle/gldraw.pyx":911
 *         # Other draw modes.
 * 
 *         if rend.operation == DISSOLVE:             # <<<<<<<<<<<<<<
 * 
 *             if self.fast_dissolve:
 */
  __pyx_t_15 = ((__pyx_v_rend->operation == __pyx_v_5renpy_5angle_6gldraw_DISSOLVE) != 0);
  if (__pyx_t_15) {

    /* "renpy/angle/gldraw.pyx":913
 *         if rend.operation == DISSOLVE:
 * 
 *             if self.fast_dissolve:             # <<<<<<<<<<<<<<
 * 
 *                 # This is a fast version of dissolve that's used on
 */
    __pyx_t_15 = (__pyx_v_self->fast_dissolve != 0);
    if (__pyx_t_15) {

      /* "renpy/angle/gldraw.pyx":919
 *                 # of dissolve on Ren'Py proper.
 * 
 *                 self.draw_transformed(rend.children[0][0], clip, xo, yo, alpha, over, reverse, nearest, subpixel)             # <<<<<<<<<<<<<<
 * 
 *                 self.draw_transformed(rend.children[1][0], clip, xo, yo, alpha * what.operation_complete, over, reverse, nearest, subpixel)
 */
      if (unlikely(__pyx_v_rend->children == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_rend->children, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_13 = ((struct __pyx_vtabstruct_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self->__pyx_vtab)->draw_transformed(__pyx_v_self, __pyx_t_2, __pyx_v_clip, __pyx_v_xo, __pyx_v_yo, __pyx_v_alpha, __pyx_v_over, __pyx_v_reverse, __pyx_v_nearest, __pyx_v_subpixel, 0); if (unlikely(__pyx_t_13 == 1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "renpy/angle/gldraw.pyx":921
 *                 self.draw_transformed(rend.children[0][0], clip, xo, yo, alpha, over, reverse, nearest, subpixel)
 * 
 *                 self.draw_transformed(rend.children[1][0], clip, xo, yo, alpha * what.operation_complete, over, reverse, nearest, subpixel)             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      if (unlikely(__pyx_v_rend->children == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_rend->children, 1, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyFloat_FromDouble(__pyx_v_alpha); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_what, __pyx_n_s_operation_complete); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_9 = PyNumber_Multiply(__pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_t_9); if (unlikely((__pyx_t_16 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_13 = ((struct __pyx_vtabstruct_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self->__pyx_vtab)->draw_transformed(__pyx_v_self, __pyx_t_1, __pyx_v_clip, __pyx_v_xo, __pyx_v_yo, __pyx_t_16, __pyx_v_over, __pyx_v_reverse, __pyx_v_nearest, __pyx_v_subpixel, 0); if (unlikely(__pyx_t_13 == 1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "renpy/angle/gldraw.pyx":913
 *         if rend.operation == DISSOLVE:
 * 
 *             if self.fast_dissolve:             # <<<<<<<<<<<<<<
 * 
 *                 # This is a fast version of dissolve that's used on
 */
      goto __pyx_L11;
    }

    /* "renpy/angle/gldraw.pyx":925
 *             else:
 * 
 *                 self.set_clip(clip)             # <<<<<<<<<<<<<<
 * 
 *                 gltexture.blend(
 */
    /*else*/ {
      __pyx_t_1 = ((struct __pyx_vtabstruct_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self->__pyx_vtab)->set_clip(__pyx_v_self, __pyx_v_clip, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "renpy/angle/gldraw.pyx":928
 * 
 *                 gltexture.blend(
 *                     rend.children[0][0].render_to_texture(what.operation_alpha),             # <<<<<<<<<<<<<<
 *                     rend.children[1][0].render_to_texture(what.operation_alpha),
 *                     xo,
 */
      if (unlikely(__pyx_v_rend->children == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_9 = __Pyx_GetItemInt_List(__pyx_v_rend->children, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_9, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_render_to_texture); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_what, __pyx_n_s_operation_alpha); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_2 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
        }
      }
      if (!__pyx_t_2) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_2); __pyx_t_2 = NULL;
        __Pyx_GIVEREF(__pyx_t_7);
        PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_7);
        __pyx_t_7 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5renpy_5angle_9gltexture_TextureGrid))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "renpy/angle/gldraw.pyx":929
 *                 gltexture.blend(
 *                     rend.children[0][0].render_to_texture(what.operation_alpha),
 *                     rend.children[1][0].render_to_texture(what.operation_alpha),             # <<<<<<<<<<<<<<
 *                     xo,
 *                     yo,
 */
      if (unlikely(__pyx_v_rend->children == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_12 = __Pyx_GetItemInt_List(__pyx_v_rend->children, 1, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_12 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_12, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_render_to_texture); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_what, __pyx_n_s_operation_alpha); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_2 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_12))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_12);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_12, function);
        }
      }
      if (!__pyx_t_2) {
        __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_7); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_9);
      } else {
        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); __pyx_t_2 = NULL;
        __Pyx_GIVEREF(__pyx_t_7);
        PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_7);
        __pyx_t_7 = 0;
        __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5renpy_5angle_9gltexture_TextureGrid))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "renpy/angle/gldraw.pyx":932
 *                     xo,
 *                     yo,
 *                     reverse * self.draw_to_virt,             # <<<<<<<<<<<<<<
 *                     alpha,
 *                     over,
 */
      __pyx_t_12 = PyNumber_Multiply(((PyObject *)__pyx_v_reverse), ((PyObject *)__pyx_v_self->draw_to_virt)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5renpy_7display_6render_Matrix2D))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "renpy/angle/gldraw.pyx":936
 *                     over,
 *                     rend.operation_complete,
 *                     self.environ,             # <<<<<<<<<<<<<<
 *                     nearest)
 * 
 */
      __pyx_t_8 = ((PyObject *)__pyx_v_self->environ);
      __Pyx_INCREF(__pyx_t_8);

      /* "renpy/angle/gldraw.pyx":927
 *                 self.set_clip(clip)
 * 
 *                 gltexture.blend(             # <<<<<<<<<<<<<<
 *                     rend.children[0][0].render_to_texture(what.operation_alpha),
 *                     rend.children[1][0].render_to_texture(what.operation_alpha),
 */
      __pyx_t_7 = __pyx_f_5renpy_5angle_9gltexture_blend(((struct __pyx_obj_5renpy_5angle_9gltexture_TextureGrid *)__pyx_t_1), ((struct __pyx_obj_5renpy_5angle_9gltexture_TextureGrid *)__pyx_t_9), __pyx_v_xo, __pyx_v_yo, ((struct __pyx_obj_5renpy_7display_6render_Matrix2D *)__pyx_t_12), __pyx_v_alpha, __pyx_v_over, __pyx_v_rend->operation_complete, ((struct __pyx_obj_5renpy_5angle_6gldraw_Environ *)__pyx_t_8), __pyx_v_nearest, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __pyx_L11:;

    /* "renpy/angle/gldraw.pyx":939
 *                     nearest)
 * 
 *             return 0             # <<<<<<<<<<<<<<
 * 
 *         elif rend.operation == IMAGEDISSOLVE:
 */
    __pyx_r = 0;
    goto __pyx_L0;

    /* "renpy/angle/gldraw.pyx":911
 *         # Other draw modes.
 * 
 *         if rend.operation == DISSOLVE:             # <<<<<<<<<<<<<<
 * 
 *             if self.fast_dissolve:
 */
  }

  /* "renpy/angle/gldraw.pyx":941
 *             return 0
 * 
 *         elif rend.operation == IMAGEDISSOLVE:             # <<<<<<<<<<<<<<
 * 
 *             self.set_clip(clip)
 */
  __pyx_t_15 = ((__pyx_v_rend->operation == __pyx_v_5renpy_5angle_6gldraw_IMAGEDISSOLVE) != 0);
  if (__pyx_t_15) {

    /* "renpy/angle/gldraw.pyx":943
 *         elif rend.operation == IMAGEDISSOLVE:
 * 
 *             self.set_clip(clip)             # <<<<<<<<<<<<<<
 * 
 *             gltexture.imageblend(
 */
    __pyx_t_7 = ((struct __pyx_vtabstruct_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self->__pyx_vtab)->set_clip(__pyx_v_self, __pyx_v_clip, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "renpy/angle/gldraw.pyx":946
 * 
 *             gltexture.imageblend(
 *                 rend.children[0][0].render_to_texture(True),             # <<<<<<<<<<<<<<
 *                 rend.children[1][0].render_to_texture(what.operation_alpha),
 *                 rend.children[2][0].render_to_texture(what.operation_alpha),
 */
    if (unlikely(__pyx_v_rend->children == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_7 = __Pyx_GetItemInt_List(__pyx_v_rend->children, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_render_to_texture); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5renpy_5angle_9gltexture_TextureGrid))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "renpy/angle/gldraw.pyx":947
 *             gltexture.imageblend(
 *                 rend.children[0][0].render_to_texture(True),
 *                 rend.children[1][0].render_to_texture(what.operation_alpha),             # <<<<<<<<<<<<<<
 *                 rend.children[2][0].render_to_texture(what.operation_alpha),
 *                 xo,
 */
    if (unlikely(__pyx_v_rend->children == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_12 = __Pyx_GetItemInt_List(__pyx_v_rend->children, 1, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_12 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_12, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_render_to_texture); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_what, __pyx_n_s_operation_alpha); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_1 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_12))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_12);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_12, function);
      }
    }
    if (!__pyx_t_1) {
      __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_9); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_GOTREF(__pyx_t_7);
    } else {
      __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = NULL;
      __Pyx_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_9);
      __pyx_t_9 = 0;
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5renpy_5angle_9gltexture_TextureGrid))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "renpy/angle/gldraw.pyx":948
 *                 rend.children[0][0].render_to_texture(True),
 *                 rend.children[1][0].render_to_texture(what.operation_alpha),
 *                 rend.children[2][0].render_to_texture(what.operation_alpha),             # <<<<<<<<<<<<<<
 *                 xo,
 *                 yo,
 */
    if (unlikely(__pyx_v_rend->children == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_rend->children, 2, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_render_to_texture); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_what, __pyx_n_s_operation_alpha); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_1 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_1) {
      __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_9); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_GOTREF(__pyx_t_12);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __pyx_t_1 = NULL;
      __Pyx_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_9);
      __pyx_t_9 = 0;
      __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5renpy_5angle_9gltexture_TextureGrid))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "renpy/angle/gldraw.pyx":951
 *                 xo,
 *                 yo,
 *                 reverse * self.draw_to_virt,             # <<<<<<<<<<<<<<
 *                 alpha,
 *                 over,
 */
    __pyx_t_2 = PyNumber_Multiply(((PyObject *)__pyx_v_reverse), ((PyObject *)__pyx_v_self->draw_to_virt)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5renpy_7display_6render_Matrix2D))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "renpy/angle/gldraw.pyx":955
 *                 over,
 *                 rend.operation_complete,
 *                 rend.operation_parameter,             # <<<<<<<<<<<<<<
 *                 self.environ,
 *                 nearest)
 */
    __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_v_rend->operation_parameter); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "renpy/angle/gldraw.pyx":956
 *                 rend.operation_complete,
 *                 rend.operation_parameter,
 *                 self.environ,             # <<<<<<<<<<<<<<
 *                 nearest)
 * 
 */
    __pyx_t_6 = ((PyObject *)__pyx_v_self->environ);
    __Pyx_INCREF(__pyx_t_6);

    /* "renpy/angle/gldraw.pyx":945
 *             self.set_clip(clip)
 * 
 *             gltexture.imageblend(             # <<<<<<<<<<<<<<
 *                 rend.children[0][0].render_to_texture(True),
 *                 rend.children[1][0].render_to_texture(what.operation_alpha),
 */
    __pyx_t_9 = __pyx_f_5renpy_5angle_9gltexture_imageblend(((struct __pyx_obj_5renpy_5angle_9gltexture_TextureGrid *)__pyx_t_8), ((struct __pyx_obj_5renpy_5angle_9gltexture_TextureGrid *)__pyx_t_7), ((struct __pyx_obj_5renpy_5angle_9gltexture_TextureGrid *)__pyx_t_12), __pyx_v_xo, __pyx_v_yo, ((struct __pyx_obj_5renpy_7display_6render_Matrix2D *)__pyx_t_2), __pyx_v_alpha, __pyx_v_over, __pyx_v_rend->operation_complete, __pyx_t_13, ((struct __pyx_obj_5renpy_5angle_6gldraw_Environ *)__pyx_t_6), __pyx_v_nearest, 0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "renpy/angle/gldraw.pyx":959
 *                 nearest)
 * 
 *             return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_r = 0;
    goto __pyx_L0;

    /* "renpy/angle/gldraw.pyx":941
 *             return 0
 * 
 *         elif rend.operation == IMAGEDISSOLVE:             # <<<<<<<<<<<<<<
 * 
 *             self.set_clip(clip)
 */
  }

  /* "renpy/angle/gldraw.pyx":962
 * 
 * 
 *         if rend.operation == PIXELLATE:             # <<<<<<<<<<<<<<
 *             self.set_clip(clip)
 * 
 */
  __pyx_t_15 = ((__pyx_v_rend->operation == __pyx_v_5renpy_5angle_6gldraw_PIXELLATE) != 0);
  if (__pyx_t_15) {

    /* "renpy/angle/gldraw.pyx":963
 * 
 *         if rend.operation == PIXELLATE:
 *             self.set_clip(clip)             # <<<<<<<<<<<<<<
 * 
 *             p = rend.operation_parameter
 */
    __pyx_t_9 = ((struct __pyx_vtabstruct_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self->__pyx_vtab)->set_clip(__pyx_v_self, __pyx_v_clip, 0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "renpy/angle/gldraw.pyx":965
 *             self.set_clip(clip)
 * 
 *             p = rend.operation_parameter             # <<<<<<<<<<<<<<
 *             pc = rend.children[0][0]
 * 
 */
    __pyx_t_9 = __pyx_v_rend->operation_parameter;
    __Pyx_INCREF(__pyx_t_9);
    __pyx_v_p = __pyx_t_9;
    __pyx_t_9 = 0;

    /* "renpy/angle/gldraw.pyx":966
 * 
 *             p = rend.operation_parameter
 *             pc = rend.children[0][0]             # <<<<<<<<<<<<<<
 * 
 *             while p > 1:
 */
    if (unlikely(__pyx_v_rend->children == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_9 = __Pyx_GetItemInt_List(__pyx_v_rend->children, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_9, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_v_pc = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "renpy/angle/gldraw.pyx":968
 *             pc = rend.children[0][0]
 * 
 *             while p > 1:             # <<<<<<<<<<<<<<
 *                 p /= 2
 *                 pc = self.get_half(pc)
 */
    while (1) {
      __pyx_t_6 = PyObject_RichCompare(__pyx_v_p, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (!__pyx_t_15) break;

      /* "renpy/angle/gldraw.pyx":969
 * 
 *             while p > 1:
 *                 p /= 2             # <<<<<<<<<<<<<<
 *                 pc = self.get_half(pc)
 * 
 */
      __pyx_t_6 = __Pyx_PyNumber_InPlaceDivide(__pyx_v_p, __pyx_int_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_p, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "renpy/angle/gldraw.pyx":970
 *             while p > 1:
 *                 p /= 2
 *                 pc = self.get_half(pc)             # <<<<<<<<<<<<<<
 * 
 *             reverse *= renpy.display.render.Matrix2D(1.0 * what.width / pc.width, 0, 0, 1.0 * what.height / pc.height)
 */
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_half); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_2 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
        }
      }
      if (!__pyx_t_2) {
        __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_pc); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
      } else {
        __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_2); __pyx_t_2 = NULL;
        __Pyx_INCREF(__pyx_v_pc);
        __Pyx_GIVEREF(__pyx_v_pc);
        PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_v_pc);
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF_SET(__pyx_v_pc, __pyx_t_6);
      __pyx_t_6 = 0;
    }

    /* "renpy/angle/gldraw.pyx":972
 *                 pc = self.get_half(pc)
 * 
 *             reverse *= renpy.display.render.Matrix2D(1.0 * what.width / pc.width, 0, 0, 1.0 * what.height / pc.height)             # <<<<<<<<<<<<<<
 * 
 *             gltexture.blit(
 */
    __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_display); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_render); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_Matrix2D); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_what, __pyx_n_s_width); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_2 = PyNumber_Multiply(__pyx_float_1_0, __pyx_t_9); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_width); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_t_9); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_what, __pyx_n_s_height); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_2 = PyNumber_Multiply(__pyx_float_1_0, __pyx_t_9); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_pc, __pyx_n_s_height); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = NULL;
    __pyx_t_11 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_12))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_12);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_12, function);
        __pyx_t_11 = 1;
      }
    }
    __pyx_t_2 = PyTuple_New(4+__pyx_t_11); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (__pyx_t_9) {
      __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_9); __pyx_t_9 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_11, __pyx_t_7);
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_11, __pyx_int_0);
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    PyTuple_SET_ITEM(__pyx_t_2, 2+__pyx_t_11, __pyx_int_0);
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_2, 3+__pyx_t_11, __pyx_t_8);
    __pyx_t_7 = 0;
    __pyx_t_8 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = PyNumber_InPlaceMultiply(((PyObject *)__pyx_v_reverse), __pyx_t_6); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5renpy_7display_6render_Matrix2D))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF_SET(__pyx_v_reverse, ((struct __pyx_obj_5renpy_7display_6render_Matrix2D *)__pyx_t_12));
    __pyx_t_12 = 0;

    /* "renpy/angle/gldraw.pyx":975
 * 
 *             gltexture.blit(
 *                 pc,             # <<<<<<<<<<<<<<
 *                 xo,
 *                 yo,
 */
    if (!(likely(((__pyx_v_pc) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_pc, __pyx_ptype_5renpy_5angle_9gltexture_TextureGrid))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "renpy/angle/gldraw.pyx":981
 *                 alpha,
 *                 over,
 *                 self.environ,             # <<<<<<<<<<<<<<
 *                 True)
 * 
 */
    __pyx_t_12 = ((PyObject *)__pyx_v_self->environ);
    __Pyx_INCREF(__pyx_t_12);

    /* "renpy/angle/gldraw.pyx":974
 *             reverse *= renpy.display.render.Matrix2D(1.0 * what.width / pc.width, 0, 0, 1.0 * what.height / pc.height)
 * 
 *             gltexture.blit(             # <<<<<<<<<<<<<<
 *                 pc,
 *                 xo,
 */
    __pyx_t_6 = __pyx_f_5renpy_5angle_9gltexture_blit(((struct __pyx_obj_5renpy_5angle_9gltexture_TextureGrid *)__pyx_v_pc), __pyx_v_xo, __pyx_v_yo, __pyx_v_reverse, __pyx_v_alpha, __pyx_v_over, ((struct __pyx_obj_5renpy_5angle_6gldraw_Environ *)__pyx_t_12), 1, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "renpy/angle/gldraw.pyx":984
 *                 True)
 * 
 *             return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_r = 0;
    goto __pyx_L0;

    /* "renpy/angle/gldraw.pyx":962
 * 
 * 
 *         if rend.operation == PIXELLATE:             # <<<<<<<<<<<<<<
 *             self.set_clip(clip)
 * 
 */
  }

  /* "renpy/angle/gldraw.pyx":988
 * 
 *         # Compute clipping.
 *         if rend.xclipping or rend.yclipping:             # <<<<<<<<<<<<<<
 * 
 *             # Non-aligned clipping uses RTT.
 */
  __pyx_t_14 = (__pyx_v_rend->xclipping != 0);
  if (!__pyx_t_14) {
  } else {
    __pyx_t_15 = __pyx_t_14;
    goto __pyx_L16_bool_binop_done;
  }
  __pyx_t_14 = (__pyx_v_rend->yclipping != 0);
  __pyx_t_15 = __pyx_t_14;
  __pyx_L16_bool_binop_done:;
  if (__pyx_t_15) {

    /* "renpy/angle/gldraw.pyx":991
 * 
 *             # Non-aligned clipping uses RTT.
 *             if reverse.ydx != 0 or reverse.xdy != 0:             # <<<<<<<<<<<<<<
 *                 tex = what.render_to_texture(True)
 *                 self.draw_transformed(tex, clip, xo, yo, alpha, over, reverse * self.draw_to_virt, nearest, subpixel)
 */
    __pyx_t_14 = ((__pyx_v_reverse->ydx != 0.0) != 0);
    if (!__pyx_t_14) {
    } else {
      __pyx_t_15 = __pyx_t_14;
      goto __pyx_L19_bool_binop_done;
    }
    __pyx_t_14 = ((__pyx_v_reverse->xdy != 0.0) != 0);
    __pyx_t_15 = __pyx_t_14;
    __pyx_L19_bool_binop_done:;
    if (__pyx_t_15) {

      /* "renpy/angle/gldraw.pyx":992
 *             # Non-aligned clipping uses RTT.
 *             if reverse.ydx != 0 or reverse.xdy != 0:
 *                 tex = what.render_to_texture(True)             # <<<<<<<<<<<<<<
 *                 self.draw_transformed(tex, clip, xo, yo, alpha, over, reverse * self.draw_to_virt, nearest, subpixel)
 *                 return 0
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_what, __pyx_n_s_render_to_texture); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_v_tex = __pyx_t_12;
      __pyx_t_12 = 0;

      /* "renpy/angle/gldraw.pyx":993
 *             if reverse.ydx != 0 or reverse.xdy != 0:
 *                 tex = what.render_to_texture(True)
 *                 self.draw_transformed(tex, clip, xo, yo, alpha, over, reverse * self.draw_to_virt, nearest, subpixel)             # <<<<<<<<<<<<<<
 *                 return 0
 * 
 */
      __pyx_t_12 = PyNumber_Multiply(((PyObject *)__pyx_v_reverse), ((PyObject *)__pyx_v_self->draw_to_virt)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5renpy_7display_6render_Matrix2D))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_13 = ((struct __pyx_vtabstruct_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self->__pyx_vtab)->draw_transformed(__pyx_v_self, __pyx_v_tex, __pyx_v_clip, __pyx_v_xo, __pyx_v_yo, __pyx_v_alpha, __pyx_v_over, ((struct __pyx_obj_5renpy_7display_6render_Matrix2D *)__pyx_t_12), __pyx_v_nearest, __pyx_v_subpixel, 0); if (unlikely(__pyx_t_13 == 1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

      /* "renpy/angle/gldraw.pyx":994
 *                 tex = what.render_to_texture(True)
 *                 self.draw_transformed(tex, clip, xo, yo, alpha, over, reverse * self.draw_to_virt, nearest, subpixel)
 *                 return 0             # <<<<<<<<<<<<<<
 * 
 *             minx, miny, maxx, maxy = clip
 */
      __pyx_r = 0;
      goto __pyx_L0;

      /* "renpy/angle/gldraw.pyx":991
 * 
 *             # Non-aligned clipping uses RTT.
 *             if reverse.ydx != 0 or reverse.xdy != 0:             # <<<<<<<<<<<<<<
 *                 tex = what.render_to_texture(True)
 *                 self.draw_transformed(tex, clip, xo, yo, alpha, over, reverse * self.draw_to_virt, nearest, subpixel)
 */
    }

    /* "renpy/angle/gldraw.pyx":996
 *                 return 0
 * 
 *             minx, miny, maxx, maxy = clip             # <<<<<<<<<<<<<<
 * 
 *             # Figure out the transformed width and height of this
 */
    if (likely(__pyx_v_clip != Py_None)) {
      PyObject* sequence = __pyx_v_clip;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 4)) {
        if (size > 4) __Pyx_RaiseTooManyValuesError(4);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_12 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2); 
      __pyx_t_8 = PyTuple_GET_ITEM(sequence, 3); 
      __Pyx_INCREF(__pyx_t_12);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_8);
      #else
      {
        Py_ssize_t i;
        PyObject** temps[4] = {&__pyx_t_12,&__pyx_t_6,&__pyx_t_2,&__pyx_t_8};
        for (i=0; i < 4; i++) {
          PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(item);
          *(temps[i]) = item;
        }
      }
      #endif
    } else {
      __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_minx = __pyx_t_12;
    __pyx_t_12 = 0;
    __pyx_v_miny = __pyx_t_6;
    __pyx_t_6 = 0;
    __pyx_v_maxx = __pyx_t_2;
    __pyx_t_2 = 0;
    __pyx_v_maxy = __pyx_t_8;
    __pyx_t_8 = 0;

    /* "renpy/angle/gldraw.pyx":1000
 *             # Figure out the transformed width and height of this
 *             # surface.
 *             tw, th = reverse.transform(what.width, what.height)             # <<<<<<<<<<<<<<
 * 
 *             if rend.xclipping:
 */
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_what, __pyx_n_s_width); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_t_8); if (unlikely((__pyx_t_16 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_what, __pyx_n_s_height); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_8); if (unlikely((__pyx_t_17 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = ((struct __pyx_vtabstruct_5renpy_7display_6render_Matrix2D *)__pyx_v_reverse->__pyx_vtab)->transform(__pyx_v_reverse, __pyx_t_16, __pyx_t_17, 0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    if (likely(__pyx_t_8 != Py_None)) {
      PyObject* sequence = __pyx_t_8;
      #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 = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      #else
      __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      #endif
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    } else {
      __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_tw = __pyx_t_2;
    __pyx_t_2 = 0;
    __pyx_v_th = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "renpy/angle/gldraw.pyx":1002
 *             tw, th = reverse.transform(what.width, what.height)
 * 
 *             if rend.xclipping:             # <<<<<<<<<<<<<<
 *                 minx = max(minx, min(xo, xo + tw))
 *                 maxx = min(maxx, max(xo, xo + tw))
 */
    __pyx_t_15 = (__pyx_v_rend->xclipping != 0);
    if (__pyx_t_15) {

      /* "renpy/angle/gldraw.pyx":1003
 * 
 *             if rend.xclipping:
 *                 minx = max(minx, min(xo, xo + tw))             # <<<<<<<<<<<<<<
 *                 maxx = min(maxx, max(xo, xo + tw))
 * 
 */
      __pyx_t_8 = PyFloat_FromDouble(__pyx_v_xo); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_6 = PyNumber_Add(__pyx_t_8, __pyx_v_tw); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_17 = __pyx_v_xo;
      __pyx_t_2 = PyFloat_FromDouble(__pyx_t_17); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_12 = PyObject_RichCompare(__pyx_t_6, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (__pyx_t_15) {
        __Pyx_INCREF(__pyx_t_6);
        __pyx_t_8 = __pyx_t_6;
      } else {
        __pyx_t_12 = PyFloat_FromDouble(__pyx_t_17); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_8 = __pyx_t_12;
        __pyx_t_12 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_INCREF(__pyx_t_8);
      __pyx_t_6 = __pyx_t_8;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_INCREF(__pyx_v_minx);
      __pyx_t_8 = __pyx_v_minx;
      __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_t_8, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_15) {
        __Pyx_INCREF(__pyx_t_6);
        __pyx_t_12 = __pyx_t_6;
      } else {
        __Pyx_INCREF(__pyx_t_8);
        __pyx_t_12 = __pyx_t_8;
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __pyx_t_12;
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF_SET(__pyx_v_minx, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "renpy/angle/gldraw.pyx":1004
 *             if rend.xclipping:
 *                 minx = max(minx, min(xo, xo + tw))
 *                 maxx = min(maxx, max(xo, xo + tw))             # <<<<<<<<<<<<<<
 * 
 *             if rend.yclipping:
 */
      __pyx_t_6 = PyFloat_FromDouble(__pyx_v_xo); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_12 = PyNumber_Add(__pyx_t_6, __pyx_v_tw); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_17 = __pyx_v_xo;
      __pyx_t_8 = PyFloat_FromDouble(__pyx_t_17); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_2 = PyObject_RichCompare(__pyx_t_12, __pyx_t_8, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_15) {
        __Pyx_INCREF(__pyx_t_12);
        __pyx_t_6 = __pyx_t_12;
      } else {
        __pyx_t_2 = PyFloat_FromDouble(__pyx_t_17); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_6 = __pyx_t_2;
        __pyx_t_2 = 0;
      }
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_INCREF(__pyx_t_6);
      __pyx_t_12 = __pyx_t_6;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_INCREF(__pyx_v_maxx);
      __pyx_t_6 = __pyx_v_maxx;
      __pyx_t_8 = PyObject_RichCompare(__pyx_t_12, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (__pyx_t_15) {
        __Pyx_INCREF(__pyx_t_12);
        __pyx_t_2 = __pyx_t_12;
      } else {
        __Pyx_INCREF(__pyx_t_6);
        __pyx_t_2 = __pyx_t_6;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = __pyx_t_2;
      __Pyx_INCREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF_SET(__pyx_v_maxx, __pyx_t_12);
      __pyx_t_12 = 0;

      /* "renpy/angle/gldraw.pyx":1002
 *             tw, th = reverse.transform(what.width, what.height)
 * 
 *             if rend.xclipping:             # <<<<<<<<<<<<<<
 *                 minx = max(minx, min(xo, xo + tw))
 *                 maxx = min(maxx, max(xo, xo + tw))
 */
    }

    /* "renpy/angle/gldraw.pyx":1006
 *                 maxx = min(maxx, max(xo, xo + tw))
 * 
 *             if rend.yclipping:             # <<<<<<<<<<<<<<
 *                 miny = max(miny, min(yo, yo + th))
 *                 maxy = min(maxy, max(yo, yo + th))
 */
    __pyx_t_15 = (__pyx_v_rend->yclipping != 0);
    if (__pyx_t_15) {

      /* "renpy/angle/gldraw.pyx":1007
 * 
 *             if rend.yclipping:
 *                 miny = max(miny, min(yo, yo + th))             # <<<<<<<<<<<<<<
 *                 maxy = min(maxy, max(yo, yo + th))
 * 
 */
      __pyx_t_12 = PyFloat_FromDouble(__pyx_v_yo); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_2 = PyNumber_Add(__pyx_t_12, __pyx_v_th); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_17 = __pyx_v_yo;
      __pyx_t_6 = PyFloat_FromDouble(__pyx_t_17); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_8 = PyObject_RichCompare(__pyx_t_2, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (__pyx_t_15) {
        __Pyx_INCREF(__pyx_t_2);
        __pyx_t_12 = __pyx_t_2;
      } else {
        __pyx_t_8 = PyFloat_FromDouble(__pyx_t_17); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_12 = __pyx_t_8;
        __pyx_t_8 = 0;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_INCREF(__pyx_t_12);
      __pyx_t_2 = __pyx_t_12;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_INCREF(__pyx_v_miny);
      __pyx_t_12 = __pyx_v_miny;
      __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_t_12, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (__pyx_t_15) {
        __Pyx_INCREF(__pyx_t_2);
        __pyx_t_8 = __pyx_t_2;
      } else {
        __Pyx_INCREF(__pyx_t_12);
        __pyx_t_8 = __pyx_t_12;
      }
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __pyx_t_8;
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF_SET(__pyx_v_miny, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "renpy/angle/gldraw.pyx":1008
 *             if rend.yclipping:
 *                 miny = max(miny, min(yo, yo + th))
 *                 maxy = min(maxy, max(yo, yo + th))             # <<<<<<<<<<<<<<
 * 
 *             clip = (minx, miny, maxx, maxy)
 */
      __pyx_t_2 = PyFloat_FromDouble(__pyx_v_yo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_v_th); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_17 = __pyx_v_yo;
      __pyx_t_12 = PyFloat_FromDouble(__pyx_t_17); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_6 = PyObject_RichCompare(__pyx_t_8, __pyx_t_12, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (__pyx_t_15) {
        __Pyx_INCREF(__pyx_t_8);
        __pyx_t_2 = __pyx_t_8;
      } else {
        __pyx_t_6 = PyFloat_FromDouble(__pyx_t_17); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_2 = __pyx_t_6;
        __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_8 = __pyx_t_2;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_INCREF(__pyx_v_maxy);
      __pyx_t_2 = __pyx_v_maxy;
      __pyx_t_12 = PyObject_RichCompare(__pyx_t_8, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (__pyx_t_15) {
        __Pyx_INCREF(__pyx_t_8);
        __pyx_t_6 = __pyx_t_8;
      } else {
        __Pyx_INCREF(__pyx_t_2);
        __pyx_t_6 = __pyx_t_2;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = __pyx_t_6;
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF_SET(__pyx_v_maxy, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "renpy/angle/gldraw.pyx":1006
 *                 maxx = min(maxx, max(xo, xo + tw))
 * 
 *             if rend.yclipping:             # <<<<<<<<<<<<<<
 *                 miny = max(miny, min(yo, yo + th))
 *                 maxy = min(maxy, max(yo, yo + th))
 */
    }

    /* "renpy/angle/gldraw.pyx":1010
 *                 maxy = min(maxy, max(yo, yo + th))
 * 
 *             clip = (minx, miny, maxx, maxy)             # <<<<<<<<<<<<<<
 * 
 *         alpha = alpha * rend.alpha
 */
    __pyx_t_8 = PyTuple_New(4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_INCREF(__pyx_v_minx);
    __Pyx_GIVEREF(__pyx_v_minx);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_minx);
    __Pyx_INCREF(__pyx_v_miny);
    __Pyx_GIVEREF(__pyx_v_miny);
    PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_miny);
    __Pyx_INCREF(__pyx_v_maxx);
    __Pyx_GIVEREF(__pyx_v_maxx);
    PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_v_maxx);
    __Pyx_INCREF(__pyx_v_maxy);
    __Pyx_GIVEREF(__pyx_v_maxy);
    PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_v_maxy);
    __Pyx_DECREF_SET(__pyx_v_clip, ((PyObject*)__pyx_t_8));
    __pyx_t_8 = 0;

    /* "renpy/angle/gldraw.pyx":988
 * 
 *         # Compute clipping.
 *         if rend.xclipping or rend.yclipping:             # <<<<<<<<<<<<<<
 * 
 *             # Non-aligned clipping uses RTT.
 */
  }

  /* "renpy/angle/gldraw.pyx":1012
 *             clip = (minx, miny, maxx, maxy)
 * 
 *         alpha = alpha * rend.alpha             # <<<<<<<<<<<<<<
 *         over = over * rend.over
 * 
 */
  __pyx_v_alpha = (__pyx_v_alpha * __pyx_v_rend->alpha);

  /* "renpy/angle/gldraw.pyx":1013
 * 
 *         alpha = alpha * rend.alpha
 *         over = over * rend.over             # <<<<<<<<<<<<<<
 * 
 *         if rend.nearest is not None:
 */
  __pyx_v_over = (__pyx_v_over * __pyx_v_rend->over);

  /* "renpy/angle/gldraw.pyx":1015
 *         over = over * rend.over
 * 
 *         if rend.nearest is not None:             # <<<<<<<<<<<<<<
 *             nearest = rend.nearest
 * 
 */
  __pyx_t_15 = (__pyx_v_rend->nearest != Py_None);
  __pyx_t_14 = (__pyx_t_15 != 0);
  if (__pyx_t_14) {

    /* "renpy/angle/gldraw.pyx":1016
 * 
 *         if rend.nearest is not None:
 *             nearest = rend.nearest             # <<<<<<<<<<<<<<
 * 
 *         # If our alpha has hit 0, don't do anything.
 */
    __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_v_rend->nearest); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_nearest = __pyx_t_14;

    /* "renpy/angle/gldraw.pyx":1015
 *         over = over * rend.over
 * 
 *         if rend.nearest is not None:             # <<<<<<<<<<<<<<
 *             nearest = rend.nearest
 * 
 */
  }

  /* "renpy/angle/gldraw.pyx":1019
 * 
 *         # If our alpha has hit 0, don't do anything.
 *         if alpha <= 0.003: # (1 / 256)             # <<<<<<<<<<<<<<
 *             return 0
 * 
 */
  __pyx_t_14 = ((__pyx_v_alpha <= 0.003) != 0);
  if (__pyx_t_14) {

    /* "renpy/angle/gldraw.pyx":1020
 *         # If our alpha has hit 0, don't do anything.
 *         if alpha <= 0.003: # (1 / 256)
 *             return 0             # <<<<<<<<<<<<<<
 * 
 *         if rend.reverse is not None and rend.reverse is not IDENTITY:
 */
    __pyx_r = 0;
    goto __pyx_L0;

    /* "renpy/angle/gldraw.pyx":1019
 * 
 *         # If our alpha has hit 0, don't do anything.
 *         if alpha <= 0.003: # (1 / 256)             # <<<<<<<<<<<<<<
 *             return 0
 * 
 */
  }

  /* "renpy/angle/gldraw.pyx":1022
 *             return 0
 * 
 *         if rend.reverse is not None and rend.reverse is not IDENTITY:             # <<<<<<<<<<<<<<
 *             child_reverse = rend.reverse * reverse
 *         else:
 */
  __pyx_t_15 = (((PyObject *)__pyx_v_rend->reverse) != Py_None);
  __pyx_t_18 = (__pyx_t_15 != 0);
  if (__pyx_t_18) {
  } else {
    __pyx_t_14 = __pyx_t_18;
    goto __pyx_L26_bool_binop_done;
  }
  __pyx_t_18 = (((PyObject *)__pyx_v_rend->reverse) != __pyx_v_5renpy_5angle_6gldraw_IDENTITY);
  __pyx_t_15 = (__pyx_t_18 != 0);
  __pyx_t_14 = __pyx_t_15;
  __pyx_L26_bool_binop_done:;
  if (__pyx_t_14) {

    /* "renpy/angle/gldraw.pyx":1023
 * 
 *         if rend.reverse is not None and rend.reverse is not IDENTITY:
 *             child_reverse = rend.reverse * reverse             # <<<<<<<<<<<<<<
 *         else:
 *             child_reverse = reverse
 */
    __pyx_t_8 = PyNumber_Multiply(((PyObject *)__pyx_v_rend->reverse), ((PyObject *)__pyx_v_reverse)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5renpy_7display_6render_Matrix2D))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_child_reverse = ((struct __pyx_obj_5renpy_7display_6render_Matrix2D *)__pyx_t_8);
    __pyx_t_8 = 0;

    /* "renpy/angle/gldraw.pyx":1022
 *             return 0
 * 
 *         if rend.reverse is not None and rend.reverse is not IDENTITY:             # <<<<<<<<<<<<<<
 *             child_reverse = rend.reverse * reverse
 *         else:
 */
    goto __pyx_L25;
  }

  /* "renpy/angle/gldraw.pyx":1025
 *             child_reverse = rend.reverse * reverse
 *         else:
 *             child_reverse = reverse             # <<<<<<<<<<<<<<
 * 
 *         for child, cx, cy, focus, main in rend.visible_children:
 */
  /*else*/ {
    __Pyx_INCREF(((PyObject *)__pyx_v_reverse));
    __pyx_v_child_reverse = __pyx_v_reverse;
  }
  __pyx_L25:;

  /* "renpy/angle/gldraw.pyx":1027
 *             child_reverse = reverse
 * 
 *         for child, cx, cy, focus, main in rend.visible_children:             # <<<<<<<<<<<<<<
 * 
 *             # The type of cx and cy depends on if this is a subpixel blit or not.
 */
  if (unlikely(__pyx_v_rend->visible_children == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_8 = __pyx_v_rend->visible_children; __Pyx_INCREF(__pyx_t_8); __pyx_t_11 = 0;
  for (;;) {
    if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_8)) break;
    #if CYTHON_COMPILING_IN_CPYTHON
    __pyx_t_6 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_11); __Pyx_INCREF(__pyx_t_6); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    #else
    __pyx_t_6 = PySequence_ITEM(__pyx_t_8, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    #endif
    if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
      PyObject* sequence = __pyx_t_6;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 5)) {
        if (size > 5) __Pyx_RaiseTooManyValuesError(5);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_12 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); 
        __pyx_t_9 = PyTuple_GET_ITEM(sequence, 3); 
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 4); 
      } else {
        __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_12 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_7 = PyList_GET_ITEM(sequence, 2); 
        __pyx_t_9 = PyList_GET_ITEM(sequence, 3); 
        __pyx_t_1 = PyList_GET_ITEM(sequence, 4); 
      }
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_12);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_1);
      #else
      {
        Py_ssize_t i;
        PyObject** temps[5] = {&__pyx_t_2,&__pyx_t_12,&__pyx_t_7,&__pyx_t_9,&__pyx_t_1};
        for (i=0; i < 5; i++) {
          PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(item);
          *(temps[i]) = item;
        }
      }
      #endif
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else {
      Py_ssize_t index = -1;
      PyObject** temps[5] = {&__pyx_t_2,&__pyx_t_12,&__pyx_t_7,&__pyx_t_9,&__pyx_t_1};
      __pyx_t_5 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_19 = Py_TYPE(__pyx_t_5)->tp_iternext;
      for (index=0; index < 5; index++) {
        PyObject* item = __pyx_t_19(__pyx_t_5); if (unlikely(!item)) goto __pyx_L30_unpacking_failed;
        __Pyx_GOTREF(item);
        *(temps[index]) = item;
      }
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_19(__pyx_t_5), 5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_19 = NULL;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L31_unpacking_done;
      __pyx_L30_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_19 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L31_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_child, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_XDECREF_SET(__pyx_v_cx, __pyx_t_12);
    __pyx_t_12 = 0;
    __Pyx_XDECREF_SET(__pyx_v_cy, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_XDECREF_SET(__pyx_v_focus, __pyx_t_9);
    __pyx_t_9 = 0;
    __Pyx_XDECREF_SET(__pyx_v_main, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "renpy/angle/gldraw.pyx":1030
 * 
 *             # The type of cx and cy depends on if this is a subpixel blit or not.
 *             if type(cx) is float:             # <<<<<<<<<<<<<<
 *                 subpixel = True
 * 
 */
    __pyx_t_14 = (((PyObject *)Py_TYPE(__pyx_v_cx)) == ((PyObject *)(&PyFloat_Type)));
    __pyx_t_15 = (__pyx_t_14 != 0);
    if (__pyx_t_15) {

      /* "renpy/angle/gldraw.pyx":1031
 *             # The type of cx and cy depends on if this is a subpixel blit or not.
 *             if type(cx) is float:
 *                 subpixel = True             # <<<<<<<<<<<<<<
 * 
 *             cxo = cx
 */
      __pyx_v_subpixel = 1;

      /* "renpy/angle/gldraw.pyx":1030
 * 
 *             # The type of cx and cy depends on if this is a subpixel blit or not.
 *             if type(cx) is float:             # <<<<<<<<<<<<<<
 *                 subpixel = True
 * 
 */
    }

    /* "renpy/angle/gldraw.pyx":1033
 *                 subpixel = True
 * 
 *             cxo = cx             # <<<<<<<<<<<<<<
 *             cyo = cy
 * 
 */
    __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_v_cx); if (unlikely((__pyx_t_17 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_cxo = __pyx_t_17;

    /* "renpy/angle/gldraw.pyx":1034
 * 
 *             cxo = cx
 *             cyo = cy             # <<<<<<<<<<<<<<
 * 
 *             tcxo = reverse.xdx * cxo + reverse.xdy * cyo
 */
    __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_v_cy); if (unlikely((__pyx_t_17 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_cyo = __pyx_t_17;

    /* "renpy/angle/gldraw.pyx":1036
 *             cyo = cy
 * 
 *             tcxo = reverse.xdx * cxo + reverse.xdy * cyo             # <<<<<<<<<<<<<<
 *             tcyo = reverse.ydx * cxo + reverse.ydy * cyo
 * 
 */
    __pyx_v_tcxo = ((__pyx_v_reverse->xdx * __pyx_v_cxo) + (__pyx_v_reverse->xdy * __pyx_v_cyo));

    /* "renpy/angle/gldraw.pyx":1037
 * 
 *             tcxo = reverse.xdx * cxo + reverse.xdy * cyo
 *             tcyo = reverse.ydx * cxo + reverse.ydy * cyo             # <<<<<<<<<<<<<<
 * 
 *             self.draw_transformed(child, clip, xo + tcxo, yo + tcyo, alpha, over, child_reverse, nearest, subpixel)
 */
    __pyx_v_tcyo = ((__pyx_v_reverse->ydx * __pyx_v_cxo) + (__pyx_v_reverse->ydy * __pyx_v_cyo));

    /* "renpy/angle/gldraw.pyx":1039
 *             tcyo = reverse.ydx * cxo + reverse.ydy * cyo
 * 
 *             self.draw_transformed(child, clip, xo + tcxo, yo + tcyo, alpha, over, child_reverse, nearest, subpixel)             # <<<<<<<<<<<<<<
 * 
 *         return 0
 */
    __pyx_t_13 = ((struct __pyx_vtabstruct_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self->__pyx_vtab)->draw_transformed(__pyx_v_self, __pyx_v_child, __pyx_v_clip, (__pyx_v_xo + __pyx_v_tcxo), (__pyx_v_yo + __pyx_v_tcyo), __pyx_v_alpha, __pyx_v_over, __pyx_v_child_reverse, __pyx_v_nearest, __pyx_v_subpixel, 0); if (unlikely(__pyx_t_13 == 1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "renpy/angle/gldraw.pyx":1027
 *             child_reverse = reverse
 * 
 *         for child, cx, cy, focus, main in rend.visible_children:             # <<<<<<<<<<<<<<
 * 
 *             # The type of cx and cy depends on if this is a subpixel blit or not.
 */
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "renpy/angle/gldraw.pyx":1041
 *             self.draw_transformed(child, clip, xo + tcxo, yo + tcyo, alpha, over, child_reverse, nearest, subpixel)
 * 
 *         return 0             # <<<<<<<<<<<<<<
 * 
 *     def render_to_texture(self, what, alpha):
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "renpy/angle/gldraw.pyx":858
 *             what.render_to_texture(True)
 * 
 *     cpdef int draw_transformed(             # <<<<<<<<<<<<<<
 *         GLDraw self,
 *         object what,
 */

  /* function exit code */
  __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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.draw_transformed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 1;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_rend);
  __Pyx_XDECREF((PyObject *)__pyx_v_child_reverse);
  __Pyx_XDECREF(__pyx_v_tex);
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_XDECREF(__pyx_v_pc);
  __Pyx_XDECREF(__pyx_v_minx);
  __Pyx_XDECREF(__pyx_v_miny);
  __Pyx_XDECREF(__pyx_v_maxx);
  __Pyx_XDECREF(__pyx_v_maxy);
  __Pyx_XDECREF(__pyx_v_tw);
  __Pyx_XDECREF(__pyx_v_th);
  __Pyx_XDECREF(__pyx_v_child);
  __Pyx_XDECREF(__pyx_v_cx);
  __Pyx_XDECREF(__pyx_v_cy);
  __Pyx_XDECREF(__pyx_v_focus);
  __Pyx_XDECREF(__pyx_v_main);
  __Pyx_XDECREF(__pyx_v_clip);
  __Pyx_XDECREF((PyObject *)__pyx_v_reverse);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_31draw_transformed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_31draw_transformed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_what = 0;
  PyObject *__pyx_v_clip = 0;
  double __pyx_v_xo;
  double __pyx_v_yo;
  double __pyx_v_alpha;
  double __pyx_v_over;
  struct __pyx_obj_5renpy_7display_6render_Matrix2D *__pyx_v_reverse = 0;
  int __pyx_v_nearest;
  int __pyx_v_subpixel;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw_transformed (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_what,&__pyx_n_s_clip,&__pyx_n_s_xo,&__pyx_n_s_yo,&__pyx_n_s_alpha,&__pyx_n_s_over,&__pyx_n_s_reverse,&__pyx_n_s_nearest,&__pyx_n_s_subpixel,0};
    PyObject* values[9] = {0,0,0,0,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  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        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_what)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_clip)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("draw_transformed", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xo)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("draw_transformed", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yo)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("draw_transformed", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("draw_transformed", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  5:
        if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_over)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("draw_transformed", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  6:
        if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_reverse)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("draw_transformed", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  7:
        if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nearest)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("draw_transformed", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  8:
        if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_subpixel)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("draw_transformed", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "draw_transformed") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
      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);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
    }
    __pyx_v_what = values[0];
    __pyx_v_clip = ((PyObject*)values[1]);
    __pyx_v_xo = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_xo == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_yo = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_yo == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_alpha = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_alpha == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_over = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_over == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_reverse = ((struct __pyx_obj_5renpy_7display_6render_Matrix2D *)values[6]);
    __pyx_v_nearest = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_nearest == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_subpixel = __Pyx_PyObject_IsTrue(values[8]); if (unlikely((__pyx_v_subpixel == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("draw_transformed", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.draw_transformed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_clip), (&PyTuple_Type), 1, "clip", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_reverse), __pyx_ptype_5renpy_7display_6render_Matrix2D, 1, "reverse", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_30draw_transformed(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self), __pyx_v_what, __pyx_v_clip, __pyx_v_xo, __pyx_v_yo, __pyx_v_alpha, __pyx_v_over, __pyx_v_reverse, __pyx_v_nearest, __pyx_v_subpixel);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_30draw_transformed(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_what, PyObject *__pyx_v_clip, double __pyx_v_xo, double __pyx_v_yo, double __pyx_v_alpha, double __pyx_v_over, struct __pyx_obj_5renpy_7display_6render_Matrix2D *__pyx_v_reverse, int __pyx_v_nearest, int __pyx_v_subpixel) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("draw_transformed", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_5renpy_5angle_6gldraw_6GLDraw_draw_transformed(__pyx_v_self, __pyx_v_what, __pyx_v_clip, __pyx_v_xo, __pyx_v_yo, __pyx_v_alpha, __pyx_v_over, __pyx_v_reverse, __pyx_v_nearest, __pyx_v_subpixel, 1); if (unlikely(__pyx_t_1 == 1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.draw_transformed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/angle/gldraw.pyx":1043
 *         return 0
 * 
 *     def render_to_texture(self, what, alpha):             # <<<<<<<<<<<<<<
 * 
 *         width = int(what.width * self.draw_per_virt)
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_33render_to_texture(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_33render_to_texture(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_what = 0;
  PyObject *__pyx_v_alpha = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("render_to_texture (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_what,&__pyx_n_s_alpha,0};
    PyObject* values[2] = {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  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_what)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("render_to_texture", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "render_to_texture") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_what = values[0];
    __pyx_v_alpha = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("render_to_texture", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.render_to_texture", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_32render_to_texture(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self), __pyx_v_what, __pyx_v_alpha);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/angle/gldraw.pyx":1048
 *         height = int(what.height * self.draw_per_virt)
 * 
 *         def draw_func(x, y, w, h):             # <<<<<<<<<<<<<<
 * 
 *             self.clip_mode_rtt(x, y, w, h)
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_17render_to_texture_1draw_func(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5renpy_5angle_6gldraw_6GLDraw_17render_to_texture_1draw_func = {"draw_func", (PyCFunction)__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_17render_to_texture_1draw_func, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_17render_to_texture_1draw_func(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_x = 0;
  PyObject *__pyx_v_y = 0;
  PyObject *__pyx_v_w = 0;
  PyObject *__pyx_v_h = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw_func (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_w,&__pyx_n_s_h,0};
    PyObject* values[4] = {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  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_x)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("draw_func", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("draw_func", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("draw_func", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "draw_func") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      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);
    }
    __pyx_v_x = values[0];
    __pyx_v_y = values[1];
    __pyx_v_w = values[2];
    __pyx_v_h = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("draw_func", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.render_to_texture.draw_func", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_17render_to_texture_draw_func(__pyx_self, __pyx_v_x, __pyx_v_y, __pyx_v_w, __pyx_v_h);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_17render_to_texture_draw_func(PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_w, PyObject *__pyx_v_h) {
  struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct_1_render_to_texture *__pyx_cur_scope;
  struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct_1_render_to_texture *__pyx_outer_scope;
  PyObject *__pyx_v_clip = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("draw_func", 0);
  __pyx_outer_scope = (struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct_1_render_to_texture *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "renpy/angle/gldraw.pyx":1050
 *         def draw_func(x, y, w, h):
 * 
 *             self.clip_mode_rtt(x, y, w, h)             # <<<<<<<<<<<<<<
 * 
 *             if alpha:
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_clip_mode_rtt); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  __pyx_t_5 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_3) {
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_INCREF(__pyx_v_x);
  __Pyx_GIVEREF(__pyx_v_x);
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_x);
  __Pyx_INCREF(__pyx_v_y);
  __Pyx_GIVEREF(__pyx_v_y);
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_y);
  __Pyx_INCREF(__pyx_v_w);
  __Pyx_GIVEREF(__pyx_v_w);
  PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_w);
  __Pyx_INCREF(__pyx_v_h);
  __Pyx_GIVEREF(__pyx_v_h);
  PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_v_h);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "renpy/angle/gldraw.pyx":1052
 *             self.clip_mode_rtt(x, y, w, h)
 * 
 *             if alpha:             # <<<<<<<<<<<<<<
 *                 glClearColor(0.0, 0.0, 0.0, 0.0)
 *             else:
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_alpha)) { __Pyx_RaiseClosureNameError("alpha"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_alpha); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_6) {

    /* "renpy/angle/gldraw.pyx":1053
 * 
 *             if alpha:
 *                 glClearColor(0.0, 0.0, 0.0, 0.0)             # <<<<<<<<<<<<<<
 *             else:
 *                 glClearColor(0.0, 0.0, 0.0, 1.0)
 */
    __pyx_t_7 = __pyx_f_5renpy_5angle_2gl_glClearColor(0.0, 0.0, 0.0, 0.0); if (unlikely(__pyx_t_7 == 0 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "renpy/angle/gldraw.pyx":1052
 *             self.clip_mode_rtt(x, y, w, h)
 * 
 *             if alpha:             # <<<<<<<<<<<<<<
 *                 glClearColor(0.0, 0.0, 0.0, 0.0)
 *             else:
 */
    goto __pyx_L3;
  }

  /* "renpy/angle/gldraw.pyx":1055
 *                 glClearColor(0.0, 0.0, 0.0, 0.0)
 *             else:
 *                 glClearColor(0.0, 0.0, 0.0, 1.0)             # <<<<<<<<<<<<<<
 * 
 *             glClear(GL_COLOR_BUFFER_BIT)
 */
  /*else*/ {
    __pyx_t_7 = __pyx_f_5renpy_5angle_2gl_glClearColor(0.0, 0.0, 0.0, 1.0); if (unlikely(__pyx_t_7 == 0 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  /* "renpy/angle/gldraw.pyx":1057
 *                 glClearColor(0.0, 0.0, 0.0, 1.0)
 * 
 *             glClear(GL_COLOR_BUFFER_BIT)             # <<<<<<<<<<<<<<
 * 
 *             self.default_clip = (0, 0, width, height)
 */
  __pyx_t_7 = __pyx_f_5renpy_5angle_2gl_glClear(GL_COLOR_BUFFER_BIT); if (unlikely(__pyx_t_7 == 0 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/angle/gldraw.pyx":1059
 *             glClear(GL_COLOR_BUFFER_BIT)
 * 
 *             self.default_clip = (0, 0, width, height)             # <<<<<<<<<<<<<<
 *             clip = self.default_clip
 * 
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_width)) { __Pyx_RaiseClosureNameError("width"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (unlikely(!__pyx_cur_scope->__pyx_v_height)) { __Pyx_RaiseClosureNameError("height"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_0);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_width);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_width);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_cur_scope->__pyx_v_width);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_height);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_height);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_cur_scope->__pyx_v_height);
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->default_clip);
  __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->default_clip);
  __pyx_cur_scope->__pyx_v_self->default_clip = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "renpy/angle/gldraw.pyx":1060
 * 
 *             self.default_clip = (0, 0, width, height)
 *             clip = self.default_clip             # <<<<<<<<<<<<<<
 * 
 *             self.draw_transformed(what, clip, 0, 0, 1.0, 1.0, self.virt_to_draw, renpy.config.nearest_neighbor, False)
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_1 = __pyx_cur_scope->__pyx_v_self->default_clip;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_clip = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "renpy/angle/gldraw.pyx":1062
 *             clip = self.default_clip
 * 
 *             self.draw_transformed(what, clip, 0, 0, 1.0, 1.0, self.virt_to_draw, renpy.config.nearest_neighbor, False)             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(what, render.Render):
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (unlikely(!__pyx_cur_scope->__pyx_v_what)) { __Pyx_RaiseClosureNameError("what"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_1 = __pyx_cur_scope->__pyx_v_what;
  __Pyx_INCREF(__pyx_t_1);
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_2 = ((PyObject *)__pyx_cur_scope->__pyx_v_self->virt_to_draw);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_config); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_nearest_neighbor); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = ((struct __pyx_vtabstruct_5renpy_5angle_6gldraw_GLDraw *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->draw_transformed(__pyx_cur_scope->__pyx_v_self, __pyx_t_1, __pyx_v_clip, 0.0, 0.0, 1.0, 1.0, ((struct __pyx_obj_5renpy_7display_6render_Matrix2D *)__pyx_t_2), __pyx_t_6, 0, 0); if (unlikely(__pyx_t_7 == 1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; __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;

  /* "renpy/angle/gldraw.pyx":1048
 *         height = int(what.height * self.draw_per_virt)
 * 
 *         def draw_func(x, y, w, h):             # <<<<<<<<<<<<<<
 * 
 *             self.clip_mode_rtt(x, y, w, h)
 */

  /* function exit code */
  __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_5);
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.render_to_texture.draw_func", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_clip);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/angle/gldraw.pyx":1043
 *         return 0
 * 
 *     def render_to_texture(self, what, alpha):             # <<<<<<<<<<<<<<
 * 
 *         width = int(what.width * self.draw_per_virt)
 */

static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_32render_to_texture(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_what, PyObject *__pyx_v_alpha) {
  struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct_1_render_to_texture *__pyx_cur_scope;
  PyObject *__pyx_v_draw_func = 0;
  PyObject *__pyx_v_rv = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("render_to_texture", 0);
  __pyx_cur_scope = (struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct_1_render_to_texture *)__pyx_tp_new_5renpy_5angle_6gldraw___pyx_scope_struct_1_render_to_texture(__pyx_ptype_5renpy_5angle_6gldraw___pyx_scope_struct_1_render_to_texture, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_what = __pyx_v_what;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_what);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_what);
  __pyx_cur_scope->__pyx_v_alpha = __pyx_v_alpha;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_alpha);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_alpha);

  /* "renpy/angle/gldraw.pyx":1045
 *     def render_to_texture(self, what, alpha):
 * 
 *         width = int(what.width * self.draw_per_virt)             # <<<<<<<<<<<<<<
 *         height = int(what.height * self.draw_per_virt)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_what, __pyx_n_s_width); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_cur_scope->__pyx_v_self->draw_per_virt); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_width = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "renpy/angle/gldraw.pyx":1046
 * 
 *         width = int(what.width * self.draw_per_virt)
 *         height = int(what.height * self.draw_per_virt)             # <<<<<<<<<<<<<<
 * 
 *         def draw_func(x, y, w, h):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_what, __pyx_n_s_height); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_cur_scope->__pyx_v_self->draw_per_virt); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_height = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "renpy/angle/gldraw.pyx":1048
 *         height = int(what.height * self.draw_per_virt)
 * 
 *         def draw_func(x, y, w, h):             # <<<<<<<<<<<<<<
 * 
 *             self.clip_mode_rtt(x, y, w, h)
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5renpy_5angle_6gldraw_6GLDraw_17render_to_texture_1draw_func, 0, __pyx_n_s_render_to_texture_locals_draw_fu, ((PyObject*)__pyx_cur_scope), __pyx_n_s_renpy_angle_gldraw, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_draw_func = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "renpy/angle/gldraw.pyx":1064
 *             self.draw_transformed(what, clip, 0, 0, 1.0, 1.0, self.virt_to_draw, renpy.config.nearest_neighbor, False)
 * 
 *         if isinstance(what, render.Render):             # <<<<<<<<<<<<<<
 *             what.is_opaque()
 * 
 */
  __pyx_t_1 = __pyx_cur_scope->__pyx_v_what;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_TypeCheck(__pyx_t_1, __pyx_ptype_5renpy_7display_6render_Render); 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "renpy/angle/gldraw.pyx":1065
 * 
 *         if isinstance(what, render.Render):
 *             what.is_opaque()             # <<<<<<<<<<<<<<
 * 
 *         rv = gltexture.texture_grid_from_drawing(width, height, draw_func, self.rtt, self.environ)
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_what, __pyx_n_s_is_opaque); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (__pyx_t_5) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "renpy/angle/gldraw.pyx":1064
 *             self.draw_transformed(what, clip, 0, 0, 1.0, 1.0, self.virt_to_draw, renpy.config.nearest_neighbor, False)
 * 
 *         if isinstance(what, render.Render):             # <<<<<<<<<<<<<<
 *             what.is_opaque()
 * 
 */
  }

  /* "renpy/angle/gldraw.pyx":1067
 *             what.is_opaque()
 * 
 *         rv = gltexture.texture_grid_from_drawing(width, height, draw_func, self.rtt, self.environ)             # <<<<<<<<<<<<<<
 * 
 *         self.did_render_to_texture = True
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_gltexture); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_texture_grid_from_drawing); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_6 = 1;
    }
  }
  __pyx_t_7 = PyTuple_New(5+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  if (__pyx_t_2) {
    __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); __pyx_t_2 = NULL;
  }
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_width);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_width);
  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_cur_scope->__pyx_v_width);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_height);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_height);
  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_cur_scope->__pyx_v_height);
  __Pyx_INCREF(__pyx_v_draw_func);
  __Pyx_GIVEREF(__pyx_v_draw_func);
  PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_v_draw_func);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self->rtt);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self->rtt);
  PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_6, __pyx_cur_scope->__pyx_v_self->rtt);
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->environ));
  __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->environ));
  PyTuple_SET_ITEM(__pyx_t_7, 4+__pyx_t_6, ((PyObject *)__pyx_cur_scope->__pyx_v_self->environ));
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_rv = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "renpy/angle/gldraw.pyx":1069
 *         rv = gltexture.texture_grid_from_drawing(width, height, draw_func, self.rtt, self.environ)
 * 
 *         self.did_render_to_texture = True             # <<<<<<<<<<<<<<
 * 
 *         return rv
 */
  __pyx_cur_scope->__pyx_v_self->did_render_to_texture = 1;

  /* "renpy/angle/gldraw.pyx":1071
 *         self.did_render_to_texture = True
 * 
 *         return rv             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_rv);
  __pyx_r = __pyx_v_rv;
  goto __pyx_L0;

  /* "renpy/angle/gldraw.pyx":1043
 *         return 0
 * 
 *     def render_to_texture(self, what, alpha):             # <<<<<<<<<<<<<<
 * 
 *         width = int(what.width * self.draw_per_virt)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.render_to_texture", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_draw_func);
  __Pyx_XDECREF(__pyx_v_rv);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/angle/gldraw.pyx":1074
 * 
 * 
 *     def is_pixel_opaque(self, what, x, y):             # <<<<<<<<<<<<<<
 *         """
 *         Returns true if the pixel is not 100% transparent.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_35is_pixel_opaque(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5renpy_5angle_6gldraw_6GLDraw_34is_pixel_opaque[] = "\n        Returns true if the pixel is not 100% transparent.\n        ";
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_35is_pixel_opaque(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_what = 0;
  PyObject *__pyx_v_x = 0;
  PyObject *__pyx_v_y = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_pixel_opaque (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_what,&__pyx_n_s_x,&__pyx_n_s_y,0};
    PyObject* values[3] = {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  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_what)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("is_pixel_opaque", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("is_pixel_opaque", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "is_pixel_opaque") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      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);
    }
    __pyx_v_what = values[0];
    __pyx_v_x = values[1];
    __pyx_v_y = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_pixel_opaque", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.is_pixel_opaque", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_34is_pixel_opaque(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self), __pyx_v_what, __pyx_v_x, __pyx_v_y);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_34is_pixel_opaque(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_what, PyObject *__pyx_v_x, PyObject *__pyx_v_y) {
  PyObject *__pyx_v_reverse = NULL;
  CYTHON_UNUSED long __pyx_v__i;
  PyObject *__pyx_v_clip = NULL;
  unsigned char __pyx_v_pixel[4];
  unsigned char __pyx_v_a;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  long __pyx_t_8;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_pixel_opaque", 0);
  __Pyx_INCREF(__pyx_v_what);

  /* "renpy/angle/gldraw.pyx":1079
 *         """
 * 
 *         if x < 0 or y < 0 or x >= what.width or y >= what.height:             # <<<<<<<<<<<<<<
 *             return 0
 * 
 */
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_x, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_y, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_what, __pyx_n_s_width); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyObject_RichCompare(__pyx_v_x, __pyx_t_2, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_what, __pyx_n_s_height); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_y, __pyx_t_4, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "renpy/angle/gldraw.pyx":1080
 * 
 *         if x < 0 or y < 0 or x >= what.width or y >= what.height:
 *             return 0             # <<<<<<<<<<<<<<
 * 
 *         if self.always_opaque or renpy.display.emulator.always_opaque:
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_int_0);
    __pyx_r = __pyx_int_0;
    goto __pyx_L0;

    /* "renpy/angle/gldraw.pyx":1079
 *         """
 * 
 *         if x < 0 or y < 0 or x >= what.width or y >= what.height:             # <<<<<<<<<<<<<<
 *             return 0
 * 
 */
  }

  /* "renpy/angle/gldraw.pyx":1082
 *             return 0
 * 
 *         if self.always_opaque or renpy.display.emulator.always_opaque:             # <<<<<<<<<<<<<<
 *             return 255
 * 
 */
  __pyx_t_3 = (__pyx_v_self->always_opaque != 0);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L9_bool_binop_done;
  }
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_display); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_emulator); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_always_opaque); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __pyx_t_3;
  __pyx_L9_bool_binop_done:;
  if (__pyx_t_1) {

    /* "renpy/angle/gldraw.pyx":1083
 * 
 *         if self.always_opaque or renpy.display.emulator.always_opaque:
 *             return 255             # <<<<<<<<<<<<<<
 * 
 *         what = what.subsurface((x, y, 1, 1))
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_int_255);
    __pyx_r = __pyx_int_255;
    goto __pyx_L0;

    /* "renpy/angle/gldraw.pyx":1082
 *             return 0
 * 
 *         if self.always_opaque or renpy.display.emulator.always_opaque:             # <<<<<<<<<<<<<<
 *             return 255
 * 
 */
  }

  /* "renpy/angle/gldraw.pyx":1085
 *             return 255
 * 
 *         what = what.subsurface((x, y, 1, 1))             # <<<<<<<<<<<<<<
 * 
 *         reverse = IDENTITY
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_what, __pyx_n_s_subsurface); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_x);
  __Pyx_GIVEREF(__pyx_v_x);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_x);
  __Pyx_INCREF(__pyx_v_y);
  __Pyx_GIVEREF(__pyx_v_y);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_y);
  __Pyx_INCREF(__pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_int_1);
  __Pyx_INCREF(__pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_int_1);
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_6) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_what, __pyx_t_4);
  __pyx_t_4 = 0;

  /* "renpy/angle/gldraw.pyx":1087
 *         what = what.subsurface((x, y, 1, 1))
 * 
 *         reverse = IDENTITY             # <<<<<<<<<<<<<<
 * 
 *         self.did_render_to_texture = False
 */
  __Pyx_INCREF(__pyx_v_5renpy_5angle_6gldraw_IDENTITY);
  __pyx_v_reverse = __pyx_v_5renpy_5angle_6gldraw_IDENTITY;

  /* "renpy/angle/gldraw.pyx":1089
 *         reverse = IDENTITY
 * 
 *         self.did_render_to_texture = False             # <<<<<<<<<<<<<<
 * 
 *         # We need to render a second time if a render-to-texture occurs, as it
 */
  __pyx_v_self->did_render_to_texture = 0;

  /* "renpy/angle/gldraw.pyx":1093
 *         # We need to render a second time if a render-to-texture occurs, as it
 *         # has overwritten the buffer we're drawing to.
 *         for _i in range(2):             # <<<<<<<<<<<<<<
 *             self.environ.viewport(0, 0, 1, 1)
 * 
 */
  for (__pyx_t_8 = 0; __pyx_t_8 < 2; __pyx_t_8+=1) {
    __pyx_v__i = __pyx_t_8;

    /* "renpy/angle/gldraw.pyx":1094
 *         # has overwritten the buffer we're drawing to.
 *         for _i in range(2):
 *             self.environ.viewport(0, 0, 1, 1)             # <<<<<<<<<<<<<<
 * 
 *             self.environ.ortho(0, 1, 0, 1, -1, 1)
 */
    ((struct __pyx_vtabstruct_5renpy_5angle_6gldraw_Environ *)__pyx_v_self->environ->__pyx_vtab)->viewport(__pyx_v_self->environ, 0, 0, 1, 1);

    /* "renpy/angle/gldraw.pyx":1096
 *             self.environ.viewport(0, 0, 1, 1)
 * 
 *             self.environ.ortho(0, 1, 0, 1, -1, 1)             # <<<<<<<<<<<<<<
 * 
 *             self.clip_mode_rtt(0, 0, 1, 1)
 */
    ((struct __pyx_vtabstruct_5renpy_5angle_6gldraw_Environ *)__pyx_v_self->environ->__pyx_vtab)->ortho(__pyx_v_self->environ, 0.0, 1.0, 0.0, 1.0, -1.0, 1.0);

    /* "renpy/angle/gldraw.pyx":1098
 *             self.environ.ortho(0, 1, 0, 1, -1, 1)
 * 
 *             self.clip_mode_rtt(0, 0, 1, 1)             # <<<<<<<<<<<<<<
 *             clip = (0, 0, 1, 1)
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_clip_mode_rtt); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "renpy/angle/gldraw.pyx":1099
 * 
 *             self.clip_mode_rtt(0, 0, 1, 1)
 *             clip = (0, 0, 1, 1)             # <<<<<<<<<<<<<<
 * 
 *             glClearColor(0.0, 0.0, 0.0, 0.0)
 */
    __Pyx_INCREF(__pyx_tuple__34);
    __Pyx_XDECREF_SET(__pyx_v_clip, __pyx_tuple__34);

    /* "renpy/angle/gldraw.pyx":1101
 *             clip = (0, 0, 1, 1)
 * 
 *             glClearColor(0.0, 0.0, 0.0, 0.0)             # <<<<<<<<<<<<<<
 *             glClear(GL_COLOR_BUFFER_BIT)
 * 
 */
    __pyx_t_9 = __pyx_f_5renpy_5angle_2gl_glClearColor(0.0, 0.0, 0.0, 0.0); if (unlikely(__pyx_t_9 == 0 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "renpy/angle/gldraw.pyx":1102
 * 
 *             glClearColor(0.0, 0.0, 0.0, 0.0)
 *             glClear(GL_COLOR_BUFFER_BIT)             # <<<<<<<<<<<<<<
 * 
 *             self.draw_transformed(what, clip, 0, 0, 1.0, 1.0, reverse, renpy.config.nearest_neighbor, False)
 */
    __pyx_t_9 = __pyx_f_5renpy_5angle_2gl_glClear(GL_COLOR_BUFFER_BIT); if (unlikely(__pyx_t_9 == 0 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "renpy/angle/gldraw.pyx":1104
 *             glClear(GL_COLOR_BUFFER_BIT)
 * 
 *             self.draw_transformed(what, clip, 0, 0, 1.0, 1.0, reverse, renpy.config.nearest_neighbor, False)             # <<<<<<<<<<<<<<
 * 
 *             if not self.did_render_to_texture:
 */
    if (!(likely(PyTuple_CheckExact(__pyx_v_clip))||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_clip)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (!(likely(((__pyx_v_reverse) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_reverse, __pyx_ptype_5renpy_7display_6render_Matrix2D))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_config); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_nearest_neighbor); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_9 = ((struct __pyx_vtabstruct_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self->__pyx_vtab)->draw_transformed(__pyx_v_self, __pyx_v_what, ((PyObject*)__pyx_v_clip), 0.0, 0.0, 1.0, 1.0, ((struct __pyx_obj_5renpy_7display_6render_Matrix2D *)__pyx_v_reverse), __pyx_t_1, 0, 0); if (unlikely(__pyx_t_9 == 1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "renpy/angle/gldraw.pyx":1106
 *             self.draw_transformed(what, clip, 0, 0, 1.0, 1.0, reverse, renpy.config.nearest_neighbor, False)
 * 
 *             if not self.did_render_to_texture:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
    __pyx_t_1 = ((!(__pyx_v_self->did_render_to_texture != 0)) != 0);
    if (__pyx_t_1) {

      /* "renpy/angle/gldraw.pyx":1107
 * 
 *             if not self.did_render_to_texture:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *         cdef unsigned char pixel[4]
 */
      goto __pyx_L12_break;

      /* "renpy/angle/gldraw.pyx":1106
 *             self.draw_transformed(what, clip, 0, 0, 1.0, 1.0, reverse, renpy.config.nearest_neighbor, False)
 * 
 *             if not self.did_render_to_texture:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
    }
  }
  __pyx_L12_break:;

  /* "renpy/angle/gldraw.pyx":1111
 *         cdef unsigned char pixel[4]
 * 
 *         glReadPixels(0, 0, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, pixel)             # <<<<<<<<<<<<<<
 * 
 *         a = pixel[3]
 */
  __pyx_t_9 = __pyx_f_5renpy_5angle_2gl_glReadPixels(0, 0, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, __pyx_v_pixel); if (unlikely(__pyx_t_9 == 0 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/angle/gldraw.pyx":1113
 *         glReadPixels(0, 0, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, pixel)
 * 
 *         a = pixel[3]             # <<<<<<<<<<<<<<
 * 
 *         what.kill()
 */
  __pyx_v_a = (__pyx_v_pixel[3]);

  /* "renpy/angle/gldraw.pyx":1115
 *         a = pixel[3]
 * 
 *         what.kill()             # <<<<<<<<<<<<<<
 * 
 *         return a
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_what, __pyx_n_s_kill); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (__pyx_t_7) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "renpy/angle/gldraw.pyx":1117
 *         what.kill()
 * 
 *         return a             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_From_unsigned_char(__pyx_v_a); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "renpy/angle/gldraw.pyx":1074
 * 
 * 
 *     def is_pixel_opaque(self, what, x, y):             # <<<<<<<<<<<<<<
 *         """
 *         Returns true if the pixel is not 100% transparent.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.is_pixel_opaque", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_reverse);
  __Pyx_XDECREF(__pyx_v_clip);
  __Pyx_XDECREF(__pyx_v_what);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/angle/gldraw.pyx":1120
 * 
 * 
 *     def get_half(self, what):             # <<<<<<<<<<<<<<
 *         """
 *         Gets a texture grid that's half the size of what..
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_37get_half(PyObject *__pyx_v_self, PyObject *__pyx_v_what); /*proto*/
static char __pyx_doc_5renpy_5angle_6gldraw_6GLDraw_36get_half[] = "\n        Gets a texture grid that's half the size of what..\n        ";
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_37get_half(PyObject *__pyx_v_self, PyObject *__pyx_v_what) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_half (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_36get_half(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self), ((PyObject *)__pyx_v_what));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/angle/gldraw.pyx":1136
 *         height = max(what.height / 2, 1)
 * 
 *         def draw_func(x, y, w, h):             # <<<<<<<<<<<<<<
 * 
 *             glClearColor(0.0, 0.0, 0.0, 1.0)
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_8get_half_1draw_func(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5renpy_5angle_6gldraw_6GLDraw_8get_half_1draw_func = {"draw_func", (PyCFunction)__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_8get_half_1draw_func, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_8get_half_1draw_func(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_x = 0;
  PyObject *__pyx_v_y = 0;
  PyObject *__pyx_v_w = 0;
  PyObject *__pyx_v_h = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw_func (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_w,&__pyx_n_s_h,0};
    PyObject* values[4] = {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  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_x)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("draw_func", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("draw_func", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("draw_func", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "draw_func") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      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);
    }
    __pyx_v_x = values[0];
    __pyx_v_y = values[1];
    __pyx_v_w = values[2];
    __pyx_v_h = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("draw_func", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.get_half.draw_func", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_8get_half_draw_func(__pyx_self, __pyx_v_x, __pyx_v_y, __pyx_v_w, __pyx_v_h);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_8get_half_draw_func(PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_w, PyObject *__pyx_v_h) {
  struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct_2_get_half *__pyx_cur_scope;
  struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct_2_get_half *__pyx_outer_scope;
  PyObject *__pyx_v_clip = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("draw_func", 0);
  __pyx_outer_scope = (struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct_2_get_half *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "renpy/angle/gldraw.pyx":1138
 *         def draw_func(x, y, w, h):
 * 
 *             glClearColor(0.0, 0.0, 0.0, 1.0)             # <<<<<<<<<<<<<<
 *             glClear(GL_COLOR_BUFFER_BIT)
 * 
 */
  __pyx_t_1 = __pyx_f_5renpy_5angle_2gl_glClearColor(0.0, 0.0, 0.0, 1.0); if (unlikely(__pyx_t_1 == 0 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/angle/gldraw.pyx":1139
 * 
 *             glClearColor(0.0, 0.0, 0.0, 1.0)
 *             glClear(GL_COLOR_BUFFER_BIT)             # <<<<<<<<<<<<<<
 * 
 *             draw.clip_mode_rtt(x, y, w, h)
 */
  __pyx_t_1 = __pyx_f_5renpy_5angle_2gl_glClear(GL_COLOR_BUFFER_BIT); if (unlikely(__pyx_t_1 == 0 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/angle/gldraw.pyx":1141
 *             glClear(GL_COLOR_BUFFER_BIT)
 * 
 *             draw.clip_mode_rtt(x, y, w, h)             # <<<<<<<<<<<<<<
 * 
 *             clip = (0, 0, width, height)
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_draw)) { __Pyx_RaiseClosureNameError("draw"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_draw), __pyx_n_s_clip_mode_rtt); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  __pyx_t_6 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (__pyx_t_4) {
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
  }
  __Pyx_INCREF(__pyx_v_x);
  __Pyx_GIVEREF(__pyx_v_x);
  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_x);
  __Pyx_INCREF(__pyx_v_y);
  __Pyx_GIVEREF(__pyx_v_y);
  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_y);
  __Pyx_INCREF(__pyx_v_w);
  __Pyx_GIVEREF(__pyx_v_w);
  PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_w);
  __Pyx_INCREF(__pyx_v_h);
  __Pyx_GIVEREF(__pyx_v_h);
  PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_5, __pyx_v_h);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "renpy/angle/gldraw.pyx":1143
 *             draw.clip_mode_rtt(x, y, w, h)
 * 
 *             clip = (0, 0, width, height)             # <<<<<<<<<<<<<<
 * 
 *             draw.draw_transformed(what, clip, 0, 0, 1.0, 1.0, reverse, renpy.config.nearest_neighbor, False)
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_width)) { __Pyx_RaiseClosureNameError("width"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (unlikely(!__pyx_cur_scope->__pyx_v_height)) { __Pyx_RaiseClosureNameError("height"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_0);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_width);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_width);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_cur_scope->__pyx_v_width);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_height);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_height);
  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_cur_scope->__pyx_v_height);
  __pyx_v_clip = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "renpy/angle/gldraw.pyx":1145
 *             clip = (0, 0, width, height)
 * 
 *             draw.draw_transformed(what, clip, 0, 0, 1.0, 1.0, reverse, renpy.config.nearest_neighbor, False)             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(what, render.Render):
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_draw)) { __Pyx_RaiseClosureNameError("draw"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (unlikely(!__pyx_cur_scope->__pyx_v_what)) { __Pyx_RaiseClosureNameError("what"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  __pyx_t_2 = __pyx_cur_scope->__pyx_v_what;
  __Pyx_INCREF(__pyx_t_2);
  if (unlikely(!__pyx_cur_scope->__pyx_v_reverse)) { __Pyx_RaiseClosureNameError("reverse"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  if (!(likely(((__pyx_cur_scope->__pyx_v_reverse) == Py_None) || likely(__Pyx_TypeTest(__pyx_cur_scope->__pyx_v_reverse, __pyx_ptype_5renpy_7display_6render_Matrix2D))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __pyx_cur_scope->__pyx_v_reverse;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_config); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_nearest_neighbor); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_1 = ((struct __pyx_vtabstruct_5renpy_5angle_6gldraw_GLDraw *)__pyx_cur_scope->__pyx_v_draw->__pyx_vtab)->draw_transformed(__pyx_cur_scope->__pyx_v_draw, __pyx_t_2, __pyx_v_clip, 0.0, 0.0, 1.0, 1.0, ((struct __pyx_obj_5renpy_7display_6render_Matrix2D *)__pyx_t_3), __pyx_t_7, 0, 0); if (unlikely(__pyx_t_1 == 1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "renpy/angle/gldraw.pyx":1136
 *         height = max(what.height / 2, 1)
 * 
 *         def draw_func(x, y, w, h):             # <<<<<<<<<<<<<<
 * 
 *             glClearColor(0.0, 0.0, 0.0, 1.0)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.get_half.draw_func", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_clip);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/angle/gldraw.pyx":1120
 * 
 * 
 *     def get_half(self, what):             # <<<<<<<<<<<<<<
 *         """
 *         Gets a texture grid that's half the size of what..
 */

static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_36get_half(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_what) {
  struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct_2_get_half *__pyx_cur_scope;
  PyObject *__pyx_v_draw_func = 0;
  PyObject *__pyx_v_rv = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  long __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_half", 0);
  __pyx_cur_scope = (struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct_2_get_half *)__pyx_tp_new_5renpy_5angle_6gldraw___pyx_scope_struct_2_get_half(__pyx_ptype_5renpy_5angle_6gldraw___pyx_scope_struct_2_get_half, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_what = __pyx_v_what;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_what);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_what);

  /* "renpy/angle/gldraw.pyx":1126
 *         # Used to work around a bug in cython where self was not getting
 *         # the right type when being assigned to the closure.
 *         cdef GLDraw draw = self             # <<<<<<<<<<<<<<
 * 
 *         if what.half_cache:
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __pyx_cur_scope->__pyx_v_draw = __pyx_v_self;

  /* "renpy/angle/gldraw.pyx":1128
 *         cdef GLDraw draw = self
 * 
 *         if what.half_cache:             # <<<<<<<<<<<<<<
 *             return what.half_cache
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_what, __pyx_n_s_half_cache); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "renpy/angle/gldraw.pyx":1129
 * 
 *         if what.half_cache:
 *             return what.half_cache             # <<<<<<<<<<<<<<
 * 
 *         reverse = renpy.display.render.Matrix2D(0.5, 0, 0, .5)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_what, __pyx_n_s_half_cache); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "renpy/angle/gldraw.pyx":1128
 *         cdef GLDraw draw = self
 * 
 *         if what.half_cache:             # <<<<<<<<<<<<<<
 *             return what.half_cache
 * 
 */
  }

  /* "renpy/angle/gldraw.pyx":1131
 *             return what.half_cache
 * 
 *         reverse = renpy.display.render.Matrix2D(0.5, 0, 0, .5)             # <<<<<<<<<<<<<<
 * 
 *         width = max(what.width / 2, 1)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_display); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_render); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Matrix2D); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_reverse = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "renpy/angle/gldraw.pyx":1133
 *         reverse = renpy.display.render.Matrix2D(0.5, 0, 0, .5)
 * 
 *         width = max(what.width / 2, 1)             # <<<<<<<<<<<<<<
 *         height = max(what.height / 2, 1)
 * 
 */
  __pyx_t_4 = 1;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_what, __pyx_n_s_width); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_int_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__pyx_t_2) {
    __pyx_t_6 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = __pyx_t_6;
    __pyx_t_6 = 0;
  } else {
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __pyx_t_1;
  __Pyx_INCREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_width = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "renpy/angle/gldraw.pyx":1134
 * 
 *         width = max(what.width / 2, 1)
 *         height = max(what.height / 2, 1)             # <<<<<<<<<<<<<<
 * 
 *         def draw_func(x, y, w, h):
 */
  __pyx_t_4 = 1;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_what, __pyx_n_s_height); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_int_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_6 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_2) {
    __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __pyx_t_5;
    __pyx_t_5 = 0;
  } else {
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_3 = __pyx_t_1;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_height = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "renpy/angle/gldraw.pyx":1136
 *         height = max(what.height / 2, 1)
 * 
 *         def draw_func(x, y, w, h):             # <<<<<<<<<<<<<<
 * 
 *             glClearColor(0.0, 0.0, 0.0, 1.0)
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5renpy_5angle_6gldraw_6GLDraw_8get_half_1draw_func, 0, __pyx_n_s_get_half_locals_draw_func, ((PyObject*)__pyx_cur_scope), __pyx_n_s_renpy_angle_gldraw, __pyx_d, ((PyObject *)__pyx_codeobj__37)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_draw_func = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "renpy/angle/gldraw.pyx":1147
 *             draw.draw_transformed(what, clip, 0, 0, 1.0, 1.0, reverse, renpy.config.nearest_neighbor, False)
 * 
 *         if isinstance(what, render.Render):             # <<<<<<<<<<<<<<
 *             what.is_opaque()
 * 
 */
  __pyx_t_1 = __pyx_cur_scope->__pyx_v_what;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_t_1, __pyx_ptype_5renpy_7display_6render_Render); 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_7 = (__pyx_t_2 != 0);
  if (__pyx_t_7) {

    /* "renpy/angle/gldraw.pyx":1148
 * 
 *         if isinstance(what, render.Render):
 *             what.is_opaque()             # <<<<<<<<<<<<<<
 * 
 *         rv = gltexture.texture_grid_from_drawing(width, height, draw_func, self.rtt, self.environ)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_what, __pyx_n_s_is_opaque); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_5) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "renpy/angle/gldraw.pyx":1147
 *             draw.draw_transformed(what, clip, 0, 0, 1.0, 1.0, reverse, renpy.config.nearest_neighbor, False)
 * 
 *         if isinstance(what, render.Render):             # <<<<<<<<<<<<<<
 *             what.is_opaque()
 * 
 */
  }

  /* "renpy/angle/gldraw.pyx":1150
 *             what.is_opaque()
 * 
 *         rv = gltexture.texture_grid_from_drawing(width, height, draw_func, self.rtt, self.environ)             # <<<<<<<<<<<<<<
 * 
 *         what.half_cache = rv
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gltexture); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_texture_grid_from_drawing); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_8 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_8 = 1;
    }
  }
  __pyx_t_6 = PyTuple_New(5+__pyx_t_8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (__pyx_t_3) {
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_width);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_width);
  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_cur_scope->__pyx_v_width);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_height);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_height);
  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_cur_scope->__pyx_v_height);
  __Pyx_INCREF(__pyx_v_draw_func);
  __Pyx_GIVEREF(__pyx_v_draw_func);
  PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_draw_func);
  __Pyx_INCREF(__pyx_v_self->rtt);
  __Pyx_GIVEREF(__pyx_v_self->rtt);
  PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_8, __pyx_v_self->rtt);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->environ));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->environ));
  PyTuple_SET_ITEM(__pyx_t_6, 4+__pyx_t_8, ((PyObject *)__pyx_v_self->environ));
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_rv = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "renpy/angle/gldraw.pyx":1152
 *         rv = gltexture.texture_grid_from_drawing(width, height, draw_func, self.rtt, self.environ)
 * 
 *         what.half_cache = rv             # <<<<<<<<<<<<<<
 * 
 *         return rv
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_what, __pyx_n_s_half_cache, __pyx_v_rv) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/angle/gldraw.pyx":1154
 *         what.half_cache = rv
 * 
 *         return rv             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_rv);
  __pyx_r = __pyx_v_rv;
  goto __pyx_L0;

  /* "renpy/angle/gldraw.pyx":1120
 * 
 * 
 *     def get_half(self, what):             # <<<<<<<<<<<<<<
 *         """
 *         Gets a texture grid that's half the size of what..
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.get_half", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_draw_func);
  __Pyx_XDECREF(__pyx_v_rv);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/angle/gldraw.pyx":1157
 * 
 * 
 *     def translate_point(self, x, y):             # <<<<<<<<<<<<<<
 *         """
 *         Translates (x, y) from physical to virtual coordinates.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_39translate_point(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5renpy_5angle_6gldraw_6GLDraw_38translate_point[] = "\n        Translates (x, y) from physical to virtual coordinates.\n        ";
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_39translate_point(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_x = 0;
  PyObject *__pyx_v_y = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("translate_point (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0};
    PyObject* values[2] = {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  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_x)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("translate_point", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "translate_point") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_x = values[0];
    __pyx_v_y = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("translate_point", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.translate_point", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_38translate_point(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self), __pyx_v_x, __pyx_v_y);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_38translate_point(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y) {
  PyObject *__pyx_v_pw = NULL;
  PyObject *__pyx_v_ph = NULL;
  PyObject *__pyx_v_vw = NULL;
  PyObject *__pyx_v_vh = NULL;
  PyObject *__pyx_v_vx = NULL;
  PyObject *__pyx_v_vy = NULL;
  PyObject *__pyx_v_vbw = NULL;
  PyObject *__pyx_v_vbh = NULL;
  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 = NULL;
  long __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("translate_point", 0);
  __Pyx_INCREF(__pyx_v_x);
  __Pyx_INCREF(__pyx_v_y);

  /* "renpy/angle/gldraw.pyx":1163
 * 
 *         # Screen sizes.
 *         pw, ph = self.physical_size             # <<<<<<<<<<<<<<
 *         vw, vh = self.virtual_size
 *         vx, vy, vbw, vbh = self.virtual_box
 */
  __pyx_t_1 = __pyx_v_self->physical_size;
  __Pyx_INCREF(__pyx_t_1);
  if (likely(__pyx_t_1 != Py_None)) {
    PyObject* sequence = __pyx_t_1;
    #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 = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
    __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_pw = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_ph = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "renpy/angle/gldraw.pyx":1164
 *         # Screen sizes.
 *         pw, ph = self.physical_size
 *         vw, vh = self.virtual_size             # <<<<<<<<<<<<<<
 *         vx, vy, vbw, vbh = self.virtual_box
 * 
 */
  __pyx_t_1 = __pyx_v_self->virtual_size;
  __Pyx_INCREF(__pyx_t_1);
  if (likely(__pyx_t_1 != Py_None)) {
    PyObject* sequence = __pyx_t_1;
    #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 = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
    __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_vw = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_vh = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "renpy/angle/gldraw.pyx":1165
 *         pw, ph = self.physical_size
 *         vw, vh = self.virtual_size
 *         vx, vy, vbw, vbh = self.virtual_box             # <<<<<<<<<<<<<<
 * 
 *         # Translate to fractional screen.
 */
  __pyx_t_1 = __pyx_v_self->virtual_box;
  __Pyx_INCREF(__pyx_t_1);
  if (likely(__pyx_t_1 != Py_None)) {
    PyObject* sequence = __pyx_t_1;
    #if CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 4)) {
      if (size > 4) __Pyx_RaiseTooManyValuesError(4);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
    __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); 
    __pyx_t_5 = PyTuple_GET_ITEM(sequence, 3); 
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_5);
    #else
    {
      Py_ssize_t i;
      PyObject** temps[4] = {&__pyx_t_2,&__pyx_t_3,&__pyx_t_4,&__pyx_t_5};
      for (i=0; i < 4; i++) {
        PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(item);
        *(temps[i]) = item;
      }
    }
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_vx = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_vy = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_vbw = __pyx_t_4;
  __pyx_t_4 = 0;
  __pyx_v_vbh = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "renpy/angle/gldraw.pyx":1168
 * 
 *         # Translate to fractional screen.
 *         x = 1.0 * x / pw             # <<<<<<<<<<<<<<
 *         y = 1.0 * y / ph
 * 
 */
  __pyx_t_1 = PyNumber_Multiply(__pyx_float_1_0, __pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_v_pw); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_5);
  __pyx_t_5 = 0;

  /* "renpy/angle/gldraw.pyx":1169
 *         # Translate to fractional screen.
 *         x = 1.0 * x / pw
 *         y = 1.0 * y / ph             # <<<<<<<<<<<<<<
 * 
 *         # Translate to virtual size.
 */
  __pyx_t_5 = PyNumber_Multiply(__pyx_float_1_0, __pyx_v_y); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_5, __pyx_v_ph); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF_SET(__pyx_v_y, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "renpy/angle/gldraw.pyx":1172
 * 
 *         # Translate to virtual size.
 *         x = vx + vbw * x             # <<<<<<<<<<<<<<
 *         y = vy + vbh * y
 * 
 */
  __pyx_t_1 = PyNumber_Multiply(__pyx_v_vbw, __pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyNumber_Add(__pyx_v_vx, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_5);
  __pyx_t_5 = 0;

  /* "renpy/angle/gldraw.pyx":1173
 *         # Translate to virtual size.
 *         x = vx + vbw * x
 *         y = vy + vbh * y             # <<<<<<<<<<<<<<
 * 
 *         x = int(x)
 */
  __pyx_t_5 = PyNumber_Multiply(__pyx_v_vbh, __pyx_v_y); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = PyNumber_Add(__pyx_v_vy, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF_SET(__pyx_v_y, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "renpy/angle/gldraw.pyx":1175
 *         y = vy + vbh * y
 * 
 *         x = int(x)             # <<<<<<<<<<<<<<
 *         y = int(y)
 * 
 */
  __pyx_t_1 = PyNumber_Int(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "renpy/angle/gldraw.pyx":1176
 * 
 *         x = int(x)
 *         y = int(y)             # <<<<<<<<<<<<<<
 * 
 *         x = max(0, x)
 */
  __pyx_t_1 = PyNumber_Int(__pyx_v_y); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_y, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "renpy/angle/gldraw.pyx":1178
 *         y = int(y)
 * 
 *         x = max(0, x)             # <<<<<<<<<<<<<<
 *         x = min(vw, x)
 *         y = max(0, y)
 */
  __Pyx_INCREF(__pyx_v_x);
  __pyx_t_1 = __pyx_v_x;
  __pyx_t_6 = 0;
  __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_7) {
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_5 = __pyx_t_1;
  } else {
    __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __pyx_t_5;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "renpy/angle/gldraw.pyx":1179
 * 
 *         x = max(0, x)
 *         x = min(vw, x)             # <<<<<<<<<<<<<<
 *         y = max(0, y)
 *         y = min(vh, y)
 */
  __Pyx_INCREF(__pyx_v_x);
  __pyx_t_1 = __pyx_v_x;
  __Pyx_INCREF(__pyx_v_vw);
  __pyx_t_5 = __pyx_v_vw;
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_7) {
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_3 = __pyx_t_1;
  } else {
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_3 = __pyx_t_5;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "renpy/angle/gldraw.pyx":1180
 *         x = max(0, x)
 *         x = min(vw, x)
 *         y = max(0, y)             # <<<<<<<<<<<<<<
 *         y = min(vh, y)
 * 
 */
  __Pyx_INCREF(__pyx_v_y);
  __pyx_t_1 = __pyx_v_y;
  __pyx_t_6 = 0;
  __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_7) {
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_3 = __pyx_t_1;
  } else {
    __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __pyx_t_4;
    __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __pyx_t_3;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF_SET(__pyx_v_y, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "renpy/angle/gldraw.pyx":1181
 *         x = min(vw, x)
 *         y = max(0, y)
 *         y = min(vh, y)             # <<<<<<<<<<<<<<
 * 
 *         return x, y
 */
  __Pyx_INCREF(__pyx_v_y);
  __pyx_t_1 = __pyx_v_y;
  __Pyx_INCREF(__pyx_v_vh);
  __pyx_t_3 = __pyx_v_vh;
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_7) {
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_4 = __pyx_t_1;
  } else {
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = __pyx_t_3;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __pyx_t_4;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF_SET(__pyx_v_y, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "renpy/angle/gldraw.pyx":1183
 *         y = min(vh, y)
 * 
 *         return x, y             # <<<<<<<<<<<<<<
 * 
 *     def untranslate_point(self, x, y):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_x);
  __Pyx_GIVEREF(__pyx_v_x);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_x);
  __Pyx_INCREF(__pyx_v_y);
  __Pyx_GIVEREF(__pyx_v_y);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_y);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "renpy/angle/gldraw.pyx":1157
 * 
 * 
 *     def translate_point(self, x, y):             # <<<<<<<<<<<<<<
 *         """
 *         Translates (x, y) from physical to virtual coordinates.
 */

  /* function exit code */
  __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_5);
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.translate_point", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pw);
  __Pyx_XDECREF(__pyx_v_ph);
  __Pyx_XDECREF(__pyx_v_vw);
  __Pyx_XDECREF(__pyx_v_vh);
  __Pyx_XDECREF(__pyx_v_vx);
  __Pyx_XDECREF(__pyx_v_vy);
  __Pyx_XDECREF(__pyx_v_vbw);
  __Pyx_XDECREF(__pyx_v_vbh);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_y);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/angle/gldraw.pyx":1185
 *         return x, y
 * 
 *     def untranslate_point(self, x, y):             # <<<<<<<<<<<<<<
 *         """
 *         Untranslates (x, y) from virtual to physical coordinates.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_41untranslate_point(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5renpy_5angle_6gldraw_6GLDraw_40untranslate_point[] = "\n        Untranslates (x, y) from virtual to physical coordinates.\n        ";
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_41untranslate_point(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_x = 0;
  PyObject *__pyx_v_y = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("untranslate_point (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0};
    PyObject* values[2] = {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  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_x)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("untranslate_point", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1185; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "untranslate_point") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1185; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_x = values[0];
    __pyx_v_y = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("untranslate_point", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1185; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.untranslate_point", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_40untranslate_point(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self), __pyx_v_x, __pyx_v_y);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_40untranslate_point(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y) {
  PyObject *__pyx_v_pw = NULL;
  PyObject *__pyx_v_ph = NULL;
  PyObject *__pyx_v_vx = NULL;
  PyObject *__pyx_v_vy = NULL;
  PyObject *__pyx_v_vbw = NULL;
  PyObject *__pyx_v_vbh = NULL;
  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 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("untranslate_point", 0);
  __Pyx_INCREF(__pyx_v_x);
  __Pyx_INCREF(__pyx_v_y);

  /* "renpy/angle/gldraw.pyx":1191
 * 
 *         # Screen sizes.
 *         pw, ph = self.physical_size             # <<<<<<<<<<<<<<
 *         vx, vy, vbw, vbh = self.virtual_box
 * 
 */
  __pyx_t_1 = __pyx_v_self->physical_size;
  __Pyx_INCREF(__pyx_t_1);
  if (likely(__pyx_t_1 != Py_None)) {
    PyObject* sequence = __pyx_t_1;
    #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 = 1191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
    __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_pw = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_ph = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "renpy/angle/gldraw.pyx":1192
 *         # Screen sizes.
 *         pw, ph = self.physical_size
 *         vx, vy, vbw, vbh = self.virtual_box             # <<<<<<<<<<<<<<
 * 
 *         # Translate from virtual to fractional screen.
 */
  __pyx_t_1 = __pyx_v_self->virtual_box;
  __Pyx_INCREF(__pyx_t_1);
  if (likely(__pyx_t_1 != Py_None)) {
    PyObject* sequence = __pyx_t_1;
    #if CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 4)) {
      if (size > 4) __Pyx_RaiseTooManyValuesError(4);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
    __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); 
    __pyx_t_5 = PyTuple_GET_ITEM(sequence, 3); 
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_5);
    #else
    {
      Py_ssize_t i;
      PyObject** temps[4] = {&__pyx_t_3,&__pyx_t_2,&__pyx_t_4,&__pyx_t_5};
      for (i=0; i < 4; i++) {
        PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(item);
        *(temps[i]) = item;
      }
    }
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_vx = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_vy = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_vbw = __pyx_t_4;
  __pyx_t_4 = 0;
  __pyx_v_vbh = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "renpy/angle/gldraw.pyx":1195
 * 
 *         # Translate from virtual to fractional screen.
 *         x = ( x - vx ) / vbw             # <<<<<<<<<<<<<<
 *         y = ( y - vy ) / vbh
 * 
 */
  __pyx_t_1 = PyNumber_Subtract(__pyx_v_x, __pyx_v_vx); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_v_vbw); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_5);
  __pyx_t_5 = 0;

  /* "renpy/angle/gldraw.pyx":1196
 *         # Translate from virtual to fractional screen.
 *         x = ( x - vx ) / vbw
 *         y = ( y - vy ) / vbh             # <<<<<<<<<<<<<<
 * 
 *         # Translate from fractional screen to physical.
 */
  __pyx_t_5 = PyNumber_Subtract(__pyx_v_y, __pyx_v_vy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_5, __pyx_v_vbh); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF_SET(__pyx_v_y, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "renpy/angle/gldraw.pyx":1199
 * 
 *         # Translate from fractional screen to physical.
 *         x = x * pw             # <<<<<<<<<<<<<<
 *         y = y * ph
 * 
 */
  __pyx_t_1 = PyNumber_Multiply(__pyx_v_x, __pyx_v_pw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "renpy/angle/gldraw.pyx":1200
 *         # Translate from fractional screen to physical.
 *         x = x * pw
 *         y = y * ph             # <<<<<<<<<<<<<<
 * 
 *         x = int(x)
 */
  __pyx_t_1 = PyNumber_Multiply(__pyx_v_y, __pyx_v_ph); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_y, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "renpy/angle/gldraw.pyx":1202
 *         y = y * ph
 * 
 *         x = int(x)             # <<<<<<<<<<<<<<
 *         y = int(y)
 * 
 */
  __pyx_t_1 = PyNumber_Int(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "renpy/angle/gldraw.pyx":1203
 * 
 *         x = int(x)
 *         y = int(y)             # <<<<<<<<<<<<<<
 * 
 *         return x, y
 */
  __pyx_t_1 = PyNumber_Int(__pyx_v_y); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_y, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "renpy/angle/gldraw.pyx":1205
 *         y = int(y)
 * 
 *         return x, y             # <<<<<<<<<<<<<<
 * 
 *     def update_mouse(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_x);
  __Pyx_GIVEREF(__pyx_v_x);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_x);
  __Pyx_INCREF(__pyx_v_y);
  __Pyx_GIVEREF(__pyx_v_y);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_y);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "renpy/angle/gldraw.pyx":1185
 *         return x, y
 * 
 *     def untranslate_point(self, x, y):             # <<<<<<<<<<<<<<
 *         """
 *         Untranslates (x, y) from virtual to physical coordinates.
 */

  /* function exit code */
  __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_5);
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.untranslate_point", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pw);
  __Pyx_XDECREF(__pyx_v_ph);
  __Pyx_XDECREF(__pyx_v_vx);
  __Pyx_XDECREF(__pyx_v_vy);
  __Pyx_XDECREF(__pyx_v_vbw);
  __Pyx_XDECREF(__pyx_v_vbh);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_y);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/angle/gldraw.pyx":1207
 *         return x, y
 * 
 *     def update_mouse(self):             # <<<<<<<<<<<<<<
 *         # The draw routine updates the mouse. There's no need to
 *         # redraw it event-by-event.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_43update_mouse(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_43update_mouse(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("update_mouse (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_42update_mouse(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_42update_mouse(CYTHON_UNUSED struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("update_mouse", 0);

  /* "renpy/angle/gldraw.pyx":1211
 *         # redraw it event-by-event.
 * 
 *         return             # <<<<<<<<<<<<<<
 * 
 *     def mouse_event(self, ev):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  /* "renpy/angle/gldraw.pyx":1207
 *         return x, y
 * 
 *     def update_mouse(self):             # <<<<<<<<<<<<<<
 *         # The draw routine updates the mouse. There's no need to
 *         # redraw it event-by-event.
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/angle/gldraw.pyx":1213
 *         return
 * 
 *     def mouse_event(self, ev):             # <<<<<<<<<<<<<<
 *         x, y = getattr(ev, 'pos', pygame.mouse.get_pos())
 *         return self.translate_point(x, y)
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_45mouse_event(PyObject *__pyx_v_self, PyObject *__pyx_v_ev); /*proto*/
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_45mouse_event(PyObject *__pyx_v_self, PyObject *__pyx_v_ev) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mouse_event (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_44mouse_event(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self), ((PyObject *)__pyx_v_ev));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_44mouse_event(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_ev) {
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_v_y = NULL;
  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 *);
  Py_ssize_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mouse_event", 0);

  /* "renpy/angle/gldraw.pyx":1214
 * 
 *     def mouse_event(self, ev):
 *         x, y = getattr(ev, 'pos', pygame.mouse.get_pos())             # <<<<<<<<<<<<<<
 *         return self.translate_point(x, y)
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_mouse); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get_pos); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetAttr3(__pyx_v_ev, __pyx_n_s_pos, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
    PyObject* sequence = __pyx_t_2;
    #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 = 1214; __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_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __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 = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __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_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), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __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 = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_x = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_y = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "renpy/angle/gldraw.pyx":1215
 *     def mouse_event(self, ev):
 *         x, y = getattr(ev, 'pos', pygame.mouse.get_pos())
 *         return self.translate_point(x, y)             # <<<<<<<<<<<<<<
 * 
 *     def get_mouse_pos(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_translate_point); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_6 = 1;
    }
  }
  __pyx_t_4 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (__pyx_t_1) {
    __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __pyx_t_1 = NULL;
  }
  __Pyx_INCREF(__pyx_v_x);
  __Pyx_GIVEREF(__pyx_v_x);
  PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_6, __pyx_v_x);
  __Pyx_INCREF(__pyx_v_y);
  __Pyx_GIVEREF(__pyx_v_y);
  PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_6, __pyx_v_y);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "renpy/angle/gldraw.pyx":1213
 *         return
 * 
 *     def mouse_event(self, ev):             # <<<<<<<<<<<<<<
 *         x, y = getattr(ev, 'pos', pygame.mouse.get_pos())
 *         return self.translate_point(x, y)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.mouse_event", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_y);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/angle/gldraw.pyx":1217
 *         return self.translate_point(x, y)
 * 
 *     def get_mouse_pos(self):             # <<<<<<<<<<<<<<
 *         x, y = pygame.mouse.get_pos()
 *         return self.translate_point(x, y)
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_47get_mouse_pos(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_47get_mouse_pos(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_mouse_pos (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_46get_mouse_pos(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_46get_mouse_pos(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self) {
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_v_y = NULL;
  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 *);
  Py_ssize_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_mouse_pos", 0);

  /* "renpy/angle/gldraw.pyx":1218
 * 
 *     def get_mouse_pos(self):
 *         x, y = pygame.mouse.get_pos()             # <<<<<<<<<<<<<<
 *         return self.translate_point(x, y)
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_mouse); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get_pos); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    #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 = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __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 = 1; __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), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __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 = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_x = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_y = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "renpy/angle/gldraw.pyx":1219
 *     def get_mouse_pos(self):
 *         x, y = pygame.mouse.get_pos()
 *         return self.translate_point(x, y)             # <<<<<<<<<<<<<<
 * 
 *     def set_mouse_pos(self, x, y):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_translate_point); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_6 = 1;
    }
  }
  __pyx_t_4 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (__pyx_t_2) {
    __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL;
  }
  __Pyx_INCREF(__pyx_v_x);
  __Pyx_GIVEREF(__pyx_v_x);
  PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_6, __pyx_v_x);
  __Pyx_INCREF(__pyx_v_y);
  __Pyx_GIVEREF(__pyx_v_y);
  PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_6, __pyx_v_y);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "renpy/angle/gldraw.pyx":1217
 *         return self.translate_point(x, y)
 * 
 *     def get_mouse_pos(self):             # <<<<<<<<<<<<<<
 *         x, y = pygame.mouse.get_pos()
 *         return self.translate_point(x, y)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.get_mouse_pos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_y);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/angle/gldraw.pyx":1221
 *         return self.translate_point(x, y)
 * 
 *     def set_mouse_pos(self, x, y):             # <<<<<<<<<<<<<<
 *         x, y = self.untranslate_point(x, y)
 *         pygame.mouse.set_pos([x, y])
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_49set_mouse_pos(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_49set_mouse_pos(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_x = 0;
  PyObject *__pyx_v_y = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_mouse_pos (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0};
    PyObject* values[2] = {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  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_x)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_mouse_pos", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1221; __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_mouse_pos") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1221; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_x = values[0];
    __pyx_v_y = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_mouse_pos", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1221; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.set_mouse_pos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_48set_mouse_pos(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self), __pyx_v_x, __pyx_v_y);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_48set_mouse_pos(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_mouse_pos", 0);
  __Pyx_INCREF(__pyx_v_x);
  __Pyx_INCREF(__pyx_v_y);

  /* "renpy/angle/gldraw.pyx":1222
 * 
 *     def set_mouse_pos(self, x, y):
 *         x, y = self.untranslate_point(x, y)             # <<<<<<<<<<<<<<
 *         pygame.mouse.set_pos([x, y])
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_untranslate_point); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_3) {
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_INCREF(__pyx_v_x);
  __Pyx_GIVEREF(__pyx_v_x);
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_x);
  __Pyx_INCREF(__pyx_v_y);
  __Pyx_GIVEREF(__pyx_v_y);
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_y);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    #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 = 1222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_5);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_5 = __pyx_t_6(__pyx_t_3); if (unlikely(!__pyx_t_5)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = NULL;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_unpacking_done:;
  }
  __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_2);
  __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_y, __pyx_t_5);
  __pyx_t_5 = 0;

  /* "renpy/angle/gldraw.pyx":1223
 *     def set_mouse_pos(self, x, y):
 *         x, y = self.untranslate_point(x, y)
 *         pygame.mouse.set_pos([x, y])             # <<<<<<<<<<<<<<
 * 
 *     # Private.
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_mouse); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_set_pos); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_x);
  __Pyx_GIVEREF(__pyx_v_x);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_x);
  __Pyx_INCREF(__pyx_v_y);
  __Pyx_GIVEREF(__pyx_v_y);
  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_v_y);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "renpy/angle/gldraw.pyx":1221
 *         return self.translate_point(x, y)
 * 
 *     def set_mouse_pos(self, x, y):             # <<<<<<<<<<<<<<
 *         x, y = self.untranslate_point(x, y)
 *         pygame.mouse.set_pos([x, y])
 */

  /* function exit code */
  __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_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.set_mouse_pos", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_y);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/angle/gldraw.pyx":1226
 * 
 *     # Private.
 *     def draw_mouse(self):             # <<<<<<<<<<<<<<
 * 
 *         hardware, mx, my, tex = renpy.game.interface.get_mouse_info()
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_51draw_mouse(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_51draw_mouse(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw_mouse (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_50draw_mouse(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_50draw_mouse(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self) {
  PyObject *__pyx_v_hardware = NULL;
  PyObject *__pyx_v_mx = NULL;
  PyObject *__pyx_v_my = NULL;
  PyObject *__pyx_v_tex = NULL;
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_v_y = NULL;
  PyObject *__pyx_v_pw = NULL;
  PyObject *__pyx_v_ph = NULL;
  PyObject *__pyx_v_pbx = NULL;
  PyObject *__pyx_v_pby = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_pbw = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_pbh = NULL;
  PyObject *__pyx_v_xmul = NULL;
  PyObject *__pyx_v_ymul = NULL;
  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 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *(*__pyx_t_7)(PyObject *);
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  double __pyx_t_12;
  double __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("draw_mouse", 0);

  /* "renpy/angle/gldraw.pyx":1228
 *     def draw_mouse(self):
 * 
 *         hardware, mx, my, tex = renpy.game.interface.get_mouse_info()             # <<<<<<<<<<<<<<
 * 
 *         self.mouse_info = (mx, my, tex)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_game); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_interface); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get_mouse_info); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    #if CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 4)) {
      if (size > 4) __Pyx_RaiseTooManyValuesError(4);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __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_4 = PyTuple_GET_ITEM(sequence, 2); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 3); 
    } else {
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 2); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 3); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_5);
    #else
    {
      Py_ssize_t i;
      PyObject** temps[4] = {&__pyx_t_3,&__pyx_t_2,&__pyx_t_4,&__pyx_t_5};
      for (i=0; i < 4; i++) {
        PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(item);
        *(temps[i]) = item;
      }
    }
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    PyObject** temps[4] = {&__pyx_t_3,&__pyx_t_2,&__pyx_t_4,&__pyx_t_5};
    __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
    for (index=0; index < 4; index++) {
      PyObject* item = __pyx_t_7(__pyx_t_6); if (unlikely(!item)) goto __pyx_L3_unpacking_failed;
      __Pyx_GOTREF(item);
      *(temps[index]) = item;
    }
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_7 = NULL;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_hardware = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_mx = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_my = __pyx_t_4;
  __pyx_t_4 = 0;
  __pyx_v_tex = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "renpy/angle/gldraw.pyx":1230
 *         hardware, mx, my, tex = renpy.game.interface.get_mouse_info()
 * 
 *         self.mouse_info = (mx, my, tex)             # <<<<<<<<<<<<<<
 * 
 *         if self.mouse_old_visible != hardware:
 */
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_mx);
  __Pyx_GIVEREF(__pyx_v_mx);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_mx);
  __Pyx_INCREF(__pyx_v_my);
  __Pyx_GIVEREF(__pyx_v_my);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_my);
  __Pyx_INCREF(__pyx_v_tex);
  __Pyx_GIVEREF(__pyx_v_tex);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_tex);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->mouse_info);
  __Pyx_DECREF(__pyx_v_self->mouse_info);
  __pyx_v_self->mouse_info = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "renpy/angle/gldraw.pyx":1232
 *         self.mouse_info = (mx, my, tex)
 * 
 *         if self.mouse_old_visible != hardware:             # <<<<<<<<<<<<<<
 *             pygame.mouse.set_visible(hardware)
 *             self.mouse_old_visible = hardware
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_self->mouse_old_visible, __pyx_v_hardware, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_8) {

    /* "renpy/angle/gldraw.pyx":1233
 * 
 *         if self.mouse_old_visible != hardware:
 *             pygame.mouse.set_visible(hardware)             # <<<<<<<<<<<<<<
 *             self.mouse_old_visible = hardware
 * 
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_mouse); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_set_visible); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_hardware); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_INCREF(__pyx_v_hardware);
      __Pyx_GIVEREF(__pyx_v_hardware);
      PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_v_hardware);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "renpy/angle/gldraw.pyx":1234
 *         if self.mouse_old_visible != hardware:
 *             pygame.mouse.set_visible(hardware)
 *             self.mouse_old_visible = hardware             # <<<<<<<<<<<<<<
 * 
 *         if not tex:
 */
    __Pyx_INCREF(__pyx_v_hardware);
    __Pyx_GIVEREF(__pyx_v_hardware);
    __Pyx_GOTREF(__pyx_v_self->mouse_old_visible);
    __Pyx_DECREF(__pyx_v_self->mouse_old_visible);
    __pyx_v_self->mouse_old_visible = __pyx_v_hardware;

    /* "renpy/angle/gldraw.pyx":1232
 *         self.mouse_info = (mx, my, tex)
 * 
 *         if self.mouse_old_visible != hardware:             # <<<<<<<<<<<<<<
 *             pygame.mouse.set_visible(hardware)
 *             self.mouse_old_visible = hardware
 */
  }

  /* "renpy/angle/gldraw.pyx":1236
 *             self.mouse_old_visible = hardware
 * 
 *         if not tex:             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_tex); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_9 = ((!__pyx_t_8) != 0);
  if (__pyx_t_9) {

    /* "renpy/angle/gldraw.pyx":1237
 * 
 *         if not tex:
 *             return             # <<<<<<<<<<<<<<
 * 
 *         x, y = pygame.mouse.get_pos()
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "renpy/angle/gldraw.pyx":1236
 *             self.mouse_old_visible = hardware
 * 
 *         if not tex:             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  }

  /* "renpy/angle/gldraw.pyx":1239
 *             return
 * 
 *         x, y = pygame.mouse.get_pos()             # <<<<<<<<<<<<<<
 * 
 *         x -= mx
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_mouse); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get_pos); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    #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 = 1239; __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_2 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_7 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_5 = __pyx_t_7(__pyx_t_4); if (unlikely(!__pyx_t_5)) goto __pyx_L7_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    index = 1; __pyx_t_2 = __pyx_t_7(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L7_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_7 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L8_unpacking_done;
    __pyx_L7_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_7 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L8_unpacking_done:;
  }
  __pyx_v_x = __pyx_t_5;
  __pyx_t_5 = 0;
  __pyx_v_y = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "renpy/angle/gldraw.pyx":1241
 *         x, y = pygame.mouse.get_pos()
 * 
 *         x -= mx             # <<<<<<<<<<<<<<
 *         y -= my
 * 
 */
  __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_v_x, __pyx_v_mx); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "renpy/angle/gldraw.pyx":1242
 * 
 *         x -= mx
 *         y -= my             # <<<<<<<<<<<<<<
 * 
 *         pw, ph = self.physical_size
 */
  __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_v_y, __pyx_v_my); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_y, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "renpy/angle/gldraw.pyx":1244
 *         y -= my
 * 
 *         pw, ph = self.physical_size             # <<<<<<<<<<<<<<
 *         pbx, pby, pbw, pbh = self.physical_box
 * 
 */
  __pyx_t_1 = __pyx_v_self->physical_size;
  __Pyx_INCREF(__pyx_t_1);
  if (likely(__pyx_t_1 != Py_None)) {
    PyObject* sequence = __pyx_t_1;
    #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 = 1244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
    __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_5);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_pw = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_ph = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "renpy/angle/gldraw.pyx":1245
 * 
 *         pw, ph = self.physical_size
 *         pbx, pby, pbw, pbh = self.physical_box             # <<<<<<<<<<<<<<
 * 
 *         xmul = 1.0 * self.drawable_size[0] / self.physical_size[0]
 */
  __pyx_t_1 = __pyx_v_self->physical_box;
  __Pyx_INCREF(__pyx_t_1);
  if (likely(__pyx_t_1 != Py_None)) {
    PyObject* sequence = __pyx_t_1;
    #if CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 4)) {
      if (size > 4) __Pyx_RaiseTooManyValuesError(4);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
    __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); 
    __pyx_t_3 = PyTuple_GET_ITEM(sequence, 3); 
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_3);
    #else
    {
      Py_ssize_t i;
      PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_2,&__pyx_t_4,&__pyx_t_3};
      for (i=0; i < 4; i++) {
        PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(item);
        *(temps[i]) = item;
      }
    }
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_pbx = __pyx_t_5;
  __pyx_t_5 = 0;
  __pyx_v_pby = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_pbw = __pyx_t_4;
  __pyx_t_4 = 0;
  __pyx_v_pbh = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "renpy/angle/gldraw.pyx":1247
 *         pbx, pby, pbw, pbh = self.physical_box
 * 
 *         xmul = 1.0 * self.drawable_size[0] / self.physical_size[0]             # <<<<<<<<<<<<<<
 *         ymul = 1.0 * self.drawable_size[1] / self.physical_size[1]
 * 
 */
  if (unlikely(__pyx_v_self->drawable_size == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_self->drawable_size, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyNumber_Multiply(__pyx_float_1_0, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_v_self->physical_size == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_self->physical_size, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_xmul = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "renpy/angle/gldraw.pyx":1248
 * 
 *         xmul = 1.0 * self.drawable_size[0] / self.physical_size[0]
 *         ymul = 1.0 * self.drawable_size[1] / self.physical_size[1]             # <<<<<<<<<<<<<<
 * 
 *         self.environ.viewport(0, 0, xmul * pw, ymul * ph)
 */
  if (unlikely(__pyx_v_self->drawable_size == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_self->drawable_size, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1248; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyNumber_Multiply(__pyx_float_1_0, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(__pyx_v_self->physical_size == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_self->physical_size, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1248; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_ymul = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "renpy/angle/gldraw.pyx":1250
 *         ymul = 1.0 * self.drawable_size[1] / self.physical_size[1]
 * 
 *         self.environ.viewport(0, 0, xmul * pw, ymul * ph)             # <<<<<<<<<<<<<<
 *         self.environ.ortho(0, pw, ph, 0, -1.0, 1.0)
 * 
 */
  __pyx_t_3 = PyNumber_Multiply(__pyx_v_xmul, __pyx_v_pw); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Multiply(__pyx_v_ymul, __pyx_v_ph); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  ((struct __pyx_vtabstruct_5renpy_5angle_6gldraw_Environ *)__pyx_v_self->environ->__pyx_vtab)->viewport(__pyx_v_self->environ, 0, 0, __pyx_t_10, __pyx_t_11);

  /* "renpy/angle/gldraw.pyx":1251
 * 
 *         self.environ.viewport(0, 0, xmul * pw, ymul * ph)
 *         self.environ.ortho(0, pw, ph, 0, -1.0, 1.0)             # <<<<<<<<<<<<<<
 * 
 *         self.clip_mode_screen()
 */
  __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_v_pw); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_v_ph); if (unlikely((__pyx_t_13 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  ((struct __pyx_vtabstruct_5renpy_5angle_6gldraw_Environ *)__pyx_v_self->environ->__pyx_vtab)->ortho(__pyx_v_self->environ, 0.0, __pyx_t_12, __pyx_t_13, 0.0, -1.0, 1.0);

  /* "renpy/angle/gldraw.pyx":1253
 *         self.environ.ortho(0, pw, ph, 0, -1.0, 1.0)
 * 
 *         self.clip_mode_screen()             # <<<<<<<<<<<<<<
 *         self.set_clip((-pbx, -pby, pw, ph))
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_clip_mode_screen); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (__pyx_t_1) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "renpy/angle/gldraw.pyx":1254
 * 
 *         self.clip_mode_screen()
 *         self.set_clip((-pbx, -pby, pw, ph))             # <<<<<<<<<<<<<<
 * 
 *         gltexture.blit(
 */
  __pyx_t_3 = PyNumber_Negative(__pyx_v_pbx); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyNumber_Negative(__pyx_v_pby); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
  __Pyx_INCREF(__pyx_v_pw);
  __Pyx_GIVEREF(__pyx_v_pw);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_pw);
  __Pyx_INCREF(__pyx_v_ph);
  __Pyx_GIVEREF(__pyx_v_ph);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_ph);
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = ((struct __pyx_vtabstruct_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self->__pyx_vtab)->set_clip(__pyx_v_self, ((PyObject*)__pyx_t_1), 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "renpy/angle/gldraw.pyx":1257
 * 
 *         gltexture.blit(
 *             tex,             # <<<<<<<<<<<<<<
 *             x,
 *             y,
 */
  if (!(likely(((__pyx_v_tex) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_tex, __pyx_ptype_5renpy_5angle_9gltexture_TextureGrid))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/angle/gldraw.pyx":1258
 *         gltexture.blit(
 *             tex,
 *             x,             # <<<<<<<<<<<<<<
 *             y,
 *             IDENTITY,
 */
  __pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_v_x); if (unlikely((__pyx_t_13 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/angle/gldraw.pyx":1259
 *             tex,
 *             x,
 *             y,             # <<<<<<<<<<<<<<
 *             IDENTITY,
 *             1.0,
 */
  __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_v_y); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/angle/gldraw.pyx":1260
 *             x,
 *             y,
 *             IDENTITY,             # <<<<<<<<<<<<<<
 *             1.0,
 *             1.0,
 */
  if (!(likely(((__pyx_v_5renpy_5angle_6gldraw_IDENTITY) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_5renpy_5angle_6gldraw_IDENTITY, __pyx_ptype_5renpy_7display_6render_Matrix2D))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = __pyx_v_5renpy_5angle_6gldraw_IDENTITY;
  __Pyx_INCREF(__pyx_t_4);

  /* "renpy/angle/gldraw.pyx":1263
 *             1.0,
 *             1.0,
 *             self.environ,             # <<<<<<<<<<<<<<
 *             False)
 * 
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->environ);
  __Pyx_INCREF(__pyx_t_1);

  /* "renpy/angle/gldraw.pyx":1256
 *         self.set_clip((-pbx, -pby, pw, ph))
 * 
 *         gltexture.blit(             # <<<<<<<<<<<<<<
 *             tex,
 *             x,
 */
  __pyx_t_3 = __pyx_f_5renpy_5angle_9gltexture_blit(((struct __pyx_obj_5renpy_5angle_9gltexture_TextureGrid *)__pyx_v_tex), __pyx_t_13, __pyx_t_12, ((struct __pyx_obj_5renpy_7display_6render_Matrix2D *)__pyx_t_4), 1.0, 1.0, ((struct __pyx_obj_5renpy_5angle_6gldraw_Environ *)__pyx_t_1), 0, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "renpy/angle/gldraw.pyx":1226
 * 
 *     # Private.
 *     def draw_mouse(self):             # <<<<<<<<<<<<<<
 * 
 *         hardware, mx, my, tex = renpy.game.interface.get_mouse_info()
 */

  /* function exit code */
  __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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.draw_mouse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_hardware);
  __Pyx_XDECREF(__pyx_v_mx);
  __Pyx_XDECREF(__pyx_v_my);
  __Pyx_XDECREF(__pyx_v_tex);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_y);
  __Pyx_XDECREF(__pyx_v_pw);
  __Pyx_XDECREF(__pyx_v_ph);
  __Pyx_XDECREF(__pyx_v_pbx);
  __Pyx_XDECREF(__pyx_v_pby);
  __Pyx_XDECREF(__pyx_v_pbw);
  __Pyx_XDECREF(__pyx_v_pbh);
  __Pyx_XDECREF(__pyx_v_xmul);
  __Pyx_XDECREF(__pyx_v_ymul);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/angle/gldraw.pyx":1266
 *             False)
 * 
 *     def screenshot(self, surftree, fullscreen_video):             # <<<<<<<<<<<<<<
 *         cdef unsigned char *pixels
 *         cdef SDL_Surface *surf
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_53screenshot(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_53screenshot(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_surftree = 0;
  PyObject *__pyx_v_fullscreen_video = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("screenshot (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_surftree,&__pyx_n_s_fullscreen_video,0};
    PyObject* values[2] = {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  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_surftree)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fullscreen_video)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("screenshot", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1266; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "screenshot") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1266; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_surftree = values[0];
    __pyx_v_fullscreen_video = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("screenshot", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1266; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.screenshot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_52screenshot(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self), __pyx_v_surftree, __pyx_v_fullscreen_video);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_52screenshot(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_surftree, PyObject *__pyx_v_fullscreen_video) {
  unsigned char *__pyx_v_pixels;
  SDL_Surface *__pyx_v_surf;
  unsigned char *__pyx_v_raw_pixels;
  unsigned char *__pyx_v_rpp;
  int __pyx_v_x;
  CYTHON_UNUSED int __pyx_v_y;
  int __pyx_v_pitch;
  PyObject *__pyx_v_full = NULL;
  PyObject *__pyx_v_px = NULL;
  PyObject *__pyx_v_py = NULL;
  PyObject *__pyx_v_pw = NULL;
  PyObject *__pyx_v_ph = NULL;
  PyObject *__pyx_v_xmul = NULL;
  PyObject *__pyx_v_ymul = NULL;
  PyObject *__pyx_v_rv = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  long __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("screenshot", 0);

  /* "renpy/angle/gldraw.pyx":1275
 * 
 *         # A surface the size of the framebuffer.
 *         full = renpy.display.pgrender.surface_unscaled(self.drawable_size, False)             # <<<<<<<<<<<<<<
 *         surf = PySurface_AsSurface(full)
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_display); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_pgrender); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_surface_unscaled); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_2) {
    __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
  }
  __Pyx_INCREF(__pyx_v_self->drawable_size);
  __Pyx_GIVEREF(__pyx_v_self->drawable_size);
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_self->drawable_size);
  __Pyx_INCREF(Py_False);
  __Pyx_GIVEREF(Py_False);
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, Py_False);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_full = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "renpy/angle/gldraw.pyx":1276
 *         # A surface the size of the framebuffer.
 *         full = renpy.display.pgrender.surface_unscaled(self.drawable_size, False)
 *         surf = PySurface_AsSurface(full)             # <<<<<<<<<<<<<<
 * 
 *         # Create an array that can hold densely-packed pixels.
 */
  __pyx_v_surf = PySurface_AsSurface(__pyx_v_full);

  /* "renpy/angle/gldraw.pyx":1279
 * 
 *         # Create an array that can hold densely-packed pixels.
 *         raw_pixels = <unsigned char *> malloc(surf.w * surf.h * 4)             # <<<<<<<<<<<<<<
 * 
 *         # Draw the last screen to the back buffer.
 */
  __pyx_v_raw_pixels = ((unsigned char *)malloc(((__pyx_v_surf->w * __pyx_v_surf->h) * 4)));

  /* "renpy/angle/gldraw.pyx":1282
 * 
 *         # Draw the last screen to the back buffer.
 *         if surftree is not None:             # <<<<<<<<<<<<<<
 *             self.draw_screen(surftree, fullscreen_video, flip=False)
 *             glFinish()
 */
  __pyx_t_6 = (__pyx_v_surftree != Py_None);
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "renpy/angle/gldraw.pyx":1283
 *         # Draw the last screen to the back buffer.
 *         if surftree is not None:
 *             self.draw_screen(surftree, fullscreen_video, flip=False)             # <<<<<<<<<<<<<<
 *             glFinish()
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_draw_screen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1283; __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 = 1283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_surftree);
    __Pyx_GIVEREF(__pyx_v_surftree);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_surftree);
    __Pyx_INCREF(__pyx_v_fullscreen_video);
    __Pyx_GIVEREF(__pyx_v_fullscreen_video);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_fullscreen_video);
    __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_flip, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "renpy/angle/gldraw.pyx":1284
 *         if surftree is not None:
 *             self.draw_screen(surftree, fullscreen_video, flip=False)
 *             glFinish()             # <<<<<<<<<<<<<<
 * 
 *         # Read the pixels.
 */
    __pyx_t_8 = __pyx_f_5renpy_5angle_2gl_glFinish(); if (unlikely(__pyx_t_8 == 0 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "renpy/angle/gldraw.pyx":1282
 * 
 *         # Draw the last screen to the back buffer.
 *         if surftree is not None:             # <<<<<<<<<<<<<<
 *             self.draw_screen(surftree, fullscreen_video, flip=False)
 *             glFinish()
 */
  }

  /* "renpy/angle/gldraw.pyx":1287
 * 
 *         # Read the pixels.
 *         glReadPixels(             # <<<<<<<<<<<<<<
 *             0,
 *             0,
 */
  __pyx_t_8 = __pyx_f_5renpy_5angle_2gl_glReadPixels(0, 0, __pyx_v_surf->w, __pyx_v_surf->h, GL_RGBA, GL_UNSIGNED_BYTE, __pyx_v_raw_pixels); if (unlikely(__pyx_t_8 == 0 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/angle/gldraw.pyx":1297
 * 
 *         # Copy the pixels from raw_pixels to the surface.
 *         pixels = <unsigned char *> surf.pixels             # <<<<<<<<<<<<<<
 *         pitch = surf.pitch
 *         rpp = raw_pixels
 */
  __pyx_v_pixels = ((unsigned char *)__pyx_v_surf->pixels);

  /* "renpy/angle/gldraw.pyx":1298
 *         # Copy the pixels from raw_pixels to the surface.
 *         pixels = <unsigned char *> surf.pixels
 *         pitch = surf.pitch             # <<<<<<<<<<<<<<
 *         rpp = raw_pixels
 * 
 */
  __pyx_t_8 = __pyx_v_surf->pitch;
  __pyx_v_pitch = __pyx_t_8;

  /* "renpy/angle/gldraw.pyx":1299
 *         pixels = <unsigned char *> surf.pixels
 *         pitch = surf.pitch
 *         rpp = raw_pixels             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __pyx_v_rpp = __pyx_v_raw_pixels;

  /* "renpy/angle/gldraw.pyx":1301
 *         rpp = raw_pixels
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             for y from 0 <= y < surf.h:
 *                 for x from 0 <= x < (surf.w * 4):
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      #endif
      /*try:*/ {

        /* "renpy/angle/gldraw.pyx":1302
 * 
 *         with nogil:
 *             for y from 0 <= y < surf.h:             # <<<<<<<<<<<<<<
 *                 for x from 0 <= x < (surf.w * 4):
 *                     pixels[x] = rpp[x]
 */
        __pyx_t_8 = __pyx_v_surf->h;
        for (__pyx_v_y = 0; __pyx_v_y < __pyx_t_8; __pyx_v_y++) {

          /* "renpy/angle/gldraw.pyx":1303
 *         with nogil:
 *             for y from 0 <= y < surf.h:
 *                 for x from 0 <= x < (surf.w * 4):             # <<<<<<<<<<<<<<
 *                     pixels[x] = rpp[x]
 * 
 */
          __pyx_t_9 = (__pyx_v_surf->w * 4);
          for (__pyx_v_x = 0; __pyx_v_x < __pyx_t_9; __pyx_v_x++) {

            /* "renpy/angle/gldraw.pyx":1304
 *             for y from 0 <= y < surf.h:
 *                 for x from 0 <= x < (surf.w * 4):
 *                     pixels[x] = rpp[x]             # <<<<<<<<<<<<<<
 * 
 *                 pixels += pitch
 */
            (__pyx_v_pixels[__pyx_v_x]) = (__pyx_v_rpp[__pyx_v_x]);
          }

          /* "renpy/angle/gldraw.pyx":1306
 *                     pixels[x] = rpp[x]
 * 
 *                 pixels += pitch             # <<<<<<<<<<<<<<
 *                 rpp += surf.w * 4
 * 
 */
          __pyx_v_pixels = (__pyx_v_pixels + __pyx_v_pitch);

          /* "renpy/angle/gldraw.pyx":1307
 * 
 *                 pixels += pitch
 *                 rpp += surf.w * 4             # <<<<<<<<<<<<<<
 * 
 *         free(raw_pixels)
 */
          __pyx_v_rpp = (__pyx_v_rpp + (__pyx_v_surf->w * 4));
        }
      }

      /* "renpy/angle/gldraw.pyx":1301
 *         rpp = raw_pixels
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             for y from 0 <= y < surf.h:
 *                 for x from 0 <= x < (surf.w * 4):
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L6;
        }
        __pyx_L6:;
      }
  }

  /* "renpy/angle/gldraw.pyx":1309
 *                 rpp += surf.w * 4
 * 
 *         free(raw_pixels)             # <<<<<<<<<<<<<<
 * 
 *         px, py, pw, ph = self.physical_box
 */
  free(__pyx_v_raw_pixels);

  /* "renpy/angle/gldraw.pyx":1311
 *         free(raw_pixels)
 * 
 *         px, py, pw, ph = self.physical_box             # <<<<<<<<<<<<<<
 *         xmul = self.drawable_size[0] / self.physical_size[0]
 *         ymul = self.drawable_size[1] / self.physical_size[1]
 */
  __pyx_t_2 = __pyx_v_self->physical_box;
  __Pyx_INCREF(__pyx_t_2);
  if (likely(__pyx_t_2 != Py_None)) {
    PyObject* sequence = __pyx_t_2;
    #if CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 4)) {
      if (size > 4) __Pyx_RaiseTooManyValuesError(4);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
    __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    __pyx_t_1 = PyTuple_GET_ITEM(sequence, 2); 
    __pyx_t_10 = PyTuple_GET_ITEM(sequence, 3); 
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_10);
    #else
    {
      Py_ssize_t i;
      PyObject** temps[4] = {&__pyx_t_5,&__pyx_t_3,&__pyx_t_1,&__pyx_t_10};
      for (i=0; i < 4; i++) {
        PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(item);
        *(temps[i]) = item;
      }
    }
    #endif
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_px = __pyx_t_5;
  __pyx_t_5 = 0;
  __pyx_v_py = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_pw = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_ph = __pyx_t_10;
  __pyx_t_10 = 0;

  /* "renpy/angle/gldraw.pyx":1312
 * 
 *         px, py, pw, ph = self.physical_box
 *         xmul = self.drawable_size[0] / self.physical_size[0]             # <<<<<<<<<<<<<<
 *         ymul = self.drawable_size[1] / self.physical_size[1]
 * 
 */
  if (unlikely(__pyx_v_self->drawable_size == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_2 = __Pyx_GetItemInt_Tuple(__pyx_v_self->drawable_size, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1312; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(__pyx_v_self->physical_size == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_10 = __Pyx_GetItemInt_Tuple(__pyx_v_self->physical_size, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1312; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_t_10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_v_xmul = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "renpy/angle/gldraw.pyx":1313
 *         px, py, pw, ph = self.physical_box
 *         xmul = self.drawable_size[0] / self.physical_size[0]
 *         ymul = self.drawable_size[1] / self.physical_size[1]             # <<<<<<<<<<<<<<
 * 
 *         # Crop and flip it, since it's upside down.
 */
  if (unlikely(__pyx_v_self->drawable_size == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_self->drawable_size, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(__pyx_v_self->physical_size == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_10 = __Pyx_GetItemInt_Tuple(__pyx_v_self->physical_size, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_v_ymul = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "renpy/angle/gldraw.pyx":1316
 * 
 *         # Crop and flip it, since it's upside down.
 *         rv = full.subsurface((px * xmul, py * ymul, pw * xmul, ph * ymul))             # <<<<<<<<<<<<<<
 *         rv = renpy.display.pgrender.flip_unscaled(rv, False, True)
 * 
 */
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_full, __pyx_n_s_subsurface); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_1 = PyNumber_Multiply(__pyx_v_px, __pyx_v_xmul); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyNumber_Multiply(__pyx_v_py, __pyx_v_ymul); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyNumber_Multiply(__pyx_v_pw, __pyx_v_xmul); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_11 = PyNumber_Multiply(__pyx_v_ph, __pyx_v_ymul); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = PyTuple_New(4); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_11);
  PyTuple_SET_ITEM(__pyx_t_12, 3, __pyx_t_11);
  __pyx_t_1 = 0;
  __pyx_t_3 = 0;
  __pyx_t_5 = 0;
  __pyx_t_11 = 0;
  __pyx_t_11 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_10))) {
    __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10);
    if (likely(__pyx_t_11)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_11);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_10, function);
    }
  }
  if (!__pyx_t_11) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_12); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_11); __pyx_t_11 = NULL;
    __Pyx_GIVEREF(__pyx_t_12);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_12);
    __pyx_t_12 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_v_rv = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "renpy/angle/gldraw.pyx":1317
 *         # Crop and flip it, since it's upside down.
 *         rv = full.subsurface((px * xmul, py * ymul, pw * xmul, ph * ymul))
 *         rv = renpy.display.pgrender.flip_unscaled(rv, False, True)             # <<<<<<<<<<<<<<
 * 
 *         return rv
 */
  __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_display); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_pgrender); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_flip_unscaled); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_10)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_4 = 1;
    }
  }
  __pyx_t_12 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  if (__pyx_t_10) {
    __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); __pyx_t_10 = NULL;
  }
  __Pyx_INCREF(__pyx_v_rv);
  __Pyx_GIVEREF(__pyx_v_rv);
  PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_4, __pyx_v_rv);
  __Pyx_INCREF(Py_False);
  __Pyx_GIVEREF(Py_False);
  PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_4, Py_False);
  __Pyx_INCREF(Py_True);
  __Pyx_GIVEREF(Py_True);
  PyTuple_SET_ITEM(__pyx_t_12, 2+__pyx_t_4, Py_True);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_12, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF_SET(__pyx_v_rv, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "renpy/angle/gldraw.pyx":1319
 *         rv = renpy.display.pgrender.flip_unscaled(rv, False, True)
 * 
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     def free_memory(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_rv);
  __pyx_r = __pyx_v_rv;
  goto __pyx_L0;

  /* "renpy/angle/gldraw.pyx":1266
 *             False)
 * 
 *     def screenshot(self, surftree, fullscreen_video):             # <<<<<<<<<<<<<<
 *         cdef unsigned char *pixels
 *         cdef SDL_Surface *surf
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.screenshot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_full);
  __Pyx_XDECREF(__pyx_v_px);
  __Pyx_XDECREF(__pyx_v_py);
  __Pyx_XDECREF(__pyx_v_pw);
  __Pyx_XDECREF(__pyx_v_ph);
  __Pyx_XDECREF(__pyx_v_xmul);
  __Pyx_XDECREF(__pyx_v_ymul);
  __Pyx_XDECREF(__pyx_v_rv);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/angle/gldraw.pyx":1321
 *         return rv
 * 
 *     def free_memory(self):             # <<<<<<<<<<<<<<
 *         self.texture_cache.clear()
 *         gltexture.dealloc_textures()
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_55free_memory(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_55free_memory(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("free_memory (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_54free_memory(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_54free_memory(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("free_memory", 0);

  /* "renpy/angle/gldraw.pyx":1322
 * 
 *     def free_memory(self):
 *         self.texture_cache.clear()             # <<<<<<<<<<<<<<
 *         gltexture.dealloc_textures()
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->texture_cache, __pyx_n_s_clear); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "renpy/angle/gldraw.pyx":1323
 *     def free_memory(self):
 *         self.texture_cache.clear()
 *         gltexture.dealloc_textures()             # <<<<<<<<<<<<<<
 * 
 *     def event_peek_sleep(self):
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_gltexture); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dealloc_textures); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "renpy/angle/gldraw.pyx":1321
 *         return rv
 * 
 *     def free_memory(self):             # <<<<<<<<<<<<<<
 *         self.texture_cache.clear()
 *         gltexture.dealloc_textures()
 */

  /* function exit code */
  __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_AddTraceback("renpy.angle.gldraw.GLDraw.free_memory", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/angle/gldraw.pyx":1325
 *         gltexture.dealloc_textures()
 * 
 *     def event_peek_sleep(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_57event_peek_sleep(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_57event_peek_sleep(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("event_peek_sleep (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_56event_peek_sleep(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_56event_peek_sleep(CYTHON_UNUSED struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("event_peek_sleep", 0);

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/angle/gldraw.pyx":1328
 *         pass
 * 
 *     def get_physical_size(self):             # <<<<<<<<<<<<<<
 *         x, y = self.physical_size
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_59get_physical_size(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_59get_physical_size(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_physical_size (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_58get_physical_size(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_58get_physical_size(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self) {
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_v_y = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_physical_size", 0);

  /* "renpy/angle/gldraw.pyx":1329
 * 
 *     def get_physical_size(self):
 *         x, y = self.physical_size             # <<<<<<<<<<<<<<
 * 
 *         x = int(x / self.dpi_scale)
 */
  __pyx_t_1 = __pyx_v_self->physical_size;
  __Pyx_INCREF(__pyx_t_1);
  if (likely(__pyx_t_1 != Py_None)) {
    PyObject* sequence = __pyx_t_1;
    #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 = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
    __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_x = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_y = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "renpy/angle/gldraw.pyx":1331
 *         x, y = self.physical_size
 * 
 *         x = int(x / self.dpi_scale)             # <<<<<<<<<<<<<<
 *         y = int(y / self.dpi_scale)
 * 
 */
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->dpi_scale); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_v_x, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Int(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "renpy/angle/gldraw.pyx":1332
 * 
 *         x = int(x / self.dpi_scale)
 *         y = int(y / self.dpi_scale)             # <<<<<<<<<<<<<<
 * 
 *         return (x, y)
 */
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->dpi_scale); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_v_y, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Int(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF_SET(__pyx_v_y, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "renpy/angle/gldraw.pyx":1334
 *         y = int(y / self.dpi_scale)
 * 
 *         return (x, y)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_x);
  __Pyx_GIVEREF(__pyx_v_x);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_x);
  __Pyx_INCREF(__pyx_v_y);
  __Pyx_GIVEREF(__pyx_v_y);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_y);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "renpy/angle/gldraw.pyx":1328
 *         pass
 * 
 *     def get_physical_size(self):             # <<<<<<<<<<<<<<
 *         x, y = self.physical_size
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.get_physical_size", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_y);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/angle/gldraw.pxd":34
 *     cdef bint did_texture_test
 *     cdef Environ environ
 *     cdef public object rtt             # <<<<<<<<<<<<<<
 *     cdef object window
 *     cdef tuple virtual_size
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_3rtt_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_3rtt_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_3rtt___get__(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_3rtt___get__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->rtt);
  __pyx_r = __pyx_v_self->rtt;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_3rtt_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_3rtt_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_3rtt_2__set__(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_3rtt_2__set__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->rtt);
  __Pyx_DECREF(__pyx_v_self->rtt);
  __pyx_v_self->rtt = __pyx_v_value;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_3rtt_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_3rtt_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_3rtt_4__del__(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_3rtt_4__del__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->rtt);
  __Pyx_DECREF(__pyx_v_self->rtt);
  __pyx_v_self->rtt = Py_None;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/angle/gldraw.pxd":37
 *     cdef object window
 *     cdef tuple virtual_size
 *     cdef public tuple physical_size             # <<<<<<<<<<<<<<
 *     cdef public tuple drawable_size
 *     cdef public tuple virtual_box
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_13physical_size_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_13physical_size_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_13physical_size___get__(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_13physical_size___get__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->physical_size);
  __pyx_r = __pyx_v_self->physical_size;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_13physical_size_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_13physical_size_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_13physical_size_2__set__(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_13physical_size_2__set__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyTuple_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->physical_size);
  __Pyx_DECREF(__pyx_v_self->physical_size);
  __pyx_v_self->physical_size = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.physical_size.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_13physical_size_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_13physical_size_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_13physical_size_4__del__(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_13physical_size_4__del__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->physical_size);
  __Pyx_DECREF(__pyx_v_self->physical_size);
  __pyx_v_self->physical_size = ((PyObject*)Py_None);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/angle/gldraw.pxd":38
 *     cdef tuple virtual_size
 *     cdef public tuple physical_size
 *     cdef public tuple drawable_size             # <<<<<<<<<<<<<<
 *     cdef public tuple virtual_box
 *     cdef public tuple physical_box
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_13drawable_size_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_13drawable_size_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_13drawable_size___get__(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_13drawable_size___get__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->drawable_size);
  __pyx_r = __pyx_v_self->drawable_size;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_13drawable_size_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_13drawable_size_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_13drawable_size_2__set__(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_13drawable_size_2__set__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyTuple_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->drawable_size);
  __Pyx_DECREF(__pyx_v_self->drawable_size);
  __pyx_v_self->drawable_size = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.drawable_size.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_13drawable_size_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_13drawable_size_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_13drawable_size_4__del__(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_13drawable_size_4__del__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->drawable_size);
  __Pyx_DECREF(__pyx_v_self->drawable_size);
  __pyx_v_self->drawable_size = ((PyObject*)Py_None);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/angle/gldraw.pxd":39
 *     cdef public tuple physical_size
 *     cdef public tuple drawable_size
 *     cdef public tuple virtual_box             # <<<<<<<<<<<<<<
 *     cdef public tuple physical_box
 *     cdef object mouse_old_visible
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_11virtual_box_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_11virtual_box_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_11virtual_box___get__(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_11virtual_box___get__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->virtual_box);
  __pyx_r = __pyx_v_self->virtual_box;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_11virtual_box_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_11virtual_box_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_11virtual_box_2__set__(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_11virtual_box_2__set__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyTuple_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->virtual_box);
  __Pyx_DECREF(__pyx_v_self->virtual_box);
  __pyx_v_self->virtual_box = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.virtual_box.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_11virtual_box_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_11virtual_box_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_11virtual_box_4__del__(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_11virtual_box_4__del__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->virtual_box);
  __Pyx_DECREF(__pyx_v_self->virtual_box);
  __pyx_v_self->virtual_box = ((PyObject*)Py_None);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/angle/gldraw.pxd":40
 *     cdef public tuple drawable_size
 *     cdef public tuple virtual_box
 *     cdef public tuple physical_box             # <<<<<<<<<<<<<<
 *     cdef object mouse_old_visible
 *     cdef object mouse_info
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_12physical_box_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_12physical_box_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_12physical_box___get__(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_12physical_box___get__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->physical_box);
  __pyx_r = __pyx_v_self->physical_box;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_12physical_box_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_12physical_box_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_12physical_box_2__set__(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_12physical_box_2__set__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyTuple_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->physical_box);
  __Pyx_DECREF(__pyx_v_self->physical_box);
  __pyx_v_self->physical_box = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.physical_box.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_12physical_box_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_12physical_box_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_12physical_box_4__del__(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_12physical_box_4__del__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->physical_box);
  __Pyx_DECREF(__pyx_v_self->physical_box);
  __pyx_v_self->physical_box = ((PyObject*)Py_None);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/angle/gldraw.pxd":46
 *     cdef double last_redraw_time
 *     cdef double redraw_period
 *     cdef public dict info             # <<<<<<<<<<<<<<
 *     cdef object old_fullscreen
 *     cdef public object fullscreen_surface
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_4info_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_4info_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_4info___get__(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_4info___get__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->info);
  __pyx_r = __pyx_v_self->info;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_4info_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_4info_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_4info_2__set__(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_4info_2__set__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyDict_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->info);
  __Pyx_DECREF(__pyx_v_self->info);
  __pyx_v_self->info = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.info.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_4info_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_4info_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_4info_4__del__(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_4info_4__del__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->info);
  __Pyx_DECREF(__pyx_v_self->info);
  __pyx_v_self->info = ((PyObject*)Py_None);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/angle/gldraw.pxd":48
 *     cdef public dict info
 *     cdef object old_fullscreen
 *     cdef public object fullscreen_surface             # <<<<<<<<<<<<<<
 *     cdef object display_info
 *     cdef tuple clip_cache
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_18fullscreen_surface_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_18fullscreen_surface_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_18fullscreen_surface___get__(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_18fullscreen_surface___get__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->fullscreen_surface);
  __pyx_r = __pyx_v_self->fullscreen_surface;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_18fullscreen_surface_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_18fullscreen_surface_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_18fullscreen_surface_2__set__(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_18fullscreen_surface_2__set__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->fullscreen_surface);
  __Pyx_DECREF(__pyx_v_self->fullscreen_surface);
  __pyx_v_self->fullscreen_surface = __pyx_v_value;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_18fullscreen_surface_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_18fullscreen_surface_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_18fullscreen_surface_4__del__(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_18fullscreen_surface_4__del__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->fullscreen_surface);
  __Pyx_DECREF(__pyx_v_self->fullscreen_surface);
  __pyx_v_self->fullscreen_surface = Py_None;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/angle/gldraw.pxd":58
 *     cdef float dpi_scale
 * 
 *     cdef public tuple clip_rtt_box             # <<<<<<<<<<<<<<
 * 
 *     # The number of drawable pixels per virtual pixel.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_12clip_rtt_box_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_12clip_rtt_box_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_12clip_rtt_box___get__(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_12clip_rtt_box___get__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->clip_rtt_box);
  __pyx_r = __pyx_v_self->clip_rtt_box;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_12clip_rtt_box_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_12clip_rtt_box_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_12clip_rtt_box_2__set__(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_12clip_rtt_box_2__set__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyTuple_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->clip_rtt_box);
  __Pyx_DECREF(__pyx_v_self->clip_rtt_box);
  __pyx_v_self->clip_rtt_box = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.clip_rtt_box.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_12clip_rtt_box_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_12clip_rtt_box_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_12clip_rtt_box_4__del__(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_12clip_rtt_box_4__del__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->clip_rtt_box);
  __Pyx_DECREF(__pyx_v_self->clip_rtt_box);
  __pyx_v_self->clip_rtt_box = ((PyObject*)Py_None);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/angle/gldraw.pxd":61
 * 
 *     # The number of drawable pixels per virtual pixel.
 *     cdef public object draw_per_virt             # <<<<<<<<<<<<<<
 * 
 *     # Matrices that transform drawable to virtual, and vice versa.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_13draw_per_virt_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_13draw_per_virt_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_13draw_per_virt___get__(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_13draw_per_virt___get__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->draw_per_virt);
  __pyx_r = __pyx_v_self->draw_per_virt;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_13draw_per_virt_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_13draw_per_virt_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_13draw_per_virt_2__set__(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_13draw_per_virt_2__set__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->draw_per_virt);
  __Pyx_DECREF(__pyx_v_self->draw_per_virt);
  __pyx_v_self->draw_per_virt = __pyx_v_value;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_13draw_per_virt_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_13draw_per_virt_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_13draw_per_virt_4__del__(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_13draw_per_virt_4__del__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->draw_per_virt);
  __Pyx_DECREF(__pyx_v_self->draw_per_virt);
  __pyx_v_self->draw_per_virt = Py_None;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/angle/gldraw.pxd":64
 * 
 *     # Matrices that transform drawable to virtual, and vice versa.
 *     cdef public render.Matrix2D virt_to_draw             # <<<<<<<<<<<<<<
 *     cdef public render.Matrix2D draw_to_virt
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_12virt_to_draw_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_12virt_to_draw_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_12virt_to_draw___get__(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_12virt_to_draw___get__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->virt_to_draw));
  __pyx_r = ((PyObject *)__pyx_v_self->virt_to_draw);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_12virt_to_draw_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_12virt_to_draw_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_12virt_to_draw_2__set__(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_12virt_to_draw_2__set__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5renpy_7display_6render_Matrix2D))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->virt_to_draw);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->virt_to_draw));
  __pyx_v_self->virt_to_draw = ((struct __pyx_obj_5renpy_7display_6render_Matrix2D *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.virt_to_draw.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_12virt_to_draw_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_12virt_to_draw_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_12virt_to_draw_4__del__(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_12virt_to_draw_4__del__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->virt_to_draw);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->virt_to_draw));
  __pyx_v_self->virt_to_draw = ((struct __pyx_obj_5renpy_7display_6render_Matrix2D *)Py_None);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/angle/gldraw.pxd":65
 *     # Matrices that transform drawable to virtual, and vice versa.
 *     cdef public render.Matrix2D virt_to_draw
 *     cdef public render.Matrix2D draw_to_virt             # <<<<<<<<<<<<<<
 * 
 *     cpdef set_clip(GLDraw self, tuple clip)
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_12draw_to_virt_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_12draw_to_virt_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_12draw_to_virt___get__(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_5angle_6gldraw_6GLDraw_12draw_to_virt___get__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->draw_to_virt));
  __pyx_r = ((PyObject *)__pyx_v_self->draw_to_virt);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_12draw_to_virt_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_12draw_to_virt_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_12draw_to_virt_2__set__(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_12draw_to_virt_2__set__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5renpy_7display_6render_Matrix2D))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->draw_to_virt);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->draw_to_virt));
  __pyx_v_self->draw_to_virt = ((struct __pyx_obj_5renpy_7display_6render_Matrix2D *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("renpy.angle.gldraw.GLDraw.draw_to_virt.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_12draw_to_virt_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_12draw_to_virt_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_12draw_to_virt_4__del__(((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_5angle_6gldraw_6GLDraw_12draw_to_virt_4__del__(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->draw_to_virt);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->draw_to_virt));
  __pyx_v_self->draw_to_virt = ((struct __pyx_obj_5renpy_7display_6render_Matrix2D *)Py_None);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/angle/gldraw.pyx":1342
 *     """
 * 
 *     def init(self):             # <<<<<<<<<<<<<<
 *         return
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_3Rtt_1init(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_5renpy_5angle_6gldraw_3Rtt_1init = {"init", (PyCFunction)__pyx_pw_5renpy_5angle_6gldraw_3Rtt_1init, METH_O, 0};
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_3Rtt_1init(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_3Rtt_init(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_5angle_6gldraw_3Rtt_init(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init", 0);

  /* "renpy/angle/gldraw.pyx":1343
 * 
 *     def init(self):
 *         return             # <<<<<<<<<<<<<<
 * 
 *     def deinit(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  /* "renpy/angle/gldraw.pyx":1342
 *     """
 * 
 *     def init(self):             # <<<<<<<<<<<<<<
 *         return
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/angle/gldraw.pyx":1345
 *         return
 * 
 *     def deinit(self):             # <<<<<<<<<<<<<<
 *         return
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_3Rtt_3deinit(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_5renpy_5angle_6gldraw_3Rtt_3deinit = {"deinit", (PyCFunction)__pyx_pw_5renpy_5angle_6gldraw_3Rtt_3deinit, METH_O, 0};
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_3Rtt_3deinit(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("deinit (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_3Rtt_2deinit(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_5angle_6gldraw_3Rtt_2deinit(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("deinit", 0);

  /* "renpy/angle/gldraw.pyx":1346
 * 
 *     def deinit(self):
 *         return             # <<<<<<<<<<<<<<
 * 
 *     def render(self, texture, x, y, w, h, draw_func):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  /* "renpy/angle/gldraw.pyx":1345
 *         return
 * 
 *     def deinit(self):             # <<<<<<<<<<<<<<
 *         return
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/angle/gldraw.pyx":1348
 *         return
 * 
 *     def render(self, texture, x, y, w, h, draw_func):             # <<<<<<<<<<<<<<
 *         """
 *         This function is called to trigger a rendering to a texture.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_3Rtt_5render(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5renpy_5angle_6gldraw_3Rtt_4render[] = "\n        This function is called to trigger a rendering to a texture.\n        `x`, `y`, `w`, and `h` specify the location and dimensions of\n        the sub-image to render to the texture. `draw_func` is called\n        to render the texture.\n        ";
static PyMethodDef __pyx_mdef_5renpy_5angle_6gldraw_3Rtt_5render = {"render", (PyCFunction)__pyx_pw_5renpy_5angle_6gldraw_3Rtt_5render, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5renpy_5angle_6gldraw_3Rtt_4render};
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_3Rtt_5render(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_texture = 0;
  CYTHON_UNUSED PyObject *__pyx_v_x = 0;
  CYTHON_UNUSED PyObject *__pyx_v_y = 0;
  CYTHON_UNUSED PyObject *__pyx_v_w = 0;
  CYTHON_UNUSED PyObject *__pyx_v_h = 0;
  CYTHON_UNUSED PyObject *__pyx_v_draw_func = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("render (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_texture,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_w,&__pyx_n_s_h,&__pyx_n_s_draw_func,0};
    PyObject* values[7] = {0,0,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  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        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_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_texture)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("render", 1, 7, 7, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("render", 1, 7, 7, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("render", 1, 7, 7, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("render", 1, 7, 7, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  5:
        if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("render", 1, 7, 7, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  6:
        if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_draw_func)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("render", 1, 7, 7, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "render") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
      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);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
    }
    __pyx_v_self = values[0];
    __pyx_v_texture = values[1];
    __pyx_v_x = values[2];
    __pyx_v_y = values[3];
    __pyx_v_w = values[4];
    __pyx_v_h = values[5];
    __pyx_v_draw_func = values[6];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("render", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("renpy.angle.gldraw.Rtt.render", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_3Rtt_4render(__pyx_self, __pyx_v_self, __pyx_v_texture, __pyx_v_x, __pyx_v_y, __pyx_v_w, __pyx_v_h, __pyx_v_draw_func);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_5angle_6gldraw_3Rtt_4render(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_texture, CYTHON_UNUSED PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_y, CYTHON_UNUSED PyObject *__pyx_v_w, CYTHON_UNUSED PyObject *__pyx_v_h, CYTHON_UNUSED PyObject *__pyx_v_draw_func) {
  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("render", 0);

  /* "renpy/angle/gldraw.pyx":1356
 *         """
 * 
 *         raise Exception("Not implemented.")             # <<<<<<<<<<<<<<
 * 
 *     def get_size_limit(self, dimension):
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/angle/gldraw.pyx":1348
 *         return
 * 
 *     def render(self, texture, x, y, w, h, draw_func):             # <<<<<<<<<<<<<<
 *         """
 *         This function is called to trigger a rendering to a texture.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("renpy.angle.gldraw.Rtt.render", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/angle/gldraw.pyx":1358
 *         raise Exception("Not implemented.")
 * 
 *     def get_size_limit(self, dimension):             # <<<<<<<<<<<<<<
 *         """
 *         Get the maximum size of a texture.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_3Rtt_7get_size_limit(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5renpy_5angle_6gldraw_3Rtt_6get_size_limit[] = "\n        Get the maximum size of a texture.\n        ";
static PyMethodDef __pyx_mdef_5renpy_5angle_6gldraw_3Rtt_7get_size_limit = {"get_size_limit", (PyCFunction)__pyx_pw_5renpy_5angle_6gldraw_3Rtt_7get_size_limit, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5renpy_5angle_6gldraw_3Rtt_6get_size_limit};
static PyObject *__pyx_pw_5renpy_5angle_6gldraw_3Rtt_7get_size_limit(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_dimension = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_size_limit (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_dimension,0};
    PyObject* values[2] = {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  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_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dimension)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("get_size_limit", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_size_limit") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_dimension = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_size_limit", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("renpy.angle.gldraw.Rtt.get_size_limit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5renpy_5angle_6gldraw_3Rtt_6get_size_limit(__pyx_self, __pyx_v_self, __pyx_v_dimension);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_5angle_6gldraw_3Rtt_6get_size_limit(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_dimension) {
  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("get_size_limit", 0);

  /* "renpy/angle/gldraw.pyx":1363
 *         """
 * 
 *         raise Exception("Not implemented.")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/angle/gldraw.pyx":1358
 *         raise Exception("Not implemented.")
 * 
 *     def get_size_limit(self, dimension):             # <<<<<<<<<<<<<<
 *         """
 *         Get the maximum size of a texture.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("renpy.angle.gldraw.Rtt.get_size_limit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/angle/gldraw.pyx":1368
 * cdef class Environ(object):
 * 
 *     cdef void blit(self):             # <<<<<<<<<<<<<<
 *         """
 *         Set up a normal blit environment. The texture to be blitted should
 */

static void __pyx_f_5renpy_5angle_6gldraw_7Environ_blit(CYTHON_UNUSED struct __pyx_obj_5renpy_5angle_6gldraw_Environ *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("blit", 0);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "renpy/angle/gldraw.pyx":1374
 *         """
 * 
 *     cdef void blend(self, double fraction):             # <<<<<<<<<<<<<<
 *         """
 *         Set up an environment that blends from TEXTURE0 to TEXTURE1.
 */

static void __pyx_f_5renpy_5angle_6gldraw_7Environ_blend(CYTHON_UNUSED struct __pyx_obj_5renpy_5angle_6gldraw_Environ *__pyx_v_self, CYTHON_UNUSED double __pyx_v_fraction) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("blend", 0);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "renpy/angle/gldraw.pyx":1381
 *         """
 * 
 *     cdef void imageblend(self, double fraction, int ramp):             # <<<<<<<<<<<<<<
 *         """
 *         Setup an environment that does an imageblend from TEXTURE1 to TEXTURE2.
 */

static void __pyx_f_5renpy_5angle_6gldraw_7Environ_imageblend(CYTHON_UNUSED struct __pyx_obj_5renpy_5angle_6gldraw_Environ *__pyx_v_self, CYTHON_UNUSED double __pyx_v_fraction, CYTHON_UNUSED int __pyx_v_ramp) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("imageblend", 0);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "renpy/angle/gldraw.pyx":1390
 *         """
 * 
 *     cdef void set_vertex(self, float *vertices):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the array of vertices to be shown. Vertices should be an packed
 */

static void __pyx_f_5renpy_5angle_6gldraw_7Environ_set_vertex(CYTHON_UNUSED struct __pyx_obj_5renpy_5angle_6gldraw_Environ *__pyx_v_self, CYTHON_UNUSED float *__pyx_v_vertices) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_vertex", 0);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "renpy/angle/gldraw.pyx":1396
 *         """
 * 
 *     cdef void set_texture(self, int unit, float *coords):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the array of texture coordinates for unit `unit`.
 */

static void __pyx_f_5renpy_5angle_6gldraw_7Environ_set_texture(CYTHON_UNUSED struct __pyx_obj_5renpy_5angle_6gldraw_Environ *__pyx_v_self, CYTHON_UNUSED int __pyx_v_unit, CYTHON_UNUSED float *__pyx_v_coords) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_texture", 0);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "renpy/angle/gldraw.pyx":1401
 *         """
 * 
 *     cdef void set_color(self, float r, float g, float b, float a):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the color to be shown.
 */

static void __pyx_f_5renpy_5angle_6gldraw_7Environ_set_color(CYTHON_UNUSED struct __pyx_obj_5renpy_5angle_6gldraw_Environ *__pyx_v_self, CYTHON_UNUSED float __pyx_v_r, CYTHON_UNUSED float __pyx_v_g, CYTHON_UNUSED float __pyx_v_b, CYTHON_UNUSED float __pyx_v_a) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_color", 0);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "renpy/angle/gldraw.pyx":1406
 *         """
 * 
 *     cdef void set_clip(self, tuple clip_box, GLDraw draw):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the clipping rectangle.
 */

static void __pyx_f_5renpy_5angle_6gldraw_7Environ_set_clip(CYTHON_UNUSED struct __pyx_obj_5renpy_5angle_6gldraw_Environ *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_clip_box, CYTHON_UNUSED struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_draw) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_clip", 0);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "renpy/angle/gldraw.pyx":1411
 *         """
 * 
 *     cdef void unset_clip(self, GLDraw draw):             # <<<<<<<<<<<<<<
 *         """
 *         Removes the clipping rectangle.
 */

static void __pyx_f_5renpy_5angle_6gldraw_7Environ_unset_clip(CYTHON_UNUSED struct __pyx_obj_5renpy_5angle_6gldraw_Environ *__pyx_v_self, CYTHON_UNUSED struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *__pyx_v_draw) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("unset_clip", 0);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "renpy/angle/gldraw.pyx":1416
 *         """
 * 
 *     cdef void ortho(self, double left, double right, double bottom, double top, double near, double far):             # <<<<<<<<<<<<<<
 *         """
 *         Enables orthographic projection. `left`, `right`, `top`, `bottom` are the coordinates of the various
 */

static void __pyx_f_5renpy_5angle_6gldraw_7Environ_ortho(CYTHON_UNUSED struct __pyx_obj_5renpy_5angle_6gldraw_Environ *__pyx_v_self, CYTHON_UNUSED double __pyx_v_left, CYTHON_UNUSED double __pyx_v_right, CYTHON_UNUSED double __pyx_v_bottom, CYTHON_UNUSED double __pyx_v_top, CYTHON_UNUSED double __pyx_v_near, CYTHON_UNUSED double __pyx_v_far) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ortho", 0);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "renpy/angle/gldraw.pyx":1422
 *         """
 * 
 *     cdef void viewport(self, int x, int y, int w, int h):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the GL viewport.
 */

static void __pyx_f_5renpy_5angle_6gldraw_7Environ_viewport(CYTHON_UNUSED struct __pyx_obj_5renpy_5angle_6gldraw_Environ *__pyx_v_self, CYTHON_UNUSED int __pyx_v_x, CYTHON_UNUSED int __pyx_v_y, CYTHON_UNUSED int __pyx_v_w, CYTHON_UNUSED int __pyx_v_h) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("viewport", 0);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}
static struct __pyx_vtabstruct_5renpy_5angle_6gldraw_Environ __pyx_vtable_5renpy_5angle_6gldraw_Environ;

static PyObject *__pyx_tp_new_5renpy_5angle_6gldraw_Environ(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_5renpy_5angle_6gldraw_Environ *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_5renpy_5angle_6gldraw_Environ *)o);
  p->__pyx_vtab = __pyx_vtabptr_5renpy_5angle_6gldraw_Environ;
  return o;
}

static void __pyx_tp_dealloc_5renpy_5angle_6gldraw_Environ(PyObject *o) {
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  (*Py_TYPE(o)->tp_free)(o);
}

static PyTypeObject __pyx_type_5renpy_5angle_6gldraw_Environ = {
  PyVarObject_HEAD_INIT(0, 0)
  "renpy.angle.gldraw.Environ", /*tp_name*/
  sizeof(struct __pyx_obj_5renpy_5angle_6gldraw_Environ), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5renpy_5angle_6gldraw_Environ, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5renpy_5angle_6gldraw_Environ, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_5renpy_5angle_6gldraw_GLDraw __pyx_vtable_5renpy_5angle_6gldraw_GLDraw;

static PyObject *__pyx_tp_new_5renpy_5angle_6gldraw_GLDraw(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)o);
  p->__pyx_vtab = __pyx_vtabptr_5renpy_5angle_6gldraw_GLDraw;
  p->environ = ((struct __pyx_obj_5renpy_5angle_6gldraw_Environ *)Py_None); Py_INCREF(Py_None);
  p->rtt = Py_None; Py_INCREF(Py_None);
  p->window = Py_None; Py_INCREF(Py_None);
  p->virtual_size = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->physical_size = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->drawable_size = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->virtual_box = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->physical_box = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->mouse_old_visible = Py_None; Py_INCREF(Py_None);
  p->mouse_info = Py_None; Py_INCREF(Py_None);
  p->texture_cache = Py_None; Py_INCREF(Py_None);
  p->info = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->old_fullscreen = Py_None; Py_INCREF(Py_None);
  p->fullscreen_surface = Py_None; Py_INCREF(Py_None);
  p->display_info = Py_None; Py_INCREF(Py_None);
  p->clip_cache = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->default_clip = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->clip_rtt_box = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->draw_per_virt = Py_None; Py_INCREF(Py_None);
  p->virt_to_draw = ((struct __pyx_obj_5renpy_7display_6render_Matrix2D *)Py_None); Py_INCREF(Py_None);
  p->draw_to_virt = ((struct __pyx_obj_5renpy_7display_6render_Matrix2D *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_5renpy_5angle_6gldraw_GLDraw(PyObject *o) {
  struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *p = (struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)o;
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->environ);
  Py_CLEAR(p->rtt);
  Py_CLEAR(p->window);
  Py_CLEAR(p->virtual_size);
  Py_CLEAR(p->physical_size);
  Py_CLEAR(p->drawable_size);
  Py_CLEAR(p->virtual_box);
  Py_CLEAR(p->physical_box);
  Py_CLEAR(p->mouse_old_visible);
  Py_CLEAR(p->mouse_info);
  Py_CLEAR(p->texture_cache);
  Py_CLEAR(p->info);
  Py_CLEAR(p->old_fullscreen);
  Py_CLEAR(p->fullscreen_surface);
  Py_CLEAR(p->display_info);
  Py_CLEAR(p->clip_cache);
  Py_CLEAR(p->default_clip);
  Py_CLEAR(p->clip_rtt_box);
  Py_CLEAR(p->draw_per_virt);
  Py_CLEAR(p->virt_to_draw);
  Py_CLEAR(p->draw_to_virt);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_5renpy_5angle_6gldraw_GLDraw(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *p = (struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)o;
  if (p->environ) {
    e = (*v)(((PyObject*)p->environ), a); if (e) return e;
  }
  if (p->rtt) {
    e = (*v)(p->rtt, a); if (e) return e;
  }
  if (p->window) {
    e = (*v)(p->window, a); if (e) return e;
  }
  if (p->virtual_size) {
    e = (*v)(p->virtual_size, a); if (e) return e;
  }
  if (p->physical_size) {
    e = (*v)(p->physical_size, a); if (e) return e;
  }
  if (p->drawable_size) {
    e = (*v)(p->drawable_size, a); if (e) return e;
  }
  if (p->virtual_box) {
    e = (*v)(p->virtual_box, a); if (e) return e;
  }
  if (p->physical_box) {
    e = (*v)(p->physical_box, a); if (e) return e;
  }
  if (p->mouse_old_visible) {
    e = (*v)(p->mouse_old_visible, a); if (e) return e;
  }
  if (p->mouse_info) {
    e = (*v)(p->mouse_info, a); if (e) return e;
  }
  if (p->texture_cache) {
    e = (*v)(p->texture_cache, a); if (e) return e;
  }
  if (p->info) {
    e = (*v)(p->info, a); if (e) return e;
  }
  if (p->old_fullscreen) {
    e = (*v)(p->old_fullscreen, a); if (e) return e;
  }
  if (p->fullscreen_surface) {
    e = (*v)(p->fullscreen_surface, a); if (e) return e;
  }
  if (p->display_info) {
    e = (*v)(p->display_info, a); if (e) return e;
  }
  if (p->clip_cache) {
    e = (*v)(p->clip_cache, a); if (e) return e;
  }
  if (p->default_clip) {
    e = (*v)(p->default_clip, a); if (e) return e;
  }
  if (p->clip_rtt_box) {
    e = (*v)(p->clip_rtt_box, a); if (e) return e;
  }
  if (p->draw_per_virt) {
    e = (*v)(p->draw_per_virt, a); if (e) return e;
  }
  if (p->virt_to_draw) {
    e = (*v)(((PyObject*)p->virt_to_draw), a); if (e) return e;
  }
  if (p->draw_to_virt) {
    e = (*v)(((PyObject*)p->draw_to_virt), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5renpy_5angle_6gldraw_GLDraw(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *p = (struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)o;
  tmp = ((PyObject*)p->environ);
  p->environ = ((struct __pyx_obj_5renpy_5angle_6gldraw_Environ *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->rtt);
  p->rtt = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->window);
  p->window = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->virtual_size);
  p->virtual_size = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->physical_size);
  p->physical_size = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->drawable_size);
  p->drawable_size = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->virtual_box);
  p->virtual_box = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->physical_box);
  p->physical_box = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->mouse_old_visible);
  p->mouse_old_visible = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->mouse_info);
  p->mouse_info = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->texture_cache);
  p->texture_cache = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->info);
  p->info = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->old_fullscreen);
  p->old_fullscreen = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->fullscreen_surface);
  p->fullscreen_surface = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->display_info);
  p->display_info = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->clip_cache);
  p->clip_cache = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->default_clip);
  p->default_clip = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->clip_rtt_box);
  p->clip_rtt_box = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->draw_per_virt);
  p->draw_per_virt = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->virt_to_draw);
  p->virt_to_draw = ((struct __pyx_obj_5renpy_7display_6render_Matrix2D *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->draw_to_virt);
  p->draw_to_virt = ((struct __pyx_obj_5renpy_7display_6render_Matrix2D *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_5renpy_5angle_6gldraw_6GLDraw_rtt(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_3rtt_1__get__(o);
}

static int __pyx_setprop_5renpy_5angle_6gldraw_6GLDraw_rtt(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_3rtt_3__set__(o, v);
  }
  else {
    return __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_3rtt_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5renpy_5angle_6gldraw_6GLDraw_physical_size(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_13physical_size_1__get__(o);
}

static int __pyx_setprop_5renpy_5angle_6gldraw_6GLDraw_physical_size(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_13physical_size_3__set__(o, v);
  }
  else {
    return __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_13physical_size_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5renpy_5angle_6gldraw_6GLDraw_drawable_size(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_13drawable_size_1__get__(o);
}

static int __pyx_setprop_5renpy_5angle_6gldraw_6GLDraw_drawable_size(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_13drawable_size_3__set__(o, v);
  }
  else {
    return __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_13drawable_size_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5renpy_5angle_6gldraw_6GLDraw_virtual_box(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_11virtual_box_1__get__(o);
}

static int __pyx_setprop_5renpy_5angle_6gldraw_6GLDraw_virtual_box(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_11virtual_box_3__set__(o, v);
  }
  else {
    return __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_11virtual_box_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5renpy_5angle_6gldraw_6GLDraw_physical_box(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_12physical_box_1__get__(o);
}

static int __pyx_setprop_5renpy_5angle_6gldraw_6GLDraw_physical_box(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_12physical_box_3__set__(o, v);
  }
  else {
    return __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_12physical_box_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5renpy_5angle_6gldraw_6GLDraw_info(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_4info_1__get__(o);
}

static int __pyx_setprop_5renpy_5angle_6gldraw_6GLDraw_info(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_4info_3__set__(o, v);
  }
  else {
    return __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_4info_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5renpy_5angle_6gldraw_6GLDraw_fullscreen_surface(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_18fullscreen_surface_1__get__(o);
}

static int __pyx_setprop_5renpy_5angle_6gldraw_6GLDraw_fullscreen_surface(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_18fullscreen_surface_3__set__(o, v);
  }
  else {
    return __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_18fullscreen_surface_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5renpy_5angle_6gldraw_6GLDraw_clip_rtt_box(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_12clip_rtt_box_1__get__(o);
}

static int __pyx_setprop_5renpy_5angle_6gldraw_6GLDraw_clip_rtt_box(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_12clip_rtt_box_3__set__(o, v);
  }
  else {
    return __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_12clip_rtt_box_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5renpy_5angle_6gldraw_6GLDraw_draw_per_virt(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_13draw_per_virt_1__get__(o);
}

static int __pyx_setprop_5renpy_5angle_6gldraw_6GLDraw_draw_per_virt(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_13draw_per_virt_3__set__(o, v);
  }
  else {
    return __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_13draw_per_virt_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5renpy_5angle_6gldraw_6GLDraw_virt_to_draw(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_12virt_to_draw_1__get__(o);
}

static int __pyx_setprop_5renpy_5angle_6gldraw_6GLDraw_virt_to_draw(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_12virt_to_draw_3__set__(o, v);
  }
  else {
    return __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_12virt_to_draw_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5renpy_5angle_6gldraw_6GLDraw_draw_to_virt(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_12draw_to_virt_1__get__(o);
}

static int __pyx_setprop_5renpy_5angle_6gldraw_6GLDraw_draw_to_virt(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_12draw_to_virt_3__set__(o, v);
  }
  else {
    return __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_12draw_to_virt_5__del__(o);
  }
}

static PyMethodDef __pyx_methods_5renpy_5angle_6gldraw_GLDraw[] = {
  {"get_texture_size", (PyCFunction)__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_3get_texture_size, METH_NOARGS, __pyx_doc_5renpy_5angle_6gldraw_6GLDraw_2get_texture_size},
  {"set_mode", (PyCFunction)__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_5set_mode, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5renpy_5angle_6gldraw_6GLDraw_4set_mode},
  {"deinit", (PyCFunction)__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_7deinit, METH_NOARGS, __pyx_doc_5renpy_5angle_6gldraw_6GLDraw_6deinit},
  {"quit", (PyCFunction)__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_9quit, METH_NOARGS, 0},
  {"init", (PyCFunction)__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_11init, METH_NOARGS, __pyx_doc_5renpy_5angle_6gldraw_6GLDraw_10init},
  {"should_redraw", (PyCFunction)__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_13should_redraw, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5renpy_5angle_6gldraw_6GLDraw_12should_redraw},
  {"mutated_surface", (PyCFunction)__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_15mutated_surface, METH_O, 0},
  {"load_texture", (PyCFunction)__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_17load_texture, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5renpy_5angle_6gldraw_6GLDraw_16load_texture},
  {"solid_texture", (PyCFunction)__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_19solid_texture, METH_VARARGS|METH_KEYWORDS, 0},
  {"clip_mode_screen", (PyCFunction)__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_21clip_mode_screen, METH_NOARGS, __pyx_doc_5renpy_5angle_6gldraw_6GLDraw_20clip_mode_screen},
  {"clip_mode_rtt", (PyCFunction)__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_23clip_mode_rtt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5renpy_5angle_6gldraw_6GLDraw_22clip_mode_rtt},
  {"set_clip", (PyCFunction)__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_25set_clip, METH_O, 0},
  {"draw_screen", (PyCFunction)__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_27draw_screen, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5renpy_5angle_6gldraw_6GLDraw_26draw_screen},
  {"draw_render_textures", (PyCFunction)__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_29draw_render_textures, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5renpy_5angle_6gldraw_6GLDraw_28draw_render_textures},
  {"draw_transformed", (PyCFunction)__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_31draw_transformed, METH_VARARGS|METH_KEYWORDS, 0},
  {"render_to_texture", (PyCFunction)__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_33render_to_texture, METH_VARARGS|METH_KEYWORDS, 0},
  {"is_pixel_opaque", (PyCFunction)__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_35is_pixel_opaque, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5renpy_5angle_6gldraw_6GLDraw_34is_pixel_opaque},
  {"get_half", (PyCFunction)__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_37get_half, METH_O, __pyx_doc_5renpy_5angle_6gldraw_6GLDraw_36get_half},
  {"translate_point", (PyCFunction)__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_39translate_point, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5renpy_5angle_6gldraw_6GLDraw_38translate_point},
  {"untranslate_point", (PyCFunction)__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_41untranslate_point, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5renpy_5angle_6gldraw_6GLDraw_40untranslate_point},
  {"update_mouse", (PyCFunction)__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_43update_mouse, METH_NOARGS, 0},
  {"mouse_event", (PyCFunction)__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_45mouse_event, METH_O, 0},
  {"get_mouse_pos", (PyCFunction)__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_47get_mouse_pos, METH_NOARGS, 0},
  {"set_mouse_pos", (PyCFunction)__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_49set_mouse_pos, METH_VARARGS|METH_KEYWORDS, 0},
  {"draw_mouse", (PyCFunction)__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_51draw_mouse, METH_NOARGS, 0},
  {"screenshot", (PyCFunction)__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_53screenshot, METH_VARARGS|METH_KEYWORDS, 0},
  {"free_memory", (PyCFunction)__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_55free_memory, METH_NOARGS, 0},
  {"event_peek_sleep", (PyCFunction)__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_57event_peek_sleep, METH_NOARGS, 0},
  {"get_physical_size", (PyCFunction)__pyx_pw_5renpy_5angle_6gldraw_6GLDraw_59get_physical_size, METH_NOARGS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_5renpy_5angle_6gldraw_GLDraw[] = {
  {(char *)"rtt", __pyx_getprop_5renpy_5angle_6gldraw_6GLDraw_rtt, __pyx_setprop_5renpy_5angle_6gldraw_6GLDraw_rtt, 0, 0},
  {(char *)"physical_size", __pyx_getprop_5renpy_5angle_6gldraw_6GLDraw_physical_size, __pyx_setprop_5renpy_5angle_6gldraw_6GLDraw_physical_size, 0, 0},
  {(char *)"drawable_size", __pyx_getprop_5renpy_5angle_6gldraw_6GLDraw_drawable_size, __pyx_setprop_5renpy_5angle_6gldraw_6GLDraw_drawable_size, 0, 0},
  {(char *)"virtual_box", __pyx_getprop_5renpy_5angle_6gldraw_6GLDraw_virtual_box, __pyx_setprop_5renpy_5angle_6gldraw_6GLDraw_virtual_box, 0, 0},
  {(char *)"physical_box", __pyx_getprop_5renpy_5angle_6gldraw_6GLDraw_physical_box, __pyx_setprop_5renpy_5angle_6gldraw_6GLDraw_physical_box, 0, 0},
  {(char *)"info", __pyx_getprop_5renpy_5angle_6gldraw_6GLDraw_info, __pyx_setprop_5renpy_5angle_6gldraw_6GLDraw_info, 0, 0},
  {(char *)"fullscreen_surface", __pyx_getprop_5renpy_5angle_6gldraw_6GLDraw_fullscreen_surface, __pyx_setprop_5renpy_5angle_6gldraw_6GLDraw_fullscreen_surface, 0, 0},
  {(char *)"clip_rtt_box", __pyx_getprop_5renpy_5angle_6gldraw_6GLDraw_clip_rtt_box, __pyx_setprop_5renpy_5angle_6gldraw_6GLDraw_clip_rtt_box, 0, 0},
  {(char *)"draw_per_virt", __pyx_getprop_5renpy_5angle_6gldraw_6GLDraw_draw_per_virt, __pyx_setprop_5renpy_5angle_6gldraw_6GLDraw_draw_per_virt, 0, 0},
  {(char *)"virt_to_draw", __pyx_getprop_5renpy_5angle_6gldraw_6GLDraw_virt_to_draw, __pyx_setprop_5renpy_5angle_6gldraw_6GLDraw_virt_to_draw, 0, 0},
  {(char *)"draw_to_virt", __pyx_getprop_5renpy_5angle_6gldraw_6GLDraw_draw_to_virt, __pyx_setprop_5renpy_5angle_6gldraw_6GLDraw_draw_to_virt, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_5renpy_5angle_6gldraw_GLDraw = {
  PyVarObject_HEAD_INIT(0, 0)
  "renpy.angle.gldraw.GLDraw", /*tp_name*/
  sizeof(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5renpy_5angle_6gldraw_GLDraw, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_5renpy_5angle_6gldraw_GLDraw, /*tp_traverse*/
  __pyx_tp_clear_5renpy_5angle_6gldraw_GLDraw, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5renpy_5angle_6gldraw_GLDraw, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_5renpy_5angle_6gldraw_GLDraw, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_5renpy_5angle_6gldraw_6GLDraw_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5renpy_5angle_6gldraw_GLDraw, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct__init *__pyx_freelist_5renpy_5angle_6gldraw___pyx_scope_struct__init[8];
static int __pyx_freecount_5renpy_5angle_6gldraw___pyx_scope_struct__init = 0;

static PyObject *__pyx_tp_new_5renpy_5angle_6gldraw___pyx_scope_struct__init(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_5renpy_5angle_6gldraw___pyx_scope_struct__init > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct__init)))) {
    o = (PyObject*)__pyx_freelist_5renpy_5angle_6gldraw___pyx_scope_struct__init[--__pyx_freecount_5renpy_5angle_6gldraw___pyx_scope_struct__init];
    memset(o, 0, sizeof(struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct__init));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_5renpy_5angle_6gldraw___pyx_scope_struct__init(PyObject *o) {
  struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct__init *p = (struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct__init *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_extensions);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_5renpy_5angle_6gldraw___pyx_scope_struct__init < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct__init)))) {
    __pyx_freelist_5renpy_5angle_6gldraw___pyx_scope_struct__init[__pyx_freecount_5renpy_5angle_6gldraw___pyx_scope_struct__init++] = ((struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct__init *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_5renpy_5angle_6gldraw___pyx_scope_struct__init(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct__init *p = (struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct__init *)o;
  if (p->__pyx_v_extensions) {
    e = (*v)(p->__pyx_v_extensions, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5renpy_5angle_6gldraw___pyx_scope_struct__init(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct__init *p = (struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct__init *)o;
  tmp = ((PyObject*)p->__pyx_v_extensions);
  p->__pyx_v_extensions = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_5renpy_5angle_6gldraw___pyx_scope_struct__init = {
  PyVarObject_HEAD_INIT(0, 0)
  "renpy.angle.gldraw.__pyx_scope_struct__init", /*tp_name*/
  sizeof(struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct__init), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5renpy_5angle_6gldraw___pyx_scope_struct__init, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_5renpy_5angle_6gldraw___pyx_scope_struct__init, /*tp_traverse*/
  __pyx_tp_clear_5renpy_5angle_6gldraw___pyx_scope_struct__init, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5renpy_5angle_6gldraw___pyx_scope_struct__init, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct_1_render_to_texture *__pyx_freelist_5renpy_5angle_6gldraw___pyx_scope_struct_1_render_to_texture[8];
static int __pyx_freecount_5renpy_5angle_6gldraw___pyx_scope_struct_1_render_to_texture = 0;

static PyObject *__pyx_tp_new_5renpy_5angle_6gldraw___pyx_scope_struct_1_render_to_texture(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_5renpy_5angle_6gldraw___pyx_scope_struct_1_render_to_texture > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct_1_render_to_texture)))) {
    o = (PyObject*)__pyx_freelist_5renpy_5angle_6gldraw___pyx_scope_struct_1_render_to_texture[--__pyx_freecount_5renpy_5angle_6gldraw___pyx_scope_struct_1_render_to_texture];
    memset(o, 0, sizeof(struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct_1_render_to_texture));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_5renpy_5angle_6gldraw___pyx_scope_struct_1_render_to_texture(PyObject *o) {
  struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct_1_render_to_texture *p = (struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct_1_render_to_texture *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_alpha);
  Py_CLEAR(p->__pyx_v_height);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_v_what);
  Py_CLEAR(p->__pyx_v_width);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_5renpy_5angle_6gldraw___pyx_scope_struct_1_render_to_texture < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct_1_render_to_texture)))) {
    __pyx_freelist_5renpy_5angle_6gldraw___pyx_scope_struct_1_render_to_texture[__pyx_freecount_5renpy_5angle_6gldraw___pyx_scope_struct_1_render_to_texture++] = ((struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct_1_render_to_texture *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_5renpy_5angle_6gldraw___pyx_scope_struct_1_render_to_texture(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct_1_render_to_texture *p = (struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct_1_render_to_texture *)o;
  if (p->__pyx_v_alpha) {
    e = (*v)(p->__pyx_v_alpha, a); if (e) return e;
  }
  if (p->__pyx_v_height) {
    e = (*v)(p->__pyx_v_height, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
  }
  if (p->__pyx_v_what) {
    e = (*v)(p->__pyx_v_what, a); if (e) return e;
  }
  if (p->__pyx_v_width) {
    e = (*v)(p->__pyx_v_width, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5renpy_5angle_6gldraw___pyx_scope_struct_1_render_to_texture(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct_1_render_to_texture *p = (struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct_1_render_to_texture *)o;
  tmp = ((PyObject*)p->__pyx_v_alpha);
  p->__pyx_v_alpha = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_height);
  p->__pyx_v_height = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = ((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_what);
  p->__pyx_v_what = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_width);
  p->__pyx_v_width = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_5renpy_5angle_6gldraw___pyx_scope_struct_1_render_to_texture = {
  PyVarObject_HEAD_INIT(0, 0)
  "renpy.angle.gldraw.__pyx_scope_struct_1_render_to_texture", /*tp_name*/
  sizeof(struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct_1_render_to_texture), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5renpy_5angle_6gldraw___pyx_scope_struct_1_render_to_texture, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_5renpy_5angle_6gldraw___pyx_scope_struct_1_render_to_texture, /*tp_traverse*/
  __pyx_tp_clear_5renpy_5angle_6gldraw___pyx_scope_struct_1_render_to_texture, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5renpy_5angle_6gldraw___pyx_scope_struct_1_render_to_texture, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct_2_get_half *__pyx_freelist_5renpy_5angle_6gldraw___pyx_scope_struct_2_get_half[8];
static int __pyx_freecount_5renpy_5angle_6gldraw___pyx_scope_struct_2_get_half = 0;

static PyObject *__pyx_tp_new_5renpy_5angle_6gldraw___pyx_scope_struct_2_get_half(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_5renpy_5angle_6gldraw___pyx_scope_struct_2_get_half > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct_2_get_half)))) {
    o = (PyObject*)__pyx_freelist_5renpy_5angle_6gldraw___pyx_scope_struct_2_get_half[--__pyx_freecount_5renpy_5angle_6gldraw___pyx_scope_struct_2_get_half];
    memset(o, 0, sizeof(struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct_2_get_half));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_5renpy_5angle_6gldraw___pyx_scope_struct_2_get_half(PyObject *o) {
  struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct_2_get_half *p = (struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct_2_get_half *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_draw);
  Py_CLEAR(p->__pyx_v_height);
  Py_CLEAR(p->__pyx_v_reverse);
  Py_CLEAR(p->__pyx_v_what);
  Py_CLEAR(p->__pyx_v_width);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_5renpy_5angle_6gldraw___pyx_scope_struct_2_get_half < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct_2_get_half)))) {
    __pyx_freelist_5renpy_5angle_6gldraw___pyx_scope_struct_2_get_half[__pyx_freecount_5renpy_5angle_6gldraw___pyx_scope_struct_2_get_half++] = ((struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct_2_get_half *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_5renpy_5angle_6gldraw___pyx_scope_struct_2_get_half(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct_2_get_half *p = (struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct_2_get_half *)o;
  if (p->__pyx_v_draw) {
    e = (*v)(((PyObject*)p->__pyx_v_draw), a); if (e) return e;
  }
  if (p->__pyx_v_height) {
    e = (*v)(p->__pyx_v_height, a); if (e) return e;
  }
  if (p->__pyx_v_reverse) {
    e = (*v)(p->__pyx_v_reverse, a); if (e) return e;
  }
  if (p->__pyx_v_what) {
    e = (*v)(p->__pyx_v_what, a); if (e) return e;
  }
  if (p->__pyx_v_width) {
    e = (*v)(p->__pyx_v_width, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5renpy_5angle_6gldraw___pyx_scope_struct_2_get_half(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct_2_get_half *p = (struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct_2_get_half *)o;
  tmp = ((PyObject*)p->__pyx_v_draw);
  p->__pyx_v_draw = ((struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_height);
  p->__pyx_v_height = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_reverse);
  p->__pyx_v_reverse = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_what);
  p->__pyx_v_what = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_width);
  p->__pyx_v_width = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_5renpy_5angle_6gldraw___pyx_scope_struct_2_get_half = {
  PyVarObject_HEAD_INIT(0, 0)
  "renpy.angle.gldraw.__pyx_scope_struct_2_get_half", /*tp_name*/
  sizeof(struct __pyx_obj_5renpy_5angle_6gldraw___pyx_scope_struct_2_get_half), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5renpy_5angle_6gldraw___pyx_scope_struct_2_get_half, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_5renpy_5angle_6gldraw___pyx_scope_struct_2_get_half, /*tp_traverse*/
  __pyx_tp_clear_5renpy_5angle_6gldraw___pyx_scope_struct_2_get_half, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5renpy_5angle_6gldraw___pyx_scope_struct_2_get_half, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef __pyx_moduledef = {
  #if PY_VERSION_HEX < 0x03020000
    { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
  #else
    PyModuleDef_HEAD_INIT,
  #endif
    "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_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0},
  {&__pyx_n_s_BLACKLIST, __pyx_k_BLACKLIST, sizeof(__pyx_k_BLACKLIST), 0, 0, 1, 1},
  {&__pyx_kp_s_Can_t_find_a_workable_environmen, __pyx_k_Can_t_find_a_workable_environmen, sizeof(__pyx_k_Can_t_find_a_workable_environmen), 0, 0, 1, 0},
  {&__pyx_kp_s_Can_t_find_a_workable_rtt, __pyx_k_Can_t_find_a_workable_rtt, sizeof(__pyx_k_Can_t_find_a_workable_rtt), 0, 0, 1, 0},
  {&__pyx_n_s_CopyRtt, __pyx_k_CopyRtt, sizeof(__pyx_k_CopyRtt), 0, 0, 1, 1},
  {&__pyx_kp_s_Could_not_get_pygame_screen_r, __pyx_k_Could_not_get_pygame_screen_r, sizeof(__pyx_k_Could_not_get_pygame_screen_r), 0, 0, 1, 0},
  {&__pyx_n_s_DISSOLVE, __pyx_k_DISSOLVE, sizeof(__pyx_k_DISSOLVE), 0, 0, 1, 1},
  {&__pyx_n_s_DOUBLEBUF, __pyx_k_DOUBLEBUF, sizeof(__pyx_k_DOUBLEBUF), 0, 0, 1, 1},
  {&__pyx_kp_s_Display_Info_s, __pyx_k_Display_Info_s, sizeof(__pyx_k_Display_Info_s), 0, 0, 1, 0},
  {&__pyx_n_s_Exception, __pyx_k_Exception, sizeof(__pyx_k_Exception), 0, 0, 1, 1},
  {&__pyx_kp_s_Extensions, __pyx_k_Extensions, sizeof(__pyx_k_Extensions), 0, 0, 1, 0},
  {&__pyx_n_s_FboRtt, __pyx_k_FboRtt, sizeof(__pyx_k_FboRtt), 0, 0, 1, 1},
  {&__pyx_n_s_FixedFunctionEnviron, __pyx_k_FixedFunctionEnviron, sizeof(__pyx_k_FixedFunctionEnviron), 0, 0, 1, 1},
  {&__pyx_kp_s_Fixed_function_is_blacklisted, __pyx_k_Fixed_function_is_blacklisted, sizeof(__pyx_k_Fixed_function_is_blacklisted), 0, 0, 1, 0},
  {&__pyx_kp_s_Fullscreen_mode, __pyx_k_Fullscreen_mode, sizeof(__pyx_k_Fullscreen_mode), 0, 0, 1, 0},
  {&__pyx_n_s_GL_ALPHA_SIZE, __pyx_k_GL_ALPHA_SIZE, sizeof(__pyx_k_GL_ALPHA_SIZE), 0, 0, 1, 1},
  {&__pyx_n_s_GL_ARB_fragment_shader, __pyx_k_GL_ARB_fragment_shader, sizeof(__pyx_k_GL_ARB_fragment_shader), 0, 0, 1, 1},
  {&__pyx_n_s_GL_ARB_texture_env_combine, __pyx_k_GL_ARB_texture_env_combine, sizeof(__pyx_k_GL_ARB_texture_env_combine), 0, 0, 1, 1},
  {&__pyx_n_s_GL_ARB_texture_env_crossbar, __pyx_k_GL_ARB_texture_env_crossbar, sizeof(__pyx_k_GL_ARB_texture_env_crossbar), 0, 0, 1, 1},
  {&__pyx_n_s_GL_ARB_vertex_shader, __pyx_k_GL_ARB_vertex_shader, sizeof(__pyx_k_GL_ARB_vertex_shader), 0, 0, 1, 1},
  {&__pyx_kp_s_GL_Disabled, __pyx_k_GL_Disabled, sizeof(__pyx_k_GL_Disabled), 0, 0, 1, 0},
  {&__pyx_n_s_GL_NV_texture_env_combine4, __pyx_k_GL_NV_texture_env_combine4, sizeof(__pyx_k_GL_NV_texture_env_combine4), 0, 0, 1, 1},
  {&__pyx_n_s_GL_SWAP_CONTROL, __pyx_k_GL_SWAP_CONTROL, sizeof(__pyx_k_GL_SWAP_CONTROL), 0, 0, 1, 1},
  {&__pyx_kp_s_GL_is_totally_blacklisted, __pyx_k_GL_is_totally_blacklisted, sizeof(__pyx_k_GL_is_totally_blacklisted), 0, 0, 1, 0},
  {&__pyx_kp_s_Glew_init_failed_s, __pyx_k_Glew_init_failed_s, sizeof(__pyx_k_Glew_init_failed_s), 0, 0, 1, 0},
  {&__pyx_n_s_IDENTITY, __pyx_k_IDENTITY, sizeof(__pyx_k_IDENTITY), 0, 0, 1, 1},
  {&__pyx_n_s_IMAGEDISSOLVE, __pyx_k_IMAGEDISSOLVE, sizeof(__pyx_k_IMAGEDISSOLVE), 0, 0, 1, 1},
  {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
  {&__pyx_kp_s_Initializing_EGL_s, __pyx_k_Initializing_EGL_s, sizeof(__pyx_k_Initializing_EGL_s), 0, 0, 1, 0},
  {&__pyx_kp_s_Initializing_shader_environment, __pyx_k_Initializing_shader_environment, sizeof(__pyx_k_Initializing_shader_environment), 0, 0, 1, 0},
  {&__pyx_n_s_LimitedEnviron, __pyx_k_LimitedEnviron, sizeof(__pyx_k_LimitedEnviron), 0, 0, 1, 1},
  {&__pyx_n_s_Matrix2D, __pyx_k_Matrix2D, sizeof(__pyx_k_Matrix2D), 0, 0, 1, 1},
  {&__pyx_kp_s_Not_implemented, __pyx_k_Not_implemented, sizeof(__pyx_k_Not_implemented), 0, 0, 1, 0},
  {&__pyx_kp_s_Number_of_texture_units_d, __pyx_k_Number_of_texture_units_d, sizeof(__pyx_k_Number_of_texture_units_d), 0, 0, 1, 0},
  {&__pyx_kp_s_Opening_in_fullscreen_failed_r, __pyx_k_Opening_in_fullscreen_failed_r, sizeof(__pyx_k_Opening_in_fullscreen_failed_r), 0, 0, 1, 0},
  {&__pyx_n_s_PIXELLATE, __pyx_k_PIXELLATE, sizeof(__pyx_k_PIXELLATE), 0, 0, 1, 1},
  {&__pyx_n_s_RENPY_FAIL, __pyx_k_RENPY_FAIL, sizeof(__pyx_k_RENPY_FAIL), 0, 0, 1, 1},
  {&__pyx_n_s_RENPY_GL_ENVIRON, __pyx_k_RENPY_GL_ENVIRON, sizeof(__pyx_k_RENPY_GL_ENVIRON), 0, 0, 1, 1},
  {&__pyx_n_s_RENPY_GL_RTT, __pyx_k_RENPY_GL_RTT, sizeof(__pyx_k_RENPY_GL_RTT), 0, 0, 1, 1},
  {&__pyx_n_s_RENPY_GL_VSYNC, __pyx_k_RENPY_GL_VSYNC, sizeof(__pyx_k_RENPY_GL_VSYNC), 0, 0, 1, 1},
  {&__pyx_n_s_RENPY_bogus_extension, __pyx_k_RENPY_bogus_extension, sizeof(__pyx_k_RENPY_bogus_extension), 0, 0, 1, 1},
  {&__pyx_n_s_RESIZABLE, __pyx_k_RESIZABLE, sizeof(__pyx_k_RESIZABLE), 0, 0, 1, 1},
  {&__pyx_kp_s_Renderer_r, __pyx_k_Renderer_r, sizeof(__pyx_k_Renderer_r), 0, 0, 1, 0},
  {&__pyx_n_s_Rtt, __pyx_k_Rtt, sizeof(__pyx_k_Rtt), 0, 0, 1, 1},
  {&__pyx_n_s_Rtt_deinit, __pyx_k_Rtt_deinit, sizeof(__pyx_k_Rtt_deinit), 0, 0, 1, 1},
  {&__pyx_n_s_Rtt_get_size_limit, __pyx_k_Rtt_get_size_limit, sizeof(__pyx_k_Rtt_get_size_limit), 0, 0, 1, 1},
  {&__pyx_n_s_Rtt_init, __pyx_k_Rtt_init, sizeof(__pyx_k_Rtt_init), 0, 0, 1, 1},
  {&__pyx_n_s_Rtt_render, __pyx_k_Rtt_render, sizeof(__pyx_k_Rtt_render), 0, 0, 1, 1},
  {&__pyx_kp_s_Screen_sizes_virtual_r_physical, __pyx_k_Screen_sizes_virtual_r_physical, sizeof(__pyx_k_Screen_sizes_virtual_r_physical), 0, 0, 1, 0},
  {&__pyx_n_s_ShaderEnviron, __pyx_k_ShaderEnviron, sizeof(__pyx_k_ShaderEnviron), 0, 0, 1, 1},
  {&__pyx_kp_s_Shaders_are_blacklisted, __pyx_k_Shaders_are_blacklisted, sizeof(__pyx_k_Shaders_are_blacklisted), 0, 0, 1, 0},
  {&__pyx_kp_s_Subclasses_of_this_class_handle, __pyx_k_Subclasses_of_this_class_handle, sizeof(__pyx_k_Subclasses_of_this_class_handle), 0, 0, 1, 0},
  {&__pyx_n_s_Surface, __pyx_k_Surface, sizeof(__pyx_k_Surface), 0, 0, 1, 1},
  {&__pyx_kp_s_Unknown_drawing_type, __pyx_k_Unknown_drawing_type, sizeof(__pyx_k_Unknown_drawing_type), 0, 0, 1, 0},
  {&__pyx_kp_s_Using_0_renderer, __pyx_k_Using_0_renderer, sizeof(__pyx_k_Using_0_renderer), 0, 0, 1, 0},
  {&__pyx_kp_s_Using_FBO_RTT, __pyx_k_Using_FBO_RTT, sizeof(__pyx_k_Using_FBO_RTT), 0, 0, 1, 0},
  {&__pyx_kp_s_Using_copy_RTT, __pyx_k_Using_copy_RTT, sizeof(__pyx_k_Using_copy_RTT), 0, 0, 1, 0},
  {&__pyx_kp_s_Using_fixed_function_environment, __pyx_k_Using_fixed_function_environment, sizeof(__pyx_k_Using_fixed_function_environment), 0, 0, 1, 0},
  {&__pyx_kp_s_Using_fixed_function_environment_2, __pyx_k_Using_fixed_function_environment_2, sizeof(__pyx_k_Using_fixed_function_environment_2), 0, 0, 1, 0},
  {&__pyx_kp_s_Using_limited_environment, __pyx_k_Using_limited_environment, sizeof(__pyx_k_Using_limited_environment), 0, 0, 1, 0},
  {&__pyx_kp_s_Using_shader_environment, __pyx_k_Using_shader_environment, sizeof(__pyx_k_Using_shader_environment), 0, 0, 1, 0},
  {&__pyx_kp_s_Vendor_r, __pyx_k_Vendor_r, sizeof(__pyx_k_Vendor_r), 0, 0, 1, 0},
  {&__pyx_kp_s_Version_r, __pyx_k_Version_r, sizeof(__pyx_k_Version_r), 0, 0, 1, 0},
  {&__pyx_n_s_WINDOW_FULLSCREEN_DESKTOP, __pyx_k_WINDOW_FULLSCREEN_DESKTOP, sizeof(__pyx_k_WINDOW_FULLSCREEN_DESKTOP), 0, 0, 1, 1},
  {&__pyx_n_s_WeakKeyDictionary, __pyx_k_WeakKeyDictionary, sizeof(__pyx_k_WeakKeyDictionary), 0, 0, 1, 1},
  {&__pyx_kp_s_Windowed_mode, __pyx_k_Windowed_mode, sizeof(__pyx_k_Windowed_mode), 0, 0, 1, 0},
  {&__pyx_kp_s__14, __pyx_k__14, sizeof(__pyx_k__14), 0, 0, 1, 0},
  {&__pyx_kp_s__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 1, 0},
  {&__pyx_n_s_additive, __pyx_k_additive, sizeof(__pyx_k_additive), 0, 0, 1, 1},
  {&__pyx_n_s_adjust_view_size, __pyx_k_adjust_view_size, sizeof(__pyx_k_adjust_view_size), 0, 0, 1, 1},
  {&__pyx_n_s_allow_fixed, __pyx_k_allow_fixed, sizeof(__pyx_k_allow_fixed), 0, 0, 1, 1},
  {&__pyx_n_s_alpha, __pyx_k_alpha, sizeof(__pyx_k_alpha), 0, 0, 1, 1},
  {&__pyx_n_s_always_opaque, __pyx_k_always_opaque, sizeof(__pyx_k_always_opaque), 0, 0, 1, 1},
  {&__pyx_n_s_android, __pyx_k_android, sizeof(__pyx_k_android), 0, 0, 1, 1},
  {&__pyx_n_s_angle, __pyx_k_angle, sizeof(__pyx_k_angle), 0, 0, 1, 1},
  {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1},
  {&__pyx_n_s_array, __pyx_k_array, sizeof(__pyx_k_array), 0, 0, 1, 1},
  {&__pyx_n_s_cleanup, __pyx_k_cleanup, sizeof(__pyx_k_cleanup), 0, 0, 1, 1},
  {&__pyx_n_s_clear, __pyx_k_clear, sizeof(__pyx_k_clear), 0, 0, 1, 1},
  {&__pyx_n_s_clip, __pyx_k_clip, sizeof(__pyx_k_clip), 0, 0, 1, 1},
  {&__pyx_n_s_clip_mode_rtt, __pyx_k_clip_mode_rtt, sizeof(__pyx_k_clip_mode_rtt), 0, 0, 1, 1},
  {&__pyx_n_s_clip_mode_screen, __pyx_k_clip_mode_screen, sizeof(__pyx_k_clip_mode_screen), 0, 0, 1, 1},
  {&__pyx_n_s_color, __pyx_k_color, sizeof(__pyx_k_color), 0, 0, 1, 1},
  {&__pyx_n_s_config, __pyx_k_config, sizeof(__pyx_k_config), 0, 0, 1, 1},
  {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
  {&__pyx_n_s_current_h, __pyx_k_current_h, sizeof(__pyx_k_current_h), 0, 0, 1, 1},
  {&__pyx_n_s_current_w, __pyx_k_current_w, sizeof(__pyx_k_current_w), 0, 0, 1, 1},
  {&__pyx_n_s_dealloc_textures, __pyx_k_dealloc_textures, sizeof(__pyx_k_dealloc_textures), 0, 0, 1, 1},
  {&__pyx_n_s_deinit, __pyx_k_deinit, sizeof(__pyx_k_deinit), 0, 0, 1, 1},
  {&__pyx_n_s_dimension, __pyx_k_dimension, sizeof(__pyx_k_dimension), 0, 0, 1, 1},
  {&__pyx_n_s_display, __pyx_k_display, sizeof(__pyx_k_display), 0, 0, 1, 1},
  {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
  {&__pyx_n_s_dpi_scale, __pyx_k_dpi_scale, sizeof(__pyx_k_dpi_scale), 0, 0, 1, 1},
  {&__pyx_n_s_draw_func, __pyx_k_draw_func, sizeof(__pyx_k_draw_func), 0, 0, 1, 1},
  {&__pyx_n_s_draw_mouse, __pyx_k_draw_mouse, sizeof(__pyx_k_draw_mouse), 0, 0, 1, 1},
  {&__pyx_n_s_draw_render_textures, __pyx_k_draw_render_textures, sizeof(__pyx_k_draw_render_textures), 0, 0, 1, 1},
  {&__pyx_n_s_draw_screen, __pyx_k_draw_screen, sizeof(__pyx_k_draw_screen), 0, 0, 1, 1},
  {&__pyx_n_s_draw_transformed, __pyx_k_draw_transformed, sizeof(__pyx_k_draw_transformed), 0, 0, 1, 1},
  {&__pyx_n_s_emulator, __pyx_k_emulator, sizeof(__pyx_k_emulator), 0, 0, 1, 1},
  {&__pyx_n_s_environ, __pyx_k_environ, sizeof(__pyx_k_environ), 0, 0, 1, 1},
  {&__pyx_n_s_envval, __pyx_k_envval, sizeof(__pyx_k_envval), 0, 0, 1, 1},
  {&__pyx_n_s_envvar, __pyx_k_envvar, sizeof(__pyx_k_envvar), 0, 0, 1, 1},
  {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
  {&__pyx_n_s_exception, __pyx_k_exception, sizeof(__pyx_k_exception), 0, 0, 1, 1},
  {&__pyx_n_s_fbo, __pyx_k_fbo, sizeof(__pyx_k_fbo), 0, 0, 1, 1},
  {&__pyx_n_s_fill, __pyx_k_fill, sizeof(__pyx_k_fill), 0, 0, 1, 1},
  {&__pyx_n_s_first_pass, __pyx_k_first_pass, sizeof(__pyx_k_first_pass), 0, 0, 1, 1},
  {&__pyx_n_s_fixed, __pyx_k_fixed, sizeof(__pyx_k_fixed), 0, 0, 1, 1},
  {&__pyx_n_s_flip, __pyx_k_flip, sizeof(__pyx_k_flip), 0, 0, 1, 1},
  {&__pyx_n_s_flip_times, __pyx_k_flip_times, sizeof(__pyx_k_flip_times), 0, 0, 1, 1},
  {&__pyx_n_s_flip_unscaled, __pyx_k_flip_unscaled, sizeof(__pyx_k_flip_unscaled), 0, 0, 1, 1},
  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
  {&__pyx_n_s_frame_times, __pyx_k_frame_times, sizeof(__pyx_k_frame_times), 0, 0, 1, 1},
  {&__pyx_n_s_fullscreen, __pyx_k_fullscreen, sizeof(__pyx_k_fullscreen), 0, 0, 1, 1},
  {&__pyx_n_s_fullscreen_video, __pyx_k_fullscreen_video, sizeof(__pyx_k_fullscreen_video), 0, 0, 1, 1},
  {&__pyx_n_s_game, __pyx_k_game, sizeof(__pyx_k_game), 0, 0, 1, 1},
  {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1},
  {&__pyx_n_s_get_display_bounds, __pyx_k_get_display_bounds, sizeof(__pyx_k_get_display_bounds), 0, 0, 1, 1},
  {&__pyx_n_s_get_drawable_size, __pyx_k_get_drawable_size, sizeof(__pyx_k_get_drawable_size), 0, 0, 1, 1},
  {&__pyx_n_s_get_half, __pyx_k_get_half, sizeof(__pyx_k_get_half), 0, 0, 1, 1},
  {&__pyx_n_s_get_half_locals_draw_func, __pyx_k_get_half_locals_draw_func, sizeof(__pyx_k_get_half_locals_draw_func), 0, 0, 1, 1},
  {&__pyx_n_s_get_info, __pyx_k_get_info, sizeof(__pyx_k_get_info), 0, 0, 1, 1},
  {&__pyx_n_s_get_mouse_info, __pyx_k_get_mouse_info, sizeof(__pyx_k_get_mouse_info), 0, 0, 1, 1},
  {&__pyx_n_s_get_pos, __pyx_k_get_pos, sizeof(__pyx_k_get_pos), 0, 0, 1, 1},
  {&__pyx_n_s_get_size, __pyx_k_get_size, sizeof(__pyx_k_get_size), 0, 0, 1, 1},
  {&__pyx_n_s_get_size_limit, __pyx_k_get_size_limit, sizeof(__pyx_k_get_size_limit), 0, 0, 1, 1},
  {&__pyx_n_s_gl_enable, __pyx_k_gl_enable, sizeof(__pyx_k_gl_enable), 0, 0, 1, 1},
  {&__pyx_n_s_gl_set_attribute, __pyx_k_gl_set_attribute, sizeof(__pyx_k_gl_set_attribute), 0, 0, 1, 1},
  {&__pyx_n_s_gl_size, __pyx_k_gl_size, sizeof(__pyx_k_gl_size), 0, 0, 1, 1},
  {&__pyx_n_s_glblacklist, __pyx_k_glblacklist, sizeof(__pyx_k_glblacklist), 0, 0, 1, 1},
  {&__pyx_n_s_glenviron_fixed, __pyx_k_glenviron_fixed, sizeof(__pyx_k_glenviron_fixed), 0, 0, 1, 1},
  {&__pyx_n_s_glenviron_limited, __pyx_k_glenviron_limited, sizeof(__pyx_k_glenviron_limited), 0, 0, 1, 1},
  {&__pyx_n_s_glenviron_shader, __pyx_k_glenviron_shader, sizeof(__pyx_k_glenviron_shader), 0, 0, 1, 1},
  {&__pyx_n_s_glrtt_copy, __pyx_k_glrtt_copy, sizeof(__pyx_k_glrtt_copy), 0, 0, 1, 1},
  {&__pyx_n_s_glrtt_fbo, __pyx_k_glrtt_fbo, sizeof(__pyx_k_glrtt_fbo), 0, 0, 1, 1},
  {&__pyx_n_s_gltexture, __pyx_k_gltexture, sizeof(__pyx_k_gltexture), 0, 0, 1, 1},
  {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1},
  {&__pyx_n_s_half_cache, __pyx_k_half_cache, sizeof(__pyx_k_half_cache), 0, 0, 1, 1},
  {&__pyx_n_s_height, __pyx_k_height, sizeof(__pyx_k_height), 0, 0, 1, 1},
  {&__pyx_kp_s_home_tom_ab_renpy_renpy_angle_g, __pyx_k_home_tom_ab_renpy_renpy_angle_g, sizeof(__pyx_k_home_tom_ab_renpy_renpy_angle_g), 0, 0, 1, 0},
  {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
  {&__pyx_n_s_init_locals_use_subsystem, __pyx_k_init_locals_use_subsystem, sizeof(__pyx_k_init_locals_use_subsystem), 0, 0, 1, 1},
  {&__pyx_n_s_interface, __pyx_k_interface, sizeof(__pyx_k_interface), 0, 0, 1, 1},
  {&__pyx_n_s_ios, __pyx_k_ios, sizeof(__pyx_k_ios), 0, 0, 1, 1},
  {&__pyx_n_s_is_opaque, __pyx_k_is_opaque, sizeof(__pyx_k_is_opaque), 0, 0, 1, 1},
  {&__pyx_n_s_kill, __pyx_k_kill, sizeof(__pyx_k_kill), 0, 0, 1, 1},
  {&__pyx_n_s_kill_textures, __pyx_k_kill_textures, sizeof(__pyx_k_kill_textures), 0, 0, 1, 1},
  {&__pyx_n_s_limited, __pyx_k_limited, sizeof(__pyx_k_limited), 0, 0, 1, 1},
  {&__pyx_n_s_load_texture, __pyx_k_load_texture, sizeof(__pyx_k_load_texture), 0, 0, 1, 1},
  {&__pyx_n_s_log, __pyx_k_log, sizeof(__pyx_k_log), 0, 0, 1, 1},
  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
  {&__pyx_n_s_mobile, __pyx_k_mobile, sizeof(__pyx_k_mobile), 0, 0, 1, 1},
  {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
  {&__pyx_n_s_module_2, __pyx_k_module_2, sizeof(__pyx_k_module_2), 0, 0, 1, 1},
  {&__pyx_n_s_mouse, __pyx_k_mouse, sizeof(__pyx_k_mouse), 0, 0, 1, 1},
  {&__pyx_n_s_movie, __pyx_k_movie, sizeof(__pyx_k_movie), 0, 0, 1, 1},
  {&__pyx_n_s_nearest, __pyx_k_nearest, sizeof(__pyx_k_nearest), 0, 0, 1, 1},
  {&__pyx_n_s_nearest_neighbor, __pyx_k_nearest_neighbor, sizeof(__pyx_k_nearest_neighbor), 0, 0, 1, 1},
  {&__pyx_n_s_needs_redraw, __pyx_k_needs_redraw, sizeof(__pyx_k_needs_redraw), 0, 0, 1, 1},
  {&__pyx_n_s_non_aligned, __pyx_k_non_aligned, sizeof(__pyx_k_non_aligned), 0, 0, 1, 1},
  {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1},
  {&__pyx_n_s_operation_alpha, __pyx_k_operation_alpha, sizeof(__pyx_k_operation_alpha), 0, 0, 1, 1},
  {&__pyx_n_s_operation_complete, __pyx_k_operation_complete, sizeof(__pyx_k_operation_complete), 0, 0, 1, 1},
  {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1},
  {&__pyx_n_s_os_path, __pyx_k_os_path, sizeof(__pyx_k_os_path), 0, 0, 1, 1},
  {&__pyx_n_s_over, __pyx_k_over, sizeof(__pyx_k_over), 0, 0, 1, 1},
  {&__pyx_n_s_pgrender, __pyx_k_pgrender, sizeof(__pyx_k_pgrender), 0, 0, 1, 1},
  {&__pyx_n_s_physical_size, __pyx_k_physical_size, sizeof(__pyx_k_physical_size), 0, 0, 1, 1},
  {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1},
  {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1},
  {&__pyx_n_s_post_init, __pyx_k_post_init, sizeof(__pyx_k_post_init), 0, 0, 1, 1},
  {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
  {&__pyx_kp_s_primary_display_bounds_r, __pyx_k_primary_display_bounds_r, sizeof(__pyx_k_primary_display_bounds_r), 0, 0, 1, 0},
  {&__pyx_n_s_pygame, __pyx_k_pygame, sizeof(__pyx_k_pygame), 0, 0, 1, 1},
  {&__pyx_n_s_pygame_sdl2, __pyx_k_pygame_sdl2, sizeof(__pyx_k_pygame_sdl2), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
  {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
  {&__pyx_n_s_quit, __pyx_k_quit, sizeof(__pyx_k_quit), 0, 0, 1, 1},
  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
  {&__pyx_n_s_render, __pyx_k_render, sizeof(__pyx_k_render), 0, 0, 1, 1},
  {&__pyx_n_s_render_movie, __pyx_k_render_movie, sizeof(__pyx_k_render_movie), 0, 0, 1, 1},
  {&__pyx_n_s_render_to_texture, __pyx_k_render_to_texture, sizeof(__pyx_k_render_to_texture), 0, 0, 1, 1},
  {&__pyx_n_s_render_to_texture_locals_draw_fu, __pyx_k_render_to_texture_locals_draw_fu, sizeof(__pyx_k_render_to_texture_locals_draw_fu), 0, 0, 1, 1},
  {&__pyx_n_s_renderer, __pyx_k_renderer, sizeof(__pyx_k_renderer), 0, 0, 1, 1},
  {&__pyx_n_s_renpy, __pyx_k_renpy, sizeof(__pyx_k_renpy), 0, 0, 1, 1},
  {&__pyx_n_s_renpy_angle_gldraw, __pyx_k_renpy_angle_gldraw, sizeof(__pyx_k_renpy_angle_gldraw), 0, 0, 1, 1},
  {&__pyx_n_s_req_ext, __pyx_k_req_ext, sizeof(__pyx_k_req_ext), 0, 0, 1, 1},
  {&__pyx_n_s_resizable, __pyx_k_resizable, sizeof(__pyx_k_resizable), 0, 0, 1, 1},
  {&__pyx_n_s_reverse, __pyx_k_reverse, sizeof(__pyx_k_reverse), 0, 0, 1, 1},
  {&__pyx_n_s_round, __pyx_k_round, sizeof(__pyx_k_round), 0, 0, 1, 1},
  {&__pyx_n_s_rtt, __pyx_k_rtt, sizeof(__pyx_k_rtt), 0, 0, 1, 1},
  {&__pyx_kp_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 0},
  {&__pyx_n_s_screen_rect, __pyx_k_screen_rect, sizeof(__pyx_k_screen_rect), 0, 0, 1, 1},
  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
  {&__pyx_n_s_set_clip, __pyx_k_set_clip, sizeof(__pyx_k_set_clip), 0, 0, 1, 1},
  {&__pyx_n_s_set_mode, __pyx_k_set_mode, sizeof(__pyx_k_set_mode), 0, 0, 1, 1},
  {&__pyx_n_s_set_pos, __pyx_k_set_pos, sizeof(__pyx_k_set_pos), 0, 0, 1, 1},
  {&__pyx_n_s_set_rgba_masks, __pyx_k_set_rgba_masks, sizeof(__pyx_k_set_rgba_masks), 0, 0, 1, 1},
  {&__pyx_n_s_set_visible, __pyx_k_set_visible, sizeof(__pyx_k_set_visible), 0, 0, 1, 1},
  {&__pyx_n_s_shader, __pyx_k_shader, sizeof(__pyx_k_shader), 0, 0, 1, 1},
  {&__pyx_n_s_sleep, __pyx_k_sleep, sizeof(__pyx_k_sleep), 0, 0, 1, 1},
  {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1},
  {&__pyx_n_s_subpixel, __pyx_k_subpixel, sizeof(__pyx_k_subpixel), 0, 0, 1, 1},
  {&__pyx_n_s_subsurface, __pyx_k_subsurface, sizeof(__pyx_k_subsurface), 0, 0, 1, 1},
  {&__pyx_n_s_sum, __pyx_k_sum, sizeof(__pyx_k_sum), 0, 0, 1, 1},
  {&__pyx_n_s_surf, __pyx_k_surf, sizeof(__pyx_k_surf), 0, 0, 1, 1},
  {&__pyx_n_s_surface, __pyx_k_surface, sizeof(__pyx_k_surface), 0, 0, 1, 1},
  {&__pyx_n_s_surface_unscaled, __pyx_k_surface_unscaled, sizeof(__pyx_k_surface_unscaled), 0, 0, 1, 1},
  {&__pyx_n_s_surftree, __pyx_k_surftree, sizeof(__pyx_k_surftree), 0, 0, 1, 1},
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {&__pyx_n_s_test_texture_sizes, __pyx_k_test_texture_sizes, sizeof(__pyx_k_test_texture_sizes), 0, 0, 1, 1},
  {&__pyx_n_s_text_rect, __pyx_k_text_rect, sizeof(__pyx_k_text_rect), 0, 0, 1, 1},
  {&__pyx_n_s_texture, __pyx_k_texture, sizeof(__pyx_k_texture), 0, 0, 1, 1},
  {&__pyx_n_s_texture_count, __pyx_k_texture_count, sizeof(__pyx_k_texture_count), 0, 0, 1, 1},
  {&__pyx_n_s_texture_grid_from_drawing, __pyx_k_texture_grid_from_drawing, sizeof(__pyx_k_texture_grid_from_drawing), 0, 0, 1, 1},
  {&__pyx_n_s_texture_grid_from_surface, __pyx_k_texture_grid_from_surface, sizeof(__pyx_k_texture_grid_from_surface), 0, 0, 1, 1},
  {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1},
  {&__pyx_n_s_total_texture_size, __pyx_k_total_texture_size, sizeof(__pyx_k_total_texture_size), 0, 0, 1, 1},
  {&__pyx_n_s_transient, __pyx_k_transient, sizeof(__pyx_k_transient), 0, 0, 1, 1},
  {&__pyx_n_s_translate_point, __pyx_k_translate_point, sizeof(__pyx_k_translate_point), 0, 0, 1, 1},
  {&__pyx_n_s_untranslate_point, __pyx_k_untranslate_point, sizeof(__pyx_k_untranslate_point), 0, 0, 1, 1},
  {&__pyx_n_s_upper, __pyx_k_upper, sizeof(__pyx_k_upper), 0, 0, 1, 1},
  {&__pyx_n_s_use_drawable_resolution, __pyx_k_use_drawable_resolution, sizeof(__pyx_k_use_drawable_resolution), 0, 0, 1, 1},
  {&__pyx_n_s_use_gl, __pyx_k_use_gl, sizeof(__pyx_k_use_gl), 0, 0, 1, 1},
  {&__pyx_n_s_use_gles, __pyx_k_use_gles, sizeof(__pyx_k_use_gles), 0, 0, 1, 1},
  {&__pyx_n_s_use_subsystem, __pyx_k_use_subsystem, sizeof(__pyx_k_use_subsystem), 0, 0, 1, 1},
  {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
  {&__pyx_n_s_video, __pyx_k_video, sizeof(__pyx_k_video), 0, 0, 1, 1},
  {&__pyx_n_s_virtual_size, __pyx_k_virtual_size, sizeof(__pyx_k_virtual_size), 0, 0, 1, 1},
  {&__pyx_n_s_vsync, __pyx_k_vsync, sizeof(__pyx_k_vsync), 0, 0, 1, 1},
  {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1},
  {&__pyx_n_s_weakref, __pyx_k_weakref, sizeof(__pyx_k_weakref), 0, 0, 1, 1},
  {&__pyx_n_s_what, __pyx_k_what, sizeof(__pyx_k_what), 0, 0, 1, 1},
  {&__pyx_n_s_width, __pyx_k_width, sizeof(__pyx_k_width), 0, 0, 1, 1},
  {&__pyx_n_s_windows, __pyx_k_windows, sizeof(__pyx_k_windows), 0, 0, 1, 1},
  {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1},
  {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
  {&__pyx_n_s_xo, __pyx_k_xo, sizeof(__pyx_k_xo), 0, 0, 1, 1},
  {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1},
  {&__pyx_n_s_yo, __pyx_k_yo, sizeof(__pyx_k_yo), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_round = __Pyx_GetBuiltinName(__pyx_n_s_round); if (!__pyx_builtin_round) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_Exception = __Pyx_GetBuiltinName(__pyx_n_s_Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_n_s_sum); if (!__pyx_builtin_sum) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __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);

  /* "renpy/angle/gldraw.pyx":112
 * 
 *         # The (x, y) and texture of the software mouse.
 *         self.mouse_info = (0, 0, None)             # <<<<<<<<<<<<<<
 * 
 *         # This is used to cache the surface->texture operation.
 */
  __pyx_tuple_ = PyTuple_Pack(3, __pyx_int_0, __pyx_int_0, Py_None); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple_);
  __Pyx_GIVEREF(__pyx_tuple_);

  /* "renpy/angle/gldraw.pyx":180
 * 
 *         if not renpy.config.gl_enable:
 *             renpy.display.log.write("GL Disabled.")             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_GL_Disabled); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__2);
  __Pyx_GIVEREF(__pyx_tuple__2);

  /* "renpy/angle/gldraw.pyx":205
 *             renpy.display.interface.post_init()
 * 
 *         renpy.display.log.write("")             # <<<<<<<<<<<<<<
 * 
 *         self.virtual_size = virtual_size
 */
  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s__3); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__4);
  __Pyx_GIVEREF(__pyx_tuple__4);

  /* "renpy/angle/gldraw.pyx":232
 *             visible_h = info.current_h
 * 
 *             if renpy.windows and renpy.windows <= (6, 1):             # <<<<<<<<<<<<<<
 *                 visible_h -= 102
 * 
 */
  __pyx_tuple__5 = PyTuple_Pack(2, __pyx_int_6, __pyx_int_1); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__5);
  __Pyx_GIVEREF(__pyx_tuple__5);

  /* "renpy/angle/gldraw.pyx":235
 *                 visible_h -= 102
 * 
 *             bounds = pygame.display.get_display_bounds(0)             # <<<<<<<<<<<<<<
 * 
 *             renpy.display.log.write("primary display bounds: %r", bounds)
 */
  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__6);
  __Pyx_GIVEREF(__pyx_tuple__6);

  /* "renpy/angle/gldraw.pyx":260
 * 
 *         # Handle swap control.
 *         vsync = int(os.environ.get("RENPY_GL_VSYNC", "1"))             # <<<<<<<<<<<<<<
 * 
 *         if ANGLE:
 */
  __pyx_tuple__7 = PyTuple_Pack(2, __pyx_n_s_RENPY_GL_VSYNC, __pyx_kp_s_1); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__7);
  __Pyx_GIVEREF(__pyx_tuple__7);

  /* "renpy/angle/gldraw.pyx":307
 *         if fullscreen:
 *             try:
 *                 renpy.display.log.write("Fullscreen mode.")             # <<<<<<<<<<<<<<
 *                 self.window = pygame.display.set_mode((0, 0), pygame.WINDOW_FULLSCREEN_DESKTOP | opengl | pygame.DOUBLEBUF)
 *             except pygame.error as e:
 */
  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_Fullscreen_mode); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__8);
  __Pyx_GIVEREF(__pyx_tuple__8);

  /* "renpy/angle/gldraw.pyx":308
 *             try:
 *                 renpy.display.log.write("Fullscreen mode.")
 *                 self.window = pygame.display.set_mode((0, 0), pygame.WINDOW_FULLSCREEN_DESKTOP | opengl | pygame.DOUBLEBUF)             # <<<<<<<<<<<<<<
 *             except pygame.error as e:
 *                 renpy.display.log.write("Opening in fullscreen failed: %r", e)
 */
  __pyx_tuple__9 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__9);
  __Pyx_GIVEREF(__pyx_tuple__9);

  /* "renpy/angle/gldraw.pyx":315
 *         if self.window is None:
 *             try:
 *                 renpy.display.log.write("Windowed mode.")             # <<<<<<<<<<<<<<
 *                 self.window = pygame.display.set_mode((pwidth, pheight), resizable | opengl | pygame.DOUBLEBUF, **window_args)
 * 
 */
  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Windowed_mode); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__10);
  __Pyx_GIVEREF(__pyx_tuple__10);

  /* "renpy/angle/gldraw.pyx":473
 * 
 *         if not allow_shader:
 *             renpy.display.log.write("Shaders are blacklisted.")             # <<<<<<<<<<<<<<
 *         if not allow_fixed:
 *             renpy.display.log.write("Fixed-function is blacklisted.")
 */
  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_Shaders_are_blacklisted); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__11);
  __Pyx_GIVEREF(__pyx_tuple__11);

  /* "renpy/angle/gldraw.pyx":475
 *             renpy.display.log.write("Shaders are blacklisted.")
 *         if not allow_fixed:
 *             renpy.display.log.write("Fixed-function is blacklisted.")             # <<<<<<<<<<<<<<
 * 
 *         if not allow_shader and not allow_fixed:
 */
  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Fixed_function_is_blacklisted); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__12);
  __Pyx_GIVEREF(__pyx_tuple__12);

  /* "renpy/angle/gldraw.pyx":478
 * 
 *         if not allow_shader and not allow_fixed:
 *             renpy.display.log.write("GL is totally blacklisted.")             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_GL_is_totally_blacklisted); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__13);
  __Pyx_GIVEREF(__pyx_tuple__13);

  /* "renpy/angle/gldraw.pyx":493
 * 
 *         extensions_string = <char *> glGetString(GL_EXTENSIONS)
 *         extensions = set(extensions_string.split(" "))             # <<<<<<<<<<<<<<
 * 
 *         renpy.display.log.write("Extensions:")
 */
  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s__14); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__15);
  __Pyx_GIVEREF(__pyx_tuple__15);

  /* "renpy/angle/gldraw.pyx":495
 *         extensions = set(extensions_string.split(" "))
 * 
 *         renpy.display.log.write("Extensions:")             # <<<<<<<<<<<<<<
 * 
 *         for i in sorted(extensions):
 */
  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Extensions); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__16);
  __Pyx_GIVEREF(__pyx_tuple__16);

  /* "renpy/angle/gldraw.pyx":500
 *             renpy.display.log.write("    %s", i)
 * 
 *         def use_subsystem(module, envvar, envval, *req_ext):             # <<<<<<<<<<<<<<
 *             """
 *             Decides if we should used a particular subsystem, based on
 */
  __pyx_tuple__17 = PyTuple_Pack(6, __pyx_n_s_module, __pyx_n_s_envvar, __pyx_n_s_envval, __pyx_n_s_req_ext, __pyx_n_s_value, __pyx_n_s_i); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__17);
  __Pyx_GIVEREF(__pyx_tuple__17);
  __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_renpy_renpy_angle_g, __pyx_n_s_use_subsystem, 500, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/angle/gldraw.pyx":542
 * 
 *             try:
 *                 renpy.display.log.write("Using shader environment.")             # <<<<<<<<<<<<<<
 *                 self.environ = glenviron_shader.ShaderEnviron()
 *                 self.info["environ"] = "shader"
 */
  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_Using_shader_environment); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__19);
  __Pyx_GIVEREF(__pyx_tuple__19);

  /* "renpy/angle/gldraw.pyx":548
 * 
 *             except Exception, e:
 *                 renpy.display.log.write("Initializing shader environment failed:")             # <<<<<<<<<<<<<<
 *                 renpy.display.log.exception()
 *                 self.environ = None
 */
  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Initializing_shader_environment); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__20);
  __Pyx_GIVEREF(__pyx_tuple__20);

  /* "renpy/angle/gldraw.pyx":561
 *                 "GL_ARB_texture_env_combine"):
 * 
 *                 renpy.display.log.write("Using fixed-function environment (clause 1).")             # <<<<<<<<<<<<<<
 *                 self.environ = glenviron_fixed.FixedFunctionEnviron()
 *                 self.info["environ"] = "fixed"
 */
  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_Using_fixed_function_environment); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__21);
  __Pyx_GIVEREF(__pyx_tuple__21);

  /* "renpy/angle/gldraw.pyx":572
 *                 "GL_NV_texture_env_combine4"):
 * 
 *                 renpy.display.log.write("Using fixed-function environment (clause 2).")             # <<<<<<<<<<<<<<
 *                 self.environ = glenviron_fixed.FixedFunctionEnviron()
 *                 self.info["environ"] = "fixed"
 */
  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Using_fixed_function_environment_2); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__22);
  __Pyx_GIVEREF(__pyx_tuple__22);

  /* "renpy/angle/gldraw.pyx":583
 *                 "RENPY_bogus_extension"):
 * 
 *                 renpy.display.log.write("Using limited environment.")             # <<<<<<<<<<<<<<
 *                 self.environ = glenviron_limited.LimitedEnviron()
 *                 self.info["environ"] = "limited"
 */
  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_Using_limited_environment); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__23);
  __Pyx_GIVEREF(__pyx_tuple__23);

  /* "renpy/angle/gldraw.pyx":589
 * 
 *             else:
 *                 renpy.display.log.write("Can't find a workable environment.")             # <<<<<<<<<<<<<<
 *                 return False
 * 
 */
  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_Can_t_find_a_workable_environmen); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__24);
  __Pyx_GIVEREF(__pyx_tuple__24);

  /* "renpy/angle/gldraw.pyx":607
 * 
 *         if use_fbo:
 *             renpy.display.log.write("Using FBO RTT.")             # <<<<<<<<<<<<<<
 *             self.rtt = glrtt_fbo.FboRtt()
 *             self.info["rtt"] = "fbo"
 */
  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_Using_FBO_RTT); if (unlikely(!__pyx_tuple__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__25);
  __Pyx_GIVEREF(__pyx_tuple__25);

  /* "renpy/angle/gldraw.pyx":613
 * 
 *         elif glrtt_copy:
 *             renpy.display.log.write("Using copy RTT.")             # <<<<<<<<<<<<<<
 *             self.rtt = glrtt_copy.CopyRtt()
 *             self.info["rtt"] = "copy"
 */
  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_Using_copy_RTT); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__26);
  __Pyx_GIVEREF(__pyx_tuple__26);

  /* "renpy/angle/gldraw.pyx":619
 * 
 *         else:
 *             renpy.display.log.write("Can't find a workable rtt.")             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_Can_t_find_a_workable_rtt); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__27);
  __Pyx_GIVEREF(__pyx_tuple__27);

  /* "renpy/angle/gldraw.pyx":856
 * 
 *         if render_what:
 *             what.render_to_texture(True)             # <<<<<<<<<<<<<<
 * 
 *     cpdef int draw_transformed(
 */
  __pyx_tuple__28 = PyTuple_Pack(1, Py_True); if (unlikely(!__pyx_tuple__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__28);
  __Pyx_GIVEREF(__pyx_tuple__28);

  /* "renpy/angle/gldraw.pyx":946
 * 
 *             gltexture.imageblend(
 *                 rend.children[0][0].render_to_texture(True),             # <<<<<<<<<<<<<<
 *                 rend.children[1][0].render_to_texture(what.operation_alpha),
 *                 rend.children[2][0].render_to_texture(what.operation_alpha),
 */
  __pyx_tuple__29 = PyTuple_Pack(1, Py_True); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__29);
  __Pyx_GIVEREF(__pyx_tuple__29);

  /* "renpy/angle/gldraw.pyx":992
 *             # Non-aligned clipping uses RTT.
 *             if reverse.ydx != 0 or reverse.xdy != 0:
 *                 tex = what.render_to_texture(True)             # <<<<<<<<<<<<<<
 *                 self.draw_transformed(tex, clip, xo, yo, alpha, over, reverse * self.draw_to_virt, nearest, subpixel)
 *                 return 0
 */
  __pyx_tuple__30 = PyTuple_Pack(1, Py_True); if (unlikely(!__pyx_tuple__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__30);
  __Pyx_GIVEREF(__pyx_tuple__30);

  /* "renpy/angle/gldraw.pyx":1048
 *         height = int(what.height * self.draw_per_virt)
 * 
 *         def draw_func(x, y, w, h):             # <<<<<<<<<<<<<<
 * 
 *             self.clip_mode_rtt(x, y, w, h)
 */
  __pyx_tuple__31 = PyTuple_Pack(5, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_w, __pyx_n_s_h, __pyx_n_s_clip); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__31);
  __Pyx_GIVEREF(__pyx_tuple__31);
  __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_renpy_renpy_angle_g, __pyx_n_s_draw_func, 1048, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/angle/gldraw.pyx":1098
 *             self.environ.ortho(0, 1, 0, 1, -1, 1)
 * 
 *             self.clip_mode_rtt(0, 0, 1, 1)             # <<<<<<<<<<<<<<
 *             clip = (0, 0, 1, 1)
 * 
 */
  __pyx_tuple__33 = PyTuple_Pack(4, __pyx_int_0, __pyx_int_0, __pyx_int_1, __pyx_int_1); if (unlikely(!__pyx_tuple__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__33);
  __Pyx_GIVEREF(__pyx_tuple__33);

  /* "renpy/angle/gldraw.pyx":1099
 * 
 *             self.clip_mode_rtt(0, 0, 1, 1)
 *             clip = (0, 0, 1, 1)             # <<<<<<<<<<<<<<
 * 
 *             glClearColor(0.0, 0.0, 0.0, 0.0)
 */
  __pyx_tuple__34 = PyTuple_Pack(4, __pyx_int_0, __pyx_int_0, __pyx_int_1, __pyx_int_1); if (unlikely(!__pyx_tuple__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__34);
  __Pyx_GIVEREF(__pyx_tuple__34);

  /* "renpy/angle/gldraw.pyx":1131
 *             return what.half_cache
 * 
 *         reverse = renpy.display.render.Matrix2D(0.5, 0, 0, .5)             # <<<<<<<<<<<<<<
 * 
 *         width = max(what.width / 2, 1)
 */
  __pyx_tuple__35 = PyTuple_Pack(4, __pyx_float_0_5, __pyx_int_0, __pyx_int_0, __pyx_float__5); if (unlikely(!__pyx_tuple__35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__35);
  __Pyx_GIVEREF(__pyx_tuple__35);

  /* "renpy/angle/gldraw.pyx":1136
 *         height = max(what.height / 2, 1)
 * 
 *         def draw_func(x, y, w, h):             # <<<<<<<<<<<<<<
 * 
 *             glClearColor(0.0, 0.0, 0.0, 1.0)
 */
  __pyx_tuple__36 = PyTuple_Pack(5, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_w, __pyx_n_s_h, __pyx_n_s_clip); if (unlikely(!__pyx_tuple__36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__36);
  __Pyx_GIVEREF(__pyx_tuple__36);
  __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_renpy_renpy_angle_g, __pyx_n_s_draw_func, 1136, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/angle/gldraw.pyx":1356
 *         """
 * 
 *         raise Exception("Not implemented.")             # <<<<<<<<<<<<<<
 * 
 *     def get_size_limit(self, dimension):
 */
  __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_Not_implemented); if (unlikely(!__pyx_tuple__38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__38);
  __Pyx_GIVEREF(__pyx_tuple__38);

  /* "renpy/angle/gldraw.pyx":1363
 *         """
 * 
 *         raise Exception("Not implemented.")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s_Not_implemented); if (unlikely(!__pyx_tuple__39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__39);
  __Pyx_GIVEREF(__pyx_tuple__39);

  /* "renpy/angle/gldraw.pyx":1342
 *     """
 * 
 *     def init(self):             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_tuple__40 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__40);
  __Pyx_GIVEREF(__pyx_tuple__40);
  __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_renpy_renpy_angle_g, __pyx_n_s_init, 1342, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/angle/gldraw.pyx":1345
 *         return
 * 
 *     def deinit(self):             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_tuple__42 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__42);
  __Pyx_GIVEREF(__pyx_tuple__42);
  __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_renpy_renpy_angle_g, __pyx_n_s_deinit, 1345, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/angle/gldraw.pyx":1348
 *         return
 * 
 *     def render(self, texture, x, y, w, h, draw_func):             # <<<<<<<<<<<<<<
 *         """
 *         This function is called to trigger a rendering to a texture.
 */
  __pyx_tuple__44 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_texture, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_w, __pyx_n_s_h, __pyx_n_s_draw_func); if (unlikely(!__pyx_tuple__44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__44);
  __Pyx_GIVEREF(__pyx_tuple__44);
  __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(7, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_renpy_renpy_angle_g, __pyx_n_s_render, 1348, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/angle/gldraw.pyx":1358
 *         raise Exception("Not implemented.")
 * 
 *     def get_size_limit(self, dimension):             # <<<<<<<<<<<<<<
 *         """
 *         Get the maximum size of a texture.
 */
  __pyx_tuple__46 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_dimension); if (unlikely(!__pyx_tuple__46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__46);
  __Pyx_GIVEREF(__pyx_tuple__46);
  __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_tom_ab_renpy_renpy_angle_g, __pyx_n_s_get_size_limit, 1358, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1358; __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;};
  __pyx_float__5 = PyFloat_FromDouble(.5); if (unlikely(!__pyx_float__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_float_0_5 = PyFloat_FromDouble(0.5); if (unlikely(!__pyx_float_0_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_float_1_0 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_float_1_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_float_2_0 = PyFloat_FromDouble(2.0); if (unlikely(!__pyx_float_2_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_float__001 = PyFloat_FromDouble(.001); if (unlikely(!__pyx_float__001)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_6 = PyInt_FromLong(6); if (unlikely(!__pyx_int_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_102 = PyInt_FromLong(102); if (unlikely(!__pyx_int_102)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_255 = PyInt_FromLong(255); if (unlikely(!__pyx_int_255)) {__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 initgldraw(void); /*proto*/
PyMODINIT_FUNC initgldraw(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;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __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_Coroutine_USED
  if (__pyx_Coroutine_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
  #ifdef __Pyx_StopAsyncIteration_USED
  if (__pyx_StopAsyncIteration_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("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;}
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_INCREF(__pyx_d);
  __pyx_b = PyImport_AddModule(__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 (PyObject_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 (__Pyx_InitGlobals() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  if (__pyx_module_is_main_renpy__angle__gldraw) {
    if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__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, "renpy.angle.gldraw")) {
      if (unlikely(PyDict_SetItemString(modules, "renpy.angle.gldraw", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Global init code ---*/
  __pyx_v_5renpy_5angle_6gldraw_IDENTITY = Py_None; Py_INCREF(Py_None);
  /*--- Variable export code ---*/
  /*--- Function export code ---*/
  /*--- Type init code ---*/
  __pyx_vtabptr_5renpy_5angle_6gldraw_Environ = &__pyx_vtable_5renpy_5angle_6gldraw_Environ;
  __pyx_vtable_5renpy_5angle_6gldraw_Environ.blit = (void (*)(struct __pyx_obj_5renpy_5angle_6gldraw_Environ *))__pyx_f_5renpy_5angle_6gldraw_7Environ_blit;
  __pyx_vtable_5renpy_5angle_6gldraw_Environ.blend = (void (*)(struct __pyx_obj_5renpy_5angle_6gldraw_Environ *, double))__pyx_f_5renpy_5angle_6gldraw_7Environ_blend;
  __pyx_vtable_5renpy_5angle_6gldraw_Environ.imageblend = (void (*)(struct __pyx_obj_5renpy_5angle_6gldraw_Environ *, double, int))__pyx_f_5renpy_5angle_6gldraw_7Environ_imageblend;
  __pyx_vtable_5renpy_5angle_6gldraw_Environ.set_vertex = (void (*)(struct __pyx_obj_5renpy_5angle_6gldraw_Environ *, float *))__pyx_f_5renpy_5angle_6gldraw_7Environ_set_vertex;
  __pyx_vtable_5renpy_5angle_6gldraw_Environ.set_texture = (void (*)(struct __pyx_obj_5renpy_5angle_6gldraw_Environ *, int, float *))__pyx_f_5renpy_5angle_6gldraw_7Environ_set_texture;
  __pyx_vtable_5renpy_5angle_6gldraw_Environ.set_color = (void (*)(struct __pyx_obj_5renpy_5angle_6gldraw_Environ *, float, float, float, float))__pyx_f_5renpy_5angle_6gldraw_7Environ_set_color;
  __pyx_vtable_5renpy_5angle_6gldraw_Environ.set_clip = (void (*)(struct __pyx_obj_5renpy_5angle_6gldraw_Environ *, PyObject *, struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *))__pyx_f_5renpy_5angle_6gldraw_7Environ_set_clip;
  __pyx_vtable_5renpy_5angle_6gldraw_Environ.unset_clip = (void (*)(struct __pyx_obj_5renpy_5angle_6gldraw_Environ *, struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *))__pyx_f_5renpy_5angle_6gldraw_7Environ_unset_clip;
  __pyx_vtable_5renpy_5angle_6gldraw_Environ.ortho = (void (*)(struct __pyx_obj_5renpy_5angle_6gldraw_Environ *, double, double, double, double, double, double))__pyx_f_5renpy_5angle_6gldraw_7Environ_ortho;
  __pyx_vtable_5renpy_5angle_6gldraw_Environ.viewport = (void (*)(struct __pyx_obj_5renpy_5angle_6gldraw_Environ *, int, int, int, int))__pyx_f_5renpy_5angle_6gldraw_7Environ_viewport;
  if (PyType_Ready(&__pyx_type_5renpy_5angle_6gldraw_Environ) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_5renpy_5angle_6gldraw_Environ.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_5renpy_5angle_6gldraw_Environ.tp_dict, __pyx_vtabptr_5renpy_5angle_6gldraw_Environ) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyObject_SetAttrString(__pyx_m, "Environ", (PyObject *)&__pyx_type_5renpy_5angle_6gldraw_Environ) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5renpy_5angle_6gldraw_Environ = &__pyx_type_5renpy_5angle_6gldraw_Environ;
  __pyx_vtabptr_5renpy_5angle_6gldraw_GLDraw = &__pyx_vtable_5renpy_5angle_6gldraw_GLDraw;
  __pyx_vtable_5renpy_5angle_6gldraw_GLDraw.set_clip = (PyObject *(*)(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *, PyObject *, int __pyx_skip_dispatch))__pyx_f_5renpy_5angle_6gldraw_6GLDraw_set_clip;
  __pyx_vtable_5renpy_5angle_6gldraw_GLDraw.draw_render_textures = (int (*)(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *, PyObject *, int, int __pyx_skip_dispatch))__pyx_f_5renpy_5angle_6gldraw_6GLDraw_draw_render_textures;
  __pyx_vtable_5renpy_5angle_6gldraw_GLDraw.draw_transformed = (int (*)(struct __pyx_obj_5renpy_5angle_6gldraw_GLDraw *, PyObject *, PyObject *, double, double, double, double, struct __pyx_obj_5renpy_7display_6render_Matrix2D *, int, int, int __pyx_skip_dispatch))__pyx_f_5renpy_5angle_6gldraw_6GLDraw_draw_transformed;
  if (PyType_Ready(&__pyx_type_5renpy_5angle_6gldraw_GLDraw) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_5renpy_5angle_6gldraw_GLDraw.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_5renpy_5angle_6gldraw_GLDraw.tp_dict, __pyx_vtabptr_5renpy_5angle_6gldraw_GLDraw) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyObject_SetAttrString(__pyx_m, "GLDraw", (PyObject *)&__pyx_type_5renpy_5angle_6gldraw_GLDraw) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5renpy_5angle_6gldraw_GLDraw = &__pyx_type_5renpy_5angle_6gldraw_GLDraw;
  if (PyType_Ready(&__pyx_type_5renpy_5angle_6gldraw___pyx_scope_struct__init) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_5renpy_5angle_6gldraw___pyx_scope_struct__init.tp_print = 0;
  __pyx_ptype_5renpy_5angle_6gldraw___pyx_scope_struct__init = &__pyx_type_5renpy_5angle_6gldraw___pyx_scope_struct__init;
  if (PyType_Ready(&__pyx_type_5renpy_5angle_6gldraw___pyx_scope_struct_1_render_to_texture) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_5renpy_5angle_6gldraw___pyx_scope_struct_1_render_to_texture.tp_print = 0;
  __pyx_ptype_5renpy_5angle_6gldraw___pyx_scope_struct_1_render_to_texture = &__pyx_type_5renpy_5angle_6gldraw___pyx_scope_struct_1_render_to_texture;
  if (PyType_Ready(&__pyx_type_5renpy_5angle_6gldraw___pyx_scope_struct_2_get_half) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_5renpy_5angle_6gldraw___pyx_scope_struct_2_get_half.tp_print = 0;
  __pyx_ptype_5renpy_5angle_6gldraw___pyx_scope_struct_2_get_half = &__pyx_type_5renpy_5angle_6gldraw___pyx_scope_struct_2_get_half;
  /*--- Type import code ---*/
  __pyx_ptype_5renpy_7display_6render_Matrix2D = __Pyx_ImportType("renpy.display.render", "Matrix2D", sizeof(struct __pyx_obj_5renpy_7display_6render_Matrix2D), 1); if (unlikely(!__pyx_ptype_5renpy_7display_6render_Matrix2D)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_5renpy_7display_6render_Matrix2D = (struct __pyx_vtabstruct_5renpy_7display_6render_Matrix2D*)__Pyx_GetVtable(__pyx_ptype_5renpy_7display_6render_Matrix2D->tp_dict); if (unlikely(!__pyx_vtabptr_5renpy_7display_6render_Matrix2D)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5renpy_7display_6render_Render = __Pyx_ImportType("renpy.display.render", "Render", sizeof(struct __pyx_obj_5renpy_7display_6render_Render), 1); if (unlikely(!__pyx_ptype_5renpy_7display_6render_Render)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_5renpy_7display_6render_Render = (struct __pyx_vtabstruct_5renpy_7display_6render_Render*)__Pyx_GetVtable(__pyx_ptype_5renpy_7display_6render_Render->tp_dict); if (unlikely(!__pyx_vtabptr_5renpy_7display_6render_Render)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5renpy_5angle_9gltexture_TextureCore = __Pyx_ImportType("renpy.angle.gltexture", "TextureCore", sizeof(struct __pyx_obj_5renpy_5angle_9gltexture_TextureCore), 1); if (unlikely(!__pyx_ptype_5renpy_5angle_9gltexture_TextureCore)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_5renpy_5angle_9gltexture_TextureCore = (struct __pyx_vtabstruct_5renpy_5angle_9gltexture_TextureCore*)__Pyx_GetVtable(__pyx_ptype_5renpy_5angle_9gltexture_TextureCore->tp_dict); if (unlikely(!__pyx_vtabptr_5renpy_5angle_9gltexture_TextureCore)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5renpy_5angle_9gltexture_TextureGrid = __Pyx_ImportType("renpy.angle.gltexture", "TextureGrid", sizeof(struct __pyx_obj_5renpy_5angle_9gltexture_TextureGrid), 1); if (unlikely(!__pyx_ptype_5renpy_5angle_9gltexture_TextureGrid)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_5renpy_5angle_9gltexture_TextureGrid = (struct __pyx_vtabstruct_5renpy_5angle_9gltexture_TextureGrid*)__Pyx_GetVtable(__pyx_ptype_5renpy_5angle_9gltexture_TextureGrid->tp_dict); if (unlikely(!__pyx_vtabptr_5renpy_5angle_9gltexture_TextureGrid)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Variable import code ---*/
  /*--- Function import code ---*/
  __pyx_t_1 = __Pyx_ImportModule("renpy.angle.gl"); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ImportFunction(__pyx_t_1, "glBlendFunc", (void (**)(void))&__pyx_f_5renpy_5angle_2gl_glBlendFunc, "int (GLenum, GLenum)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ImportFunction(__pyx_t_1, "glClear", (void (**)(void))&__pyx_f_5renpy_5angle_2gl_glClear, "int (GLbitfield)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ImportFunction(__pyx_t_1, "glClearColor", (void (**)(void))&__pyx_f_5renpy_5angle_2gl_glClearColor, "int (GLclampf, GLclampf, GLclampf, GLclampf)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ImportFunction(__pyx_t_1, "glEnable", (void (**)(void))&__pyx_f_5renpy_5angle_2gl_glEnable, "int (GLenum)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ImportFunction(__pyx_t_1, "glFinish", (void (**)(void))&__pyx_f_5renpy_5angle_2gl_glFinish, "int (void)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ImportFunction(__pyx_t_1, "glGetIntegerv", (void (**)(void))&__pyx_f_5renpy_5angle_2gl_glGetIntegerv, "int (GLenum, GLint *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ImportFunction(__pyx_t_1, "glGetString", (void (**)(void))&__pyx_f_5renpy_5angle_2gl_glGetString, "GLchar *(GLenum)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ImportFunction(__pyx_t_1, "glReadPixels", (void (**)(void))&__pyx_f_5renpy_5angle_2gl_glReadPixels, "int (GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, GLubyte *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_2 = __Pyx_ImportModule("renpy.angle.gltexture"); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ImportFunction(__pyx_t_2, "blit", (void (**)(void))&__pyx_f_5renpy_5angle_9gltexture_blit, "PyObject *(struct __pyx_obj_5renpy_5angle_9gltexture_TextureGrid *, double, double, struct __pyx_obj_5renpy_7display_6render_Matrix2D *, double, double, struct __pyx_obj_5renpy_5angle_6gldraw_Environ *, int, int __pyx_skip_dispatch)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ImportFunction(__pyx_t_2, "blend", (void (**)(void))&__pyx_f_5renpy_5angle_9gltexture_blend, "PyObject *(struct __pyx_obj_5renpy_5angle_9gltexture_TextureGrid *, struct __pyx_obj_5renpy_5angle_9gltexture_TextureGrid *, double, double, struct __pyx_obj_5renpy_7display_6render_Matrix2D *, double, double, double, struct __pyx_obj_5renpy_5angle_6gldraw_Environ *, int, int __pyx_skip_dispatch)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ImportFunction(__pyx_t_2, "imageblend", (void (**)(void))&__pyx_f_5renpy_5angle_9gltexture_imageblend, "PyObject *(struct __pyx_obj_5renpy_5angle_9gltexture_TextureGrid *, struct __pyx_obj_5renpy_5angle_9gltexture_TextureGrid *, struct __pyx_obj_5renpy_5angle_9gltexture_TextureGrid *, double, double, struct __pyx_obj_5renpy_7display_6render_Matrix2D *, double, double, double, int, struct __pyx_obj_5renpy_5angle_6gldraw_Environ *, int, int __pyx_skip_dispatch)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  /*--- Execution code ---*/
  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  if (__Pyx_patch_abc() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif

  /* "renpy/angle/gldraw.pyx":34
 * 
 * from pygame_sdl2 cimport *
 * import_pygame_sdl2()             # <<<<<<<<<<<<<<
 * 
 * import renpy
 */
  import_pygame_sdl2();

  /* "renpy/angle/gldraw.pyx":36
 * import_pygame_sdl2()
 * 
 * import renpy             # <<<<<<<<<<<<<<
 * import pygame_sdl2 as pygame
 * import os
 */
  __pyx_t_3 = __Pyx_Import(__pyx_n_s_renpy, 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_renpy, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "renpy/angle/gldraw.pyx":37
 * 
 * import renpy
 * import pygame_sdl2 as pygame             # <<<<<<<<<<<<<<
 * import os
 * import os.path
 */
  __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2, 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "renpy/angle/gldraw.pyx":38
 * import renpy
 * import pygame_sdl2 as pygame
 * import os             # <<<<<<<<<<<<<<
 * import os.path
 * import weakref
 */
  __pyx_t_3 = __Pyx_Import(__pyx_n_s_os, 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "renpy/angle/gldraw.pyx":39
 * import pygame_sdl2 as pygame
 * import os
 * import os.path             # <<<<<<<<<<<<<<
 * import weakref
 * import array
 */
  __pyx_t_3 = __Pyx_Import(__pyx_n_s_os_path, 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "renpy/angle/gldraw.pyx":40
 * import os
 * import os.path
 * import weakref             # <<<<<<<<<<<<<<
 * import array
 * import time
 */
  __pyx_t_3 = __Pyx_Import(__pyx_n_s_weakref, 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_weakref, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "renpy/angle/gldraw.pyx":41
 * import os.path
 * import weakref
 * import array             # <<<<<<<<<<<<<<
 * import time
 * 
 */
  __pyx_t_3 = __Pyx_Import(__pyx_n_s_array, 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_array, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "renpy/angle/gldraw.pyx":42
 * import weakref
 * import array
 * import time             # <<<<<<<<<<<<<<
 * 
 * cimport renpy.display.render as render
 */
  __pyx_t_3 = __Pyx_Import(__pyx_n_s_time, 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_time, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "renpy/angle/gldraw.pyx":46
 * cimport renpy.display.render as render
 * cimport gltexture
 * import gltexture             # <<<<<<<<<<<<<<
 * import glblacklist
 * 
 */
  __pyx_t_3 = __Pyx_Import(__pyx_n_s_gltexture, 0, -1); 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);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_gltexture, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "renpy/angle/gldraw.pyx":47
 * cimport gltexture
 * import gltexture
 * import glblacklist             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_3 = __Pyx_Import(__pyx_n_s_glblacklist, 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_glblacklist, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "renpy/angle/gldraw.pyx":66
 * # EGL is a flag we check to see if we have EGL on this platform.
 * cdef bint EGL
 * EGL = egl_available()             # <<<<<<<<<<<<<<
 * 
 * # Cache various externals, so we can use them more efficiently.
 */
  __pyx_v_5renpy_5angle_6gldraw_EGL = egl_available();

  /* "renpy/angle/gldraw.pyx":70
 * # Cache various externals, so we can use them more efficiently.
 * cdef int DISSOLVE, IMAGEDISSOLVE, PIXELLATE
 * DISSOLVE = renpy.display.render.DISSOLVE             # <<<<<<<<<<<<<<
 * IMAGEDISSOLVE = renpy.display.render.IMAGEDISSOLVE
 * PIXELLATE = renpy.display.render.PIXELLATE
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_display); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_render); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_DISSOLVE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_5renpy_5angle_6gldraw_DISSOLVE = __pyx_t_5;

  /* "renpy/angle/gldraw.pyx":71
 * cdef int DISSOLVE, IMAGEDISSOLVE, PIXELLATE
 * DISSOLVE = renpy.display.render.DISSOLVE
 * IMAGEDISSOLVE = renpy.display.render.IMAGEDISSOLVE             # <<<<<<<<<<<<<<
 * PIXELLATE = renpy.display.render.PIXELLATE
 * 
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_display); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_render); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_IMAGEDISSOLVE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_5renpy_5angle_6gldraw_IMAGEDISSOLVE = __pyx_t_5;

  /* "renpy/angle/gldraw.pyx":72
 * DISSOLVE = renpy.display.render.DISSOLVE
 * IMAGEDISSOLVE = renpy.display.render.IMAGEDISSOLVE
 * PIXELLATE = renpy.display.render.PIXELLATE             # <<<<<<<<<<<<<<
 * 
 * cdef object IDENTITY
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_display); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_render); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_PIXELLATE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_5renpy_5angle_6gldraw_PIXELLATE = __pyx_t_5;

  /* "renpy/angle/gldraw.pyx":75
 * 
 * cdef object IDENTITY
 * IDENTITY = renpy.display.render.IDENTITY             # <<<<<<<<<<<<<<
 * 
 * # Should we try to vsync?
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_display); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_render); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_IDENTITY); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_XGOTREF(__pyx_v_5renpy_5angle_6gldraw_IDENTITY);
  __Pyx_DECREF_SET(__pyx_v_5renpy_5angle_6gldraw_IDENTITY, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;

  /* "renpy/angle/gldraw.pyx":78
 * 
 * # Should we try to vsync?
 * vsync = True             # <<<<<<<<<<<<<<
 * 
 * # A list of flip times, which we used to detect if vsync is failing.
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_vsync, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/angle/gldraw.pyx":81
 * 
 * # A list of flip times, which we used to detect if vsync is failing.
 * flip_times = [ ]             # <<<<<<<<<<<<<<
 * 
 * # A list of frame end times, used for the same purpose.
 */
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_flip_times, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "renpy/angle/gldraw.pyx":84
 * 
 * # A list of frame end times, used for the same purpose.
 * frame_times = [ ]             # <<<<<<<<<<<<<<
 * 
 * cdef class GLDraw:
 */
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_frame_times, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "renpy/angle/gldraw.pyx":1337
 * 
 * 
 * class Rtt(object):             # <<<<<<<<<<<<<<
 *     """
 *     Subclasses of this class handle rendering to a texture.
 */
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_builtin_object);
  __Pyx_GIVEREF(__pyx_builtin_object);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_builtin_object);
  __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_3, __pyx_n_s_Rtt, __pyx_n_s_Rtt, (PyObject *) NULL, __pyx_n_s_renpy_angle_gldraw, __pyx_kp_s_Subclasses_of_this_class_handle); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);

  /* "renpy/angle/gldraw.pyx":1342
 *     """
 * 
 *     def init(self):             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5renpy_5angle_6gldraw_3Rtt_1init, 0, __pyx_n_s_Rtt_init, NULL, __pyx_n_s_renpy_angle_gldraw, __pyx_d, ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  if (PyObject_SetItem(__pyx_t_6, __pyx_n_s_init, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "renpy/angle/gldraw.pyx":1345
 *         return
 * 
 *     def deinit(self):             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5renpy_5angle_6gldraw_3Rtt_3deinit, 0, __pyx_n_s_Rtt_deinit, NULL, __pyx_n_s_renpy_angle_gldraw, __pyx_d, ((PyObject *)__pyx_codeobj__43)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  if (PyObject_SetItem(__pyx_t_6, __pyx_n_s_deinit, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "renpy/angle/gldraw.pyx":1348
 *         return
 * 
 *     def render(self, texture, x, y, w, h, draw_func):             # <<<<<<<<<<<<<<
 *         """
 *         This function is called to trigger a rendering to a texture.
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5renpy_5angle_6gldraw_3Rtt_5render, 0, __pyx_n_s_Rtt_render, NULL, __pyx_n_s_renpy_angle_gldraw, __pyx_d, ((PyObject *)__pyx_codeobj__45)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  if (PyObject_SetItem(__pyx_t_6, __pyx_n_s_render, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "renpy/angle/gldraw.pyx":1358
 *         raise Exception("Not implemented.")
 * 
 *     def get_size_limit(self, dimension):             # <<<<<<<<<<<<<<
 *         """
 *         Get the maximum size of a texture.
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5renpy_5angle_6gldraw_3Rtt_7get_size_limit, 0, __pyx_n_s_Rtt_get_size_limit, NULL, __pyx_n_s_renpy_angle_gldraw, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  if (PyObject_SetItem(__pyx_t_6, __pyx_n_s_get_size_limit, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "renpy/angle/gldraw.pyx":1337
 * 
 * 
 * class Rtt(object):             # <<<<<<<<<<<<<<
 *     """
 *     Subclasses of this class handle rendering to a texture.
 */
  __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_n_s_Rtt, __pyx_t_3, __pyx_t_6, NULL, 0, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Rtt, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "renpy/angle/gldraw.pyx":1430
 * # These imports need to be down at the bottom, after the Rtt and Environ
 * # classes have been created.
 * try:             # <<<<<<<<<<<<<<
 *     import glrtt_copy
 * except:
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
    __Pyx_XGOTREF(__pyx_t_8);
    __Pyx_XGOTREF(__pyx_t_9);
    __Pyx_XGOTREF(__pyx_t_10);
    /*try:*/ {

      /* "renpy/angle/gldraw.pyx":1431
 * # classes have been created.
 * try:
 *     import glrtt_copy             # <<<<<<<<<<<<<<
 * except:
 *     glrtt_copy = None
 */
      __pyx_t_3 = __Pyx_Import(__pyx_n_s_glrtt_copy, 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1431; __pyx_clineno = __LINE__; goto __pyx_L2_error;}
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_glrtt_copy, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1431; __pyx_clineno = __LINE__; goto __pyx_L2_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "renpy/angle/gldraw.pyx":1430
 * # These imports need to be down at the bottom, after the Rtt and Environ
 * # classes have been created.
 * try:             # <<<<<<<<<<<<<<
 *     import glrtt_copy
 * except:
 */
    }
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    goto __pyx_L9_try_end;
    __pyx_L2_error:;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "renpy/angle/gldraw.pyx":1432
 * try:
 *     import glrtt_copy
 * except:             # <<<<<<<<<<<<<<
 *     glrtt_copy = None
 * 
 */
    /*except:*/ {
      __Pyx_AddTraceback("renpy.angle.gldraw", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_4, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L4_except_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);

      /* "renpy/angle/gldraw.pyx":1433
 *     import glrtt_copy
 * except:
 *     glrtt_copy = None             # <<<<<<<<<<<<<<
 * 
 * # Copy doesn't work on iOS.
 */
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_glrtt_copy, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; __pyx_clineno = __LINE__; goto __pyx_L4_except_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L3_exception_handled;
    }
    __pyx_L4_except_error:;

    /* "renpy/angle/gldraw.pyx":1430
 * # These imports need to be down at the bottom, after the Rtt and Environ
 * # classes have been created.
 * try:             # <<<<<<<<<<<<<<
 *     import glrtt_copy
 * except:
 */
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
    goto __pyx_L1_error;
    __pyx_L3_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
    __pyx_L9_try_end:;
  }

  /* "renpy/angle/gldraw.pyx":1436
 * 
 * # Copy doesn't work on iOS.
 * if renpy.ios:             # <<<<<<<<<<<<<<
 *     glrtt_copy = None
 * 
 */
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_ios); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_11) {

    /* "renpy/angle/gldraw.pyx":1437
 * # Copy doesn't work on iOS.
 * if renpy.ios:
 *     glrtt_copy = None             # <<<<<<<<<<<<<<
 * 
 * try:
 */
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_glrtt_copy, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "renpy/angle/gldraw.pyx":1436
 * 
 * # Copy doesn't work on iOS.
 * if renpy.ios:             # <<<<<<<<<<<<<<
 *     glrtt_copy = None
 * 
 */
  }

  /* "renpy/angle/gldraw.pyx":1439
 *     glrtt_copy = None
 * 
 * try:             # <<<<<<<<<<<<<<
 *     import glrtt_fbo
 * except ImportError:
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
    __Pyx_XGOTREF(__pyx_t_10);
    __Pyx_XGOTREF(__pyx_t_9);
    __Pyx_XGOTREF(__pyx_t_8);
    /*try:*/ {

      /* "renpy/angle/gldraw.pyx":1440
 * 
 * try:
 *     import glrtt_fbo             # <<<<<<<<<<<<<<
 * except ImportError:
 *     glrtt_fbo = None
 */
      __pyx_t_4 = __Pyx_Import(__pyx_n_s_glrtt_fbo, 0, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1440; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_glrtt_fbo, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1440; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "renpy/angle/gldraw.pyx":1439
 *     glrtt_copy = None
 * 
 * try:             # <<<<<<<<<<<<<<
 *     import glrtt_fbo
 * except ImportError:
 */
    }
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    goto __pyx_L20_try_end;
    __pyx_L13_error:;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "renpy/angle/gldraw.pyx":1441
 * try:
 *     import glrtt_fbo
 * except ImportError:             # <<<<<<<<<<<<<<
 *     glrtt_fbo = None
 * 
 */
    __pyx_t_5 = PyErr_ExceptionMatches(__pyx_builtin_ImportError);
    if (__pyx_t_5) {
      __Pyx_AddTraceback("renpy.angle.gldraw", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_3);

      /* "renpy/angle/gldraw.pyx":1442
 *     import glrtt_fbo
 * except ImportError:
 *     glrtt_fbo = None             # <<<<<<<<<<<<<<
 * 
 * try:
 */
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_glrtt_fbo, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1442; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L14_exception_handled;
    }
    goto __pyx_L15_except_error;
    __pyx_L15_except_error:;

    /* "renpy/angle/gldraw.pyx":1439
 *     glrtt_copy = None
 * 
 * try:             # <<<<<<<<<<<<<<
 *     import glrtt_fbo
 * except ImportError:
 */
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8);
    goto __pyx_L1_error;
    __pyx_L14_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8);
    __pyx_L20_try_end:;
  }

  /* "renpy/angle/gldraw.pyx":1444
 *     glrtt_fbo = None
 * 
 * try:             # <<<<<<<<<<<<<<
 *     import glenviron_fixed
 * except ImportError:
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
    __Pyx_XGOTREF(__pyx_t_8);
    __Pyx_XGOTREF(__pyx_t_9);
    __Pyx_XGOTREF(__pyx_t_10);
    /*try:*/ {

      /* "renpy/angle/gldraw.pyx":1445
 * 
 * try:
 *     import glenviron_fixed             # <<<<<<<<<<<<<<
 * except ImportError:
 *     glenviron_fixed = None
 */
      __pyx_t_3 = __Pyx_Import(__pyx_n_s_glenviron_fixed, 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_glenviron_fixed, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "renpy/angle/gldraw.pyx":1444
 *     glrtt_fbo = None
 * 
 * try:             # <<<<<<<<<<<<<<
 *     import glenviron_fixed
 * except ImportError:
 */
    }
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    goto __pyx_L30_try_end;
    __pyx_L23_error:;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "renpy/angle/gldraw.pyx":1446
 * try:
 *     import glenviron_fixed
 * except ImportError:             # <<<<<<<<<<<<<<
 *     glenviron_fixed = None
 * 
 */
    __pyx_t_5 = PyErr_ExceptionMatches(__pyx_builtin_ImportError);
    if (__pyx_t_5) {
      __Pyx_AddTraceback("renpy.angle.gldraw", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_6, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L25_except_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_4);

      /* "renpy/angle/gldraw.pyx":1447
 *     import glenviron_fixed
 * except ImportError:
 *     glenviron_fixed = None             # <<<<<<<<<<<<<<
 * 
 * try:
 */
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_glenviron_fixed, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1447; __pyx_clineno = __LINE__; goto __pyx_L25_except_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L24_exception_handled;
    }
    goto __pyx_L25_except_error;
    __pyx_L25_except_error:;

    /* "renpy/angle/gldraw.pyx":1444
 *     glrtt_fbo = None
 * 
 * try:             # <<<<<<<<<<<<<<
 *     import glenviron_fixed
 * except ImportError:
 */
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
    goto __pyx_L1_error;
    __pyx_L24_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
    __pyx_L30_try_end:;
  }

  /* "renpy/angle/gldraw.pyx":1449
 *     glenviron_fixed = None
 * 
 * try:             # <<<<<<<<<<<<<<
 *     import glenviron_shader
 * except ImportError:
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
    __Pyx_XGOTREF(__pyx_t_10);
    __Pyx_XGOTREF(__pyx_t_9);
    __Pyx_XGOTREF(__pyx_t_8);
    /*try:*/ {

      /* "renpy/angle/gldraw.pyx":1450
 * 
 * try:
 *     import glenviron_shader             # <<<<<<<<<<<<<<
 * except ImportError:
 *     glenviron_shader = None
 */
      __pyx_t_4 = __Pyx_Import(__pyx_n_s_glenviron_shader, 0, -1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L33_error;}
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_glenviron_shader, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L33_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "renpy/angle/gldraw.pyx":1449
 *     glenviron_fixed = None
 * 
 * try:             # <<<<<<<<<<<<<<
 *     import glenviron_shader
 * except ImportError:
 */
    }
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    goto __pyx_L40_try_end;
    __pyx_L33_error:;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "renpy/angle/gldraw.pyx":1451
 * try:
 *     import glenviron_shader
 * except ImportError:             # <<<<<<<<<<<<<<
 *     glenviron_shader = None
 * 
 */
    __pyx_t_5 = PyErr_ExceptionMatches(__pyx_builtin_ImportError);
    if (__pyx_t_5) {
      __Pyx_AddTraceback("renpy.angle.gldraw", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1451; __pyx_clineno = __LINE__; goto __pyx_L35_except_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_3);

      /* "renpy/angle/gldraw.pyx":1452
 *     import glenviron_shader
 * except ImportError:
 *     glenviron_shader = None             # <<<<<<<<<<<<<<
 * 
 * try:
 */
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_glenviron_shader, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1452; __pyx_clineno = __LINE__; goto __pyx_L35_except_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L34_exception_handled;
    }
    goto __pyx_L35_except_error;
    __pyx_L35_except_error:;

    /* "renpy/angle/gldraw.pyx":1449
 *     glenviron_fixed = None
 * 
 * try:             # <<<<<<<<<<<<<<
 *     import glenviron_shader
 * except ImportError:
 */
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8);
    goto __pyx_L1_error;
    __pyx_L34_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8);
    __pyx_L40_try_end:;
  }

  /* "renpy/angle/gldraw.pyx":1454
 *     glenviron_shader = None
 * 
 * try:             # <<<<<<<<<<<<<<
 *     import glenviron_limited
 * except ImportError:
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
    __Pyx_XGOTREF(__pyx_t_8);
    __Pyx_XGOTREF(__pyx_t_9);
    __Pyx_XGOTREF(__pyx_t_10);
    /*try:*/ {

      /* "renpy/angle/gldraw.pyx":1455
 * 
 * try:
 *     import glenviron_limited             # <<<<<<<<<<<<<<
 * except ImportError:
 *     glenviron_limited = None
 */
      __pyx_t_3 = __Pyx_Import(__pyx_n_s_glenviron_limited, 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1455; __pyx_clineno = __LINE__; goto __pyx_L43_error;}
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_glenviron_limited, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1455; __pyx_clineno = __LINE__; goto __pyx_L43_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "renpy/angle/gldraw.pyx":1454
 *     glenviron_shader = None
 * 
 * try:             # <<<<<<<<<<<<<<
 *     import glenviron_limited
 * except ImportError:
 */
    }
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    goto __pyx_L50_try_end;
    __pyx_L43_error:;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "renpy/angle/gldraw.pyx":1456
 * try:
 *     import glenviron_limited
 * except ImportError:             # <<<<<<<<<<<<<<
 *     glenviron_limited = None
 * 
 */
    __pyx_t_5 = PyErr_ExceptionMatches(__pyx_builtin_ImportError);
    if (__pyx_t_5) {
      __Pyx_AddTraceback("renpy.angle.gldraw", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_6, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1456; __pyx_clineno = __LINE__; goto __pyx_L45_except_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_4);

      /* "renpy/angle/gldraw.pyx":1457
 *     import glenviron_limited
 * except ImportError:
 *     glenviron_limited = None             # <<<<<<<<<<<<<<
 * 
 */
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_glenviron_limited, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1457; __pyx_clineno = __LINE__; goto __pyx_L45_except_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L44_exception_handled;
    }
    goto __pyx_L45_except_error;
    __pyx_L45_except_error:;

    /* "renpy/angle/gldraw.pyx":1454
 *     glenviron_shader = None
 * 
 * try:             # <<<<<<<<<<<<<<
 *     import glenviron_limited
 * except ImportError:
 */
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
    goto __pyx_L1_error;
    __pyx_L44_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
    __pyx_L50_try_end:;
  }

  /* "renpy/angle/gldraw.pyx":1
 * # This file was automatically generated from renpy/gl/gldraw.pyx             # <<<<<<<<<<<<<<
 * # Modifications will be automatically overwritten.
 * 
 */
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /*--- Wrapped vars code ---*/

  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_6);
  __Pyx_XDECREF(__pyx_t_7);
  if (__pyx_m) {
    if (__pyx_d) {
      __Pyx_AddTraceback("init renpy.angle.gldraw", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init renpy.angle.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

static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
    if (unlikely(!result)) {
        PyErr_Format(PyExc_NameError,
#if PY_MAJOR_VERSION >= 3
            "name '%U' is not defined", name);
#else
            "name '%.200s' is not defined", PyString_AS_STRING(name));
#endif
    }
    return result;
}

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,
        "%.200s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

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,
                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
    PyObject *result;
#if CYTHON_COMPILING_IN_CPYTHON
    result = PyDict_GetItem(__pyx_d, name);
    if (likely(result)) {
        Py_INCREF(result);
    } else {
#else
    result = PyObject_GetItem(__pyx_d, name);
    if (!result) {
        PyErr_Clear();
#endif
        result = __Pyx_GetBuiltinName(name);
    }
    return result;
}

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = func->ob_type->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = (*call)(func, arg, kw);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
    PyObject *self, *result;
    PyCFunction cfunc;
    cfunc = PyCFunction_GET_FUNCTION(func);
    self = PyCFunction_GET_SELF(func);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = cfunc(self, arg);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_New(1);
    if (unlikely(!args)) return NULL;
    Py_INCREF(arg);
    PyTuple_SET_ITEM(args, 0, arg);
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
    if (likely(PyCFunction_Check(func))) {
#endif
        if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
            return __Pyx_PyObject_CallMethO(func, arg);
        }
    }
    return __Pyx__PyObject_CallOneArg(func, arg);
}
#else
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_Pack(1, arg);
    if (unlikely(!args)) return NULL;
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
#endif

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
    if (likely(PyCFunction_Check(func))) {
#endif
        if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
            return __Pyx_PyObject_CallMethO(func, NULL);
        }
    }
    return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
}
#endif

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%.1s 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;
}

#if CYTHON_USE_PYLONG_INTERNALS
  #include "longintrepr.h"
#endif

#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
            x = (long)((unsigned long)a - b);
            if (likely((x^a) >= 0 || (x^~b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
            }
        }
                x = a - b;
            return PyLong_FromLong(x);
        long_long:
                llx = lla - llb;
            return PyLong_FromLongLong(llx);
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
            double result;
            PyFPE_START_PROTECT("subtract", return NULL)
            result = ((double)a) - (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
}
#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;
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
    if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
    if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
                                                     CYTHON_NCP_UNUSED int wraparound,
                                                     CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if ((!boundscheck) || (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 = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    } else {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (PyErr_ExceptionMatches(PyExc_OverflowError))
                        PyErr_Clear();
                    else
                        return NULL;
                }
            }
            return m->sq_item(o, i);
        }
    }
#else
    if (is_list || PySequence_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
#else
    PyErr_GetExcInfo(type, value, tb);
#endif
}
static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = type;
    tstate->exc_value = value;
    tstate->exc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(type, value, tb);
#endif
}

static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *local_type, *local_value, *local_tb;
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    local_type = tstate->curexc_type;
    local_value = tstate->curexc_value;
    local_tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_COMPILING_IN_CPYTHON
    if (unlikely(tstate->curexc_type))
#else
    if (unlikely(PyErr_Occurred()))
#endif
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (local_tb) {
        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
            goto bad;
    }
    #endif
    Py_XINCREF(local_tb);
    Py_XINCREF(local_type);
    Py_XINCREF(local_value);
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
#if CYTHON_COMPILING_IN_CPYTHON
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = local_type;
    tstate->exc_value = local_value;
    tstate->exc_traceback = local_tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
}

#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyFloat_DivideObjC(PyObject *op1, PyObject *op2, double floatval, CYTHON_UNUSED int inplace) {
    const double b = floatval;
    double a, result;
    if (likely(PyFloat_CheckExact(op1))) {
        a = PyFloat_AS_DOUBLE(op1);
    } else
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        a = (double) PyInt_AS_LONG(op1);
    } else
    #endif
    if (likely(PyLong_CheckExact(op1))) {
        #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        switch (size) {
            case  0: a = 0.0; break;
            case -1: a = -(double) digits[0]; break;
            case  1: a = (double) digits[0]; break;
            case -2:
            case 2:
                if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) {
                    a = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) {
                        if (size == -2)
                            a = -a;
                        break;
                    }
                }
            case -3:
            case 3:
                if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) {
                    a = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) {
                        if (size == -3)
                            a = -a;
                        break;
                    }
                }
            case -4:
            case 4:
                if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) {
                    a = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) {
                        if (size == -4)
                            a = -a;
                        break;
                    }
                }
            default:
        #else
        {
        #endif
            a = PyLong_AsDouble(op1);
            if (unlikely(a == -1.0 && PyErr_Occurred())) return NULL;
        }
    } else {
        return (inplace ? __Pyx_PyNumber_InPlaceDivide(op1, op2) : __Pyx_PyNumber_Divide(op1, op2));
    }
        PyFPE_START_PROTECT("divide", return NULL)
        result = a / b;
        PyFPE_END_PROTECT(result)
        return PyFloat_FromDouble(result);
}
#endif

#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyFloat_DivideCObj(PyObject *op1, PyObject *op2, double floatval, CYTHON_UNUSED int inplace) {
    const double a = floatval;
    double b, result;
    if (likely(PyFloat_CheckExact(op2))) {
        b = PyFloat_AS_DOUBLE(op2);
    } else
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op2))) {
        b = (double) PyInt_AS_LONG(op2);
    } else
    #endif
    if (likely(PyLong_CheckExact(op2))) {
        #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3
        const digit* digits = ((PyLongObject*)op2)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op2);
        switch (size) {
            case  0: b = 0.0; break;
            case -1: b = -(double) digits[0]; break;
            case  1: b = (double) digits[0]; break;
            case -2:
            case 2:
                if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) {
                    b = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (b < (double) (1L<<53))) {
                        if (size == -2)
                            b = -b;
                        break;
                    }
                }
            case -3:
            case 3:
                if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) {
                    b = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (b < (double) (1L<<53))) {
                        if (size == -3)
                            b = -b;
                        break;
                    }
                }
            case -4:
            case 4:
                if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) {
                    b = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (b < (double) (1L<<53))) {
                        if (size == -4)
                            b = -b;
                        break;
                    }
                }
            default:
        #else
        {
        #endif
            b = PyLong_AsDouble(op2);
            if (unlikely(b == -1.0 && PyErr_Occurred())) return NULL;
        }
    } else {
        return (inplace ? __Pyx_PyNumber_InPlaceDivide(op1, op2) : __Pyx_PyNumber_Divide(op1, op2));
    }
        PyFPE_START_PROTECT("divide", return NULL)
        result = a / b;
        PyFPE_END_PROTECT(result)
        return PyFloat_FromDouble(result);
}
#endif

static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
    PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
}

static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
    PyObject* fake_module;
    PyTypeObject* cached_type = NULL;
    fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
    if (!fake_module) return NULL;
    Py_INCREF(fake_module);
    cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
    if (cached_type) {
        if (!PyType_Check((PyObject*)cached_type)) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s is not a type object",
                type->tp_name);
            goto bad;
        }
        if (cached_type->tp_basicsize != type->tp_basicsize) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s has the wrong size, try recompiling",
                type->tp_name);
            goto bad;
        }
    } else {
        if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
        PyErr_Clear();
        if (PyType_Ready(type) < 0) goto bad;
        if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
            goto bad;
        Py_INCREF(type);
        cached_type = type;
    }
done:
    Py_DECREF(fake_module);
    return cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}

static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
{
    if (unlikely(op->func_doc == NULL)) {
        if (op->func.m_ml->ml_doc) {
#if PY_MAJOR_VERSION >= 3
            op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
#else
            op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
#endif
            if (unlikely(op->func_doc == NULL))
                return NULL;
        } else {
            Py_INCREF(Py_None);
            return Py_None;
        }
    }
    Py_INCREF(op->func_doc);
    return op->func_doc;
}
static int
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp = op->func_doc;
    if (value == NULL) {
        value = Py_None;
    }
    Py_INCREF(value);
    op->func_doc = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op)
{
    if (unlikely(op->func_name == NULL)) {
#if PY_MAJOR_VERSION >= 3
        op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
#else
        op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
#endif
        if (unlikely(op->func_name == NULL))
            return NULL;
    }
    Py_INCREF(op->func_name);
    return op->func_name;
}
static int
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
#else
    if (unlikely(value == NULL || !PyString_Check(value))) {
#endif
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    tmp = op->func_name;
    Py_INCREF(value);
    op->func_name = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op)
{
    Py_INCREF(op->func_qualname);
    return op->func_qualname;
}
static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
#else
    if (unlikely(value == NULL || !PyString_Check(value))) {
#endif
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    tmp = op->func_qualname;
    Py_INCREF(value);
    op->func_qualname = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
{
    PyObject *self;
    self = m->func_closure;
    if (self == NULL)
        self = Py_None;
    Py_INCREF(self);
    return self;
}
static PyObject *
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op)
{
    if (unlikely(op->func_dict == NULL)) {
        op->func_dict = PyDict_New();
        if (unlikely(op->func_dict == NULL))
            return NULL;
    }
    Py_INCREF(op->func_dict);
    return op->func_dict;
}
static int
__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp;
    if (unlikely(value == NULL)) {
        PyErr_SetString(PyExc_TypeError,
               "function's dictionary may not be deleted");
        return -1;
    }
    if (unlikely(!PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
               "setting function's dictionary to a non-dict");
        return -1;
    }
    tmp = op->func_dict;
    Py_INCREF(value);
    op->func_dict = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op)
{
    Py_INCREF(op->func_globals);
    return op->func_globals;
}
static PyObject *
__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op)
{
    Py_INCREF(Py_None);
    return Py_None;
}
static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op)
{
    PyObject* result = (op->func_code) ? op->func_code : Py_None;
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
    int result = 0;
    PyObject *res = op->defaults_getter((PyObject *) op);
    if (unlikely(!res))
        return -1;
    #if CYTHON_COMPILING_IN_CPYTHON
    op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
    Py_INCREF(op->defaults_tuple);
    op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
    Py_INCREF(op->defaults_kwdict);
    #else
    op->defaults_tuple = PySequence_ITEM(res, 0);
    if (unlikely(!op->defaults_tuple)) result = -1;
    else {
        op->defaults_kwdict = PySequence_ITEM(res, 1);
        if (unlikely(!op->defaults_kwdict)) result = -1;
    }
    #endif
    Py_DECREF(res);
    return result;
}
static int
__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) {
    PyObject* tmp;
    if (!value) {
        value = Py_None;
    } else if (value != Py_None && !PyTuple_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__defaults__ must be set to a tuple object");
        return -1;
    }
    Py_INCREF(value);
    tmp = op->defaults_tuple;
    op->defaults_tuple = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) {
    PyObject* result = op->defaults_tuple;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
            result = op->defaults_tuple;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) {
    PyObject* tmp;
    if (!value) {
        value = Py_None;
    } else if (value != Py_None && !PyDict_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__kwdefaults__ must be set to a dict object");
        return -1;
    }
    Py_INCREF(value);
    tmp = op->defaults_kwdict;
    op->defaults_kwdict = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) {
    PyObject* result = op->defaults_kwdict;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
            result = op->defaults_kwdict;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) {
    PyObject* tmp;
    if (!value || value == Py_None) {
        value = NULL;
    } else if (!PyDict_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__annotations__ must be set to a dict object");
        return -1;
    }
    Py_XINCREF(value);
    tmp = op->func_annotations;
    op->func_annotations = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) {
    PyObject* result = op->func_annotations;
    if (unlikely(!result)) {
        result = PyDict_New();
        if (unlikely(!result)) return NULL;
        op->func_annotations = result;
    }
    Py_INCREF(result);
    return result;
}
static PyGetSetDef __pyx_CyFunction_getsets[] = {
    {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "__doc__",  (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
    {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
    {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
    {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
    {0, 0, 0, 0, 0}
};
static PyMemberDef __pyx_CyFunction_members[] = {
    {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0},
    {0, 0, 0,  0, 0}
};
static PyObject *
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromString(m->func.m_ml->ml_name);
#else
    return PyString_FromString(m->func.m_ml->ml_name);
#endif
}
static PyMethodDef __pyx_CyFunction_methods[] = {
    {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
    {0, 0, 0, 0}
};
#if PY_VERSION_HEX < 0x030500A0
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
#else
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
#endif
static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname,
                                      PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
    __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type);
    if (op == NULL)
        return NULL;
    op->flags = flags;
    __Pyx_CyFunction_weakreflist(op) = NULL;
    op->func.m_ml = ml;
    op->func.m_self = (PyObject *) op;
    Py_XINCREF(closure);
    op->func_closure = closure;
    Py_XINCREF(module);
    op->func.m_module = module;
    op->func_dict = NULL;
    op->func_name = NULL;
    Py_INCREF(qualname);
    op->func_qualname = qualname;
    op->func_doc = NULL;
    op->func_classobj = NULL;
    op->func_globals = globals;
    Py_INCREF(op->func_globals);
    Py_XINCREF(code);
    op->func_code = code;
    op->defaults_pyobjects = 0;
    op->defaults = NULL;
    op->defaults_tuple = NULL;
    op->defaults_kwdict = NULL;
    op->defaults_getter = NULL;
    op->func_annotations = NULL;
    PyObject_GC_Track(op);
    return (PyObject *) op;
}
static int
__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
{
    Py_CLEAR(m->func_closure);
    Py_CLEAR(m->func.m_module);
    Py_CLEAR(m->func_dict);
    Py_CLEAR(m->func_name);
    Py_CLEAR(m->func_qualname);
    Py_CLEAR(m->func_doc);
    Py_CLEAR(m->func_globals);
    Py_CLEAR(m->func_code);
    Py_CLEAR(m->func_classobj);
    Py_CLEAR(m->defaults_tuple);
    Py_CLEAR(m->defaults_kwdict);
    Py_CLEAR(m->func_annotations);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_XDECREF(pydefaults[i]);
        PyMem_Free(m->defaults);
        m->defaults = NULL;
    }
    return 0;
}
static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    PyObject_GC_UnTrack(m);
    if (__Pyx_CyFunction_weakreflist(m) != NULL)
        PyObject_ClearWeakRefs((PyObject *) m);
    __Pyx_CyFunction_clear(m);
    PyObject_GC_Del(m);
}
static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
{
    Py_VISIT(m->func_closure);
    Py_VISIT(m->func.m_module);
    Py_VISIT(m->func_dict);
    Py_VISIT(m->func_name);
    Py_VISIT(m->func_qualname);
    Py_VISIT(m->func_doc);
    Py_VISIT(m->func_globals);
    Py_VISIT(m->func_code);
    Py_VISIT(m->func_classobj);
    Py_VISIT(m->defaults_tuple);
    Py_VISIT(m->defaults_kwdict);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_VISIT(pydefaults[i]);
    }
    return 0;
}
static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
{
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
        Py_INCREF(func);
        return func;
    }
    if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
        if (type == NULL)
            type = (PyObject *)(Py_TYPE(obj));
        return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
    }
    if (obj == Py_None)
        obj = NULL;
    return __Pyx_PyMethod_New(func, obj, type);
}
static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromFormat("<cyfunction %U at %p>",
                                op->func_qualname, (void *)op);
#else
    return PyString_FromFormat("<cyfunction %s at %p>",
                               PyString_AsString(op->func_qualname), (void *)op);
#endif
}
#if CYTHON_COMPILING_IN_PYPY
static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyCFunctionObject* f = (PyCFunctionObject*)func;
    PyCFunction meth = f->m_ml->ml_meth;
    PyObject *self = f->m_self;
    Py_ssize_t size;
    switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
    case METH_VARARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0))
            return (*meth)(self, arg);
        break;
    case METH_VARARGS | METH_KEYWORDS:
        return (*(PyCFunctionWithKeywords)meth)(self, arg, kw);
    case METH_NOARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
            size = PyTuple_GET_SIZE(arg);
            if (likely(size == 0))
                return (*meth)(self, NULL);
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    case METH_O:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
            size = PyTuple_GET_SIZE(arg);
            if (likely(size == 1)) {
                PyObject *result, *arg0 = PySequence_ITEM(arg, 0);
                if (unlikely(!arg0)) return NULL;
                result = (*meth)(self, arg0);
                Py_DECREF(arg0);
                return result;
            }
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags in "
                        "__Pyx_CyFunction_Call. METH_OLDARGS is no "
                        "longer supported!");
        return NULL;
    }
    PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
                 f->m_ml->ml_name);
    return NULL;
}
#else
static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
	return PyCFunction_Call(func, arg, kw);
}
#endif
static PyTypeObject __pyx_CyFunctionType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    "cython_function_or_method",
    sizeof(__pyx_CyFunctionObject),
    0,
    (destructor) __Pyx_CyFunction_dealloc,
    0,
    0,
    0,
#if PY_MAJOR_VERSION < 3
    0,
#else
    0,
#endif
    (reprfunc) __Pyx_CyFunction_repr,
    0,
    0,
    0,
    0,
    __Pyx_CyFunction_Call,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
    0,
    (traverseproc) __Pyx_CyFunction_traverse,
    (inquiry) __Pyx_CyFunction_clear,
    0,
#if PY_VERSION_HEX < 0x030500A0
    offsetof(__pyx_CyFunctionObject, func_weakreflist),
#else
    offsetof(PyCFunctionObject, m_weakreflist),
#endif
    0,
    0,
    __pyx_CyFunction_methods,
    __pyx_CyFunction_members,
    __pyx_CyFunction_getsets,
    0,
    0,
    __Pyx_CyFunction_descr_get,
    0,
    offsetof(__pyx_CyFunctionObject, func_dict),
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if PY_VERSION_HEX >= 0x030400a1
    0,
#endif
};
static int __pyx_CyFunction_init(void) {
#if !CYTHON_COMPILING_IN_PYPY
    __pyx_CyFunctionType_type.tp_call = PyCFunction_Call;
#endif
    __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
    if (__pyx_CyFunctionType == NULL) {
        return -1;
    }
    return 0;
}
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults = PyMem_Malloc(size);
    if (!m->defaults)
        return PyErr_NoMemory();
    memset(m->defaults, 0, size);
    m->defaults_pyobjects = pyobjects;
    return m->defaults;
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_tuple = tuple;
    Py_INCREF(tuple);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_kwdict = dict;
    Py_INCREF(dict);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->func_annotations = dict;
    Py_INCREF(dict);
}

static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (likely(PyObject_TypeCheck(obj, type)))
        return 1;
    PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
                 Py_TYPE(obj)->tp_name, type->tp_name);
    return 0;
}

#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
            x = (long)((unsigned long)a + b);
            if (likely((x^a) >= 0 || (x^b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_add(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
            }
        }
                x = a + b;
            return PyLong_FromLong(x);
        long_long:
                llx = lla + llb;
            return PyLong_FromLongLong(llx);
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
            double result;
            PyFPE_START_PROTECT("add", return NULL)
            result = ((double)a) + (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
}
#endif

static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
    PyErr_Format(PyExc_TypeError,
        "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
        name, type->tp_name, Py_TYPE(obj)->tp_name);
}
static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
    const char *name, int exact)
{
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (none_allowed && obj == Py_None) return 1;
    else if (exact) {
        if (likely(Py_TYPE(obj) == type)) return 1;
        #if PY_MAJOR_VERSION == 2
        else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
        #endif
    }
    else {
        if (likely(PyObject_TypeCheck(obj, type))) return 1;
    }
    __Pyx_RaiseArgumentTypeInvalid(name, obj, type);
    return 0;
}

static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
    PyObject *method, *result = NULL;
    method = __Pyx_PyObject_GetAttrStr(obj, method_name);
    if (unlikely(!method)) goto bad;
#if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyMethod_Check(method))) {
        PyObject *self = PyMethod_GET_SELF(method);
        if (likely(self)) {
            PyObject *args;
            PyObject *function = PyMethod_GET_FUNCTION(method);
            args = PyTuple_New(2);
            if (unlikely(!args)) goto bad;
            Py_INCREF(self);
            PyTuple_SET_ITEM(args, 0, self);
            Py_INCREF(arg);
            PyTuple_SET_ITEM(args, 1, arg);
            Py_INCREF(function);
            Py_DECREF(method); method = NULL;
            result = __Pyx_PyObject_Call(function, args, NULL);
            Py_DECREF(args);
            Py_DECREF(function);
            return result;
        }
    }
#endif
    result = __Pyx_PyObject_CallOneArg(method, arg);
bad:
    Py_XDECREF(method);
    return result;
}

static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
    if (likely(PyList_CheckExact(L))) {
        if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1;
    } else {
        PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x);
        if (unlikely(!retval))
            return -1;
        Py_DECREF(retval);
    }
    return 0;
}

static PyObject* __Pyx__PyObject_PopNewIndex(PyObject* L, PyObject* py_ix) {
    PyObject *r;
    if (unlikely(!py_ix)) return NULL;
    r = __Pyx__PyObject_PopIndex(L, py_ix);
    Py_DECREF(py_ix);
    return r;
}
static PyObject* __Pyx__PyObject_PopIndex(PyObject* L, PyObject* py_ix) {
    return __Pyx_PyObject_CallMethod1(L, __pyx_n_s_pop, py_ix);
}
#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx__PyList_PopIndex(PyObject* L, PyObject* py_ix, Py_ssize_t ix) {
    Py_ssize_t size = PyList_GET_SIZE(L);
    if (likely(size > (((PyListObject*)L)->allocated >> 1))) {
        Py_ssize_t cix = ix;
        if (cix < 0) {
            cix += size;
        }
        if (likely(0 <= cix && cix < size)) {
            PyObject* v = PyList_GET_ITEM(L, cix);
            Py_SIZE(L) -= 1;
            size -= 1;
            memmove(&PyList_GET_ITEM(L, cix), &PyList_GET_ITEM(L, cix+1), (size_t)(size-cix)*sizeof(PyObject*));
            return v;
        }
    }
    if (py_ix == Py_None) {
        return __Pyx__PyObject_PopNewIndex(L, PyInt_FromSsize_t(ix));
    } else {
        return __Pyx__PyObject_PopIndex(L, py_ix);
    }
}
#endif

static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_Restore(type, value, tb);
#endif
}
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(type, value, tb);
#endif
}

#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                        CYTHON_UNUSED PyObject *cause) {
    Py_XINCREF(type);
    if (!value || value == Py_None)
        value = NULL;
    else
        Py_INCREF(value);
    if (!tb || tb == Py_None)
        tb = NULL;
    else {
        Py_INCREF(tb);
        if (!PyTraceBack_Check(tb)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: arg 3 must be a traceback or None");
            goto raise_error;
        }
    }
    if (PyType_Check(type)) {
#if CYTHON_COMPILING_IN_PYPY
        if (!value) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#endif
        PyErr_NormalizeException(&type, &value, &tb);
    } else {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        value = type;
        type = (PyObject*) Py_TYPE(type);
        Py_INCREF(type);
        if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: exception class must be a subclass of BaseException");
            goto raise_error;
        }
    }
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    PyObject* owned_instance = NULL;
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;
    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (PyExceptionClass_Check(type)) {
        PyObject *instance_class = NULL;
        if (value && PyExceptionInstance_Check(value)) {
            instance_class = (PyObject*) Py_TYPE(value);
            if (instance_class != type) {
                int is_subclass = PyObject_IsSubclass(instance_class, type);
                if (!is_subclass) {
                    instance_class = NULL;
                } else if (unlikely(is_subclass == -1)) {
                    goto bad;
                } else {
                    type = instance_class;
                }
            }
        }
        if (!instance_class) {
            PyObject *args;
            if (!value)
                args = PyTuple_New(0);
            else if (PyTuple_Check(value)) {
                Py_INCREF(value);
                args = value;
            } else
                args = PyTuple_Pack(1, value);
            if (!args)
                goto bad;
            owned_instance = PyObject_Call(type, args, NULL);
            Py_DECREF(args);
            if (!owned_instance)
                goto bad;
            value = owned_instance;
            if (!PyExceptionInstance_Check(value)) {
                PyErr_Format(PyExc_TypeError,
                             "calling %R should have returned an instance of "
                             "BaseException, not %R",
                             type, Py_TYPE(value));
                goto bad;
            }
        }
    } else {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
#if PY_VERSION_HEX >= 0x03030000
    if (cause) {
#else
    if (cause && cause != Py_None) {
#endif
        PyObject *fixed_cause;
        if (cause == Py_None) {
            fixed_cause = NULL;
        } else if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        } else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        } else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        PyException_SetCause(value, fixed_cause);
    }
    PyErr_SetObject(type, value);
    if (tb) {
#if CYTHON_COMPILING_IN_PYPY
        PyObject *tmp_type, *tmp_value, *tmp_tb;
        PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
        Py_INCREF(tb);
        PyErr_Restore(tmp_type, tmp_value, tb);
        Py_XDECREF(tmp_tb);
#else
        PyThreadState *tstate = PyThreadState_GET();
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
}

static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
#if CYTHON_COMPILING_IN_CPYTHON
#if PY_MAJOR_VERSION >= 3
    if (likely(PyUnicode_Check(n)))
#else
    if (likely(PyString_Check(n)))
#endif
        return __Pyx_PyObject_GetAttrStr(o, n);
#endif
    return PyObject_GetAttr(o, n);
}

static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
    PyObject *r = __Pyx_GetAttr(o, n);
    if (unlikely(!r)) {
        if (!PyErr_ExceptionMatches(PyExc_AttributeError))
            goto bad;
        PyErr_Clear();
        r = d;
        Py_INCREF(d);
    }
    return r;
bad:
    return NULL;
}

static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
#if PY_VERSION_HEX >= 0x02070000
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
#else
    PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
#endif
    if (!ob)
        goto bad;
    if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

static void* __Pyx_GetVtable(PyObject *dict) {
    void* ptr;
    PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable);
    if (!ob)
        goto bad;
#if PY_VERSION_HEX >= 0x02070000
    ptr = PyCapsule_GetPointer(ob, 0);
#else
    ptr = PyCObject_AsVoidPtr(ob);
#endif
    if (!ptr && !PyErr_Occurred())
        PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
    Py_DECREF(ob);
    return ptr;
bad:
    Py_XDECREF(ob);
    return NULL;
}

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    #if PY_VERSION_HEX < 0x03030000
    PyObject *py_import;
    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
    if (!py_import)
        goto bad;
    #endif
    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_MAJOR_VERSION >= 3
        if (level == -1) {
            if (strchr(__Pyx_MODULE_NAME, '.')) {
                #if PY_VERSION_HEX < 0x03030000
                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);
                #else
                module = PyImport_ImportModuleLevelObject(
                    name, global_dict, empty_dict, list, 1);
                #endif
                if (!module) {
                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0;
        }
        #endif
        if (!module) {
            #if PY_VERSION_HEX < 0x03030000
            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
            module = PyImport_ImportModuleLevelObject(
                name, global_dict, empty_dict, list, level);
            #endif
        }
    }
bad:
    #if PY_VERSION_HEX < 0x03030000
    Py_XDECREF(py_import);
    #endif
    Py_XDECREF(empty_list);
    Py_XDECREF(empty_dict);
    return module;
}

static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
    Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
    for (i=0; i < nbases; i++) {
        PyTypeObject *tmptype;
        PyObject *tmp = PyTuple_GET_ITEM(bases, i);
        tmptype = Py_TYPE(tmp);
#if PY_MAJOR_VERSION < 3
        if (tmptype == &PyClass_Type)
            continue;
#endif
        if (!metaclass) {
            metaclass = tmptype;
            continue;
        }
        if (PyType_IsSubtype(metaclass, tmptype))
            continue;
        if (PyType_IsSubtype(tmptype, metaclass)) {
            metaclass = tmptype;
            continue;
        }
        PyErr_SetString(PyExc_TypeError,
                        "metaclass conflict: "
                        "the metaclass of a derived class "
                        "must be a (non-strict) subclass "
                        "of the metaclasses of all its bases");
        return NULL;
    }
    if (!metaclass) {
#if PY_MAJOR_VERSION < 3
        metaclass = &PyClass_Type;
#else
        metaclass = &PyType_Type;
#endif
    }
    Py_INCREF((PyObject*) metaclass);
    return (PyObject*) metaclass;
}

static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
                                           PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
    PyObject *ns;
    if (metaclass) {
        PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
        if (prep) {
            PyObject *pargs = PyTuple_Pack(2, name, bases);
            if (unlikely(!pargs)) {
                Py_DECREF(prep);
                return NULL;
            }
            ns = PyObject_Call(prep, pargs, mkw);
            Py_DECREF(prep);
            Py_DECREF(pargs);
        } else {
            if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
                return NULL;
            PyErr_Clear();
            ns = PyDict_New();
        }
    } else {
        ns = PyDict_New();
    }
    if (unlikely(!ns))
        return NULL;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module_2, modname) < 0)) goto bad;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
    if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
    return ns;
bad:
    Py_DECREF(ns);
    return NULL;
}
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
                                      PyObject *dict, PyObject *mkw,
                                      int calculate_metaclass, int allow_py2_metaclass) {
    PyObject *result, *margs;
    PyObject *owned_metaclass = NULL;
    if (allow_py2_metaclass) {
        owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
        if (owned_metaclass) {
            metaclass = owned_metaclass;
        } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
            PyErr_Clear();
        } else {
            return NULL;
        }
    }
    if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
        metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
        Py_XDECREF(owned_metaclass);
        if (unlikely(!metaclass))
            return NULL;
        owned_metaclass = metaclass;
    }
    margs = PyTuple_Pack(3, name, bases, dict);
    if (unlikely(!margs)) {
        result = NULL;
    } else {
        result = PyObject_Call(metaclass, margs, mkw);
        Py_DECREF(margs);
    }
    Py_XDECREF(owned_metaclass);
    return result;
}

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 - start) / 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, (size_t)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,
        0,
        0,
        0,
        0,
        __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,
        __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;
    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_frame = PyFrame_New(
        PyThreadState_GET(), /*PyThreadState *tstate,*/
        py_code,             /*PyCodeObject *code,*/
        __pyx_d,      /*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);
}

#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
    {\
        func_type value = func_value;\
        if (sizeof(target_type) < sizeof(func_type)) {\
            if (unlikely(value != (func_type) (target_type) value)) {\
                func_type zero = 0;\
                if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
                    return (target_type) -1;\
                if (is_unsigned && unlikely(value < zero))\
                    goto raise_neg_overflow;\
                else\
                    goto raise_overflow;\
            }\
        }\
        return (target_type) value;\
    }

static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
    const int neg_one = (int) -1, const_zero = (int) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(int) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
                            return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
                            return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
                            return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (int) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(int) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(int) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
            } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            int val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (int) -1;
        }
    } else {
        int val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyInt_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int");
    return (int) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int");
    return (int) -1;
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
    const long neg_one = (long) -1, const_zero = (long) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_GLint(GLint value) {
    const GLint neg_one = (GLint) -1, const_zero = (GLint) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(GLint) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(GLint) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(GLint) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(GLint) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(GLint) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(GLint),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
    const int neg_one = (int) -1, const_zero = (int) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(int) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(int),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
    const long neg_one = (long) -1, const_zero = (long) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(long) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (long) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
                            return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
                            return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
                            return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (long) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(long) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(long) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
            } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            long val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (long) -1;
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyInt_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to long");
    return (long) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to long");
    return (long) -1;
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_char(unsigned char value) {
    const unsigned char neg_one = (unsigned char) -1, const_zero = (unsigned char) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(unsigned char) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(unsigned char) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(unsigned char) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(unsigned char) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(unsigned char) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(unsigned char),
                                     little, !is_unsigned);
    }
}

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);
        return PyErr_WarnEx(NULL, message, 1);
    }
    return 0;
}

#ifndef __PYX_HAVE_RT_ImportModule
#define __PYX_HAVE_RT_ImportModule
static PyObject *__Pyx_ImportModule(const char *name) {
    PyObject *py_name = 0;
    PyObject *py_module = 0;
    py_name = __Pyx_PyIdentifier_FromString(name);
    if (!py_name)
        goto bad;
    py_module = PyImport_Import(py_name);
    Py_DECREF(py_name);
    return py_module;
bad:
    Py_XDECREF(py_name);
    return 0;
}
#endif

#ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
    size_t size, int strict)
{
    PyObject *py_module = 0;
    PyObject *result = 0;
    PyObject *py_name = 0;
    char warning[200];
    Py_ssize_t basicsize;
#ifdef Py_LIMITED_API
    PyObject *py_basicsize;
#endif
    py_module = __Pyx_ImportModule(module_name);
    if (!py_module)
        goto bad;
    py_name = __Pyx_PyIdentifier_FromString(class_name);
    if (!py_name)
        goto bad;
    result = PyObject_GetAttr(py_module, py_name);
    Py_DECREF(py_name);
    py_name = 0;
    Py_DECREF(py_module);
    py_module = 0;
    if (!result)
        goto bad;
    if (!PyType_Check(result)) {
        PyErr_Format(PyExc_TypeError,
            "%.200s.%.200s is not a type object",
            module_name, class_name);
        goto bad;
    }
#ifndef Py_LIMITED_API
    basicsize = ((PyTypeObject *)result)->tp_basicsize;
#else
    py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
    if (!py_basicsize)
        goto bad;
    basicsize = PyLong_AsSsize_t(py_basicsize);
    Py_DECREF(py_basicsize);
    py_basicsize = 0;
    if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
#endif
    if (!strict && (size_t)basicsize > size) {
        PyOS_snprintf(warning, sizeof(warning),
            "%s.%s size changed, may indicate binary incompatibility",
            module_name, class_name);
        if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
    }
    else if ((size_t)basicsize != size) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s has the wrong size, try recompiling",
            module_name, class_name);
        goto bad;
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(py_module);
    Py_XDECREF(result);
    return NULL;
}
#endif

#ifndef __PYX_HAVE_RT_ImportFunction
#define __PYX_HAVE_RT_ImportFunction
static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) {
    PyObject *d = 0;
    PyObject *cobj = 0;
    union {
        void (*fp)(void);
        void *p;
    } tmp;
    d = PyObject_GetAttrString(module, (char *)"__pyx_capi__");
    if (!d)
        goto bad;
    cobj = PyDict_GetItemString(d, funcname);
    if (!cobj) {
        PyErr_Format(PyExc_ImportError,
            "%.200s does not export expected C function %.200s",
                PyModule_GetName(module), funcname);
        goto bad;
    }
#if PY_VERSION_HEX >= 0x02070000
    if (!PyCapsule_IsValid(cobj, sig)) {
        PyErr_Format(PyExc_TypeError,
            "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
             PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj));
        goto bad;
    }
    tmp.p = PyCapsule_GetPointer(cobj, sig);
#else
    {const char *desc, *s1, *s2;
    desc = (const char *)PyCObject_GetDesc(cobj);
    if (!desc)
        goto bad;
    s1 = desc; s2 = sig;
    while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; }
    if (*s1 != *s2) {
        PyErr_Format(PyExc_TypeError,
            "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
             PyModule_GetName(module), funcname, sig, desc);
        goto bad;
    }
    tmp.p = PyCObject_AsVoidPtr(cobj);}
#endif
    *f = tmp.fp;
    if (!(*f))
        goto bad;
    Py_DECREF(d);
    return 0;
bad:
    Py_XDECREF(d);
    return -1;
}
#endif

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

static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
}
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
    if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
            __Pyx_sys_getdefaultencoding_not_ascii &&
#endif
            PyUnicode_Check(o)) {
#if PY_VERSION_HEX < 0x03030000
        char* defenc_c;
        PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
        if (!defenc) return NULL;
        defenc_c = PyBytes_AS_STRING(defenc);
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        {
            char* end = defenc_c + PyBytes_GET_SIZE(defenc);
            char* c;
            for (c = defenc_c; c < end; c++) {
                if ((unsigned char) (*c) >= 128) {
                    PyUnicode_AsASCIIString(o);
                    return NULL;
                }
            }
        }
#endif
        *length = PyBytes_GET_SIZE(defenc);
        return defenc_c;
#else
        if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        if (PyUnicode_IS_ASCII(o)) {
            *length = PyUnicode_GET_LENGTH(o);
            return PyUnicode_AsUTF8(o);
        } else {
            PyUnicode_AsASCIIString(o);
            return NULL;
        }
#else
        return PyUnicode_AsUTF8AndSize(o, length);
#endif
#endif
    } else
#endif
#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
    if (PyByteArray_Check(o)) {
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
    } else
#endif
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (unlikely(r < 0)) {
            return NULL;
        } else {
            return result;
        }
    }
}
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_MAJOR_VERSION < 3
  if (PyInt_Check(x) || PyLong_Check(x))
#else
  if (PyLong_Check(x))
#endif
    return __Pyx_NewRef(x);
  m = Py_TYPE(x)->tp_as_number;
#if PY_MAJOR_VERSION < 3
  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_MAJOR_VERSION < 3
    if (!PyInt_Check(res) && !PyLong_Check(res)) {
#else
    if (!PyLong_Check(res)) {
#endif
      PyErr_Format(PyExc_TypeError,
                   "__%.4s__ returned non-%.4s (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;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_CheckExact(b))) {
    if (sizeof(Py_ssize_t) >= sizeof(long))
        return PyInt_AS_LONG(b);
    else
        return PyInt_AsSsize_t(x);
  }
#endif
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_USE_PYLONG_INTERNALS
    const digit* digits = ((PyLongObject*)b)->ob_digit;
    const Py_ssize_t size = Py_SIZE(b);
    if (likely(__Pyx_sst_abs(size) <= 1)) {
        ival = likely(size) ? digits[0] : 0;
        if (size == -1) ival = -ival;
        return ival;
    } else {
      switch (size) {
         case 2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
      }
    }
    #endif
    return PyLong_AsSsize_t(b);
  }
  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) {
    return PyInt_FromSize_t(ival);
}


#endif /* Py_PYTHON_H */
