Codebase list pygame-sdl2 / 6cbdd32
Import upstream version 7.4.8 Debian Janitor 2 years ago
7 changed file(s) with 6964 addition(s) and 6151 deletion(s). Raw diff Collapse all Expand all
00 Metadata-Version: 1.2
11 Name: pygame_sdl2
2 Version: 2.1.0-for-renpy-7.4.2
2 Version: 2.1.0-for-renpy-7.4.8
33 Summary: UNKNOWN
44 Home-page: https://github.com/renpy/pygame_sdl2
55 Maintainer: Tom Rothamel
11841184 /* RaiseException.proto */
11851185 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
11861186
1187 /* Import.proto */
1188 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1189
11901187 /* GetTopmostException.proto */
11911188 #if CYTHON_USE_EXC_INFO_STACK
11921189 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
12031200 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
12041201 #endif
12051202
1206 /* PyErrExceptionMatches.proto */
1207 #if CYTHON_FAST_THREAD_STATE
1208 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1209 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1210 #else
1211 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1212 #endif
1213
12141203 /* GetException.proto */
12151204 #if CYTHON_FAST_THREAD_STATE
12161205 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
12441233 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
12451234 __Pyx__ArgTypeTest(obj, type, name, exact))
12461235 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
1236
1237 /* Import.proto */
1238 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
12471239
12481240 /* ExtTypeTest.proto */
12491241 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
12861278 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
12871279 #else
12881280 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
1281 #endif
1282
1283 /* PyErrExceptionMatches.proto */
1284 #if CYTHON_FAST_THREAD_STATE
1285 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1286 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1287 #else
1288 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
12891289 #endif
12901290
12911291 /* PyObjectGetAttrStrNoError.proto */
14331433 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value);
14341434
14351435 /* CIntToPy.proto */
1436 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_long(unsigned long value);
1437
1438 /* CIntToPy.proto */
14361439 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value);
14371440
14381441 /* CIntFromPy.proto */
15101513 int __pyx_module_is_main_pygame_sdl2__display = 0;
15111514
15121515 /* Implementation of 'pygame_sdl2.display' */
1516 static PyObject *__pyx_builtin_ImportError;
15131517 static PyObject *__pyx_builtin_object;
1514 static PyObject *__pyx_builtin_ImportError;
15151518 static PyObject *__pyx_builtin_MemoryError;
15161519 static PyObject *__pyx_builtin_range;
15171520 static PyObject *__pyx_builtin_TypeError;
15591562 static const char __pyx_k_value[] = "value";
15601563 static const char __pyx_k_Info_r[] = "<Info({!r})>";
15611564 static const char __pyx_k_Window[] = "Window";
1565 static const char __pyx_k_ctypes[] = "ctypes";
15621566 static const char __pyx_k_driver[] = "driver";
15631567 static const char __pyx_k_encode[] = "encode";
15641568 static const char __pyx_k_format[] = "format";
15851589 static const char __pyx_k_surface[] = "surface";
15861590 static const char __pyx_k_SRCALPHA[] = "SRCALPHA";
15871591 static const char __pyx_k_bytesize[] = "bytesize";
1592 static const char __pyx_k_c_void_p[] = "c_void_p";
15881593 static const char __pyx_k_get_hint[] = "_get_hint";
15891594 static const char __pyx_k_get_init[] = "get_init";
15901595 static const char __pyx_k_get_size[] = "get_size";
16341639 static const char __pyx_k_set_caption[] = "set_caption";
16351640 static const char __pyx_k_RESIZE_FLAGS[] = "RESIZE_FLAGS";
16361641 static const char __pyx_k_androidembed[] = "androidembed";
1637 static const char __pyx_k_close_window[] = "close_window";
16381642 static const char __pyx_k_default_icon[] = "default_icon";
16391643 static const char __pyx_k_get_platform[] = "get_platform";
16401644 static const char __pyx_k_pygame_hints[] = "_pygame_hints";
16611665 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
16621666 static const char __pyx_k_get_display_bounds[] = "get_display_bounds";
16631667 static const char __pyx_k_pygame_sdl2_locals[] = "pygame_sdl2.locals";
1664 static const char __pyx_k_shown_first_window[] = "_shown_first_window";
1665 static const char __pyx_k_before_first_window[] = "_before_first_window";
16661668 static const char __pyx_k_gl_reset_attributes[] = "gl_reset_attributes";
16671669 static const char __pyx_k_pygame_sdl2_display[] = "pygame_sdl2.display";
16681670 static const char __pyx_k_PYGAME_SDL2_AVOID_GL[] = "PYGAME_SDL2_AVOID_GL";
16911693 static PyObject *__pyx_n_s_TypeError;
16921694 static PyObject *__pyx_n_s_Window;
16931695 static PyObject *__pyx_n_s_androidembed;
1694 static PyObject *__pyx_n_s_before_first_window;
16951696 static PyObject *__pyx_n_s_bitsize;
16961697 static PyObject *__pyx_n_s_blit_hw;
16971698 static PyObject *__pyx_n_s_blit_hw_A;
17011702 static PyObject *__pyx_n_s_blit_sw_CC;
17021703 static PyObject *__pyx_n_s_blue;
17031704 static PyObject *__pyx_n_s_bytesize;
1705 static PyObject *__pyx_n_s_c_void_p;
17041706 static PyObject *__pyx_n_s_cline_in_traceback;
1705 static PyObject *__pyx_n_s_close_window;
17061707 static PyObject *__pyx_n_s_copy;
17071708 static PyObject *__pyx_n_s_create_surface;
1709 static PyObject *__pyx_n_s_ctypes;
17081710 static PyObject *__pyx_n_s_current_h;
17091711 static PyObject *__pyx_n_s_current_w;
17101712 static PyObject *__pyx_n_s_default;
18151817 static PyObject *__pyx_n_s_setstate;
18161818 static PyObject *__pyx_n_s_setstate_cython;
18171819 static PyObject *__pyx_n_s_shifts;
1818 static PyObject *__pyx_n_s_shown_first_window;
18191820 static PyObject *__pyx_n_s_size;
18201821 static PyObject *__pyx_kp_s_src_pygame_sdl2_display_pyx;
18211822 static PyObject *__pyx_n_s_startswith;
18371838 static PyObject *__pyx_pf_11pygame_sdl2_7display_6init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
18381839 static PyObject *__pyx_pf_11pygame_sdl2_7display_8quit(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
18391840 static PyObject *__pyx_pf_11pygame_sdl2_7display_10get_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
1840 static PyObject *__pyx_pf_11pygame_sdl2_7display_12_before_first_window(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
18411841 static int __pyx_pf_11pygame_sdl2_7display_6Window___init__(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_title, PyObject *__pyx_v_resolution, PyObject *__pyx_v_flags, CYTHON_UNUSED PyObject *__pyx_v_depth, PyObject *__pyx_v_pos); /* proto */
18421842 static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_2create_surface(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */
18431843 static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_4destroy(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */
18611861 static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_40restore(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */
18621862 static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_42maximize(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */
18631863 static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_44minimize(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */
1864 static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_46get_sdl_window_pointer(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */
18641865 static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_7surface___get__(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */
18651866 static int __pyx_pf_11pygame_sdl2_7display_6Window_7surface_2__set__(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
18661867 static int __pyx_pf_11pygame_sdl2_7display_6Window_7surface_4__del__(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */
1867 static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_46__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */
1868 static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_48__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
1869 static PyObject *__pyx_pf_11pygame_sdl2_7display_14set_mode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_resolution, PyObject *__pyx_v_flags, PyObject *__pyx_v_depth, PyObject *__pyx_v_pos); /* proto */
1868 static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_48__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */
1869 static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_50__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
1870 static PyObject *__pyx_pf_11pygame_sdl2_7display_12set_mode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_resolution, PyObject *__pyx_v_flags, PyObject *__pyx_v_depth, PyObject *__pyx_v_pos); /* proto */
1871 static PyObject *__pyx_pf_11pygame_sdl2_7display_14destroy(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
18701872 static PyObject *__pyx_pf_11pygame_sdl2_7display_16get_surface(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
18711873 static PyObject *__pyx_pf_11pygame_sdl2_7display_18get_window(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
18721874 static PyObject *__pyx_pf_11pygame_sdl2_7display_20flip(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
19141916 static PyObject *__pyx_tuple__10;
19151917 static PyObject *__pyx_tuple__12;
19161918 static PyObject *__pyx_tuple__18;
1917 static PyObject *__pyx_tuple__20;
1918 static PyObject *__pyx_tuple__25;
1919 static PyObject *__pyx_tuple__27;
1919 static PyObject *__pyx_tuple__24;
1920 static PyObject *__pyx_tuple__26;
1921 static PyObject *__pyx_tuple__28;
19201922 static PyObject *__pyx_tuple__29;
1921 static PyObject *__pyx_tuple__30;
1922 static PyObject *__pyx_tuple__32;
1923 static PyObject *__pyx_tuple__35;
1924 static PyObject *__pyx_tuple__37;
1925 static PyObject *__pyx_tuple__39;
1926 static PyObject *__pyx_tuple__42;
1927 static PyObject *__pyx_tuple__44;
1928 static PyObject *__pyx_tuple__46;
1929 static PyObject *__pyx_tuple__52;
1930 static PyObject *__pyx_tuple__54;
1931 static PyObject *__pyx_tuple__56;
1932 static PyObject *__pyx_tuple__58;
1933 static PyObject *__pyx_tuple__63;
1934 static PyObject *__pyx_tuple__65;
1935 static PyObject *__pyx_tuple__67;
1923 static PyObject *__pyx_tuple__31;
1924 static PyObject *__pyx_tuple__34;
1925 static PyObject *__pyx_tuple__36;
1926 static PyObject *__pyx_tuple__38;
1927 static PyObject *__pyx_tuple__41;
1928 static PyObject *__pyx_tuple__43;
1929 static PyObject *__pyx_tuple__45;
1930 static PyObject *__pyx_tuple__51;
1931 static PyObject *__pyx_tuple__53;
1932 static PyObject *__pyx_tuple__55;
1933 static PyObject *__pyx_tuple__57;
1934 static PyObject *__pyx_tuple__62;
1935 static PyObject *__pyx_tuple__64;
1936 static PyObject *__pyx_tuple__66;
19361937 static PyObject *__pyx_codeobj__11;
19371938 static PyObject *__pyx_codeobj__13;
19381939 static PyObject *__pyx_codeobj__14;
19401941 static PyObject *__pyx_codeobj__16;
19411942 static PyObject *__pyx_codeobj__17;
19421943 static PyObject *__pyx_codeobj__19;
1944 static PyObject *__pyx_codeobj__20;
19431945 static PyObject *__pyx_codeobj__21;
19441946 static PyObject *__pyx_codeobj__22;
19451947 static PyObject *__pyx_codeobj__23;
1946 static PyObject *__pyx_codeobj__24;
1947 static PyObject *__pyx_codeobj__26;
1948 static PyObject *__pyx_codeobj__28;
1949 static PyObject *__pyx_codeobj__31;
1948 static PyObject *__pyx_codeobj__25;
1949 static PyObject *__pyx_codeobj__27;
1950 static PyObject *__pyx_codeobj__30;
1951 static PyObject *__pyx_codeobj__32;
19501952 static PyObject *__pyx_codeobj__33;
1951 static PyObject *__pyx_codeobj__34;
1952 static PyObject *__pyx_codeobj__36;
1953 static PyObject *__pyx_codeobj__38;
1953 static PyObject *__pyx_codeobj__35;
1954 static PyObject *__pyx_codeobj__37;
1955 static PyObject *__pyx_codeobj__39;
19541956 static PyObject *__pyx_codeobj__40;
1955 static PyObject *__pyx_codeobj__41;
1956 static PyObject *__pyx_codeobj__43;
1957 static PyObject *__pyx_codeobj__45;
1957 static PyObject *__pyx_codeobj__42;
1958 static PyObject *__pyx_codeobj__44;
1959 static PyObject *__pyx_codeobj__46;
19581960 static PyObject *__pyx_codeobj__47;
19591961 static PyObject *__pyx_codeobj__48;
19601962 static PyObject *__pyx_codeobj__49;
19611963 static PyObject *__pyx_codeobj__50;
1962 static PyObject *__pyx_codeobj__51;
1963 static PyObject *__pyx_codeobj__53;
1964 static PyObject *__pyx_codeobj__55;
1965 static PyObject *__pyx_codeobj__57;
1964 static PyObject *__pyx_codeobj__52;
1965 static PyObject *__pyx_codeobj__54;
1966 static PyObject *__pyx_codeobj__56;
1967 static PyObject *__pyx_codeobj__58;
19661968 static PyObject *__pyx_codeobj__59;
19671969 static PyObject *__pyx_codeobj__60;
19681970 static PyObject *__pyx_codeobj__61;
1969 static PyObject *__pyx_codeobj__62;
1970 static PyObject *__pyx_codeobj__64;
1971 static PyObject *__pyx_codeobj__66;
1971 static PyObject *__pyx_codeobj__63;
1972 static PyObject *__pyx_codeobj__65;
1973 static PyObject *__pyx_codeobj__67;
19721974 static PyObject *__pyx_codeobj__68;
1973 static PyObject *__pyx_codeobj__69;
19741975 /* Late includes */
19751976
19761977 /* "pygame_sdl2/display.pyx":40
30563057 return __pyx_r;
30573058 }
30583059
3059 /* "pygame_sdl2/display.pyx":126
3060 * _shown_first_window = False
3061 *
3062 * def _before_first_window(): # <<<<<<<<<<<<<<
3063 * global _shown_first_window
3064 *
3065 */
3066
3067 /* Python wrapper */
3068 static PyObject *__pyx_pw_11pygame_sdl2_7display_13_before_first_window(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
3069 static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_13_before_first_window = {"_before_first_window", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_13_before_first_window, METH_NOARGS, 0};
3070 static PyObject *__pyx_pw_11pygame_sdl2_7display_13_before_first_window(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
3071 PyObject *__pyx_r = 0;
3072 __Pyx_RefNannyDeclarations
3073 __Pyx_RefNannySetupContext("_before_first_window (wrapper)", 0);
3074 __pyx_r = __pyx_pf_11pygame_sdl2_7display_12_before_first_window(__pyx_self);
3075
3076 /* function exit code */
3077 __Pyx_RefNannyFinishContext();
3078 return __pyx_r;
3079 }
3080
3081 static PyObject *__pyx_pf_11pygame_sdl2_7display_12_before_first_window(CYTHON_UNUSED PyObject *__pyx_self) {
3082 PyObject *__pyx_v_androidembed = NULL;
3083 PyObject *__pyx_r = NULL;
3084 __Pyx_RefNannyDeclarations
3085 PyObject *__pyx_t_1 = NULL;
3086 int __pyx_t_2;
3087 PyObject *__pyx_t_3 = NULL;
3088 PyObject *__pyx_t_4 = NULL;
3089 PyObject *__pyx_t_5 = NULL;
3090 PyObject *__pyx_t_6 = NULL;
3091 PyObject *__pyx_t_7 = NULL;
3092 int __pyx_t_8;
3093 int __pyx_lineno = 0;
3094 const char *__pyx_filename = NULL;
3095 int __pyx_clineno = 0;
3096 __Pyx_RefNannySetupContext("_before_first_window", 0);
3097
3098 /* "pygame_sdl2/display.pyx":129
3099 * global _shown_first_window
3100 *
3101 * if _shown_first_window: # <<<<<<<<<<<<<<
3102 * return
3103 *
3104 */
3105 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_shown_first_window); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __pyx_L1_error)
3106 __Pyx_GOTREF(__pyx_t_1);
3107 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 129, __pyx_L1_error)
3108 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3109 if (__pyx_t_2) {
3110
3111 /* "pygame_sdl2/display.pyx":130
3112 *
3113 * if _shown_first_window:
3114 * return # <<<<<<<<<<<<<<
3115 *
3116 * _shown_first_window = True
3117 */
3118 __Pyx_XDECREF(__pyx_r);
3119 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3120 goto __pyx_L0;
3121
3122 /* "pygame_sdl2/display.pyx":129
3123 * global _shown_first_window
3124 *
3125 * if _shown_first_window: # <<<<<<<<<<<<<<
3126 * return
3127 *
3128 */
3129 }
3130
3131 /* "pygame_sdl2/display.pyx":132
3132 * return
3133 *
3134 * _shown_first_window = True # <<<<<<<<<<<<<<
3135 *
3136 * # If we're on android, we have to close the splash window before opening
3137 */
3138 if (PyDict_SetItem(__pyx_d, __pyx_n_s_shown_first_window, Py_True) < 0) __PYX_ERR(0, 132, __pyx_L1_error)
3139
3140 /* "pygame_sdl2/display.pyx":136
3141 * # If we're on android, we have to close the splash window before opening
3142 * # our window.
3143 * try: # <<<<<<<<<<<<<<
3144 * import androidembed
3145 * androidembed.close_window()
3146 */
3147 {
3148 __Pyx_PyThreadState_declare
3149 __Pyx_PyThreadState_assign
3150 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
3151 __Pyx_XGOTREF(__pyx_t_3);
3152 __Pyx_XGOTREF(__pyx_t_4);
3153 __Pyx_XGOTREF(__pyx_t_5);
3154 /*try:*/ {
3155
3156 /* "pygame_sdl2/display.pyx":137
3157 * # our window.
3158 * try:
3159 * import androidembed # <<<<<<<<<<<<<<
3160 * androidembed.close_window()
3161 * except ImportError:
3162 */
3163 __pyx_t_1 = __Pyx_Import(__pyx_n_s_androidembed, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L4_error)
3164 __Pyx_GOTREF(__pyx_t_1);
3165 __pyx_v_androidembed = __pyx_t_1;
3166 __pyx_t_1 = 0;
3167
3168 /* "pygame_sdl2/display.pyx":138
3169 * try:
3170 * import androidembed
3171 * androidembed.close_window() # <<<<<<<<<<<<<<
3172 * except ImportError:
3173 * pass
3174 */
3175 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_androidembed, __pyx_n_s_close_window); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 138, __pyx_L4_error)
3176 __Pyx_GOTREF(__pyx_t_6);
3177 __pyx_t_7 = NULL;
3178 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
3179 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
3180 if (likely(__pyx_t_7)) {
3181 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
3182 __Pyx_INCREF(__pyx_t_7);
3183 __Pyx_INCREF(function);
3184 __Pyx_DECREF_SET(__pyx_t_6, function);
3185 }
3186 }
3187 __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
3188 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
3189 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 138, __pyx_L4_error)
3190 __Pyx_GOTREF(__pyx_t_1);
3191 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3192 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3193
3194 /* "pygame_sdl2/display.pyx":136
3195 * # If we're on android, we have to close the splash window before opening
3196 * # our window.
3197 * try: # <<<<<<<<<<<<<<
3198 * import androidembed
3199 * androidembed.close_window()
3200 */
3201 }
3202 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
3203 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3204 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3205 goto __pyx_L9_try_end;
3206 __pyx_L4_error:;
3207 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
3208 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
3209 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
3210
3211 /* "pygame_sdl2/display.pyx":139
3212 * import androidembed
3213 * androidembed.close_window()
3214 * except ImportError: # <<<<<<<<<<<<<<
3215 * pass
3216 *
3217 */
3218 __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
3219 if (__pyx_t_8) {
3220 __Pyx_ErrRestore(0,0,0);
3221 goto __pyx_L5_exception_handled;
3222 }
3223 goto __pyx_L6_except_error;
3224 __pyx_L6_except_error:;
3225
3226 /* "pygame_sdl2/display.pyx":136
3227 * # If we're on android, we have to close the splash window before opening
3228 * # our window.
3229 * try: # <<<<<<<<<<<<<<
3230 * import androidembed
3231 * androidembed.close_window()
3232 */
3233 __Pyx_XGIVEREF(__pyx_t_3);
3234 __Pyx_XGIVEREF(__pyx_t_4);
3235 __Pyx_XGIVEREF(__pyx_t_5);
3236 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
3237 goto __pyx_L1_error;
3238 __pyx_L5_exception_handled:;
3239 __Pyx_XGIVEREF(__pyx_t_3);
3240 __Pyx_XGIVEREF(__pyx_t_4);
3241 __Pyx_XGIVEREF(__pyx_t_5);
3242 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
3243 __pyx_L9_try_end:;
3244 }
3245
3246 /* "pygame_sdl2/display.pyx":126
3247 * _shown_first_window = False
3248 *
3249 * def _before_first_window(): # <<<<<<<<<<<<<<
3250 * global _shown_first_window
3251 *
3252 */
3253
3254 /* function exit code */
3255 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3256 goto __pyx_L0;
3257 __pyx_L1_error:;
3258 __Pyx_XDECREF(__pyx_t_1);
3259 __Pyx_XDECREF(__pyx_t_6);
3260 __Pyx_XDECREF(__pyx_t_7);
3261 __Pyx_AddTraceback("pygame_sdl2.display._before_first_window", __pyx_clineno, __pyx_lineno, __pyx_filename);
3262 __pyx_r = NULL;
3263 __pyx_L0:;
3264 __Pyx_XDECREF(__pyx_v_androidembed);
3265 __Pyx_XGIVEREF(__pyx_r);
3266 __Pyx_RefNannyFinishContext();
3267 return __pyx_r;
3268 }
3269
3270 /* "pygame_sdl2/display.pyx":145
3060 /* "pygame_sdl2/display.pyx":130
32713061 *
32723062 * cdef class Window:
32733063 * def __init__(self, title, resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): # <<<<<<<<<<<<<<
33443134 }
33453135 }
33463136 if (unlikely(kw_args > 0)) {
3347 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 145, __pyx_L3_error)
3137 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 130, __pyx_L3_error)
33483138 }
33493139 } else {
33503140 switch (PyTuple_GET_SIZE(__pyx_args)) {
33693159 }
33703160 goto __pyx_L4_argument_unpacking_done;
33713161 __pyx_L5_argtuple_error:;
3372 __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 145, __pyx_L3_error)
3162 __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 130, __pyx_L3_error)
33733163 __pyx_L3_error:;
33743164 __Pyx_AddTraceback("pygame_sdl2.display.Window.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
33753165 __Pyx_RefNannyFinishContext();
33933183 PyObject *__pyx_t_5 = NULL;
33943184 Uint32 __pyx_t_6;
33953185 char const *__pyx_t_7;
3396 int __pyx_t_8;
3186 char const *__pyx_t_8;
33973187 int __pyx_t_9;
33983188 int __pyx_t_10;
33993189 int __pyx_t_11;
3400 PyObject *__pyx_t_12 = NULL;
3190 int __pyx_t_12;
34013191 PyObject *__pyx_t_13 = NULL;
34023192 PyObject *__pyx_t_14 = NULL;
34033193 PyObject *__pyx_t_15 = NULL;
34043194 PyObject *__pyx_t_16 = NULL;
34053195 PyObject *__pyx_t_17 = NULL;
3196 PyObject *__pyx_t_18 = NULL;
34063197 int __pyx_lineno = 0;
34073198 const char *__pyx_filename = NULL;
34083199 int __pyx_clineno = 0;
34093200 __Pyx_RefNannySetupContext("__init__", 0);
34103201 __Pyx_INCREF(__pyx_v_title);
34113202
3412 /* "pygame_sdl2/display.pyx":147
3203 /* "pygame_sdl2/display.pyx":132
34133204 * def __init__(self, title, resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)):
34143205 *
34153206 * if not isinstance(title, bytes): # <<<<<<<<<<<<<<
34203211 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
34213212 if (__pyx_t_2) {
34223213
3423 /* "pygame_sdl2/display.pyx":148
3214 /* "pygame_sdl2/display.pyx":133
34243215 *
34253216 * if not isinstance(title, bytes):
34263217 * title = title.encode("utf-8") # <<<<<<<<<<<<<<
34273218 *
3428 * _before_first_window()
3429 */
3430 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_title, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 148, __pyx_L1_error)
3219 * self.create_flags = flags
3220 */
3221 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_title, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 133, __pyx_L1_error)
34313222 __Pyx_GOTREF(__pyx_t_4);
34323223 __pyx_t_5 = NULL;
34333224 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
34413232 }
34423233 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_s_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_s_utf_8);
34433234 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3444 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 148, __pyx_L1_error)
3235 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 133, __pyx_L1_error)
34453236 __Pyx_GOTREF(__pyx_t_3);
34463237 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
34473238 __Pyx_DECREF_SET(__pyx_v_title, __pyx_t_3);
34483239 __pyx_t_3 = 0;
34493240
3450 /* "pygame_sdl2/display.pyx":147
3241 /* "pygame_sdl2/display.pyx":132
34513242 * def __init__(self, title, resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)):
34523243 *
34533244 * if not isinstance(title, bytes): # <<<<<<<<<<<<<<
34563247 */
34573248 }
34583249
3459 /* "pygame_sdl2/display.pyx":150
3250 /* "pygame_sdl2/display.pyx":135
34603251 * title = title.encode("utf-8")
34613252 *
3462 * _before_first_window() # <<<<<<<<<<<<<<
3463 *
3464 * self.create_flags = flags
3465 */
3466 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_before_first_window); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 150, __pyx_L1_error)
3467 __Pyx_GOTREF(__pyx_t_4);
3468 __pyx_t_5 = NULL;
3469 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
3470 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
3471 if (likely(__pyx_t_5)) {
3472 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
3473 __Pyx_INCREF(__pyx_t_5);
3474 __Pyx_INCREF(function);
3475 __Pyx_DECREF_SET(__pyx_t_4, function);
3476 }
3477 }
3478 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
3479 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3480 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 150, __pyx_L1_error)
3481 __Pyx_GOTREF(__pyx_t_3);
3482 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3483 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3484
3485 /* "pygame_sdl2/display.pyx":152
3486 * _before_first_window()
3487 *
34883253 * self.create_flags = flags # <<<<<<<<<<<<<<
34893254 *
34903255 * # If we do not get the AVOID_GL hint, we always create a GL-compatible
34913256 */
3492 __pyx_t_6 = __Pyx_PyInt_As_uint32_t(__pyx_v_flags); if (unlikely((__pyx_t_6 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 152, __pyx_L1_error)
3257 __pyx_t_6 = __Pyx_PyInt_As_uint32_t(__pyx_v_flags); if (unlikely((__pyx_t_6 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 135, __pyx_L1_error)
34933258 __pyx_v_self->create_flags = __pyx_t_6;
34943259
3495 /* "pygame_sdl2/display.pyx":156
3260 /* "pygame_sdl2/display.pyx":139
34963261 * # If we do not get the AVOID_GL hint, we always create a GL-compatible
34973262 * # window. This lets us change the OPENGL flag later on.
34983263 * if int(_get_hint("PYGAME_SDL2_AVOID_GL", "0")): # <<<<<<<<<<<<<<
34993264 * gl_flag = 0
35003265 * else:
35013266 */
3502 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_get_hint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 156, __pyx_L1_error)
3267 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_get_hint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error)
35033268 __Pyx_GOTREF(__pyx_t_3);
3504 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 156, __pyx_L1_error)
3269 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 139, __pyx_L1_error)
35053270 __Pyx_GOTREF(__pyx_t_4);
35063271 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3507 __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 156, __pyx_L1_error)
3272 __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error)
35083273 __Pyx_GOTREF(__pyx_t_3);
35093274 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3510 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 156, __pyx_L1_error)
3275 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 139, __pyx_L1_error)
35113276 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
35123277 if (__pyx_t_2) {
35133278
3514 /* "pygame_sdl2/display.pyx":157
3279 /* "pygame_sdl2/display.pyx":140
35153280 * # window. This lets us change the OPENGL flag later on.
35163281 * if int(_get_hint("PYGAME_SDL2_AVOID_GL", "0")):
35173282 * gl_flag = 0 # <<<<<<<<<<<<<<
35203285 */
35213286 __pyx_v_gl_flag = 0;
35223287
3523 /* "pygame_sdl2/display.pyx":156
3288 /* "pygame_sdl2/display.pyx":139
35243289 * # If we do not get the AVOID_GL hint, we always create a GL-compatible
35253290 * # window. This lets us change the OPENGL flag later on.
35263291 * if int(_get_hint("PYGAME_SDL2_AVOID_GL", "0")): # <<<<<<<<<<<<<<
35303295 goto __pyx_L4;
35313296 }
35323297
3533 /* "pygame_sdl2/display.pyx":159
3298 /* "pygame_sdl2/display.pyx":142
35343299 * gl_flag = 0
35353300 * else:
35363301 * gl_flag = SDL_WINDOW_OPENGL # <<<<<<<<<<<<<<
35373302 *
3538 * self.window = SDL_CreateWindow(
3303 * self.window = NULL
35393304 */
35403305 /*else*/ {
35413306 __pyx_v_gl_flag = SDL_WINDOW_OPENGL;
35423307 }
35433308 __pyx_L4:;
35443309
3545 /* "pygame_sdl2/display.pyx":162
3546 *
3547 * self.window = SDL_CreateWindow(
3548 * title, # <<<<<<<<<<<<<<
3549 * pos[0], pos[1],
3550 * resolution[0], resolution[1], flags | gl_flag)
3551 */
3552 __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_title); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 162, __pyx_L1_error)
3553
3554 /* "pygame_sdl2/display.pyx":163
3555 * self.window = SDL_CreateWindow(
3556 * title,
3557 * pos[0], pos[1], # <<<<<<<<<<<<<<
3558 * resolution[0], resolution[1], flags | gl_flag)
3559 *
3560 */
3561 __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pos, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error)
3310 /* "pygame_sdl2/display.pyx":144
3311 * gl_flag = SDL_WINDOW_OPENGL
3312 *
3313 * self.window = NULL # <<<<<<<<<<<<<<
3314 *
3315 * if androidembed is not None:
3316 */
3317 __pyx_v_self->window = NULL;
3318
3319 /* "pygame_sdl2/display.pyx":146
3320 * self.window = NULL
3321 *
3322 * if androidembed is not None: # <<<<<<<<<<<<<<
3323 * self.window = SDL_GL_GetCurrentWindow()
3324 *
3325 */
3326 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_androidembed); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 146, __pyx_L1_error)
35623327 __Pyx_GOTREF(__pyx_t_3);
3563 __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 163, __pyx_L1_error)
3328 __pyx_t_2 = (__pyx_t_3 != Py_None);
35643329 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3565 __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pos, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error)
3566 __Pyx_GOTREF(__pyx_t_3);
3567 __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 163, __pyx_L1_error)
3568 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3569
3570 /* "pygame_sdl2/display.pyx":164
3571 * title,
3572 * pos[0], pos[1],
3573 * resolution[0], resolution[1], flags | gl_flag) # <<<<<<<<<<<<<<
3330 __pyx_t_1 = (__pyx_t_2 != 0);
3331 if (__pyx_t_1) {
3332
3333 /* "pygame_sdl2/display.pyx":147
3334 *
3335 * if androidembed is not None:
3336 * self.window = SDL_GL_GetCurrentWindow() # <<<<<<<<<<<<<<
3337 *
3338 * if self.window:
3339 */
3340 __pyx_v_self->window = SDL_GL_GetCurrentWindow();
3341
3342 /* "pygame_sdl2/display.pyx":149
3343 * self.window = SDL_GL_GetCurrentWindow()
3344 *
3345 * if self.window: # <<<<<<<<<<<<<<
3346 *
3347 * # Android bug - a RGB_565 format is likely to mean the window
3348 */
3349 __pyx_t_1 = (__pyx_v_self->window != 0);
3350 if (__pyx_t_1) {
3351
3352 /* "pygame_sdl2/display.pyx":153
3353 * # Android bug - a RGB_565 format is likely to mean the window
3354 * # wasn't created properly, so re-make it.
3355 * if SDL_GetWindowPixelFormat(self.window) == SDL_PIXELFORMAT_RGB565: # <<<<<<<<<<<<<<
3356 * SDL_DestroyWindow(self.window)
3357 * self.window = NULL
3358 */
3359 __pyx_t_1 = ((SDL_GetWindowPixelFormat(__pyx_v_self->window) == SDL_PIXELFORMAT_RGB565) != 0);
3360 if (__pyx_t_1) {
3361
3362 /* "pygame_sdl2/display.pyx":154
3363 * # wasn't created properly, so re-make it.
3364 * if SDL_GetWindowPixelFormat(self.window) == SDL_PIXELFORMAT_RGB565:
3365 * SDL_DestroyWindow(self.window) # <<<<<<<<<<<<<<
3366 * self.window = NULL
3367 * else:
3368 */
3369 SDL_DestroyWindow(__pyx_v_self->window);
3370
3371 /* "pygame_sdl2/display.pyx":155
3372 * if SDL_GetWindowPixelFormat(self.window) == SDL_PIXELFORMAT_RGB565:
3373 * SDL_DestroyWindow(self.window)
3374 * self.window = NULL # <<<<<<<<<<<<<<
3375 * else:
3376 * SDL_SetWindowTitle(self.window, title)
3377 */
3378 __pyx_v_self->window = NULL;
3379
3380 /* "pygame_sdl2/display.pyx":153
3381 * # Android bug - a RGB_565 format is likely to mean the window
3382 * # wasn't created properly, so re-make it.
3383 * if SDL_GetWindowPixelFormat(self.window) == SDL_PIXELFORMAT_RGB565: # <<<<<<<<<<<<<<
3384 * SDL_DestroyWindow(self.window)
3385 * self.window = NULL
3386 */
3387 goto __pyx_L7;
3388 }
3389
3390 /* "pygame_sdl2/display.pyx":157
3391 * self.window = NULL
3392 * else:
3393 * SDL_SetWindowTitle(self.window, title) # <<<<<<<<<<<<<<
35743394 *
35753395 * if not self.window:
35763396 */
3577 __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_resolution, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 164, __pyx_L1_error)
3578 __Pyx_GOTREF(__pyx_t_3);
3579 __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 164, __pyx_L1_error)
3580 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3581 __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_resolution, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 164, __pyx_L1_error)
3582 __Pyx_GOTREF(__pyx_t_3);
3583 __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 164, __pyx_L1_error)
3584 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3585 __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_gl_flag); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 164, __pyx_L1_error)
3586 __Pyx_GOTREF(__pyx_t_3);
3587 __pyx_t_4 = PyNumber_Or(__pyx_v_flags, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 164, __pyx_L1_error)
3588 __Pyx_GOTREF(__pyx_t_4);
3589 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3590 __pyx_t_6 = __Pyx_PyInt_As_uint32_t(__pyx_t_4); if (unlikely((__pyx_t_6 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 164, __pyx_L1_error)
3591 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3592
3593 /* "pygame_sdl2/display.pyx":161
3594 * gl_flag = SDL_WINDOW_OPENGL
3595 *
3596 * self.window = SDL_CreateWindow( # <<<<<<<<<<<<<<
3597 * title,
3598 * pos[0], pos[1],
3599 */
3600 __pyx_v_self->window = SDL_CreateWindow(__pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_t_11, __pyx_t_6);
3601
3602 /* "pygame_sdl2/display.pyx":166
3603 * resolution[0], resolution[1], flags | gl_flag)
3397 /*else*/ {
3398 __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_title); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 157, __pyx_L1_error)
3399 SDL_SetWindowTitle(__pyx_v_self->window, __pyx_t_7);
3400 }
3401 __pyx_L7:;
3402
3403 /* "pygame_sdl2/display.pyx":149
3404 * self.window = SDL_GL_GetCurrentWindow()
3405 *
3406 * if self.window: # <<<<<<<<<<<<<<
3407 *
3408 * # Android bug - a RGB_565 format is likely to mean the window
3409 */
3410 }
3411
3412 /* "pygame_sdl2/display.pyx":146
3413 * self.window = NULL
3414 *
3415 * if androidembed is not None: # <<<<<<<<<<<<<<
3416 * self.window = SDL_GL_GetCurrentWindow()
3417 *
3418 */
3419 }
3420
3421 /* "pygame_sdl2/display.pyx":159
3422 * SDL_SetWindowTitle(self.window, title)
3423 *
3424 * if not self.window: # <<<<<<<<<<<<<<
3425 * self.window = SDL_CreateWindow(
3426 * title,
3427 */
3428 __pyx_t_1 = ((!(__pyx_v_self->window != 0)) != 0);
3429 if (__pyx_t_1) {
3430
3431 /* "pygame_sdl2/display.pyx":161
3432 * if not self.window:
3433 * self.window = SDL_CreateWindow(
3434 * title, # <<<<<<<<<<<<<<
3435 * pos[0], pos[1],
3436 * resolution[0], resolution[1], flags | gl_flag)
3437 */
3438 __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_v_title); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 161, __pyx_L1_error)
3439
3440 /* "pygame_sdl2/display.pyx":162
3441 * self.window = SDL_CreateWindow(
3442 * title,
3443 * pos[0], pos[1], # <<<<<<<<<<<<<<
3444 * resolution[0], resolution[1], flags | gl_flag)
3445 *
3446 */
3447 __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pos, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 162, __pyx_L1_error)
3448 __Pyx_GOTREF(__pyx_t_3);
3449 __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 162, __pyx_L1_error)
3450 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3451 __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pos, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 162, __pyx_L1_error)
3452 __Pyx_GOTREF(__pyx_t_3);
3453 __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 162, __pyx_L1_error)
3454 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3455
3456 /* "pygame_sdl2/display.pyx":163
3457 * title,
3458 * pos[0], pos[1],
3459 * resolution[0], resolution[1], flags | gl_flag) # <<<<<<<<<<<<<<
3460 *
3461 * if not self.window:
3462 */
3463 __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_resolution, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error)
3464 __Pyx_GOTREF(__pyx_t_3);
3465 __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 163, __pyx_L1_error)
3466 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3467 __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_resolution, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error)
3468 __Pyx_GOTREF(__pyx_t_3);
3469 __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 163, __pyx_L1_error)
3470 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3471 __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_gl_flag); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error)
3472 __Pyx_GOTREF(__pyx_t_3);
3473 __pyx_t_4 = PyNumber_Or(__pyx_v_flags, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error)
3474 __Pyx_GOTREF(__pyx_t_4);
3475 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3476 __pyx_t_6 = __Pyx_PyInt_As_uint32_t(__pyx_t_4); if (unlikely((__pyx_t_6 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 163, __pyx_L1_error)
3477 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3478
3479 /* "pygame_sdl2/display.pyx":160
3480 *
3481 * if not self.window:
3482 * self.window = SDL_CreateWindow( # <<<<<<<<<<<<<<
3483 * title,
3484 * pos[0], pos[1],
3485 */
3486 __pyx_v_self->window = SDL_CreateWindow(__pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_t_11, __pyx_t_12, __pyx_t_6);
3487
3488 /* "pygame_sdl2/display.pyx":159
3489 * SDL_SetWindowTitle(self.window, title)
3490 *
3491 * if not self.window: # <<<<<<<<<<<<<<
3492 * self.window = SDL_CreateWindow(
3493 * title,
3494 */
3495 }
3496
3497 /* "pygame_sdl2/display.pyx":165
3498 * resolution[0], resolution[1], flags | gl_flag)
36043499 *
36053500 * if not self.window: # <<<<<<<<<<<<<<
36063501 * raise error()
36073502 *
36083503 */
3609 __pyx_t_2 = ((!(__pyx_v_self->window != 0)) != 0);
3610 if (unlikely(__pyx_t_2)) {
3611
3612 /* "pygame_sdl2/display.pyx":167
3504 __pyx_t_1 = ((!(__pyx_v_self->window != 0)) != 0);
3505 if (unlikely(__pyx_t_1)) {
3506
3507 /* "pygame_sdl2/display.pyx":166
36133508 *
36143509 * if not self.window:
36153510 * raise error() # <<<<<<<<<<<<<<
36163511 *
36173512 * # From here on, the window exists. So we have to call self.destroy if
36183513 */
3619 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 167, __pyx_L1_error)
3514 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 166, __pyx_L1_error)
36203515 __Pyx_GOTREF(__pyx_t_3);
36213516 __pyx_t_5 = NULL;
36223517 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
36303525 }
36313526 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
36323527 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3633 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L1_error)
3528 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 166, __pyx_L1_error)
36343529 __Pyx_GOTREF(__pyx_t_4);
36353530 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
36363531 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
36373532 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3638 __PYX_ERR(0, 167, __pyx_L1_error)
3639
3640 /* "pygame_sdl2/display.pyx":166
3641 * resolution[0], resolution[1], flags | gl_flag)
3533 __PYX_ERR(0, 166, __pyx_L1_error)
3534
3535 /* "pygame_sdl2/display.pyx":165
3536 * resolution[0], resolution[1], flags | gl_flag)
36423537 *
36433538 * if not self.window: # <<<<<<<<<<<<<<
36443539 * raise error()
36463541 */
36473542 }
36483543
3649 /* "pygame_sdl2/display.pyx":172
3544 /* "pygame_sdl2/display.pyx":171
36503545 * # an exception occurs.
36513546 *
36523547 * try: # <<<<<<<<<<<<<<
36563551 {
36573552 __Pyx_PyThreadState_declare
36583553 __Pyx_PyThreadState_assign
3659 __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
3660 __Pyx_XGOTREF(__pyx_t_12);
3554 __Pyx_ExceptionSave(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
36613555 __Pyx_XGOTREF(__pyx_t_13);
36623556 __Pyx_XGOTREF(__pyx_t_14);
3557 __Pyx_XGOTREF(__pyx_t_15);
36633558 /*try:*/ {
36643559
3665 /* "pygame_sdl2/display.pyx":174
3560 /* "pygame_sdl2/display.pyx":173
36663561 * try:
36673562 *
36683563 * if flags & SDL_WINDOW_OPENGL: # <<<<<<<<<<<<<<
36693564 *
36703565 * self.gl_context = SDL_GL_CreateContext(self.window)
36713566 */
3672 __pyx_t_4 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_OPENGL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 174, __pyx_L6_error)
3567 __pyx_t_4 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_OPENGL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 173, __pyx_L10_error)
36733568 __Pyx_GOTREF(__pyx_t_4);
3674 __pyx_t_3 = PyNumber_And(__pyx_v_flags, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 174, __pyx_L6_error)
3569 __pyx_t_3 = PyNumber_And(__pyx_v_flags, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 173, __pyx_L10_error)
36753570 __Pyx_GOTREF(__pyx_t_3);
36763571 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3677 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 174, __pyx_L6_error)
3572 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 173, __pyx_L10_error)
36783573 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3679 if (__pyx_t_2) {
3680
3681 /* "pygame_sdl2/display.pyx":176
3574 if (__pyx_t_1) {
3575
3576 /* "pygame_sdl2/display.pyx":175
36823577 * if flags & SDL_WINDOW_OPENGL:
36833578 *
36843579 * self.gl_context = SDL_GL_CreateContext(self.window) # <<<<<<<<<<<<<<
36873582 */
36883583 __pyx_v_self->gl_context = SDL_GL_CreateContext(__pyx_v_self->window);
36893584
3690 /* "pygame_sdl2/display.pyx":178
3585 /* "pygame_sdl2/display.pyx":177
36913586 * self.gl_context = SDL_GL_CreateContext(self.window)
36923587 *
36933588 * if self.gl_context == NULL: # <<<<<<<<<<<<<<
36943589 * raise error()
36953590 *
36963591 */
3697 __pyx_t_2 = ((__pyx_v_self->gl_context == NULL) != 0);
3698 if (unlikely(__pyx_t_2)) {
3699
3700 /* "pygame_sdl2/display.pyx":179
3592 __pyx_t_1 = ((__pyx_v_self->gl_context == NULL) != 0);
3593 if (unlikely(__pyx_t_1)) {
3594
3595 /* "pygame_sdl2/display.pyx":178
37013596 *
37023597 * if self.gl_context == NULL:
37033598 * raise error() # <<<<<<<<<<<<<<
37043599 *
3705 * if not ios:
3706 */
3707 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 179, __pyx_L6_error)
3600 * SDL_GL_MakeCurrent(self.window, self.gl_context)
3601 */
3602 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 178, __pyx_L10_error)
37083603 __Pyx_GOTREF(__pyx_t_4);
37093604 __pyx_t_5 = NULL;
37103605 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
37183613 }
37193614 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
37203615 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3721 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 179, __pyx_L6_error)
3616 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 178, __pyx_L10_error)
37223617 __Pyx_GOTREF(__pyx_t_3);
37233618 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37243619 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
37253620 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3726 __PYX_ERR(0, 179, __pyx_L6_error)
3727
3728 /* "pygame_sdl2/display.pyx":178
3621 __PYX_ERR(0, 178, __pyx_L10_error)
3622
3623 /* "pygame_sdl2/display.pyx":177
37293624 * self.gl_context = SDL_GL_CreateContext(self.window)
37303625 *
37313626 * if self.gl_context == NULL: # <<<<<<<<<<<<<<
37343629 */
37353630 }
37363631
3737 /* "pygame_sdl2/display.pyx":181
3632 /* "pygame_sdl2/display.pyx":180
37383633 * raise error()
3634 *
3635 * SDL_GL_MakeCurrent(self.window, self.gl_context) # <<<<<<<<<<<<<<
3636 *
3637 * if not ios:
3638 */
3639 (void)(SDL_GL_MakeCurrent(__pyx_v_self->window, __pyx_v_self->gl_context));
3640
3641 /* "pygame_sdl2/display.pyx":182
3642 * SDL_GL_MakeCurrent(self.window, self.gl_context)
37393643 *
37403644 * if not ios: # <<<<<<<<<<<<<<
37413645 * # Try setting the swap interval - first positive, then negated
37423646 * # to deal with the case where the negative interval isn't
37433647 */
3744 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ios); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 181, __pyx_L6_error)
3648 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ios); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 182, __pyx_L10_error)
37453649 __Pyx_GOTREF(__pyx_t_3);
3746 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 181, __pyx_L6_error)
3650 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 182, __pyx_L10_error)
37473651 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3748 __pyx_t_1 = ((!__pyx_t_2) != 0);
3749 if (__pyx_t_1) {
3750
3751 /* "pygame_sdl2/display.pyx":185
3652 __pyx_t_2 = ((!__pyx_t_1) != 0);
3653 if (__pyx_t_2) {
3654
3655 /* "pygame_sdl2/display.pyx":186
37523656 * # to deal with the case where the negative interval isn't
37533657 * # supported. Then give up and carry on.
37543658 * if SDL_GL_SetSwapInterval(default_swap_control): # <<<<<<<<<<<<<<
3755 * SDL_GL_SetSwapInterval(-default_swap_control)
3756 *
3757 */
3758 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_default_swap_control); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 185, __pyx_L6_error)
3659 * if default_swap_control < 0:
3660 * SDL_GL_SetSwapInterval(-default_swap_control)
3661 */
3662 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_default_swap_control); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 186, __pyx_L10_error)
37593663 __Pyx_GOTREF(__pyx_t_3);
3760 __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 185, __pyx_L6_error)
3664 __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 186, __pyx_L10_error)
37613665 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3762 __pyx_t_1 = (SDL_GL_SetSwapInterval(__pyx_t_11) != 0);
3763 if (__pyx_t_1) {
3764
3765 /* "pygame_sdl2/display.pyx":186
3666 __pyx_t_2 = (SDL_GL_SetSwapInterval(__pyx_t_12) != 0);
3667 if (__pyx_t_2) {
3668
3669 /* "pygame_sdl2/display.pyx":187
37663670 * # supported. Then give up and carry on.
37673671 * if SDL_GL_SetSwapInterval(default_swap_control):
3768 * SDL_GL_SetSwapInterval(-default_swap_control) # <<<<<<<<<<<<<<
3769 *
3770 *
3771 */
3772 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_default_swap_control); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 186, __pyx_L6_error)
3672 * if default_swap_control < 0: # <<<<<<<<<<<<<<
3673 * SDL_GL_SetSwapInterval(-default_swap_control)
3674 *
3675 */
3676 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_default_swap_control); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L10_error)
37733677 __Pyx_GOTREF(__pyx_t_3);
3774 __pyx_t_4 = PyNumber_Negative(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 186, __pyx_L6_error)
3775 __Pyx_GOTREF(__pyx_t_4);
3678 __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L10_error)
37763679 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3777 __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 186, __pyx_L6_error)
3680 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 187, __pyx_L10_error)
37783681 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3779 (void)(SDL_GL_SetSwapInterval(__pyx_t_11));
3780
3781 /* "pygame_sdl2/display.pyx":185
3682 if (__pyx_t_2) {
3683
3684 /* "pygame_sdl2/display.pyx":188
3685 * if SDL_GL_SetSwapInterval(default_swap_control):
3686 * if default_swap_control < 0:
3687 * SDL_GL_SetSwapInterval(-default_swap_control) # <<<<<<<<<<<<<<
3688 *
3689 * self.create_surface()
3690 */
3691 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_default_swap_control); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 188, __pyx_L10_error)
3692 __Pyx_GOTREF(__pyx_t_4);
3693 __pyx_t_3 = PyNumber_Negative(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 188, __pyx_L10_error)
3694 __Pyx_GOTREF(__pyx_t_3);
3695 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3696 __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 188, __pyx_L10_error)
3697 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3698 (void)(SDL_GL_SetSwapInterval(__pyx_t_12));
3699
3700 /* "pygame_sdl2/display.pyx":187
3701 * # supported. Then give up and carry on.
3702 * if SDL_GL_SetSwapInterval(default_swap_control):
3703 * if default_swap_control < 0: # <<<<<<<<<<<<<<
3704 * SDL_GL_SetSwapInterval(-default_swap_control)
3705 *
3706 */
3707 }
3708
3709 /* "pygame_sdl2/display.pyx":186
37823710 * # to deal with the case where the negative interval isn't
37833711 * # supported. Then give up and carry on.
37843712 * if SDL_GL_SetSwapInterval(default_swap_control): # <<<<<<<<<<<<<<
3785 * SDL_GL_SetSwapInterval(-default_swap_control)
3786 *
3713 * if default_swap_control < 0:
3714 * SDL_GL_SetSwapInterval(-default_swap_control)
37873715 */
37883716 }
37893717
3790 /* "pygame_sdl2/display.pyx":181
3791 * raise error()
3718 /* "pygame_sdl2/display.pyx":182
3719 * SDL_GL_MakeCurrent(self.window, self.gl_context)
37923720 *
37933721 * if not ios: # <<<<<<<<<<<<<<
37943722 * # Try setting the swap interval - first positive, then negated
37963724 */
37973725 }
37983726
3799 /* "pygame_sdl2/display.pyx":174
3727 /* "pygame_sdl2/display.pyx":173
38003728 * try:
38013729 *
38023730 * if flags & SDL_WINDOW_OPENGL: # <<<<<<<<<<<<<<
38053733 */
38063734 }
38073735
3808 /* "pygame_sdl2/display.pyx":189
3809 *
3736 /* "pygame_sdl2/display.pyx":190
3737 * SDL_GL_SetSwapInterval(-default_swap_control)
38103738 *
38113739 * self.create_surface() # <<<<<<<<<<<<<<
38123740 *
38133741 * except:
38143742 */
3815 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_create_surface); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 189, __pyx_L6_error)
3816 __Pyx_GOTREF(__pyx_t_3);
3743 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_create_surface); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 190, __pyx_L10_error)
3744 __Pyx_GOTREF(__pyx_t_4);
38173745 __pyx_t_5 = NULL;
3818 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3819 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3746 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
3747 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
38203748 if (likely(__pyx_t_5)) {
3821 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3749 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
38223750 __Pyx_INCREF(__pyx_t_5);
38233751 __Pyx_INCREF(function);
3824 __Pyx_DECREF_SET(__pyx_t_3, function);
3752 __Pyx_DECREF_SET(__pyx_t_4, function);
38253753 }
38263754 }
3827 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
3755 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
38283756 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3829 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 189, __pyx_L6_error)
3830 __Pyx_GOTREF(__pyx_t_4);
3757 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 190, __pyx_L10_error)
3758 __Pyx_GOTREF(__pyx_t_3);
3759 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
38313760 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3832 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3833
3834 /* "pygame_sdl2/display.pyx":172
3761
3762 /* "pygame_sdl2/display.pyx":171
38353763 * # an exception occurs.
38363764 *
38373765 * try: # <<<<<<<<<<<<<<
38393767 * if flags & SDL_WINDOW_OPENGL:
38403768 */
38413769 }
3842 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
38433770 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
38443771 __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
3845 goto __pyx_L11_try_end;
3846 __pyx_L6_error:;
3772 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
3773 goto __pyx_L15_try_end;
3774 __pyx_L10_error:;
38473775 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
38483776 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
38493777 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
38503778
3851 /* "pygame_sdl2/display.pyx":191
3779 /* "pygame_sdl2/display.pyx":192
38523780 * self.create_surface()
38533781 *
38543782 * except: # <<<<<<<<<<<<<<
38573785 */
38583786 /*except:*/ {
38593787 __Pyx_AddTraceback("pygame_sdl2.display.Window.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3860 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_3, &__pyx_t_5) < 0) __PYX_ERR(0, 191, __pyx_L8_except_error)
3788 if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5) < 0) __PYX_ERR(0, 192, __pyx_L12_except_error)
3789 __Pyx_GOTREF(__pyx_t_3);
38613790 __Pyx_GOTREF(__pyx_t_4);
3862 __Pyx_GOTREF(__pyx_t_3);
38633791 __Pyx_GOTREF(__pyx_t_5);
38643792
3865 /* "pygame_sdl2/display.pyx":192
3793 /* "pygame_sdl2/display.pyx":193
38663794 *
38673795 * except:
38683796 * self.destroy() # <<<<<<<<<<<<<<
38693797 * raise
38703798 *
38713799 */
3872 __pyx_t_16 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_destroy); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 192, __pyx_L8_except_error)
3873 __Pyx_GOTREF(__pyx_t_16);
3874 __pyx_t_17 = NULL;
3875 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_16))) {
3876 __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_16);
3877 if (likely(__pyx_t_17)) {
3878 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16);
3879 __Pyx_INCREF(__pyx_t_17);
3800 __pyx_t_17 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_destroy); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 193, __pyx_L12_except_error)
3801 __Pyx_GOTREF(__pyx_t_17);
3802 __pyx_t_18 = NULL;
3803 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_17))) {
3804 __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_17);
3805 if (likely(__pyx_t_18)) {
3806 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
3807 __Pyx_INCREF(__pyx_t_18);
38803808 __Pyx_INCREF(function);
3881 __Pyx_DECREF_SET(__pyx_t_16, function);
3809 __Pyx_DECREF_SET(__pyx_t_17, function);
38823810 }
38833811 }
3884 __pyx_t_15 = (__pyx_t_17) ? __Pyx_PyObject_CallOneArg(__pyx_t_16, __pyx_t_17) : __Pyx_PyObject_CallNoArg(__pyx_t_16);
3885 __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
3886 if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 192, __pyx_L8_except_error)
3887 __Pyx_GOTREF(__pyx_t_15);
3812 __pyx_t_16 = (__pyx_t_18) ? __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_t_18) : __Pyx_PyObject_CallNoArg(__pyx_t_17);
3813 __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
3814 if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 193, __pyx_L12_except_error)
3815 __Pyx_GOTREF(__pyx_t_16);
3816 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
38883817 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3889 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3890
3891 /* "pygame_sdl2/display.pyx":193
3818
3819 /* "pygame_sdl2/display.pyx":194
38923820 * except:
38933821 * self.destroy()
38943822 * raise # <<<<<<<<<<<<<<
38953823 *
38963824 * def create_surface(self):
38973825 */
3826 __Pyx_GIVEREF(__pyx_t_3);
38983827 __Pyx_GIVEREF(__pyx_t_4);
3899 __Pyx_GIVEREF(__pyx_t_3);
39003828 __Pyx_XGIVEREF(__pyx_t_5);
3901 __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_3, __pyx_t_5);
3902 __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_5 = 0;
3903 __PYX_ERR(0, 193, __pyx_L8_except_error)
3904 }
3905 __pyx_L8_except_error:;
3906
3907 /* "pygame_sdl2/display.pyx":172
3829 __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_4, __pyx_t_5);
3830 __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0;
3831 __PYX_ERR(0, 194, __pyx_L12_except_error)
3832 }
3833 __pyx_L12_except_error:;
3834
3835 /* "pygame_sdl2/display.pyx":171
39083836 * # an exception occurs.
39093837 *
39103838 * try: # <<<<<<<<<<<<<<
39113839 *
39123840 * if flags & SDL_WINDOW_OPENGL:
39133841 */
3914 __Pyx_XGIVEREF(__pyx_t_12);
39153842 __Pyx_XGIVEREF(__pyx_t_13);
39163843 __Pyx_XGIVEREF(__pyx_t_14);
3917 __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
3844 __Pyx_XGIVEREF(__pyx_t_15);
3845 __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15);
39183846 goto __pyx_L1_error;
3919 __pyx_L11_try_end:;
3847 __pyx_L15_try_end:;
39203848 }
39213849
3922 /* "pygame_sdl2/display.pyx":145
3850 /* "pygame_sdl2/display.pyx":130
39233851 *
39243852 * cdef class Window:
39253853 * def __init__(self, title, resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): # <<<<<<<<<<<<<<
39343862 __Pyx_XDECREF(__pyx_t_3);
39353863 __Pyx_XDECREF(__pyx_t_4);
39363864 __Pyx_XDECREF(__pyx_t_5);
3937 __Pyx_XDECREF(__pyx_t_15);
39383865 __Pyx_XDECREF(__pyx_t_16);
39393866 __Pyx_XDECREF(__pyx_t_17);
3867 __Pyx_XDECREF(__pyx_t_18);
39403868 __Pyx_AddTraceback("pygame_sdl2.display.Window.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
39413869 __pyx_r = -1;
39423870 __pyx_L0:;
39453873 return __pyx_r;
39463874 }
39473875
3948 /* "pygame_sdl2/display.pyx":195
3876 /* "pygame_sdl2/display.pyx":196
39493877 * raise
39503878 *
39513879 * def create_surface(self): # <<<<<<<<<<<<<<
39823910 int __pyx_clineno = 0;
39833911 __Pyx_RefNannySetupContext("create_surface", 0);
39843912
3985 /* "pygame_sdl2/display.pyx":201
3913 /* "pygame_sdl2/display.pyx":202
39863914 *
39873915 * cdef int w, h
39883916 * SDL_GetWindowSize(self.window, &w, &h) # <<<<<<<<<<<<<<
39913919 */
39923920 SDL_GetWindowSize(__pyx_v_self->window, (&__pyx_v_w), (&__pyx_v_h));
39933921
3994 /* "pygame_sdl2/display.pyx":203
3922 /* "pygame_sdl2/display.pyx":204
39953923 * SDL_GetWindowSize(self.window, &w, &h)
39963924 *
39973925 * if self.gl_context: # <<<<<<<<<<<<<<
40013929 __pyx_t_1 = (__pyx_v_self->gl_context != 0);
40023930 if (__pyx_t_1) {
40033931
4004 /* "pygame_sdl2/display.pyx":208
3932 /* "pygame_sdl2/display.pyx":209
40053933 * # TODO: Make this a bit less wasteful of memory, even if it means
40063934 * # we lie about the actual size of the pixel array.
40073935 * self.surface = Surface((w, h), SRCALPHA, 32) # <<<<<<<<<<<<<<
40083936 *
40093937 * else:
40103938 */
4011 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_w); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 208, __pyx_L1_error)
3939 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_w); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 209, __pyx_L1_error)
40123940 __Pyx_GOTREF(__pyx_t_2);
4013 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_h); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 208, __pyx_L1_error)
3941 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_h); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 209, __pyx_L1_error)
40143942 __Pyx_GOTREF(__pyx_t_3);
4015 __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 208, __pyx_L1_error)
3943 __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 209, __pyx_L1_error)
40163944 __Pyx_GOTREF(__pyx_t_4);
40173945 __Pyx_GIVEREF(__pyx_t_2);
40183946 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
40203948 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
40213949 __pyx_t_2 = 0;
40223950 __pyx_t_3 = 0;
4023 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SRCALPHA); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 208, __pyx_L1_error)
3951 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SRCALPHA); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 209, __pyx_L1_error)
40243952 __Pyx_GOTREF(__pyx_t_3);
4025 __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 208, __pyx_L1_error)
3953 __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 209, __pyx_L1_error)
40263954 __Pyx_GOTREF(__pyx_t_2);
40273955 __Pyx_GIVEREF(__pyx_t_4);
40283956 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
40333961 PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_int_32);
40343962 __pyx_t_4 = 0;
40353963 __pyx_t_3 = 0;
4036 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 208, __pyx_L1_error)
3964 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 209, __pyx_L1_error)
40373965 __Pyx_GOTREF(__pyx_t_3);
40383966 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
40393967 __Pyx_GIVEREF(__pyx_t_3);
40423970 __pyx_v_self->surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_3);
40433971 __pyx_t_3 = 0;
40443972
4045 /* "pygame_sdl2/display.pyx":203
3973 /* "pygame_sdl2/display.pyx":204
40463974 * SDL_GetWindowSize(self.window, &w, &h)
40473975 *
40483976 * if self.gl_context: # <<<<<<<<<<<<<<
40523980 goto __pyx_L3;
40533981 }
40543982
4055 /* "pygame_sdl2/display.pyx":212
3983 /* "pygame_sdl2/display.pyx":213
40563984 * else:
40573985 *
40583986 * self.window_surface = SDL_GetWindowSurface(self.window) # <<<<<<<<<<<<<<
40623990 /*else*/ {
40633991 __pyx_v_self->window_surface = SDL_GetWindowSurface(__pyx_v_self->window);
40643992
4065 /* "pygame_sdl2/display.pyx":216
3993 /* "pygame_sdl2/display.pyx":217
40663994 * # If the surface is 32-bit, we can use it directly. Otherwise,
40673995 * # we need to create a 32-bit proxy surface.
40683996 * if self.window_surface.format.BitsPerPixel == 32: # <<<<<<<<<<<<<<
40724000 __pyx_t_1 = ((__pyx_v_self->window_surface->format->BitsPerPixel == 32) != 0);
40734001 if (__pyx_t_1) {
40744002
4075 /* "pygame_sdl2/display.pyx":218
4003 /* "pygame_sdl2/display.pyx":219
40764004 * if self.window_surface.format.BitsPerPixel == 32:
40774005 *
40784006 * self.surface = Surface(()) # <<<<<<<<<<<<<<
40794007 * self.surface.surface = self.window_surface
40804008 * self.surface.owns_surface = False
40814009 */
4082 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 218, __pyx_L1_error)
4010 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 219, __pyx_L1_error)
40834011 __Pyx_GOTREF(__pyx_t_3);
40844012 __Pyx_GIVEREF(__pyx_t_3);
40854013 __Pyx_GOTREF(__pyx_v_self->surface);
40874015 __pyx_v_self->surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_3);
40884016 __pyx_t_3 = 0;
40894017
4090 /* "pygame_sdl2/display.pyx":219
4018 /* "pygame_sdl2/display.pyx":220
40914019 *
40924020 * self.surface = Surface(())
40934021 * self.surface.surface = self.window_surface # <<<<<<<<<<<<<<
40974025 __pyx_t_5 = __pyx_v_self->window_surface;
40984026 __pyx_v_self->surface->surface = __pyx_t_5;
40994027
4100 /* "pygame_sdl2/display.pyx":220
4028 /* "pygame_sdl2/display.pyx":221
41014029 * self.surface = Surface(())
41024030 * self.surface.surface = self.window_surface
41034031 * self.surface.owns_surface = False # <<<<<<<<<<<<<<
41064034 */
41074035 __pyx_v_self->surface->owns_surface = 0;
41084036
4109 /* "pygame_sdl2/display.pyx":221
4037 /* "pygame_sdl2/display.pyx":222
41104038 * self.surface.surface = self.window_surface
41114039 * self.surface.owns_surface = False
41124040 * self.surface.window_surface = True # <<<<<<<<<<<<<<
41154043 */
41164044 __pyx_v_self->surface->window_surface = 1;
41174045
4118 /* "pygame_sdl2/display.pyx":216
4046 /* "pygame_sdl2/display.pyx":217
41194047 * # If the surface is 32-bit, we can use it directly. Otherwise,
41204048 * # we need to create a 32-bit proxy surface.
41214049 * if self.window_surface.format.BitsPerPixel == 32: # <<<<<<<<<<<<<<
41254053 goto __pyx_L4;
41264054 }
41274055
4128 /* "pygame_sdl2/display.pyx":224
4056 /* "pygame_sdl2/display.pyx":225
41294057 *
41304058 * else:
41314059 * self.surface = Surface((w, h), 0, 32) # <<<<<<<<<<<<<<
41334061 * self.surface.get_window_flags = self.get_window_flags
41344062 */
41354063 /*else*/ {
4136 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 224, __pyx_L1_error)
4064 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 225, __pyx_L1_error)
41374065 __Pyx_GOTREF(__pyx_t_3);
4138 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error)
4066 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 225, __pyx_L1_error)
41394067 __Pyx_GOTREF(__pyx_t_2);
4140 __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 224, __pyx_L1_error)
4068 __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 225, __pyx_L1_error)
41414069 __Pyx_GOTREF(__pyx_t_4);
41424070 __Pyx_GIVEREF(__pyx_t_3);
41434071 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
41454073 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
41464074 __pyx_t_3 = 0;
41474075 __pyx_t_2 = 0;
4148 __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error)
4076 __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 225, __pyx_L1_error)
41494077 __Pyx_GOTREF(__pyx_t_2);
41504078 __Pyx_GIVEREF(__pyx_t_4);
41514079 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
41564084 __Pyx_GIVEREF(__pyx_int_32);
41574085 PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_int_32);
41584086 __pyx_t_4 = 0;
4159 __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 224, __pyx_L1_error)
4087 __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 225, __pyx_L1_error)
41604088 __Pyx_GOTREF(__pyx_t_4);
41614089 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
41624090 __Pyx_GIVEREF(__pyx_t_4);
41694097 }
41704098 __pyx_L3:;
41714099
4172 /* "pygame_sdl2/display.pyx":226
4100 /* "pygame_sdl2/display.pyx":227
41734101 * self.surface = Surface((w, h), 0, 32)
41744102 *
41754103 * self.surface.get_window_flags = self.get_window_flags # <<<<<<<<<<<<<<
41764104 *
41774105 *
41784106 */
4179 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_window_flags); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 226, __pyx_L1_error)
4107 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_window_flags); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 227, __pyx_L1_error)
41804108 __Pyx_GOTREF(__pyx_t_4);
41814109 __Pyx_GIVEREF(__pyx_t_4);
41824110 __Pyx_GOTREF(__pyx_v_self->surface->get_window_flags);
41844112 __pyx_v_self->surface->get_window_flags = __pyx_t_4;
41854113 __pyx_t_4 = 0;
41864114
4187 /* "pygame_sdl2/display.pyx":195
4115 /* "pygame_sdl2/display.pyx":196
41884116 * raise
41894117 *
41904118 * def create_surface(self): # <<<<<<<<<<<<<<
42074135 return __pyx_r;
42084136 }
42094137
4210 /* "pygame_sdl2/display.pyx":229
4138 /* "pygame_sdl2/display.pyx":230
42114139 *
42124140 *
42134141 * def destroy(self): # <<<<<<<<<<<<<<
42384166 int __pyx_clineno = 0;
42394167 __Pyx_RefNannySetupContext("destroy", 0);
42404168
4241 /* "pygame_sdl2/display.pyx":234
4169 /* "pygame_sdl2/display.pyx":235
42424170 * """
42434171 *
42444172 * if self.gl_context != NULL: # <<<<<<<<<<<<<<
42484176 __pyx_t_1 = ((__pyx_v_self->gl_context != NULL) != 0);
42494177 if (__pyx_t_1) {
42504178
4251 /* "pygame_sdl2/display.pyx":235
4179 /* "pygame_sdl2/display.pyx":236
42524180 *
42534181 * if self.gl_context != NULL:
42544182 * SDL_GL_DeleteContext(self.gl_context) # <<<<<<<<<<<<<<
42574185 */
42584186 SDL_GL_DeleteContext(__pyx_v_self->gl_context);
42594187
4260 /* "pygame_sdl2/display.pyx":234
4188 /* "pygame_sdl2/display.pyx":235
42614189 * """
42624190 *
42634191 * if self.gl_context != NULL: # <<<<<<<<<<<<<<
42664194 */
42674195 }
42684196
4269 /* "pygame_sdl2/display.pyx":237
4197 /* "pygame_sdl2/display.pyx":238
42704198 * SDL_GL_DeleteContext(self.gl_context)
42714199 *
42724200 * if self.surface: # <<<<<<<<<<<<<<
42734201 *
42744202 * # Break the cycle that prevents refcounting from collecting this
42754203 */
4276 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->surface)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 237, __pyx_L1_error)
4204 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->surface)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 238, __pyx_L1_error)
42774205 if (__pyx_t_1) {
42784206
4279 /* "pygame_sdl2/display.pyx":241
4207 /* "pygame_sdl2/display.pyx":242
42804208 * # Break the cycle that prevents refcounting from collecting this
42814209 * # object.
42824210 * self.surface.get_window_flags = None # <<<<<<<<<<<<<<
42894217 __Pyx_DECREF(__pyx_v_self->surface->get_window_flags);
42904218 __pyx_v_self->surface->get_window_flags = Py_None;
42914219
4292 /* "pygame_sdl2/display.pyx":244
4220 /* "pygame_sdl2/display.pyx":245
42934221 *
42944222 * # Necessary to collect the GL surface, doesn't hurt the window surface.
42954223 * self.surface = None # <<<<<<<<<<<<<<
43024230 __Pyx_DECREF(((PyObject *)__pyx_v_self->surface));
43034231 __pyx_v_self->surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None);
43044232
4305 /* "pygame_sdl2/display.pyx":237
4233 /* "pygame_sdl2/display.pyx":238
43064234 * SDL_GL_DeleteContext(self.gl_context)
43074235 *
43084236 * if self.surface: # <<<<<<<<<<<<<<
43114239 */
43124240 }
43134241
4314 /* "pygame_sdl2/display.pyx":246
4242 /* "pygame_sdl2/display.pyx":247
43154243 * self.surface = None
43164244 *
43174245 * SDL_DestroyWindow(self.window) # <<<<<<<<<<<<<<
43204248 */
43214249 SDL_DestroyWindow(__pyx_v_self->window);
43224250
4323 /* "pygame_sdl2/display.pyx":229
4251 /* "pygame_sdl2/display.pyx":230
43244252 *
43254253 *
43264254 * def destroy(self): # <<<<<<<<<<<<<<
43404268 return __pyx_r;
43414269 }
43424270
4343 /* "pygame_sdl2/display.pyx":248
4271 /* "pygame_sdl2/display.pyx":249
43444272 * SDL_DestroyWindow(self.window)
43454273 *
43464274 * def resize(self, size, opengl=False, fullscreen=None): # <<<<<<<<<<<<<<
43984326 }
43994327 }
44004328 if (unlikely(kw_args > 0)) {
4401 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "resize") < 0)) __PYX_ERR(0, 248, __pyx_L3_error)
4329 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "resize") < 0)) __PYX_ERR(0, 249, __pyx_L3_error)
44024330 }
44034331 } else {
44044332 switch (PyTuple_GET_SIZE(__pyx_args)) {
44174345 }
44184346 goto __pyx_L4_argument_unpacking_done;
44194347 __pyx_L5_argtuple_error:;
4420 __Pyx_RaiseArgtupleInvalid("resize", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 248, __pyx_L3_error)
4348 __Pyx_RaiseArgtupleInvalid("resize", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 249, __pyx_L3_error)
44214349 __pyx_L3_error:;
44224350 __Pyx_AddTraceback("pygame_sdl2.display.Window.resize", __pyx_clineno, __pyx_lineno, __pyx_filename);
44234351 __Pyx_RefNannyFinishContext();
44524380 __Pyx_RefNannySetupContext("resize", 0);
44534381 __Pyx_INCREF(__pyx_v_fullscreen);
44544382
4455 /* "pygame_sdl2/display.pyx":255
4383 /* "pygame_sdl2/display.pyx":256
44564384 * """
44574385 *
44584386 * if fullscreen is None: # <<<<<<<<<<<<<<
44634391 __pyx_t_2 = (__pyx_t_1 != 0);
44644392 if (__pyx_t_2) {
44654393
4466 /* "pygame_sdl2/display.pyx":256
4394 /* "pygame_sdl2/display.pyx":257
44674395 *
44684396 * if fullscreen is None:
44694397 * fullscreen = SDL_GetWindowFlags(self.window) & SDL_WINDOW_FULLSCREEN_DESKTOP # <<<<<<<<<<<<<<
44704398 *
44714399 * # Prevents a loop between the surface and this object.
44724400 */
4473 __pyx_t_3 = __Pyx_PyInt_From_uint32_t((SDL_GetWindowFlags(__pyx_v_self->window) & SDL_WINDOW_FULLSCREEN_DESKTOP)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 256, __pyx_L1_error)
4401 __pyx_t_3 = __Pyx_PyInt_From_uint32_t((SDL_GetWindowFlags(__pyx_v_self->window) & SDL_WINDOW_FULLSCREEN_DESKTOP)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 257, __pyx_L1_error)
44744402 __Pyx_GOTREF(__pyx_t_3);
44754403 __Pyx_DECREF_SET(__pyx_v_fullscreen, __pyx_t_3);
44764404 __pyx_t_3 = 0;
44774405
4478 /* "pygame_sdl2/display.pyx":255
4406 /* "pygame_sdl2/display.pyx":256
44794407 * """
44804408 *
44814409 * if fullscreen is None: # <<<<<<<<<<<<<<
44844412 */
44854413 }
44864414
4487 /* "pygame_sdl2/display.pyx":259
4415 /* "pygame_sdl2/display.pyx":260
44884416 *
44894417 * # Prevents a loop between the surface and this object.
44904418 * self.surface.get_window_flags = None # <<<<<<<<<<<<<<
44974425 __Pyx_DECREF(__pyx_v_self->surface->get_window_flags);
44984426 __pyx_v_self->surface->get_window_flags = Py_None;
44994427
4500 /* "pygame_sdl2/display.pyx":261
4428 /* "pygame_sdl2/display.pyx":262
45014429 * self.surface.get_window_flags = None
45024430 *
45034431 * if self.gl_context and not opengl: # <<<<<<<<<<<<<<
45104438 __pyx_t_2 = __pyx_t_1;
45114439 goto __pyx_L5_bool_binop_done;
45124440 }
4513 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_opengl); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 261, __pyx_L1_error)
4441 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_opengl); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 262, __pyx_L1_error)
45144442 __pyx_t_4 = ((!__pyx_t_1) != 0);
45154443 __pyx_t_2 = __pyx_t_4;
45164444 __pyx_L5_bool_binop_done:;
45174445 if (__pyx_t_2) {
45184446
4519 /* "pygame_sdl2/display.pyx":262
4447 /* "pygame_sdl2/display.pyx":263
45204448 *
45214449 * if self.gl_context and not opengl:
45224450 * SDL_GL_DeleteContext(self.gl_context) # <<<<<<<<<<<<<<
45254453 */
45264454 SDL_GL_DeleteContext(__pyx_v_self->gl_context);
45274455
4528 /* "pygame_sdl2/display.pyx":263
4456 /* "pygame_sdl2/display.pyx":264
45294457 * if self.gl_context and not opengl:
45304458 * SDL_GL_DeleteContext(self.gl_context)
45314459 * self.gl_context = NULL # <<<<<<<<<<<<<<
45344462 */
45354463 __pyx_v_self->gl_context = NULL;
45364464
4537 /* "pygame_sdl2/display.pyx":261
4465 /* "pygame_sdl2/display.pyx":262
45384466 * self.surface.get_window_flags = None
45394467 *
45404468 * if self.gl_context and not opengl: # <<<<<<<<<<<<<<
45434471 */
45444472 }
45454473
4546 /* "pygame_sdl2/display.pyx":265
4474 /* "pygame_sdl2/display.pyx":266
45474475 * self.gl_context = NULL
45484476 *
45494477 * cdef int cur_width = 0 # <<<<<<<<<<<<<<
45524480 */
45534481 __pyx_v_cur_width = 0;
45544482
4555 /* "pygame_sdl2/display.pyx":266
4483 /* "pygame_sdl2/display.pyx":267
45564484 *
45574485 * cdef int cur_width = 0
45584486 * cdef int cur_height = 0 # <<<<<<<<<<<<<<
45614489 */
45624490 __pyx_v_cur_height = 0;
45634491
4564 /* "pygame_sdl2/display.pyx":268
4492 /* "pygame_sdl2/display.pyx":269
45654493 * cdef int cur_height = 0
45664494 *
45674495 * if fullscreen: # <<<<<<<<<<<<<<
45684496 * if SDL_SetWindowFullscreen(self.window, SDL_WINDOW_FULLSCREEN_DESKTOP):
45694497 * fullscreen = False
45704498 */
4571 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_fullscreen); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 268, __pyx_L1_error)
4499 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_fullscreen); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 269, __pyx_L1_error)
45724500 if (__pyx_t_2) {
45734501
4574 /* "pygame_sdl2/display.pyx":269
4502 /* "pygame_sdl2/display.pyx":270
45754503 *
45764504 * if fullscreen:
45774505 * if SDL_SetWindowFullscreen(self.window, SDL_WINDOW_FULLSCREEN_DESKTOP): # <<<<<<<<<<<<<<
45814509 __pyx_t_2 = (SDL_SetWindowFullscreen(__pyx_v_self->window, SDL_WINDOW_FULLSCREEN_DESKTOP) != 0);
45824510 if (__pyx_t_2) {
45834511
4584 /* "pygame_sdl2/display.pyx":270
4512 /* "pygame_sdl2/display.pyx":271
45854513 * if fullscreen:
45864514 * if SDL_SetWindowFullscreen(self.window, SDL_WINDOW_FULLSCREEN_DESKTOP):
45874515 * fullscreen = False # <<<<<<<<<<<<<<
45914519 __Pyx_INCREF(Py_False);
45924520 __Pyx_DECREF_SET(__pyx_v_fullscreen, Py_False);
45934521
4594 /* "pygame_sdl2/display.pyx":269
4522 /* "pygame_sdl2/display.pyx":270
45954523 *
45964524 * if fullscreen:
45974525 * if SDL_SetWindowFullscreen(self.window, SDL_WINDOW_FULLSCREEN_DESKTOP): # <<<<<<<<<<<<<<
46004528 */
46014529 }
46024530
4603 /* "pygame_sdl2/display.pyx":268
4531 /* "pygame_sdl2/display.pyx":269
46044532 * cdef int cur_height = 0
46054533 *
46064534 * if fullscreen: # <<<<<<<<<<<<<<
46094537 */
46104538 }
46114539
4612 /* "pygame_sdl2/display.pyx":272
4540 /* "pygame_sdl2/display.pyx":273
46134541 * fullscreen = False
46144542 *
46154543 * if not fullscreen: # <<<<<<<<<<<<<<
46164544 * SDL_SetWindowFullscreen(self.window, 0)
46174545 *
46184546 */
4619 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_fullscreen); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 272, __pyx_L1_error)
4547 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_fullscreen); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 273, __pyx_L1_error)
46204548 __pyx_t_4 = ((!__pyx_t_2) != 0);
46214549 if (__pyx_t_4) {
46224550
4623 /* "pygame_sdl2/display.pyx":273
4551 /* "pygame_sdl2/display.pyx":274
46244552 *
46254553 * if not fullscreen:
46264554 * SDL_SetWindowFullscreen(self.window, 0) # <<<<<<<<<<<<<<
46294557 */
46304558 (void)(SDL_SetWindowFullscreen(__pyx_v_self->window, 0));
46314559
4632 /* "pygame_sdl2/display.pyx":275
4560 /* "pygame_sdl2/display.pyx":276
46334561 * SDL_SetWindowFullscreen(self.window, 0)
46344562 *
46354563 * width, height = size # <<<<<<<<<<<<<<
46424570 if (unlikely(size != 2)) {
46434571 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
46444572 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
4645 __PYX_ERR(0, 275, __pyx_L1_error)
4573 __PYX_ERR(0, 276, __pyx_L1_error)
46464574 }
46474575 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
46484576 if (likely(PyTuple_CheckExact(sequence))) {
46554583 __Pyx_INCREF(__pyx_t_3);
46564584 __Pyx_INCREF(__pyx_t_5);
46574585 #else
4658 __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 275, __pyx_L1_error)
4586 __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 276, __pyx_L1_error)
46594587 __Pyx_GOTREF(__pyx_t_3);
4660 __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 275, __pyx_L1_error)
4588 __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 276, __pyx_L1_error)
46614589 __Pyx_GOTREF(__pyx_t_5);
46624590 #endif
46634591 } else {
46644592 Py_ssize_t index = -1;
4665 __pyx_t_6 = PyObject_GetIter(__pyx_v_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 275, __pyx_L1_error)
4593 __pyx_t_6 = PyObject_GetIter(__pyx_v_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 276, __pyx_L1_error)
46664594 __Pyx_GOTREF(__pyx_t_6);
46674595 __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
46684596 index = 0; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L10_unpacking_failed;
46694597 __Pyx_GOTREF(__pyx_t_3);
46704598 index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L10_unpacking_failed;
46714599 __Pyx_GOTREF(__pyx_t_5);
4672 if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 275, __pyx_L1_error)
4600 if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 276, __pyx_L1_error)
46734601 __pyx_t_7 = NULL;
46744602 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
46754603 goto __pyx_L11_unpacking_done;
46774605 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
46784606 __pyx_t_7 = NULL;
46794607 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
4680 __PYX_ERR(0, 275, __pyx_L1_error)
4608 __PYX_ERR(0, 276, __pyx_L1_error)
46814609 __pyx_L11_unpacking_done:;
46824610 }
46834611 __pyx_v_width = __pyx_t_3;
46854613 __pyx_v_height = __pyx_t_5;
46864614 __pyx_t_5 = 0;
46874615
4688 /* "pygame_sdl2/display.pyx":277
4616 /* "pygame_sdl2/display.pyx":278
46894617 * width, height = size
46904618 *
46914619 * SDL_GetWindowSize(self.window, &cur_width, &cur_height) # <<<<<<<<<<<<<<
46944622 */
46954623 SDL_GetWindowSize(__pyx_v_self->window, (&__pyx_v_cur_width), (&__pyx_v_cur_height));
46964624
4697 /* "pygame_sdl2/display.pyx":279
4625 /* "pygame_sdl2/display.pyx":280
46984626 * SDL_GetWindowSize(self.window, &cur_width, &cur_height)
46994627 *
47004628 * if (cur_width != width) or (cur_height != height): # <<<<<<<<<<<<<<
47014629 * SDL_SetWindowSize(self.window, width, height)
47024630 *
47034631 */
4704 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_cur_width); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 279, __pyx_L1_error)
4632 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_cur_width); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 280, __pyx_L1_error)
47054633 __Pyx_GOTREF(__pyx_t_5);
4706 __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_width, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 279, __pyx_L1_error)
4634 __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_width, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 280, __pyx_L1_error)
47074635 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4708 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 279, __pyx_L1_error)
4636 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 280, __pyx_L1_error)
47094637 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
47104638 if (!__pyx_t_2) {
47114639 } else {
47124640 __pyx_t_4 = __pyx_t_2;
47134641 goto __pyx_L13_bool_binop_done;
47144642 }
4715 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_cur_height); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 279, __pyx_L1_error)
4643 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_cur_height); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 280, __pyx_L1_error)
47164644 __Pyx_GOTREF(__pyx_t_3);
4717 __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_v_height, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 279, __pyx_L1_error)
4645 __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_v_height, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 280, __pyx_L1_error)
47184646 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4719 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 279, __pyx_L1_error)
4647 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 280, __pyx_L1_error)
47204648 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
47214649 __pyx_t_4 = __pyx_t_2;
47224650 __pyx_L13_bool_binop_done:;
47234651 if (__pyx_t_4) {
47244652
4725 /* "pygame_sdl2/display.pyx":280
4653 /* "pygame_sdl2/display.pyx":281
47264654 *
47274655 * if (cur_width != width) or (cur_height != height):
47284656 * SDL_SetWindowSize(self.window, width, height) # <<<<<<<<<<<<<<
47294657 *
47304658 * # Create a missing GL context.
47314659 */
4732 __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_width); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 280, __pyx_L1_error)
4733 __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_height); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 280, __pyx_L1_error)
4660 __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_width); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 281, __pyx_L1_error)
4661 __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_height); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 281, __pyx_L1_error)
47344662 SDL_SetWindowSize(__pyx_v_self->window, __pyx_t_8, __pyx_t_9);
47354663
4736 /* "pygame_sdl2/display.pyx":279
4664 /* "pygame_sdl2/display.pyx":280
47374665 * SDL_GetWindowSize(self.window, &cur_width, &cur_height)
47384666 *
47394667 * if (cur_width != width) or (cur_height != height): # <<<<<<<<<<<<<<
47424670 */
47434671 }
47444672
4745 /* "pygame_sdl2/display.pyx":272
4673 /* "pygame_sdl2/display.pyx":273
47464674 * fullscreen = False
47474675 *
47484676 * if not fullscreen: # <<<<<<<<<<<<<<
47514679 */
47524680 }
47534681
4754 /* "pygame_sdl2/display.pyx":283
4682 /* "pygame_sdl2/display.pyx":284
47554683 *
47564684 * # Create a missing GL context.
47574685 * if opengl and not self.gl_context: # <<<<<<<<<<<<<<
47584686 * self.gl_context = SDL_GL_CreateContext(self.window)
47594687 *
47604688 */
4761 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_opengl); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 283, __pyx_L1_error)
4689 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_opengl); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 284, __pyx_L1_error)
47624690 if (__pyx_t_2) {
47634691 } else {
47644692 __pyx_t_4 = __pyx_t_2;
47694697 __pyx_L16_bool_binop_done:;
47704698 if (__pyx_t_4) {
47714699
4772 /* "pygame_sdl2/display.pyx":284
4700 /* "pygame_sdl2/display.pyx":285
47734701 * # Create a missing GL context.
47744702 * if opengl and not self.gl_context:
47754703 * self.gl_context = SDL_GL_CreateContext(self.window) # <<<<<<<<<<<<<<
47784706 */
47794707 __pyx_v_self->gl_context = SDL_GL_CreateContext(__pyx_v_self->window);
47804708
4781 /* "pygame_sdl2/display.pyx":286
4709 /* "pygame_sdl2/display.pyx":287
47824710 * self.gl_context = SDL_GL_CreateContext(self.window)
47834711 *
47844712 * if self.gl_context == NULL: # <<<<<<<<<<<<<<
47884716 __pyx_t_4 = ((__pyx_v_self->gl_context == NULL) != 0);
47894717 if (unlikely(__pyx_t_4)) {
47904718
4791 /* "pygame_sdl2/display.pyx":287
4719 /* "pygame_sdl2/display.pyx":288
47924720 *
47934721 * if self.gl_context == NULL:
47944722 * raise error() # <<<<<<<<<<<<<<
47954723 *
47964724 * self.create_surface()
47974725 */
4798 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 287, __pyx_L1_error)
4726 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 288, __pyx_L1_error)
47994727 __Pyx_GOTREF(__pyx_t_3);
48004728 __pyx_t_6 = NULL;
48014729 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
48094737 }
48104738 __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
48114739 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
4812 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 287, __pyx_L1_error)
4740 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 288, __pyx_L1_error)
48134741 __Pyx_GOTREF(__pyx_t_5);
48144742 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
48154743 __Pyx_Raise(__pyx_t_5, 0, 0, 0);
48164744 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4817 __PYX_ERR(0, 287, __pyx_L1_error)
4818
4819 /* "pygame_sdl2/display.pyx":286
4745 __PYX_ERR(0, 288, __pyx_L1_error)
4746
4747 /* "pygame_sdl2/display.pyx":287
48204748 * self.gl_context = SDL_GL_CreateContext(self.window)
48214749 *
48224750 * if self.gl_context == NULL: # <<<<<<<<<<<<<<
48254753 */
48264754 }
48274755
4828 /* "pygame_sdl2/display.pyx":283
4756 /* "pygame_sdl2/display.pyx":284
48294757 *
48304758 * # Create a missing GL context.
48314759 * if opengl and not self.gl_context: # <<<<<<<<<<<<<<
48344762 */
48354763 }
48364764
4837 /* "pygame_sdl2/display.pyx":289
4765 /* "pygame_sdl2/display.pyx":290
48384766 * raise error()
48394767 *
48404768 * self.create_surface() # <<<<<<<<<<<<<<
48414769 *
48424770 * def recreate_gl_context(self):
48434771 */
4844 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_create_surface); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 289, __pyx_L1_error)
4772 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_create_surface); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 290, __pyx_L1_error)
48454773 __Pyx_GOTREF(__pyx_t_3);
48464774 __pyx_t_6 = NULL;
48474775 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
48554783 }
48564784 __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
48574785 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
4858 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 289, __pyx_L1_error)
4786 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 290, __pyx_L1_error)
48594787 __Pyx_GOTREF(__pyx_t_5);
48604788 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
48614789 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
48624790
4863 /* "pygame_sdl2/display.pyx":248
4791 /* "pygame_sdl2/display.pyx":249
48644792 * SDL_DestroyWindow(self.window)
48654793 *
48664794 * def resize(self, size, opengl=False, fullscreen=None): # <<<<<<<<<<<<<<
48864814 return __pyx_r;
48874815 }
48884816
4889 /* "pygame_sdl2/display.pyx":291
4817 /* "pygame_sdl2/display.pyx":292
48904818 * self.create_surface()
48914819 *
48924820 * def recreate_gl_context(self): # <<<<<<<<<<<<<<
49204848 int __pyx_clineno = 0;
49214849 __Pyx_RefNannySetupContext("recreate_gl_context", 0);
49224850
4923 /* "pygame_sdl2/display.pyx":296
4851 /* "pygame_sdl2/display.pyx":297
49244852 * """
49254853 *
4926 * if <unsigned int> SDL_GL_GetCurrentContext(): # <<<<<<<<<<<<<<
4854 * if <unsigned long> SDL_GL_GetCurrentContext(): # <<<<<<<<<<<<<<
49274855 * return False
49284856 *
49294857 */
4930 __pyx_t_1 = (((unsigned int)SDL_GL_GetCurrentContext()) != 0);
4858 __pyx_t_1 = (((unsigned long)SDL_GL_GetCurrentContext()) != 0);
49314859 if (__pyx_t_1) {
49324860
4933 /* "pygame_sdl2/display.pyx":297
4934 *
4935 * if <unsigned int> SDL_GL_GetCurrentContext():
4861 /* "pygame_sdl2/display.pyx":298
4862 *
4863 * if <unsigned long> SDL_GL_GetCurrentContext():
49364864 * return False # <<<<<<<<<<<<<<
49374865 *
49384866 * self.gl_context = SDL_GL_CreateContext(self.window)
49424870 __pyx_r = Py_False;
49434871 goto __pyx_L0;
49444872
4945 /* "pygame_sdl2/display.pyx":296
4873 /* "pygame_sdl2/display.pyx":297
49464874 * """
49474875 *
4948 * if <unsigned int> SDL_GL_GetCurrentContext(): # <<<<<<<<<<<<<<
4876 * if <unsigned long> SDL_GL_GetCurrentContext(): # <<<<<<<<<<<<<<
49494877 * return False
49504878 *
49514879 */
49524880 }
49534881
4954 /* "pygame_sdl2/display.pyx":299
4882 /* "pygame_sdl2/display.pyx":300
49554883 * return False
49564884 *
49574885 * self.gl_context = SDL_GL_CreateContext(self.window) # <<<<<<<<<<<<<<
49604888 */
49614889 __pyx_v_self->gl_context = SDL_GL_CreateContext(__pyx_v_self->window);
49624890
4963 /* "pygame_sdl2/display.pyx":301
4891 /* "pygame_sdl2/display.pyx":302
49644892 * self.gl_context = SDL_GL_CreateContext(self.window)
49654893 *
49664894 * if self.gl_context == NULL: # <<<<<<<<<<<<<<
49704898 __pyx_t_1 = ((__pyx_v_self->gl_context == NULL) != 0);
49714899 if (unlikely(__pyx_t_1)) {
49724900
4973 /* "pygame_sdl2/display.pyx":302
4901 /* "pygame_sdl2/display.pyx":303
49744902 *
49754903 * if self.gl_context == NULL:
49764904 * raise error() # <<<<<<<<<<<<<<
49774905 *
49784906 * return True
49794907 */
4980 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 302, __pyx_L1_error)
4908 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 303, __pyx_L1_error)
49814909 __Pyx_GOTREF(__pyx_t_3);
49824910 __pyx_t_4 = NULL;
49834911 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
49914919 }
49924920 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
49934921 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
4994 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 302, __pyx_L1_error)
4922 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 303, __pyx_L1_error)
49954923 __Pyx_GOTREF(__pyx_t_2);
49964924 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
49974925 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
49984926 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4999 __PYX_ERR(0, 302, __pyx_L1_error)
5000
5001 /* "pygame_sdl2/display.pyx":301
4927 __PYX_ERR(0, 303, __pyx_L1_error)
4928
4929 /* "pygame_sdl2/display.pyx":302
50024930 * self.gl_context = SDL_GL_CreateContext(self.window)
50034931 *
50044932 * if self.gl_context == NULL: # <<<<<<<<<<<<<<
50074935 */
50084936 }
50094937
5010 /* "pygame_sdl2/display.pyx":304
4938 /* "pygame_sdl2/display.pyx":305
50114939 * raise error()
50124940 *
50134941 * return True # <<<<<<<<<<<<<<
50194947 __pyx_r = Py_True;
50204948 goto __pyx_L0;
50214949
5022 /* "pygame_sdl2/display.pyx":291
4950 /* "pygame_sdl2/display.pyx":292
50234951 * self.create_surface()
50244952 *
50254953 * def recreate_gl_context(self): # <<<<<<<<<<<<<<
50404968 return __pyx_r;
50414969 }
50424970
5043 /* "pygame_sdl2/display.pyx":306
4971 /* "pygame_sdl2/display.pyx":307
50444972 * return True
50454973 *
50464974 * def get_window_flags(self): # <<<<<<<<<<<<<<
50735001 int __pyx_clineno = 0;
50745002 __Pyx_RefNannySetupContext("get_window_flags", 0);
50755003
5076 /* "pygame_sdl2/display.pyx":307
5004 /* "pygame_sdl2/display.pyx":308
50775005 *
50785006 * def get_window_flags(self):
50795007 * rv = SDL_GetWindowFlags(self.window) # <<<<<<<<<<<<<<
50805008 *
50815009 * if self.gl_context:
50825010 */
5083 __pyx_t_1 = __Pyx_PyInt_From_uint32_t(SDL_GetWindowFlags(__pyx_v_self->window)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error)
5011 __pyx_t_1 = __Pyx_PyInt_From_uint32_t(SDL_GetWindowFlags(__pyx_v_self->window)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __pyx_L1_error)
50845012 __Pyx_GOTREF(__pyx_t_1);
50855013 __pyx_v_rv = __pyx_t_1;
50865014 __pyx_t_1 = 0;
50875015
5088 /* "pygame_sdl2/display.pyx":309
5016 /* "pygame_sdl2/display.pyx":310
50895017 * rv = SDL_GetWindowFlags(self.window)
50905018 *
50915019 * if self.gl_context: # <<<<<<<<<<<<<<
50955023 __pyx_t_2 = (__pyx_v_self->gl_context != 0);
50965024 if (__pyx_t_2) {
50975025
5098 /* "pygame_sdl2/display.pyx":310
5026 /* "pygame_sdl2/display.pyx":311
50995027 *
51005028 * if self.gl_context:
51015029 * rv |= SDL_WINDOW_OPENGL # <<<<<<<<<<<<<<
51025030 * else:
51035031 * rv &= ~SDL_WINDOW_OPENGL
51045032 */
5105 __pyx_t_1 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_OPENGL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error)
5033 __pyx_t_1 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_OPENGL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 311, __pyx_L1_error)
51065034 __Pyx_GOTREF(__pyx_t_1);
5107 __pyx_t_3 = PyNumber_InPlaceOr(__pyx_v_rv, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 310, __pyx_L1_error)
5035 __pyx_t_3 = PyNumber_InPlaceOr(__pyx_v_rv, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 311, __pyx_L1_error)
51085036 __Pyx_GOTREF(__pyx_t_3);
51095037 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
51105038 __Pyx_DECREF_SET(__pyx_v_rv, __pyx_t_3);
51115039 __pyx_t_3 = 0;
51125040
5113 /* "pygame_sdl2/display.pyx":309
5041 /* "pygame_sdl2/display.pyx":310
51145042 * rv = SDL_GetWindowFlags(self.window)
51155043 *
51165044 * if self.gl_context: # <<<<<<<<<<<<<<
51205048 goto __pyx_L3;
51215049 }
51225050
5123 /* "pygame_sdl2/display.pyx":312
5051 /* "pygame_sdl2/display.pyx":313
51245052 * rv |= SDL_WINDOW_OPENGL
51255053 * else:
51265054 * rv &= ~SDL_WINDOW_OPENGL # <<<<<<<<<<<<<<
51285056 * return rv
51295057 */
51305058 /*else*/ {
5131 __pyx_t_3 = __Pyx_PyInt_From_int((~SDL_WINDOW_OPENGL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 312, __pyx_L1_error)
5059 __pyx_t_3 = __Pyx_PyInt_From_int((~SDL_WINDOW_OPENGL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 313, __pyx_L1_error)
51325060 __Pyx_GOTREF(__pyx_t_3);
5133 __pyx_t_1 = PyNumber_InPlaceAnd(__pyx_v_rv, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 312, __pyx_L1_error)
5061 __pyx_t_1 = PyNumber_InPlaceAnd(__pyx_v_rv, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 313, __pyx_L1_error)
51345062 __Pyx_GOTREF(__pyx_t_1);
51355063 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
51365064 __Pyx_DECREF_SET(__pyx_v_rv, __pyx_t_1);
51385066 }
51395067 __pyx_L3:;
51405068
5141 /* "pygame_sdl2/display.pyx":314
5069 /* "pygame_sdl2/display.pyx":315
51425070 * rv &= ~SDL_WINDOW_OPENGL
51435071 *
51445072 * return rv # <<<<<<<<<<<<<<
51505078 __pyx_r = __pyx_v_rv;
51515079 goto __pyx_L0;
51525080
5153 /* "pygame_sdl2/display.pyx":306
5081 /* "pygame_sdl2/display.pyx":307
51545082 * return True
51555083 *
51565084 * def get_window_flags(self): # <<<<<<<<<<<<<<
51715099 return __pyx_r;
51725100 }
51735101
5174 /* "pygame_sdl2/display.pyx":316
5102 /* "pygame_sdl2/display.pyx":317
51755103 * return rv
51765104 *
51775105 * def proxy_window_surface(self): # <<<<<<<<<<<<<<
51975125 __Pyx_RefNannyDeclarations
51985126 __Pyx_RefNannySetupContext("proxy_window_surface", 0);
51995127
5200 /* "pygame_sdl2/display.pyx":317
5128 /* "pygame_sdl2/display.pyx":318
52015129 *
52025130 * def proxy_window_surface(self):
52035131 * SDL_UpperBlit(self.surface.surface, NULL, self.window_surface, NULL) # <<<<<<<<<<<<<<
52065134 */
52075135 (void)(SDL_UpperBlit(__pyx_v_self->surface->surface, NULL, __pyx_v_self->window_surface, NULL));
52085136
5209 /* "pygame_sdl2/display.pyx":316
5137 /* "pygame_sdl2/display.pyx":317
52105138 * return rv
52115139 *
52125140 * def proxy_window_surface(self): # <<<<<<<<<<<<<<
52215149 return __pyx_r;
52225150 }
52235151
5224 /* "pygame_sdl2/display.pyx":319
5152 /* "pygame_sdl2/display.pyx":320
52255153 * SDL_UpperBlit(self.surface.surface, NULL, self.window_surface, NULL)
52265154 *
52275155 * def flip(self): # <<<<<<<<<<<<<<
52565184 int __pyx_clineno = 0;
52575185 __Pyx_RefNannySetupContext("flip", 0);
52585186
5259 /* "pygame_sdl2/display.pyx":322
5187 /* "pygame_sdl2/display.pyx":323
52605188 * cdef const char *err
52615189 *
52625190 * if self.gl_context != NULL: # <<<<<<<<<<<<<<
52665194 __pyx_t_1 = ((__pyx_v_self->gl_context != NULL) != 0);
52675195 if (__pyx_t_1) {
52685196
5269 /* "pygame_sdl2/display.pyx":323
5197 /* "pygame_sdl2/display.pyx":324
52705198 *
52715199 * if self.gl_context != NULL:
52725200 * with nogil: # <<<<<<<<<<<<<<
52815209 #endif
52825210 /*try:*/ {
52835211
5284 /* "pygame_sdl2/display.pyx":324
5212 /* "pygame_sdl2/display.pyx":325
52855213 * if self.gl_context != NULL:
52865214 * with nogil:
52875215 * SDL_ClearError(); # <<<<<<<<<<<<<<
52905218 */
52915219 SDL_ClearError();
52925220
5293 /* "pygame_sdl2/display.pyx":326
5221 /* "pygame_sdl2/display.pyx":327
52945222 * SDL_ClearError();
52955223 *
52965224 * SDL_GL_SwapWindow(self.window) # <<<<<<<<<<<<<<
52995227 */
53005228 SDL_GL_SwapWindow(__pyx_v_self->window);
53015229
5302 /* "pygame_sdl2/display.pyx":328
5230 /* "pygame_sdl2/display.pyx":329
53035231 * SDL_GL_SwapWindow(self.window)
53045232 *
53055233 * err = SDL_GetError() # <<<<<<<<<<<<<<
53095237 __pyx_v_err = SDL_GetError();
53105238 }
53115239
5312 /* "pygame_sdl2/display.pyx":323
5240 /* "pygame_sdl2/display.pyx":324
53135241 *
53145242 * if self.gl_context != NULL:
53155243 * with nogil: # <<<<<<<<<<<<<<
53285256 }
53295257 }
53305258
5331 /* "pygame_sdl2/display.pyx":330
5259 /* "pygame_sdl2/display.pyx":331
53325260 * err = SDL_GetError()
53335261 *
53345262 * if err[0]: # <<<<<<<<<<<<<<
53385266 __pyx_t_1 = ((__pyx_v_err[0]) != 0);
53395267 if (unlikely(__pyx_t_1)) {
53405268
5341 /* "pygame_sdl2/display.pyx":331
5269 /* "pygame_sdl2/display.pyx":332
53425270 *
53435271 * if err[0]:
53445272 * raise error(err) # <<<<<<<<<<<<<<
53455273 *
53465274 * else:
53475275 */
5348 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 331, __pyx_L1_error)
5276 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 332, __pyx_L1_error)
53495277 __Pyx_GOTREF(__pyx_t_3);
5350 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_err); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 331, __pyx_L1_error)
5278 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_err); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 332, __pyx_L1_error)
53515279 __Pyx_GOTREF(__pyx_t_4);
53525280 __pyx_t_5 = NULL;
53535281 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
53625290 __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
53635291 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
53645292 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5365 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 331, __pyx_L1_error)
5293 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
53665294 __Pyx_GOTREF(__pyx_t_2);
53675295 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
53685296 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
53695297 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5370 __PYX_ERR(0, 331, __pyx_L1_error)
5371
5372 /* "pygame_sdl2/display.pyx":330
5298 __PYX_ERR(0, 332, __pyx_L1_error)
5299
5300 /* "pygame_sdl2/display.pyx":331
53735301 * err = SDL_GetError()
53745302 *
53755303 * if err[0]: # <<<<<<<<<<<<<<
53785306 */
53795307 }
53805308
5381 /* "pygame_sdl2/display.pyx":322
5309 /* "pygame_sdl2/display.pyx":323
53825310 * cdef const char *err
53835311 *
53845312 * if self.gl_context != NULL: # <<<<<<<<<<<<<<
53885316 goto __pyx_L3;
53895317 }
53905318
5391 /* "pygame_sdl2/display.pyx":335
5319 /* "pygame_sdl2/display.pyx":336
53925320 * else:
53935321 *
53945322 * if self.surface.surface != self.window_surface: # <<<<<<<<<<<<<<
53995327 __pyx_t_1 = ((__pyx_v_self->surface->surface != __pyx_v_self->window_surface) != 0);
54005328 if (__pyx_t_1) {
54015329
5402 /* "pygame_sdl2/display.pyx":336
5330 /* "pygame_sdl2/display.pyx":337
54035331 *
54045332 * if self.surface.surface != self.window_surface:
54055333 * self.proxy_window_surface() # <<<<<<<<<<<<<<
54065334 *
54075335 * with nogil:
54085336 */
5409 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_proxy_window_surface); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 336, __pyx_L1_error)
5337 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_proxy_window_surface); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 337, __pyx_L1_error)
54105338 __Pyx_GOTREF(__pyx_t_3);
54115339 __pyx_t_4 = NULL;
54125340 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
54205348 }
54215349 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
54225350 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
5423 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 336, __pyx_L1_error)
5351 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error)
54245352 __Pyx_GOTREF(__pyx_t_2);
54255353 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
54265354 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
54275355
5428 /* "pygame_sdl2/display.pyx":335
5356 /* "pygame_sdl2/display.pyx":336
54295357 * else:
54305358 *
54315359 * if self.surface.surface != self.window_surface: # <<<<<<<<<<<<<<
54345362 */
54355363 }
54365364
5437 /* "pygame_sdl2/display.pyx":338
5365 /* "pygame_sdl2/display.pyx":339
54385366 * self.proxy_window_surface()
54395367 *
54405368 * with nogil: # <<<<<<<<<<<<<<
54495377 #endif
54505378 /*try:*/ {
54515379
5452 /* "pygame_sdl2/display.pyx":339
5380 /* "pygame_sdl2/display.pyx":340
54535381 *
54545382 * with nogil:
54555383 * SDL_UpdateWindowSurface(self.window) # <<<<<<<<<<<<<<
54595387 (void)(SDL_UpdateWindowSurface(__pyx_v_self->window));
54605388 }
54615389
5462 /* "pygame_sdl2/display.pyx":338
5390 /* "pygame_sdl2/display.pyx":339
54635391 * self.proxy_window_surface()
54645392 *
54655393 * with nogil: # <<<<<<<<<<<<<<
54805408 }
54815409 __pyx_L3:;
54825410
5483 /* "pygame_sdl2/display.pyx":319
5411 /* "pygame_sdl2/display.pyx":320
54845412 * SDL_UpperBlit(self.surface.surface, NULL, self.window_surface, NULL)
54855413 *
54865414 * def flip(self): # <<<<<<<<<<<<<<
55045432 return __pyx_r;
55055433 }
55065434
5507 /* "pygame_sdl2/display.pyx":341
5435 /* "pygame_sdl2/display.pyx":342
55085436 * SDL_UpdateWindowSurface(self.window)
55095437 *
55105438 * def get_surface(self): # <<<<<<<<<<<<<<
55305458 __Pyx_RefNannyDeclarations
55315459 __Pyx_RefNannySetupContext("get_surface", 0);
55325460
5533 /* "pygame_sdl2/display.pyx":342
5461 /* "pygame_sdl2/display.pyx":343
55345462 *
55355463 * def get_surface(self):
55365464 * return self.surface # <<<<<<<<<<<<<<
55425470 __pyx_r = ((PyObject *)__pyx_v_self->surface);
55435471 goto __pyx_L0;
55445472
5545 /* "pygame_sdl2/display.pyx":341
5473 /* "pygame_sdl2/display.pyx":342
55465474 * SDL_UpdateWindowSurface(self.window)
55475475 *
55485476 * def get_surface(self): # <<<<<<<<<<<<<<
55575485 return __pyx_r;
55585486 }
55595487
5560 /* "pygame_sdl2/display.pyx":344
5488 /* "pygame_sdl2/display.pyx":345
55615489 * return self.surface
55625490 *
55635491 * def update(self, rectangles=None): # <<<<<<<<<<<<<<
55975525 }
55985526 }
55995527 if (unlikely(kw_args > 0)) {
5600 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "update") < 0)) __PYX_ERR(0, 344, __pyx_L3_error)
5528 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "update") < 0)) __PYX_ERR(0, 345, __pyx_L3_error)
56015529 }
56025530 } else {
56035531 switch (PyTuple_GET_SIZE(__pyx_args)) {
56115539 }
56125540 goto __pyx_L4_argument_unpacking_done;
56135541 __pyx_L5_argtuple_error:;
5614 __Pyx_RaiseArgtupleInvalid("update", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 344, __pyx_L3_error)
5542 __Pyx_RaiseArgtupleInvalid("update", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 345, __pyx_L3_error)
56155543 __pyx_L3_error:;
56165544 __Pyx_AddTraceback("pygame_sdl2.display.Window.update", __pyx_clineno, __pyx_lineno, __pyx_filename);
56175545 __Pyx_RefNannyFinishContext();
56525580 __Pyx_RefNannySetupContext("update", 0);
56535581 __Pyx_INCREF(__pyx_v_rectangles);
56545582
5655 /* "pygame_sdl2/display.pyx":347
5583 /* "pygame_sdl2/display.pyx":348
56565584 *
56575585 * cdef SDL_Rect *rects
56585586 * cdef int count = 0 # <<<<<<<<<<<<<<
56615589 */
56625590 __pyx_v_count = 0;
56635591
5664 /* "pygame_sdl2/display.pyx":349
5592 /* "pygame_sdl2/display.pyx":350
56655593 * cdef int count = 0
56665594 *
56675595 * if rectangles is None: # <<<<<<<<<<<<<<
56725600 __pyx_t_2 = (__pyx_t_1 != 0);
56735601 if (__pyx_t_2) {
56745602
5675 /* "pygame_sdl2/display.pyx":350
5603 /* "pygame_sdl2/display.pyx":351
56765604 *
56775605 * if rectangles is None:
56785606 * self.flip() # <<<<<<<<<<<<<<
56795607 * return
56805608 *
56815609 */
5682 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flip); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 350, __pyx_L1_error)
5610 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flip); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 351, __pyx_L1_error)
56835611 __Pyx_GOTREF(__pyx_t_4);
56845612 __pyx_t_5 = NULL;
56855613 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
56935621 }
56945622 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
56955623 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
5696 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 350, __pyx_L1_error)
5624 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 351, __pyx_L1_error)
56975625 __Pyx_GOTREF(__pyx_t_3);
56985626 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
56995627 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
57005628
5701 /* "pygame_sdl2/display.pyx":351
5629 /* "pygame_sdl2/display.pyx":352
57025630 * if rectangles is None:
57035631 * self.flip()
57045632 * return # <<<<<<<<<<<<<<
57095637 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
57105638 goto __pyx_L0;
57115639
5712 /* "pygame_sdl2/display.pyx":349
5640 /* "pygame_sdl2/display.pyx":350
57135641 * cdef int count = 0
57145642 *
57155643 * if rectangles is None: # <<<<<<<<<<<<<<
57185646 */
57195647 }
57205648
5721 /* "pygame_sdl2/display.pyx":353
5649 /* "pygame_sdl2/display.pyx":354
57225650 * return
57235651 *
57245652 * if self.surface.surface != self.window_surface: # <<<<<<<<<<<<<<
57285656 __pyx_t_2 = ((__pyx_v_self->surface->surface != __pyx_v_self->window_surface) != 0);
57295657 if (__pyx_t_2) {
57305658
5731 /* "pygame_sdl2/display.pyx":354
5659 /* "pygame_sdl2/display.pyx":355
57325660 *
57335661 * if self.surface.surface != self.window_surface:
57345662 * self.proxy_window_surface() # <<<<<<<<<<<<<<
57355663 *
57365664 * if not isinstance(rectangles, list):
57375665 */
5738 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_proxy_window_surface); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 354, __pyx_L1_error)
5666 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_proxy_window_surface); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 355, __pyx_L1_error)
57395667 __Pyx_GOTREF(__pyx_t_4);
57405668 __pyx_t_5 = NULL;
57415669 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
57495677 }
57505678 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
57515679 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
5752 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 354, __pyx_L1_error)
5680 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 355, __pyx_L1_error)
57535681 __Pyx_GOTREF(__pyx_t_3);
57545682 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
57555683 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
57565684
5757 /* "pygame_sdl2/display.pyx":353
5685 /* "pygame_sdl2/display.pyx":354
57585686 * return
57595687 *
57605688 * if self.surface.surface != self.window_surface: # <<<<<<<<<<<<<<
57635691 */
57645692 }
57655693
5766 /* "pygame_sdl2/display.pyx":356
5694 /* "pygame_sdl2/display.pyx":357
57675695 * self.proxy_window_surface()
57685696 *
57695697 * if not isinstance(rectangles, list): # <<<<<<<<<<<<<<
57745702 __pyx_t_1 = ((!(__pyx_t_2 != 0)) != 0);
57755703 if (__pyx_t_1) {
57765704
5777 /* "pygame_sdl2/display.pyx":357
5705 /* "pygame_sdl2/display.pyx":358
57785706 *
57795707 * if not isinstance(rectangles, list):
57805708 * rectangles = [ rectangles ] # <<<<<<<<<<<<<<
57815709 *
57825710 * rects = <SDL_Rect *> calloc(len(rectangles), sizeof(SDL_Rect))
57835711 */
5784 __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 357, __pyx_L1_error)
5712 __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 358, __pyx_L1_error)
57855713 __Pyx_GOTREF(__pyx_t_3);
57865714 __Pyx_INCREF(__pyx_v_rectangles);
57875715 __Pyx_GIVEREF(__pyx_v_rectangles);
57895717 __Pyx_DECREF_SET(__pyx_v_rectangles, __pyx_t_3);
57905718 __pyx_t_3 = 0;
57915719
5792 /* "pygame_sdl2/display.pyx":356
5720 /* "pygame_sdl2/display.pyx":357
57935721 * self.proxy_window_surface()
57945722 *
57955723 * if not isinstance(rectangles, list): # <<<<<<<<<<<<<<
57985726 */
57995727 }
58005728
5801 /* "pygame_sdl2/display.pyx":359
5729 /* "pygame_sdl2/display.pyx":360
58025730 * rectangles = [ rectangles ]
58035731 *
58045732 * rects = <SDL_Rect *> calloc(len(rectangles), sizeof(SDL_Rect)) # <<<<<<<<<<<<<<
58055733 * if rects == NULL:
58065734 * raise MemoryError("Couldn't allocate rectangles.")
58075735 */
5808 __pyx_t_6 = PyObject_Length(__pyx_v_rectangles); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 359, __pyx_L1_error)
5736 __pyx_t_6 = PyObject_Length(__pyx_v_rectangles); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 360, __pyx_L1_error)
58095737 __pyx_v_rects = ((SDL_Rect *)calloc(__pyx_t_6, (sizeof(SDL_Rect))));
58105738
5811 /* "pygame_sdl2/display.pyx":360
5739 /* "pygame_sdl2/display.pyx":361
58125740 *
58135741 * rects = <SDL_Rect *> calloc(len(rectangles), sizeof(SDL_Rect))
58145742 * if rects == NULL: # <<<<<<<<<<<<<<
58185746 __pyx_t_1 = ((__pyx_v_rects == NULL) != 0);
58195747 if (unlikely(__pyx_t_1)) {
58205748
5821 /* "pygame_sdl2/display.pyx":361
5749 /* "pygame_sdl2/display.pyx":362
58225750 * rects = <SDL_Rect *> calloc(len(rectangles), sizeof(SDL_Rect))
58235751 * if rects == NULL:
58245752 * raise MemoryError("Couldn't allocate rectangles.") # <<<<<<<<<<<<<<
58255753 *
58265754 * try:
58275755 */
5828 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 361, __pyx_L1_error)
5756 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 362, __pyx_L1_error)
58295757 __Pyx_GOTREF(__pyx_t_3);
58305758 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
58315759 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5832 __PYX_ERR(0, 361, __pyx_L1_error)
5833
5834 /* "pygame_sdl2/display.pyx":360
5760 __PYX_ERR(0, 362, __pyx_L1_error)
5761
5762 /* "pygame_sdl2/display.pyx":361
58355763 *
58365764 * rects = <SDL_Rect *> calloc(len(rectangles), sizeof(SDL_Rect))
58375765 * if rects == NULL: # <<<<<<<<<<<<<<
58405768 */
58415769 }
58425770
5843 /* "pygame_sdl2/display.pyx":363
5771 /* "pygame_sdl2/display.pyx":364
58445772 * raise MemoryError("Couldn't allocate rectangles.")
58455773 *
58465774 * try: # <<<<<<<<<<<<<<
58495777 */
58505778 /*try:*/ {
58515779
5852 /* "pygame_sdl2/display.pyx":365
5780 /* "pygame_sdl2/display.pyx":366
58535781 * try:
58545782 *
58555783 * for i in rectangles: # <<<<<<<<<<<<<<
58605788 __pyx_t_3 = __pyx_v_rectangles; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0;
58615789 __pyx_t_7 = NULL;
58625790 } else {
5863 __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_rectangles); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 365, __pyx_L8_error)
5791 __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_rectangles); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 366, __pyx_L8_error)
58645792 __Pyx_GOTREF(__pyx_t_3);
5865 __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 365, __pyx_L8_error)
5793 __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 366, __pyx_L8_error)
58665794 }
58675795 for (;;) {
58685796 if (likely(!__pyx_t_7)) {
58695797 if (likely(PyList_CheckExact(__pyx_t_3))) {
58705798 if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break;
58715799 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5872 __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 365, __pyx_L8_error)
5800 __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 366, __pyx_L8_error)
58735801 #else
5874 __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 365, __pyx_L8_error)
5802 __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 366, __pyx_L8_error)
58755803 __Pyx_GOTREF(__pyx_t_4);
58765804 #endif
58775805 } else {
58785806 if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
58795807 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5880 __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_ERR(0, 365, __pyx_L8_error)
5808 __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_ERR(0, 366, __pyx_L8_error)
58815809 #else
5882 __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 365, __pyx_L8_error)
5810 __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 366, __pyx_L8_error)
58835811 __Pyx_GOTREF(__pyx_t_4);
58845812 #endif
58855813 }
58895817 PyObject* exc_type = PyErr_Occurred();
58905818 if (exc_type) {
58915819 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
5892 else __PYX_ERR(0, 365, __pyx_L8_error)
5820 else __PYX_ERR(0, 366, __pyx_L8_error)
58935821 }
58945822 break;
58955823 }
58985826 __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4);
58995827 __pyx_t_4 = 0;
59005828
5901 /* "pygame_sdl2/display.pyx":366
5829 /* "pygame_sdl2/display.pyx":367
59025830 *
59035831 * for i in rectangles:
59045832 * if i is None: # <<<<<<<<<<<<<<
59095837 __pyx_t_2 = (__pyx_t_1 != 0);
59105838 if (__pyx_t_2) {
59115839
5912 /* "pygame_sdl2/display.pyx":367
5840 /* "pygame_sdl2/display.pyx":368
59135841 * for i in rectangles:
59145842 * if i is None:
59155843 * continue # <<<<<<<<<<<<<<
59185846 */
59195847 goto __pyx_L10_continue;
59205848
5921 /* "pygame_sdl2/display.pyx":366
5849 /* "pygame_sdl2/display.pyx":367
59225850 *
59235851 * for i in rectangles:
59245852 * if i is None: # <<<<<<<<<<<<<<
59275855 */
59285856 }
59295857
5930 /* "pygame_sdl2/display.pyx":369
5858 /* "pygame_sdl2/display.pyx":370
59315859 * continue
59325860 *
59335861 * to_sdl_rect(i, &rects[count]) # <<<<<<<<<<<<<<
59345862 * count += 1
59355863 *
59365864 */
5937 __pyx_t_8 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_i, (&(__pyx_v_rects[__pyx_v_count])), NULL); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 369, __pyx_L8_error)
5938
5939 /* "pygame_sdl2/display.pyx":370
5865 __pyx_t_8 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_i, (&(__pyx_v_rects[__pyx_v_count])), NULL); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 370, __pyx_L8_error)
5866
5867 /* "pygame_sdl2/display.pyx":371
59405868 *
59415869 * to_sdl_rect(i, &rects[count])
59425870 * count += 1 # <<<<<<<<<<<<<<
59455873 */
59465874 __pyx_v_count = (__pyx_v_count + 1);
59475875
5948 /* "pygame_sdl2/display.pyx":365
5876 /* "pygame_sdl2/display.pyx":366
59495877 * try:
59505878 *
59515879 * for i in rectangles: # <<<<<<<<<<<<<<
59565884 }
59575885 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
59585886
5959 /* "pygame_sdl2/display.pyx":372
5887 /* "pygame_sdl2/display.pyx":373
59605888 * count += 1
59615889 *
59625890 * SDL_UpdateWindowSurfaceRects(self.window, rects, count) # <<<<<<<<<<<<<<
59665894 (void)(SDL_UpdateWindowSurfaceRects(__pyx_v_self->window, __pyx_v_rects, __pyx_v_count));
59675895 }
59685896
5969 /* "pygame_sdl2/display.pyx":375
5897 /* "pygame_sdl2/display.pyx":376
59705898 *
59715899 * finally:
59725900 * free(rects) # <<<<<<<<<<<<<<
60155943 __pyx_L9:;
60165944 }
60175945
6018 /* "pygame_sdl2/display.pyx":344
5946 /* "pygame_sdl2/display.pyx":345
60195947 * return self.surface
60205948 *
60215949 * def update(self, rectangles=None): # <<<<<<<<<<<<<<
60405968 return __pyx_r;
60415969 }
60425970
6043 /* "pygame_sdl2/display.pyx":377
5971 /* "pygame_sdl2/display.pyx":378
60445972 * free(rects)
60455973 *
60465974 * def get_wm_info(self): # <<<<<<<<<<<<<<
60705998 int __pyx_clineno = 0;
60715999 __Pyx_RefNannySetupContext("get_wm_info", 0);
60726000
6073 /* "pygame_sdl2/display.pyx":378
6001 /* "pygame_sdl2/display.pyx":379
60746002 *
60756003 * def get_wm_info(self):
60766004 * return { } # <<<<<<<<<<<<<<
60786006 * def get_active(self):
60796007 */
60806008 __Pyx_XDECREF(__pyx_r);
6081 __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 378, __pyx_L1_error)
6009 __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 379, __pyx_L1_error)
60826010 __Pyx_GOTREF(__pyx_t_1);
60836011 __pyx_r = __pyx_t_1;
60846012 __pyx_t_1 = 0;
60856013 goto __pyx_L0;
60866014
6087 /* "pygame_sdl2/display.pyx":377
6015 /* "pygame_sdl2/display.pyx":378
60886016 * free(rects)
60896017 *
60906018 * def get_wm_info(self): # <<<<<<<<<<<<<<
61036031 return __pyx_r;
61046032 }
61056033
6106 /* "pygame_sdl2/display.pyx":380
6034 /* "pygame_sdl2/display.pyx":381
61076035 * return { }
61086036 *
61096037 * def get_active(self): # <<<<<<<<<<<<<<
61306058 int __pyx_t_1;
61316059 __Pyx_RefNannySetupContext("get_active", 0);
61326060
6133 /* "pygame_sdl2/display.pyx":381
6061 /* "pygame_sdl2/display.pyx":382
61346062 *
61356063 * def get_active(self):
61366064 * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_HIDDEN | SDL_WINDOW_MINIMIZED): # <<<<<<<<<<<<<<
61406068 __pyx_t_1 = ((SDL_GetWindowFlags(__pyx_v_self->window) & (SDL_WINDOW_HIDDEN | SDL_WINDOW_MINIMIZED)) != 0);
61416069 if (__pyx_t_1) {
61426070
6143 /* "pygame_sdl2/display.pyx":382
6071 /* "pygame_sdl2/display.pyx":383
61446072 * def get_active(self):
61456073 * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_HIDDEN | SDL_WINDOW_MINIMIZED):
61466074 * return False # <<<<<<<<<<<<<<
61526080 __pyx_r = Py_False;
61536081 goto __pyx_L0;
61546082
6155 /* "pygame_sdl2/display.pyx":381
6083 /* "pygame_sdl2/display.pyx":382
61566084 *
61576085 * def get_active(self):
61586086 * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_HIDDEN | SDL_WINDOW_MINIMIZED): # <<<<<<<<<<<<<<
61616089 */
61626090 }
61636091
6164 /* "pygame_sdl2/display.pyx":384
6092 /* "pygame_sdl2/display.pyx":385
61656093 * return False
61666094 * else:
61676095 * return True # <<<<<<<<<<<<<<
61756103 goto __pyx_L0;
61766104 }
61776105
6178 /* "pygame_sdl2/display.pyx":380
6106 /* "pygame_sdl2/display.pyx":381
61796107 * return { }
61806108 *
61816109 * def get_active(self): # <<<<<<<<<<<<<<
61906118 return __pyx_r;
61916119 }
61926120
6193 /* "pygame_sdl2/display.pyx":386
6121 /* "pygame_sdl2/display.pyx":387
61946122 * return True
61956123 *
61966124 * def iconify(self): # <<<<<<<<<<<<<<
62166144 __Pyx_RefNannyDeclarations
62176145 __Pyx_RefNannySetupContext("iconify", 0);
62186146
6219 /* "pygame_sdl2/display.pyx":387
6147 /* "pygame_sdl2/display.pyx":388
62206148 *
62216149 * def iconify(self):
62226150 * SDL_MinimizeWindow(self.window) # <<<<<<<<<<<<<<
62256153 */
62266154 SDL_MinimizeWindow(__pyx_v_self->window);
62276155
6228 /* "pygame_sdl2/display.pyx":388
6156 /* "pygame_sdl2/display.pyx":389
62296157 * def iconify(self):
62306158 * SDL_MinimizeWindow(self.window)
62316159 * return True # <<<<<<<<<<<<<<
62376165 __pyx_r = Py_True;
62386166 goto __pyx_L0;
62396167
6240 /* "pygame_sdl2/display.pyx":386
6168 /* "pygame_sdl2/display.pyx":387
62416169 * return True
62426170 *
62436171 * def iconify(self): # <<<<<<<<<<<<<<
62526180 return __pyx_r;
62536181 }
62546182
6255 /* "pygame_sdl2/display.pyx":390
6183 /* "pygame_sdl2/display.pyx":391
62566184 * return True
62576185 *
62586186 * def toggle_fullscreen(self): # <<<<<<<<<<<<<<
62856213 int __pyx_clineno = 0;
62866214 __Pyx_RefNannySetupContext("toggle_fullscreen", 0);
62876215
6288 /* "pygame_sdl2/display.pyx":391
6216 /* "pygame_sdl2/display.pyx":392
62896217 *
62906218 * def toggle_fullscreen(self):
62916219 * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_FULLSCREEN_DESKTOP): # <<<<<<<<<<<<<<
62956223 __pyx_t_1 = ((SDL_GetWindowFlags(__pyx_v_self->window) & SDL_WINDOW_FULLSCREEN_DESKTOP) != 0);
62966224 if (__pyx_t_1) {
62976225
6298 /* "pygame_sdl2/display.pyx":392
6226 /* "pygame_sdl2/display.pyx":393
62996227 * def toggle_fullscreen(self):
63006228 * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_FULLSCREEN_DESKTOP):
63016229 * if SDL_SetWindowFullscreen(self.window, 0): # <<<<<<<<<<<<<<
63056233 __pyx_t_1 = (SDL_SetWindowFullscreen(__pyx_v_self->window, 0) != 0);
63066234 if (unlikely(__pyx_t_1)) {
63076235
6308 /* "pygame_sdl2/display.pyx":393
6236 /* "pygame_sdl2/display.pyx":394
63096237 * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_FULLSCREEN_DESKTOP):
63106238 * if SDL_SetWindowFullscreen(self.window, 0):
63116239 * raise error() # <<<<<<<<<<<<<<
63126240 * else:
63136241 * if SDL_SetWindowFullscreen(self.window, SDL_WINDOW_FULLSCREEN_DESKTOP):
63146242 */
6315 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 393, __pyx_L1_error)
6243 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 394, __pyx_L1_error)
63166244 __Pyx_GOTREF(__pyx_t_3);
63176245 __pyx_t_4 = NULL;
63186246 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
63266254 }
63276255 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
63286256 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6329 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 393, __pyx_L1_error)
6257 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 394, __pyx_L1_error)
63306258 __Pyx_GOTREF(__pyx_t_2);
63316259 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
63326260 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
63336261 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6334 __PYX_ERR(0, 393, __pyx_L1_error)
6335
6336 /* "pygame_sdl2/display.pyx":392
6262 __PYX_ERR(0, 394, __pyx_L1_error)
6263
6264 /* "pygame_sdl2/display.pyx":393
63376265 * def toggle_fullscreen(self):
63386266 * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_FULLSCREEN_DESKTOP):
63396267 * if SDL_SetWindowFullscreen(self.window, 0): # <<<<<<<<<<<<<<
63426270 */
63436271 }
63446272
6345 /* "pygame_sdl2/display.pyx":391
6273 /* "pygame_sdl2/display.pyx":392
63466274 *
63476275 * def toggle_fullscreen(self):
63486276 * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_FULLSCREEN_DESKTOP): # <<<<<<<<<<<<<<
63526280 goto __pyx_L3;
63536281 }
63546282
6355 /* "pygame_sdl2/display.pyx":395
6283 /* "pygame_sdl2/display.pyx":396
63566284 * raise error()
63576285 * else:
63586286 * if SDL_SetWindowFullscreen(self.window, SDL_WINDOW_FULLSCREEN_DESKTOP): # <<<<<<<<<<<<<<
63636291 __pyx_t_1 = (SDL_SetWindowFullscreen(__pyx_v_self->window, SDL_WINDOW_FULLSCREEN_DESKTOP) != 0);
63646292 if (unlikely(__pyx_t_1)) {
63656293
6366 /* "pygame_sdl2/display.pyx":396
6294 /* "pygame_sdl2/display.pyx":397
63676295 * else:
63686296 * if SDL_SetWindowFullscreen(self.window, SDL_WINDOW_FULLSCREEN_DESKTOP):
63696297 * raise error() # <<<<<<<<<<<<<<
63706298 *
63716299 * return True
63726300 */
6373 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 396, __pyx_L1_error)
6301 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 397, __pyx_L1_error)
63746302 __Pyx_GOTREF(__pyx_t_3);
63756303 __pyx_t_4 = NULL;
63766304 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
63846312 }
63856313 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
63866314 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6387 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 396, __pyx_L1_error)
6315 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 397, __pyx_L1_error)
63886316 __Pyx_GOTREF(__pyx_t_2);
63896317 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
63906318 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
63916319 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6392 __PYX_ERR(0, 396, __pyx_L1_error)
6393
6394 /* "pygame_sdl2/display.pyx":395
6320 __PYX_ERR(0, 397, __pyx_L1_error)
6321
6322 /* "pygame_sdl2/display.pyx":396
63956323 * raise error()
63966324 * else:
63976325 * if SDL_SetWindowFullscreen(self.window, SDL_WINDOW_FULLSCREEN_DESKTOP): # <<<<<<<<<<<<<<
64026330 }
64036331 __pyx_L3:;
64046332
6405 /* "pygame_sdl2/display.pyx":398
6333 /* "pygame_sdl2/display.pyx":399
64066334 * raise error()
64076335 *
64086336 * return True # <<<<<<<<<<<<<<
64146342 __pyx_r = Py_True;
64156343 goto __pyx_L0;
64166344
6417 /* "pygame_sdl2/display.pyx":390
6345 /* "pygame_sdl2/display.pyx":391
64186346 * return True
64196347 *
64206348 * def toggle_fullscreen(self): # <<<<<<<<<<<<<<
64356363 return __pyx_r;
64366364 }
64376365
6438 /* "pygame_sdl2/display.pyx":400
6366 /* "pygame_sdl2/display.pyx":401
64396367 * return True
64406368 *
64416369 * def set_gamma(self, red, green=None, blue=None): # <<<<<<<<<<<<<<
64926420 }
64936421 }
64946422 if (unlikely(kw_args > 0)) {
6495 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_gamma") < 0)) __PYX_ERR(0, 400, __pyx_L3_error)
6423 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_gamma") < 0)) __PYX_ERR(0, 401, __pyx_L3_error)
64966424 }
64976425 } else {
64986426 switch (PyTuple_GET_SIZE(__pyx_args)) {
65116439 }
65126440 goto __pyx_L4_argument_unpacking_done;
65136441 __pyx_L5_argtuple_error:;
6514 __Pyx_RaiseArgtupleInvalid("set_gamma", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 400, __pyx_L3_error)
6442 __Pyx_RaiseArgtupleInvalid("set_gamma", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 401, __pyx_L3_error)
65156443 __pyx_L3_error:;
65166444 __Pyx_AddTraceback("pygame_sdl2.display.Window.set_gamma", __pyx_clineno, __pyx_lineno, __pyx_filename);
65176445 __Pyx_RefNannyFinishContext();
65406468 __Pyx_INCREF(__pyx_v_green);
65416469 __Pyx_INCREF(__pyx_v_blue);
65426470
6543 /* "pygame_sdl2/display.pyx":401
6471 /* "pygame_sdl2/display.pyx":402
65446472 *
65456473 * def set_gamma(self, red, green=None, blue=None):
65466474 * if green is None: # <<<<<<<<<<<<<<
65516479 __pyx_t_2 = (__pyx_t_1 != 0);
65526480 if (__pyx_t_2) {
65536481
6554 /* "pygame_sdl2/display.pyx":402
6482 /* "pygame_sdl2/display.pyx":403
65556483 * def set_gamma(self, red, green=None, blue=None):
65566484 * if green is None:
65576485 * green = red # <<<<<<<<<<<<<<
65616489 __Pyx_INCREF(__pyx_v_red);
65626490 __Pyx_DECREF_SET(__pyx_v_green, __pyx_v_red);
65636491
6564 /* "pygame_sdl2/display.pyx":401
6492 /* "pygame_sdl2/display.pyx":402
65656493 *
65666494 * def set_gamma(self, red, green=None, blue=None):
65676495 * if green is None: # <<<<<<<<<<<<<<
65706498 */
65716499 }
65726500
6573 /* "pygame_sdl2/display.pyx":403
6501 /* "pygame_sdl2/display.pyx":404
65746502 * if green is None:
65756503 * green = red
65766504 * if blue is None: # <<<<<<<<<<<<<<
65816509 __pyx_t_1 = (__pyx_t_2 != 0);
65826510 if (__pyx_t_1) {
65836511
6584 /* "pygame_sdl2/display.pyx":404
6512 /* "pygame_sdl2/display.pyx":405
65856513 * green = red
65866514 * if blue is None:
65876515 * blue = red # <<<<<<<<<<<<<<
65916519 __Pyx_INCREF(__pyx_v_red);
65926520 __Pyx_DECREF_SET(__pyx_v_blue, __pyx_v_red);
65936521
6594 /* "pygame_sdl2/display.pyx":403
6522 /* "pygame_sdl2/display.pyx":404
65956523 * if green is None:
65966524 * green = red
65976525 * if blue is None: # <<<<<<<<<<<<<<
66006528 */
66016529 }
66026530
6603 /* "pygame_sdl2/display.pyx":410
6531 /* "pygame_sdl2/display.pyx":411
66046532 * cdef Uint16 blue_gamma[256]
66056533 *
66066534 * SDL_CalculateGammaRamp(red, red_gamma) # <<<<<<<<<<<<<<
66076535 * SDL_CalculateGammaRamp(green, green_gamma)
66086536 * SDL_CalculateGammaRamp(blue, blue_gamma)
66096537 */
6610 __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_v_red); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 410, __pyx_L1_error)
6538 __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_v_red); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 411, __pyx_L1_error)
66116539 SDL_CalculateGammaRamp(__pyx_t_3, __pyx_v_red_gamma);
66126540
6613 /* "pygame_sdl2/display.pyx":411
6541 /* "pygame_sdl2/display.pyx":412
66146542 *
66156543 * SDL_CalculateGammaRamp(red, red_gamma)
66166544 * SDL_CalculateGammaRamp(green, green_gamma) # <<<<<<<<<<<<<<
66176545 * SDL_CalculateGammaRamp(blue, blue_gamma)
66186546 *
66196547 */
6620 __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_v_green); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 411, __pyx_L1_error)
6548 __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_v_green); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 412, __pyx_L1_error)
66216549 SDL_CalculateGammaRamp(__pyx_t_3, __pyx_v_green_gamma);
66226550
6623 /* "pygame_sdl2/display.pyx":412
6551 /* "pygame_sdl2/display.pyx":413
66246552 * SDL_CalculateGammaRamp(red, red_gamma)
66256553 * SDL_CalculateGammaRamp(green, green_gamma)
66266554 * SDL_CalculateGammaRamp(blue, blue_gamma) # <<<<<<<<<<<<<<
66276555 *
66286556 * if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma):
66296557 */
6630 __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_v_blue); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 412, __pyx_L1_error)
6558 __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_v_blue); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 413, __pyx_L1_error)
66316559 SDL_CalculateGammaRamp(__pyx_t_3, __pyx_v_blue_gamma);
66326560
6633 /* "pygame_sdl2/display.pyx":414
6561 /* "pygame_sdl2/display.pyx":415
66346562 * SDL_CalculateGammaRamp(blue, blue_gamma)
66356563 *
66366564 * if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma): # <<<<<<<<<<<<<<
66406568 __pyx_t_1 = (SDL_SetWindowGammaRamp(__pyx_v_self->window, __pyx_v_red_gamma, __pyx_v_green_gamma, __pyx_v_blue_gamma) != 0);
66416569 if (__pyx_t_1) {
66426570
6643 /* "pygame_sdl2/display.pyx":415
6571 /* "pygame_sdl2/display.pyx":416
66446572 *
66456573 * if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma):
66466574 * return False # <<<<<<<<<<<<<<
66526580 __pyx_r = Py_False;
66536581 goto __pyx_L0;
66546582
6655 /* "pygame_sdl2/display.pyx":414
6583 /* "pygame_sdl2/display.pyx":415
66566584 * SDL_CalculateGammaRamp(blue, blue_gamma)
66576585 *
66586586 * if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma): # <<<<<<<<<<<<<<
66616589 */
66626590 }
66636591
6664 /* "pygame_sdl2/display.pyx":417
6592 /* "pygame_sdl2/display.pyx":418
66656593 * return False
66666594 *
66676595 * return True # <<<<<<<<<<<<<<
66736601 __pyx_r = Py_True;
66746602 goto __pyx_L0;
66756603
6676 /* "pygame_sdl2/display.pyx":400
6604 /* "pygame_sdl2/display.pyx":401
66776605 * return True
66786606 *
66796607 * def set_gamma(self, red, green=None, blue=None): # <<<<<<<<<<<<<<
66936621 return __pyx_r;
66946622 }
66956623
6696 /* "pygame_sdl2/display.pyx":419
6624 /* "pygame_sdl2/display.pyx":420
66976625 * return True
66986626 *
66996627 * def set_gamma_ramp(self, red, green, blue): # <<<<<<<<<<<<<<
67386666 case 1:
67396667 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_green)) != 0)) kw_args--;
67406668 else {
6741 __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, 1); __PYX_ERR(0, 419, __pyx_L3_error)
6669 __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, 1); __PYX_ERR(0, 420, __pyx_L3_error)
67426670 }
67436671 CYTHON_FALLTHROUGH;
67446672 case 2:
67456673 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_blue)) != 0)) kw_args--;
67466674 else {
6747 __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, 2); __PYX_ERR(0, 419, __pyx_L3_error)
6675 __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, 2); __PYX_ERR(0, 420, __pyx_L3_error)
67486676 }
67496677 }
67506678 if (unlikely(kw_args > 0)) {
6751 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_gamma_ramp") < 0)) __PYX_ERR(0, 419, __pyx_L3_error)
6679 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_gamma_ramp") < 0)) __PYX_ERR(0, 420, __pyx_L3_error)
67526680 }
67536681 } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
67546682 goto __pyx_L5_argtuple_error;
67636691 }
67646692 goto __pyx_L4_argument_unpacking_done;
67656693 __pyx_L5_argtuple_error:;
6766 __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 419, __pyx_L3_error)
6694 __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 420, __pyx_L3_error)
67676695 __pyx_L3_error:;
67686696 __Pyx_AddTraceback("pygame_sdl2.display.Window.set_gamma_ramp", __pyx_clineno, __pyx_lineno, __pyx_filename);
67696697 __Pyx_RefNannyFinishContext();
67926720 int __pyx_clineno = 0;
67936721 __Pyx_RefNannySetupContext("set_gamma_ramp", 0);
67946722
6795 /* "pygame_sdl2/display.pyx":425
6723 /* "pygame_sdl2/display.pyx":426
67966724 * cdef Uint16 blue_gamma[256]
67976725 *
67986726 * for i in range(256): # <<<<<<<<<<<<<<
68026730 for (__pyx_t_1 = 0; __pyx_t_1 < 0x100; __pyx_t_1+=1) {
68036731 __pyx_v_i = __pyx_t_1;
68046732
6805 /* "pygame_sdl2/display.pyx":426
6733 /* "pygame_sdl2/display.pyx":427
68066734 *
68076735 * for i in range(256):
68086736 * red_gamma[i] = red[i] # <<<<<<<<<<<<<<
68096737 * green_gamma[i] = green[i]
68106738 * blue_gamma[i] = blue[i]
68116739 */
6812 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_red, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 426, __pyx_L1_error)
6740 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_red, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 427, __pyx_L1_error)
68136741 __Pyx_GOTREF(__pyx_t_2);
6814 __pyx_t_3 = __Pyx_PyInt_As_uint16_t(__pyx_t_2); if (unlikely((__pyx_t_3 == ((Uint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 426, __pyx_L1_error)
6742 __pyx_t_3 = __Pyx_PyInt_As_uint16_t(__pyx_t_2); if (unlikely((__pyx_t_3 == ((Uint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 427, __pyx_L1_error)
68156743 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
68166744 (__pyx_v_red_gamma[__pyx_v_i]) = __pyx_t_3;
68176745
6818 /* "pygame_sdl2/display.pyx":427
6746 /* "pygame_sdl2/display.pyx":428
68196747 * for i in range(256):
68206748 * red_gamma[i] = red[i]
68216749 * green_gamma[i] = green[i] # <<<<<<<<<<<<<<
68226750 * blue_gamma[i] = blue[i]
68236751 *
68246752 */
6825 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_green, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 427, __pyx_L1_error)
6753 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_green, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 428, __pyx_L1_error)
68266754 __Pyx_GOTREF(__pyx_t_2);
6827 __pyx_t_3 = __Pyx_PyInt_As_uint16_t(__pyx_t_2); if (unlikely((__pyx_t_3 == ((Uint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 427, __pyx_L1_error)
6755 __pyx_t_3 = __Pyx_PyInt_As_uint16_t(__pyx_t_2); if (unlikely((__pyx_t_3 == ((Uint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 428, __pyx_L1_error)
68286756 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
68296757 (__pyx_v_green_gamma[__pyx_v_i]) = __pyx_t_3;
68306758
6831 /* "pygame_sdl2/display.pyx":428
6759 /* "pygame_sdl2/display.pyx":429
68326760 * red_gamma[i] = red[i]
68336761 * green_gamma[i] = green[i]
68346762 * blue_gamma[i] = blue[i] # <<<<<<<<<<<<<<
68356763 *
68366764 * if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma):
68376765 */
6838 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_blue, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 428, __pyx_L1_error)
6766 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_blue, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 429, __pyx_L1_error)
68396767 __Pyx_GOTREF(__pyx_t_2);
6840 __pyx_t_3 = __Pyx_PyInt_As_uint16_t(__pyx_t_2); if (unlikely((__pyx_t_3 == ((Uint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 428, __pyx_L1_error)
6768 __pyx_t_3 = __Pyx_PyInt_As_uint16_t(__pyx_t_2); if (unlikely((__pyx_t_3 == ((Uint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 429, __pyx_L1_error)
68416769 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
68426770 (__pyx_v_blue_gamma[__pyx_v_i]) = __pyx_t_3;
68436771 }
68446772
6845 /* "pygame_sdl2/display.pyx":430
6773 /* "pygame_sdl2/display.pyx":431
68466774 * blue_gamma[i] = blue[i]
68476775 *
68486776 * if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma): # <<<<<<<<<<<<<<
68526780 __pyx_t_4 = (SDL_SetWindowGammaRamp(__pyx_v_self->window, __pyx_v_red_gamma, __pyx_v_green_gamma, __pyx_v_blue_gamma) != 0);
68536781 if (__pyx_t_4) {
68546782
6855 /* "pygame_sdl2/display.pyx":431
6783 /* "pygame_sdl2/display.pyx":432
68566784 *
68576785 * if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma):
68586786 * return False # <<<<<<<<<<<<<<
68646792 __pyx_r = Py_False;
68656793 goto __pyx_L0;
68666794
6867 /* "pygame_sdl2/display.pyx":430
6795 /* "pygame_sdl2/display.pyx":431
68686796 * blue_gamma[i] = blue[i]
68696797 *
68706798 * if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma): # <<<<<<<<<<<<<<
68736801 */
68746802 }
68756803
6876 /* "pygame_sdl2/display.pyx":433
6804 /* "pygame_sdl2/display.pyx":434
68776805 * return False
68786806 *
68796807 * return True # <<<<<<<<<<<<<<
68856813 __pyx_r = Py_True;
68866814 goto __pyx_L0;
68876815
6888 /* "pygame_sdl2/display.pyx":419
6816 /* "pygame_sdl2/display.pyx":420
68896817 * return True
68906818 *
68916819 * def set_gamma_ramp(self, red, green, blue): # <<<<<<<<<<<<<<
69046832 return __pyx_r;
69056833 }
69066834
6907 /* "pygame_sdl2/display.pyx":435
6835 /* "pygame_sdl2/display.pyx":436
69086836 * return True
69096837 *
69106838 * def set_icon(self, Surface surface): # <<<<<<<<<<<<<<
69216849 PyObject *__pyx_r = 0;
69226850 __Pyx_RefNannyDeclarations
69236851 __Pyx_RefNannySetupContext("set_icon (wrapper)", 0);
6924 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 435, __pyx_L1_error)
6852 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 436, __pyx_L1_error)
69256853 __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_32set_icon(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self), ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_surface));
69266854
69276855 /* function exit code */
69386866 __Pyx_RefNannyDeclarations
69396867 __Pyx_RefNannySetupContext("set_icon", 0);
69406868
6941 /* "pygame_sdl2/display.pyx":436
6869 /* "pygame_sdl2/display.pyx":437
69426870 *
69436871 * def set_icon(self, Surface surface):
69446872 * SDL_SetWindowIcon(self.window, surface.surface) # <<<<<<<<<<<<<<
69476875 */
69486876 SDL_SetWindowIcon(__pyx_v_self->window, __pyx_v_surface->surface);
69496877
6950 /* "pygame_sdl2/display.pyx":435
6878 /* "pygame_sdl2/display.pyx":436
69516879 * return True
69526880 *
69536881 * def set_icon(self, Surface surface): # <<<<<<<<<<<<<<
69626890 return __pyx_r;
69636891 }
69646892
6965 /* "pygame_sdl2/display.pyx":438
6893 /* "pygame_sdl2/display.pyx":439
69666894 * SDL_SetWindowIcon(self.window, surface.surface)
69676895 *
69686896 * def set_caption(self, title): # <<<<<<<<<<<<<<
69986926 __Pyx_RefNannySetupContext("set_caption", 0);
69996927 __Pyx_INCREF(__pyx_v_title);
70006928
7001 /* "pygame_sdl2/display.pyx":440
6929 /* "pygame_sdl2/display.pyx":441
70026930 * def set_caption(self, title):
70036931 *
70046932 * if not isinstance(title, bytes): # <<<<<<<<<<<<<<
70096937 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
70106938 if (__pyx_t_2) {
70116939
7012 /* "pygame_sdl2/display.pyx":441
6940 /* "pygame_sdl2/display.pyx":442
70136941 *
70146942 * if not isinstance(title, bytes):
70156943 * title = title.encode("utf-8") # <<<<<<<<<<<<<<
70166944 *
70176945 * SDL_SetWindowTitle(self.window, title)
70186946 */
7019 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_title, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 441, __pyx_L1_error)
6947 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_title, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 442, __pyx_L1_error)
70206948 __Pyx_GOTREF(__pyx_t_4);
70216949 __pyx_t_5 = NULL;
70226950 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
70306958 }
70316959 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_s_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_s_utf_8);
70326960 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
7033 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 441, __pyx_L1_error)
6961 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 442, __pyx_L1_error)
70346962 __Pyx_GOTREF(__pyx_t_3);
70356963 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
70366964 __Pyx_DECREF_SET(__pyx_v_title, __pyx_t_3);
70376965 __pyx_t_3 = 0;
70386966
7039 /* "pygame_sdl2/display.pyx":440
6967 /* "pygame_sdl2/display.pyx":441
70406968 * def set_caption(self, title):
70416969 *
70426970 * if not isinstance(title, bytes): # <<<<<<<<<<<<<<
70456973 */
70466974 }
70476975
7048 /* "pygame_sdl2/display.pyx":443
6976 /* "pygame_sdl2/display.pyx":444
70496977 * title = title.encode("utf-8")
70506978 *
70516979 * SDL_SetWindowTitle(self.window, title) # <<<<<<<<<<<<<<
70526980 *
70536981 * def get_drawable_size(self):
70546982 */
7055 __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_title); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 443, __pyx_L1_error)
6983 __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_title); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 444, __pyx_L1_error)
70566984 SDL_SetWindowTitle(__pyx_v_self->window, __pyx_t_6);
70576985
7058 /* "pygame_sdl2/display.pyx":438
6986 /* "pygame_sdl2/display.pyx":439
70596987 * SDL_SetWindowIcon(self.window, surface.surface)
70606988 *
70616989 * def set_caption(self, title): # <<<<<<<<<<<<<<
70797007 return __pyx_r;
70807008 }
70817009
7082 /* "pygame_sdl2/display.pyx":445
7010 /* "pygame_sdl2/display.pyx":446
70837011 * SDL_SetWindowTitle(self.window, title)
70847012 *
70857013 * def get_drawable_size(self): # <<<<<<<<<<<<<<
71137041 int __pyx_clineno = 0;
71147042 __Pyx_RefNannySetupContext("get_drawable_size", 0);
71157043
7116 /* "pygame_sdl2/display.pyx":448
7044 /* "pygame_sdl2/display.pyx":449
71177045 * cdef int w, h
71187046 *
71197047 * SDL_GL_GetDrawableSize(self.window, &w, &h) # <<<<<<<<<<<<<<
71227050 */
71237051 SDL_GL_GetDrawableSize(__pyx_v_self->window, (&__pyx_v_w), (&__pyx_v_h));
71247052
7125 /* "pygame_sdl2/display.pyx":449
7053 /* "pygame_sdl2/display.pyx":450
71267054 *
71277055 * SDL_GL_GetDrawableSize(self.window, &w, &h)
71287056 * return w, h # <<<<<<<<<<<<<<
71307058 *
71317059 */
71327060 __Pyx_XDECREF(__pyx_r);
7133 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L1_error)
7061 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 450, __pyx_L1_error)
71347062 __Pyx_GOTREF(__pyx_t_1);
7135 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 449, __pyx_L1_error)
7063 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 450, __pyx_L1_error)
71367064 __Pyx_GOTREF(__pyx_t_2);
7137 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 449, __pyx_L1_error)
7065 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 450, __pyx_L1_error)
71387066 __Pyx_GOTREF(__pyx_t_3);
71397067 __Pyx_GIVEREF(__pyx_t_1);
71407068 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
71467074 __pyx_t_3 = 0;
71477075 goto __pyx_L0;
71487076
7149 /* "pygame_sdl2/display.pyx":445
7077 /* "pygame_sdl2/display.pyx":446
71507078 * SDL_SetWindowTitle(self.window, title)
71517079 *
71527080 * def get_drawable_size(self): # <<<<<<<<<<<<<<
71677095 return __pyx_r;
71687096 }
71697097
7170 /* "pygame_sdl2/display.pyx":452
7098 /* "pygame_sdl2/display.pyx":453
71717099 *
71727100 *
71737101 * def get_size(self): # <<<<<<<<<<<<<<
72017129 int __pyx_clineno = 0;
72027130 __Pyx_RefNannySetupContext("get_size", 0);
72037131
7204 /* "pygame_sdl2/display.pyx":455
7132 /* "pygame_sdl2/display.pyx":456
72057133 * cdef int w, h
72067134 *
72077135 * SDL_GetWindowSize(self.window, &w, &h) # <<<<<<<<<<<<<<
72107138 */
72117139 SDL_GetWindowSize(__pyx_v_self->window, (&__pyx_v_w), (&__pyx_v_h));
72127140
7213 /* "pygame_sdl2/display.pyx":456
7141 /* "pygame_sdl2/display.pyx":457
72147142 *
72157143 * SDL_GetWindowSize(self.window, &w, &h)
72167144 * return w, h # <<<<<<<<<<<<<<
72187146 * def restore(self):
72197147 */
72207148 __Pyx_XDECREF(__pyx_r);
7221 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error)
7149 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L1_error)
72227150 __Pyx_GOTREF(__pyx_t_1);
7223 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 456, __pyx_L1_error)
7151 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 457, __pyx_L1_error)
72247152 __Pyx_GOTREF(__pyx_t_2);
7225 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error)
7153 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 457, __pyx_L1_error)
72267154 __Pyx_GOTREF(__pyx_t_3);
72277155 __Pyx_GIVEREF(__pyx_t_1);
72287156 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
72347162 __pyx_t_3 = 0;
72357163 goto __pyx_L0;
72367164
7237 /* "pygame_sdl2/display.pyx":452
7165 /* "pygame_sdl2/display.pyx":453
72387166 *
72397167 *
72407168 * def get_size(self): # <<<<<<<<<<<<<<
72557183 return __pyx_r;
72567184 }
72577185
7258 /* "pygame_sdl2/display.pyx":458
7186 /* "pygame_sdl2/display.pyx":459
72597187 * return w, h
72607188 *
72617189 * def restore(self): # <<<<<<<<<<<<<<
72817209 __Pyx_RefNannyDeclarations
72827210 __Pyx_RefNannySetupContext("restore", 0);
72837211
7284 /* "pygame_sdl2/display.pyx":459
7212 /* "pygame_sdl2/display.pyx":460
72857213 *
72867214 * def restore(self):
72877215 * SDL_RestoreWindow(self.window) # <<<<<<<<<<<<<<
72907218 */
72917219 SDL_RestoreWindow(__pyx_v_self->window);
72927220
7293 /* "pygame_sdl2/display.pyx":458
7221 /* "pygame_sdl2/display.pyx":459
72947222 * return w, h
72957223 *
72967224 * def restore(self): # <<<<<<<<<<<<<<
73057233 return __pyx_r;
73067234 }
73077235
7308 /* "pygame_sdl2/display.pyx":461
7236 /* "pygame_sdl2/display.pyx":462
73097237 * SDL_RestoreWindow(self.window)
73107238 *
73117239 * def maximize(self): # <<<<<<<<<<<<<<
73317259 __Pyx_RefNannyDeclarations
73327260 __Pyx_RefNannySetupContext("maximize", 0);
73337261
7334 /* "pygame_sdl2/display.pyx":462
7262 /* "pygame_sdl2/display.pyx":463
73357263 *
73367264 * def maximize(self):
73377265 * SDL_MaximizeWindow(self.window) # <<<<<<<<<<<<<<
73407268 */
73417269 SDL_MaximizeWindow(__pyx_v_self->window);
73427270
7343 /* "pygame_sdl2/display.pyx":461
7271 /* "pygame_sdl2/display.pyx":462
73447272 * SDL_RestoreWindow(self.window)
73457273 *
73467274 * def maximize(self): # <<<<<<<<<<<<<<
73557283 return __pyx_r;
73567284 }
73577285
7358 /* "pygame_sdl2/display.pyx":464
7286 /* "pygame_sdl2/display.pyx":465
73597287 * SDL_MaximizeWindow(self.window)
73607288 *
73617289 * def minimize(self): # <<<<<<<<<<<<<<
73817309 __Pyx_RefNannyDeclarations
73827310 __Pyx_RefNannySetupContext("minimize", 0);
73837311
7384 /* "pygame_sdl2/display.pyx":465
7312 /* "pygame_sdl2/display.pyx":466
73857313 *
73867314 * def minimize(self):
73877315 * SDL_MinimizeWindow(self.window) # <<<<<<<<<<<<<<
73887316 *
7389 *
7317 * def get_sdl_window_pointer(self):
73907318 */
73917319 SDL_MinimizeWindow(__pyx_v_self->window);
73927320
7393 /* "pygame_sdl2/display.pyx":464
7321 /* "pygame_sdl2/display.pyx":465
73947322 * SDL_MaximizeWindow(self.window)
73957323 *
73967324 * def minimize(self): # <<<<<<<<<<<<<<
74007328
74017329 /* function exit code */
74027330 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7331 __Pyx_XGIVEREF(__pyx_r);
7332 __Pyx_RefNannyFinishContext();
7333 return __pyx_r;
7334 }
7335
7336 /* "pygame_sdl2/display.pyx":468
7337 * SDL_MinimizeWindow(self.window)
7338 *
7339 * def get_sdl_window_pointer(self): # <<<<<<<<<<<<<<
7340 * """
7341 * Returns the pointer to the SDL_Window corresponding to this window.
7342 */
7343
7344 /* Python wrapper */
7345 static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_47get_sdl_window_pointer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
7346 static char __pyx_doc_11pygame_sdl2_7display_6Window_46get_sdl_window_pointer[] = "\n Returns the pointer to the SDL_Window corresponding to this window.\n ";
7347 static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_47get_sdl_window_pointer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
7348 PyObject *__pyx_r = 0;
7349 __Pyx_RefNannyDeclarations
7350 __Pyx_RefNannySetupContext("get_sdl_window_pointer (wrapper)", 0);
7351 __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_46get_sdl_window_pointer(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self));
7352
7353 /* function exit code */
7354 __Pyx_RefNannyFinishContext();
7355 return __pyx_r;
7356 }
7357
7358 static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_46get_sdl_window_pointer(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) {
7359 PyObject *__pyx_v_ctypes = NULL;
7360 PyObject *__pyx_r = NULL;
7361 __Pyx_RefNannyDeclarations
7362 PyObject *__pyx_t_1 = NULL;
7363 PyObject *__pyx_t_2 = NULL;
7364 PyObject *__pyx_t_3 = NULL;
7365 PyObject *__pyx_t_4 = NULL;
7366 int __pyx_lineno = 0;
7367 const char *__pyx_filename = NULL;
7368 int __pyx_clineno = 0;
7369 __Pyx_RefNannySetupContext("get_sdl_window_pointer", 0);
7370
7371 /* "pygame_sdl2/display.pyx":473
7372 * """
7373 *
7374 * import ctypes # <<<<<<<<<<<<<<
7375 * return ctypes.c_void_p(<unsigned long> self.window)
7376 *
7377 */
7378 __pyx_t_1 = __Pyx_Import(__pyx_n_s_ctypes, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 473, __pyx_L1_error)
7379 __Pyx_GOTREF(__pyx_t_1);
7380 __pyx_v_ctypes = __pyx_t_1;
7381 __pyx_t_1 = 0;
7382
7383 /* "pygame_sdl2/display.pyx":474
7384 *
7385 * import ctypes
7386 * return ctypes.c_void_p(<unsigned long> self.window) # <<<<<<<<<<<<<<
7387 *
7388 *
7389 */
7390 __Pyx_XDECREF(__pyx_r);
7391 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_ctypes, __pyx_n_s_c_void_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 474, __pyx_L1_error)
7392 __Pyx_GOTREF(__pyx_t_2);
7393 __pyx_t_3 = __Pyx_PyInt_From_unsigned_long(((unsigned long)__pyx_v_self->window)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 474, __pyx_L1_error)
7394 __Pyx_GOTREF(__pyx_t_3);
7395 __pyx_t_4 = NULL;
7396 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
7397 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
7398 if (likely(__pyx_t_4)) {
7399 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
7400 __Pyx_INCREF(__pyx_t_4);
7401 __Pyx_INCREF(function);
7402 __Pyx_DECREF_SET(__pyx_t_2, function);
7403 }
7404 }
7405 __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
7406 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
7407 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7408 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error)
7409 __Pyx_GOTREF(__pyx_t_1);
7410 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7411 __pyx_r = __pyx_t_1;
7412 __pyx_t_1 = 0;
7413 goto __pyx_L0;
7414
7415 /* "pygame_sdl2/display.pyx":468
7416 * SDL_MinimizeWindow(self.window)
7417 *
7418 * def get_sdl_window_pointer(self): # <<<<<<<<<<<<<<
7419 * """
7420 * Returns the pointer to the SDL_Window corresponding to this window.
7421 */
7422
7423 /* function exit code */
7424 __pyx_L1_error:;
7425 __Pyx_XDECREF(__pyx_t_1);
7426 __Pyx_XDECREF(__pyx_t_2);
7427 __Pyx_XDECREF(__pyx_t_3);
7428 __Pyx_XDECREF(__pyx_t_4);
7429 __Pyx_AddTraceback("pygame_sdl2.display.Window.get_sdl_window_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
7430 __pyx_r = NULL;
7431 __pyx_L0:;
7432 __Pyx_XDECREF(__pyx_v_ctypes);
74037433 __Pyx_XGIVEREF(__pyx_r);
74047434 __Pyx_RefNannyFinishContext();
74057435 return __pyx_r;
75207550 */
75217551
75227552 /* Python wrapper */
7523 static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_47__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
7524 static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_47__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
7553 static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_49__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
7554 static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_49__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
75257555 PyObject *__pyx_r = 0;
75267556 __Pyx_RefNannyDeclarations
75277557 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
7528 __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_46__reduce_cython__(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self));
7558 __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_48__reduce_cython__(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self));
75297559
75307560 /* function exit code */
75317561 __Pyx_RefNannyFinishContext();
75327562 return __pyx_r;
75337563 }
75347564
7535 static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_46__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) {
7565 static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_48__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) {
75367566 PyObject *__pyx_r = NULL;
75377567 __Pyx_RefNannyDeclarations
75387568 PyObject *__pyx_t_1 = NULL;
75777607 */
75787608
75797609 /* Python wrapper */
7580 static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_49__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
7581 static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_49__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
7610 static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_51__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
7611 static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_51__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
75827612 PyObject *__pyx_r = 0;
75837613 __Pyx_RefNannyDeclarations
75847614 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
7585 __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_48__setstate_cython__(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
7615 __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_50__setstate_cython__(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
75867616
75877617 /* function exit code */
75887618 __Pyx_RefNannyFinishContext();
75897619 return __pyx_r;
75907620 }
75917621
7592 static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_48__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
7622 static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_50__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
75937623 PyObject *__pyx_r = NULL;
75947624 __Pyx_RefNannyDeclarations
75957625 PyObject *__pyx_t_1 = NULL;
76267656 return __pyx_r;
76277657 }
76287658
7629 /* "pygame_sdl2/display.pyx":477
7659 /* "pygame_sdl2/display.pyx":488
76307660 * default_swap_control = 1
76317661 *
76327662 * def set_mode(resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): # <<<<<<<<<<<<<<
76357665 */
76367666
76377667 /* Python wrapper */
7638 static PyObject *__pyx_pw_11pygame_sdl2_7display_15set_mode(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7639 static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_15set_mode = {"set_mode", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_7display_15set_mode, METH_VARARGS|METH_KEYWORDS, 0};
7640 static PyObject *__pyx_pw_11pygame_sdl2_7display_15set_mode(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7668 static PyObject *__pyx_pw_11pygame_sdl2_7display_13set_mode(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7669 static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_13set_mode = {"set_mode", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_7display_13set_mode, METH_VARARGS|METH_KEYWORDS, 0};
7670 static PyObject *__pyx_pw_11pygame_sdl2_7display_13set_mode(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
76417671 PyObject *__pyx_v_resolution = 0;
76427672 PyObject *__pyx_v_flags = 0;
76437673 PyObject *__pyx_v_depth = 0;
76977727 }
76987728 }
76997729 if (unlikely(kw_args > 0)) {
7700 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_mode") < 0)) __PYX_ERR(0, 477, __pyx_L3_error)
7730 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_mode") < 0)) __PYX_ERR(0, 488, __pyx_L3_error)
77017731 }
77027732 } else {
77037733 switch (PyTuple_GET_SIZE(__pyx_args)) {
77207750 }
77217751 goto __pyx_L4_argument_unpacking_done;
77227752 __pyx_L5_argtuple_error:;
7723 __Pyx_RaiseArgtupleInvalid("set_mode", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 477, __pyx_L3_error)
7753 __Pyx_RaiseArgtupleInvalid("set_mode", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 488, __pyx_L3_error)
77247754 __pyx_L3_error:;
77257755 __Pyx_AddTraceback("pygame_sdl2.display.set_mode", __pyx_clineno, __pyx_lineno, __pyx_filename);
77267756 __Pyx_RefNannyFinishContext();
77277757 return NULL;
77287758 __pyx_L4_argument_unpacking_done:;
7729 __pyx_r = __pyx_pf_11pygame_sdl2_7display_14set_mode(__pyx_self, __pyx_v_resolution, __pyx_v_flags, __pyx_v_depth, __pyx_v_pos);
7759 __pyx_r = __pyx_pf_11pygame_sdl2_7display_12set_mode(__pyx_self, __pyx_v_resolution, __pyx_v_flags, __pyx_v_depth, __pyx_v_pos);
77307760
77317761 /* function exit code */
77327762 __Pyx_RefNannyFinishContext();
77337763 return __pyx_r;
77347764 }
77357765
7736 static PyObject *__pyx_pf_11pygame_sdl2_7display_14set_mode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_resolution, PyObject *__pyx_v_flags, PyObject *__pyx_v_depth, PyObject *__pyx_v_pos) {
7766 static PyObject *__pyx_pf_11pygame_sdl2_7display_12set_mode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_resolution, PyObject *__pyx_v_flags, PyObject *__pyx_v_depth, PyObject *__pyx_v_pos) {
77377767 int __pyx_v_RESIZE_FLAGS;
77387768 PyObject *__pyx_r = NULL;
77397769 __Pyx_RefNannyDeclarations
77517781 int __pyx_clineno = 0;
77527782 __Pyx_RefNannySetupContext("set_mode", 0);
77537783
7754 /* "pygame_sdl2/display.pyx":480
7784 /* "pygame_sdl2/display.pyx":491
77557785 * global main_window
77567786 *
77577787 * RESIZE_FLAGS = SDL_WINDOW_OPENGL | SDL_WINDOW_FULLSCREEN_DESKTOP # <<<<<<<<<<<<<<
77607790 */
77617791 __pyx_v_RESIZE_FLAGS = (SDL_WINDOW_OPENGL | SDL_WINDOW_FULLSCREEN_DESKTOP);
77627792
7763 /* "pygame_sdl2/display.pyx":482
7793 /* "pygame_sdl2/display.pyx":493
77647794 * RESIZE_FLAGS = SDL_WINDOW_OPENGL | SDL_WINDOW_FULLSCREEN_DESKTOP
77657795 *
77667796 * if main_window: # <<<<<<<<<<<<<<
77677797 *
77687798 * if (flags & ~RESIZE_FLAGS) == (main_window.create_flags & ~RESIZE_FLAGS):
77697799 */
7770 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 482, __pyx_L1_error)
7800 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 493, __pyx_L1_error)
77717801 if (__pyx_t_1) {
77727802
7773 /* "pygame_sdl2/display.pyx":484
7803 /* "pygame_sdl2/display.pyx":495
77747804 * if main_window:
77757805 *
77767806 * if (flags & ~RESIZE_FLAGS) == (main_window.create_flags & ~RESIZE_FLAGS): # <<<<<<<<<<<<<<
77777807 * main_window.resize(resolution, flags & SDL_WINDOW_OPENGL, flags & SDL_WINDOW_FULLSCREEN_DESKTOP)
77787808 * return main_window.surface
77797809 */
7780 __pyx_t_2 = __Pyx_PyInt_From_int((~__pyx_v_RESIZE_FLAGS)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 484, __pyx_L1_error)
7810 __pyx_t_2 = __Pyx_PyInt_From_int((~__pyx_v_RESIZE_FLAGS)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 495, __pyx_L1_error)
77817811 __Pyx_GOTREF(__pyx_t_2);
7782 __pyx_t_3 = PyNumber_And(__pyx_v_flags, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 484, __pyx_L1_error)
7812 __pyx_t_3 = PyNumber_And(__pyx_v_flags, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 495, __pyx_L1_error)
77837813 __Pyx_GOTREF(__pyx_t_3);
77847814 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7785 __pyx_t_2 = __Pyx_PyInt_From_uint32_t((__pyx_v_11pygame_sdl2_7display_main_window->create_flags & (~__pyx_v_RESIZE_FLAGS))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 484, __pyx_L1_error)
7815 __pyx_t_2 = __Pyx_PyInt_From_uint32_t((__pyx_v_11pygame_sdl2_7display_main_window->create_flags & (~__pyx_v_RESIZE_FLAGS))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 495, __pyx_L1_error)
77867816 __Pyx_GOTREF(__pyx_t_2);
7787 __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 484, __pyx_L1_error)
7817 __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 495, __pyx_L1_error)
77887818 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
77897819 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7790 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 484, __pyx_L1_error)
7820 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 495, __pyx_L1_error)
77917821 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
77927822 if (__pyx_t_1) {
77937823
7794 /* "pygame_sdl2/display.pyx":485
7824 /* "pygame_sdl2/display.pyx":496
77957825 *
77967826 * if (flags & ~RESIZE_FLAGS) == (main_window.create_flags & ~RESIZE_FLAGS):
77977827 * main_window.resize(resolution, flags & SDL_WINDOW_OPENGL, flags & SDL_WINDOW_FULLSCREEN_DESKTOP) # <<<<<<<<<<<<<<
77987828 * return main_window.surface
77997829 *
78007830 */
7801 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_resize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 485, __pyx_L1_error)
7831 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_resize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 496, __pyx_L1_error)
78027832 __Pyx_GOTREF(__pyx_t_2);
7803 __pyx_t_3 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_OPENGL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 485, __pyx_L1_error)
7833 __pyx_t_3 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_OPENGL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 496, __pyx_L1_error)
78047834 __Pyx_GOTREF(__pyx_t_3);
7805 __pyx_t_5 = PyNumber_And(__pyx_v_flags, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 485, __pyx_L1_error)
7835 __pyx_t_5 = PyNumber_And(__pyx_v_flags, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 496, __pyx_L1_error)
78067836 __Pyx_GOTREF(__pyx_t_5);
78077837 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7808 __pyx_t_3 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_FULLSCREEN_DESKTOP); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 485, __pyx_L1_error)
7838 __pyx_t_3 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_FULLSCREEN_DESKTOP); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 496, __pyx_L1_error)
78097839 __Pyx_GOTREF(__pyx_t_3);
7810 __pyx_t_6 = PyNumber_And(__pyx_v_flags, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 485, __pyx_L1_error)
7840 __pyx_t_6 = PyNumber_And(__pyx_v_flags, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 496, __pyx_L1_error)
78117841 __Pyx_GOTREF(__pyx_t_6);
78127842 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
78137843 __pyx_t_3 = NULL;
78257855 #if CYTHON_FAST_PYCALL
78267856 if (PyFunction_Check(__pyx_t_2)) {
78277857 PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_resolution, __pyx_t_5, __pyx_t_6};
7828 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 485, __pyx_L1_error)
7858 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 496, __pyx_L1_error)
78297859 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
78307860 __Pyx_GOTREF(__pyx_t_4);
78317861 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
78357865 #if CYTHON_FAST_PYCCALL
78367866 if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
78377867 PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_resolution, __pyx_t_5, __pyx_t_6};
7838 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 485, __pyx_L1_error)
7868 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 496, __pyx_L1_error)
78397869 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
78407870 __Pyx_GOTREF(__pyx_t_4);
78417871 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
78437873 } else
78447874 #endif
78457875 {
7846 __pyx_t_8 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 485, __pyx_L1_error)
7876 __pyx_t_8 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 496, __pyx_L1_error)
78477877 __Pyx_GOTREF(__pyx_t_8);
78487878 if (__pyx_t_3) {
78497879 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); __pyx_t_3 = NULL;
78577887 PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_t_6);
78587888 __pyx_t_5 = 0;
78597889 __pyx_t_6 = 0;
7860 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 485, __pyx_L1_error)
7890 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 496, __pyx_L1_error)
78617891 __Pyx_GOTREF(__pyx_t_4);
78627892 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
78637893 }
78647894 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
78657895 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
78667896
7867 /* "pygame_sdl2/display.pyx":486
7897 /* "pygame_sdl2/display.pyx":497
78687898 * if (flags & ~RESIZE_FLAGS) == (main_window.create_flags & ~RESIZE_FLAGS):
78697899 * main_window.resize(resolution, flags & SDL_WINDOW_OPENGL, flags & SDL_WINDOW_FULLSCREEN_DESKTOP)
78707900 * return main_window.surface # <<<<<<<<<<<<<<
78767906 __pyx_r = ((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window->surface);
78777907 goto __pyx_L0;
78787908
7879 /* "pygame_sdl2/display.pyx":484
7909 /* "pygame_sdl2/display.pyx":495
78807910 * if main_window:
78817911 *
78827912 * if (flags & ~RESIZE_FLAGS) == (main_window.create_flags & ~RESIZE_FLAGS): # <<<<<<<<<<<<<<
78857915 */
78867916 }
78877917
7888 /* "pygame_sdl2/display.pyx":489
7918 /* "pygame_sdl2/display.pyx":500
78897919 *
78907920 * else:
78917921 * main_window.destroy() # <<<<<<<<<<<<<<
78937923 * main_window = Window(default_title, resolution, flags, depth, pos=pos)
78947924 */
78957925 /*else*/ {
7896 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_destroy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 489, __pyx_L1_error)
7926 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_destroy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 500, __pyx_L1_error)
78977927 __Pyx_GOTREF(__pyx_t_2);
78987928 __pyx_t_8 = NULL;
78997929 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
79077937 }
79087938 __pyx_t_4 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
79097939 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
7910 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 489, __pyx_L1_error)
7940 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 500, __pyx_L1_error)
79117941 __Pyx_GOTREF(__pyx_t_4);
79127942 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
79137943 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
79147944 }
79157945
7916 /* "pygame_sdl2/display.pyx":482
7946 /* "pygame_sdl2/display.pyx":493
79177947 * RESIZE_FLAGS = SDL_WINDOW_OPENGL | SDL_WINDOW_FULLSCREEN_DESKTOP
79187948 *
79197949 * if main_window: # <<<<<<<<<<<<<<
79227952 */
79237953 }
79247954
7925 /* "pygame_sdl2/display.pyx":491
7955 /* "pygame_sdl2/display.pyx":502
79267956 * main_window.destroy()
79277957 *
79287958 * main_window = Window(default_title, resolution, flags, depth, pos=pos) # <<<<<<<<<<<<<<
79297959 *
79307960 * if default_icon is not None:
79317961 */
7932 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_default_title); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 491, __pyx_L1_error)
7962 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_default_title); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 502, __pyx_L1_error)
79337963 __Pyx_GOTREF(__pyx_t_4);
7934 __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 491, __pyx_L1_error)
7964 __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 502, __pyx_L1_error)
79357965 __Pyx_GOTREF(__pyx_t_2);
79367966 __Pyx_GIVEREF(__pyx_t_4);
79377967 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
79457975 __Pyx_GIVEREF(__pyx_v_depth);
79467976 PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_depth);
79477977 __pyx_t_4 = 0;
7948 __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 491, __pyx_L1_error)
7978 __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 502, __pyx_L1_error)
79497979 __Pyx_GOTREF(__pyx_t_4);
7950 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_pos, __pyx_v_pos) < 0) __PYX_ERR(0, 491, __pyx_L1_error)
7951 __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window), __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 491, __pyx_L1_error)
7980 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_pos, __pyx_v_pos) < 0) __PYX_ERR(0, 502, __pyx_L1_error)
7981 __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window), __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 502, __pyx_L1_error)
79527982 __Pyx_GOTREF(__pyx_t_8);
79537983 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
79547984 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
79577987 __Pyx_GIVEREF(__pyx_t_8);
79587988 __pyx_t_8 = 0;
79597989
7960 /* "pygame_sdl2/display.pyx":493
7990 /* "pygame_sdl2/display.pyx":504
79617991 * main_window = Window(default_title, resolution, flags, depth, pos=pos)
79627992 *
79637993 * if default_icon is not None: # <<<<<<<<<<<<<<
79647994 * main_window.set_icon(default_icon)
79657995 *
79667996 */
7967 __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_default_icon); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 493, __pyx_L1_error)
7997 __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_default_icon); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 504, __pyx_L1_error)
79687998 __Pyx_GOTREF(__pyx_t_8);
79697999 __pyx_t_1 = (__pyx_t_8 != Py_None);
79708000 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
79718001 __pyx_t_9 = (__pyx_t_1 != 0);
79728002 if (__pyx_t_9) {
79738003
7974 /* "pygame_sdl2/display.pyx":494
8004 /* "pygame_sdl2/display.pyx":505
79758005 *
79768006 * if default_icon is not None:
79778007 * main_window.set_icon(default_icon) # <<<<<<<<<<<<<<
79788008 *
79798009 * return main_window.surface
79808010 */
7981 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_set_icon); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 494, __pyx_L1_error)
8011 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_set_icon); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 505, __pyx_L1_error)
79828012 __Pyx_GOTREF(__pyx_t_4);
7983 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_default_icon); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 494, __pyx_L1_error)
8013 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_default_icon); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 505, __pyx_L1_error)
79848014 __Pyx_GOTREF(__pyx_t_2);
79858015 __pyx_t_6 = NULL;
79868016 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
79958025 __pyx_t_8 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2);
79968026 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
79978027 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7998 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 494, __pyx_L1_error)
8028 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 505, __pyx_L1_error)
79998029 __Pyx_GOTREF(__pyx_t_8);
80008030 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
80018031 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
80028032
8003 /* "pygame_sdl2/display.pyx":493
8033 /* "pygame_sdl2/display.pyx":504
80048034 * main_window = Window(default_title, resolution, flags, depth, pos=pos)
80058035 *
80068036 * if default_icon is not None: # <<<<<<<<<<<<<<
80098039 */
80108040 }
80118041
8012 /* "pygame_sdl2/display.pyx":496
8042 /* "pygame_sdl2/display.pyx":507
80138043 * main_window.set_icon(default_icon)
80148044 *
80158045 * return main_window.surface # <<<<<<<<<<<<<<
80168046 *
8017 * def get_surface():
8047 * def destroy():
80188048 */
80198049 __Pyx_XDECREF(__pyx_r);
80208050 __Pyx_INCREF(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window->surface));
80218051 __pyx_r = ((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window->surface);
80228052 goto __pyx_L0;
80238053
8024 /* "pygame_sdl2/display.pyx":477
8054 /* "pygame_sdl2/display.pyx":488
80258055 * default_swap_control = 1
80268056 *
80278057 * def set_mode(resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): # <<<<<<<<<<<<<<
80458075 return __pyx_r;
80468076 }
80478077
8048 /* "pygame_sdl2/display.pyx":498
8078 /* "pygame_sdl2/display.pyx":509
80498079 * return main_window.surface
8080 *
8081 * def destroy(): # <<<<<<<<<<<<<<
8082 * global main_window
8083 *
8084 */
8085
8086 /* Python wrapper */
8087 static PyObject *__pyx_pw_11pygame_sdl2_7display_15destroy(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
8088 static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_15destroy = {"destroy", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_15destroy, METH_NOARGS, 0};
8089 static PyObject *__pyx_pw_11pygame_sdl2_7display_15destroy(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
8090 PyObject *__pyx_r = 0;
8091 __Pyx_RefNannyDeclarations
8092 __Pyx_RefNannySetupContext("destroy (wrapper)", 0);
8093 __pyx_r = __pyx_pf_11pygame_sdl2_7display_14destroy(__pyx_self);
8094
8095 /* function exit code */
8096 __Pyx_RefNannyFinishContext();
8097 return __pyx_r;
8098 }
8099
8100 static PyObject *__pyx_pf_11pygame_sdl2_7display_14destroy(CYTHON_UNUSED PyObject *__pyx_self) {
8101 PyObject *__pyx_r = NULL;
8102 __Pyx_RefNannyDeclarations
8103 int __pyx_t_1;
8104 int __pyx_t_2;
8105 PyObject *__pyx_t_3 = NULL;
8106 PyObject *__pyx_t_4 = NULL;
8107 PyObject *__pyx_t_5 = NULL;
8108 int __pyx_lineno = 0;
8109 const char *__pyx_filename = NULL;
8110 int __pyx_clineno = 0;
8111 __Pyx_RefNannySetupContext("destroy", 0);
8112
8113 /* "pygame_sdl2/display.pyx":512
8114 * global main_window
8115 *
8116 * if main_window is not None: # <<<<<<<<<<<<<<
8117 * main_window.destroy()
8118 * main_window = None
8119 */
8120 __pyx_t_1 = (((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window) != Py_None);
8121 __pyx_t_2 = (__pyx_t_1 != 0);
8122 if (__pyx_t_2) {
8123
8124 /* "pygame_sdl2/display.pyx":513
8125 *
8126 * if main_window is not None:
8127 * main_window.destroy() # <<<<<<<<<<<<<<
8128 * main_window = None
8129 *
8130 */
8131 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_destroy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 513, __pyx_L1_error)
8132 __Pyx_GOTREF(__pyx_t_4);
8133 __pyx_t_5 = NULL;
8134 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
8135 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
8136 if (likely(__pyx_t_5)) {
8137 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
8138 __Pyx_INCREF(__pyx_t_5);
8139 __Pyx_INCREF(function);
8140 __Pyx_DECREF_SET(__pyx_t_4, function);
8141 }
8142 }
8143 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
8144 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
8145 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 513, __pyx_L1_error)
8146 __Pyx_GOTREF(__pyx_t_3);
8147 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8148 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8149
8150 /* "pygame_sdl2/display.pyx":514
8151 * if main_window is not None:
8152 * main_window.destroy()
8153 * main_window = None # <<<<<<<<<<<<<<
8154 *
8155 * def get_surface():
8156 */
8157 __Pyx_INCREF(Py_None);
8158 __Pyx_XGOTREF(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window));
8159 __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_7display_main_window, ((struct __pyx_obj_11pygame_sdl2_7display_Window *)Py_None));
8160 __Pyx_GIVEREF(Py_None);
8161
8162 /* "pygame_sdl2/display.pyx":512
8163 * global main_window
8164 *
8165 * if main_window is not None: # <<<<<<<<<<<<<<
8166 * main_window.destroy()
8167 * main_window = None
8168 */
8169 }
8170
8171 /* "pygame_sdl2/display.pyx":509
8172 * return main_window.surface
8173 *
8174 * def destroy(): # <<<<<<<<<<<<<<
8175 * global main_window
8176 *
8177 */
8178
8179 /* function exit code */
8180 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8181 goto __pyx_L0;
8182 __pyx_L1_error:;
8183 __Pyx_XDECREF(__pyx_t_3);
8184 __Pyx_XDECREF(__pyx_t_4);
8185 __Pyx_XDECREF(__pyx_t_5);
8186 __Pyx_AddTraceback("pygame_sdl2.display.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename);
8187 __pyx_r = NULL;
8188 __pyx_L0:;
8189 __Pyx_XGIVEREF(__pyx_r);
8190 __Pyx_RefNannyFinishContext();
8191 return __pyx_r;
8192 }
8193
8194 /* "pygame_sdl2/display.pyx":516
8195 * main_window = None
80508196 *
80518197 * def get_surface(): # <<<<<<<<<<<<<<
80528198 * if main_window is None:
80808226 int __pyx_clineno = 0;
80818227 __Pyx_RefNannySetupContext("get_surface", 0);
80828228
8083 /* "pygame_sdl2/display.pyx":499
8229 /* "pygame_sdl2/display.pyx":517
80848230 *
80858231 * def get_surface():
80868232 * if main_window is None: # <<<<<<<<<<<<<<
80918237 __pyx_t_2 = (__pyx_t_1 != 0);
80928238 if (__pyx_t_2) {
80938239
8094 /* "pygame_sdl2/display.pyx":500
8240 /* "pygame_sdl2/display.pyx":518
80958241 * def get_surface():
80968242 * if main_window is None:
80978243 * return None # <<<<<<<<<<<<<<
81028248 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
81038249 goto __pyx_L0;
81048250
8105 /* "pygame_sdl2/display.pyx":499
8251 /* "pygame_sdl2/display.pyx":517
81068252 *
81078253 * def get_surface():
81088254 * if main_window is None: # <<<<<<<<<<<<<<
81118257 */
81128258 }
81138259
8114 /* "pygame_sdl2/display.pyx":502
8260 /* "pygame_sdl2/display.pyx":520
81158261 * return None
81168262 *
81178263 * return main_window.get_surface() # <<<<<<<<<<<<<<
81198265 * def get_window():
81208266 */
81218267 __Pyx_XDECREF(__pyx_r);
8122 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_get_surface); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 502, __pyx_L1_error)
8268 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_get_surface); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error)
81238269 __Pyx_GOTREF(__pyx_t_4);
81248270 __pyx_t_5 = NULL;
81258271 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
81338279 }
81348280 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
81358281 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
8136 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 502, __pyx_L1_error)
8282 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 520, __pyx_L1_error)
81378283 __Pyx_GOTREF(__pyx_t_3);
81388284 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
81398285 __pyx_r = __pyx_t_3;
81408286 __pyx_t_3 = 0;
81418287 goto __pyx_L0;
81428288
8143 /* "pygame_sdl2/display.pyx":498
8144 * return main_window.surface
8289 /* "pygame_sdl2/display.pyx":516
8290 * main_window = None
81458291 *
81468292 * def get_surface(): # <<<<<<<<<<<<<<
81478293 * if main_window is None:
81618307 return __pyx_r;
81628308 }
81638309
8164 /* "pygame_sdl2/display.pyx":504
8310 /* "pygame_sdl2/display.pyx":522
81658311 * return main_window.get_surface()
81668312 *
81678313 * def get_window(): # <<<<<<<<<<<<<<
81898335 __Pyx_RefNannyDeclarations
81908336 __Pyx_RefNannySetupContext("get_window", 0);
81918337
8192 /* "pygame_sdl2/display.pyx":510
8338 /* "pygame_sdl2/display.pyx":528
81938339 * """
81948340 *
81958341 * return main_window # <<<<<<<<<<<<<<
82018347 __pyx_r = ((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window);
82028348 goto __pyx_L0;
82038349
8204 /* "pygame_sdl2/display.pyx":504
8350 /* "pygame_sdl2/display.pyx":522
82058351 * return main_window.get_surface()
82068352 *
82078353 * def get_window(): # <<<<<<<<<<<<<<
82168362 return __pyx_r;
82178363 }
82188364
8219 /* "pygame_sdl2/display.pyx":512
8365 /* "pygame_sdl2/display.pyx":530
82208366 * return main_window
82218367 *
82228368 * def flip(): # <<<<<<<<<<<<<<
82508396 int __pyx_clineno = 0;
82518397 __Pyx_RefNannySetupContext("flip", 0);
82528398
8253 /* "pygame_sdl2/display.pyx":513
8399 /* "pygame_sdl2/display.pyx":531
82548400 *
82558401 * def flip():
82568402 * if main_window: # <<<<<<<<<<<<<<
82578403 * main_window.flip()
82588404 *
82598405 */
8260 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 513, __pyx_L1_error)
8406 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 531, __pyx_L1_error)
82618407 if (__pyx_t_1) {
82628408
8263 /* "pygame_sdl2/display.pyx":514
8409 /* "pygame_sdl2/display.pyx":532
82648410 * def flip():
82658411 * if main_window:
82668412 * main_window.flip() # <<<<<<<<<<<<<<
82678413 *
82688414 * def update(rectangles=None):
82698415 */
8270 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_flip); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 514, __pyx_L1_error)
8416 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_flip); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 532, __pyx_L1_error)
82718417 __Pyx_GOTREF(__pyx_t_3);
82728418 __pyx_t_4 = NULL;
82738419 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
82818427 }
82828428 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
82838429 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8284 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error)
8430 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 532, __pyx_L1_error)
82858431 __Pyx_GOTREF(__pyx_t_2);
82868432 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
82878433 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
82888434
8289 /* "pygame_sdl2/display.pyx":513
8435 /* "pygame_sdl2/display.pyx":531
82908436 *
82918437 * def flip():
82928438 * if main_window: # <<<<<<<<<<<<<<
82958441 */
82968442 }
82978443
8298 /* "pygame_sdl2/display.pyx":512
8444 /* "pygame_sdl2/display.pyx":530
82998445 * return main_window
83008446 *
83018447 * def flip(): # <<<<<<<<<<<<<<
83188464 return __pyx_r;
83198465 }
83208466
8321 /* "pygame_sdl2/display.pyx":516
8467 /* "pygame_sdl2/display.pyx":534
83228468 * main_window.flip()
83238469 *
83248470 * def update(rectangles=None): # <<<<<<<<<<<<<<
83598505 }
83608506 }
83618507 if (unlikely(kw_args > 0)) {
8362 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "update") < 0)) __PYX_ERR(0, 516, __pyx_L3_error)
8508 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "update") < 0)) __PYX_ERR(0, 534, __pyx_L3_error)
83638509 }
83648510 } else {
83658511 switch (PyTuple_GET_SIZE(__pyx_args)) {
83738519 }
83748520 goto __pyx_L4_argument_unpacking_done;
83758521 __pyx_L5_argtuple_error:;
8376 __Pyx_RaiseArgtupleInvalid("update", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 516, __pyx_L3_error)
8522 __Pyx_RaiseArgtupleInvalid("update", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 534, __pyx_L3_error)
83778523 __pyx_L3_error:;
83788524 __Pyx_AddTraceback("pygame_sdl2.display.update", __pyx_clineno, __pyx_lineno, __pyx_filename);
83798525 __Pyx_RefNannyFinishContext();
83988544 int __pyx_clineno = 0;
83998545 __Pyx_RefNannySetupContext("update", 0);
84008546
8401 /* "pygame_sdl2/display.pyx":517
8547 /* "pygame_sdl2/display.pyx":535
84028548 *
84038549 * def update(rectangles=None):
84048550 * if main_window: # <<<<<<<<<<<<<<
84058551 * main_window.update(rectangles)
84068552 *
84078553 */
8408 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 517, __pyx_L1_error)
8554 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 535, __pyx_L1_error)
84098555 if (__pyx_t_1) {
84108556
8411 /* "pygame_sdl2/display.pyx":518
8557 /* "pygame_sdl2/display.pyx":536
84128558 * def update(rectangles=None):
84138559 * if main_window:
84148560 * main_window.update(rectangles) # <<<<<<<<<<<<<<
84158561 *
84168562 * def get_driver():
84178563 */
8418 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_update); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 518, __pyx_L1_error)
8564 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_update); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 536, __pyx_L1_error)
84198565 __Pyx_GOTREF(__pyx_t_3);
84208566 __pyx_t_4 = NULL;
84218567 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
84298575 }
84308576 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_rectangles) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_rectangles);
84318577 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8432 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 518, __pyx_L1_error)
8578 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 536, __pyx_L1_error)
84338579 __Pyx_GOTREF(__pyx_t_2);
84348580 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
84358581 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
84368582
8437 /* "pygame_sdl2/display.pyx":517
8583 /* "pygame_sdl2/display.pyx":535
84388584 *
84398585 * def update(rectangles=None):
84408586 * if main_window: # <<<<<<<<<<<<<<
84438589 */
84448590 }
84458591
8446 /* "pygame_sdl2/display.pyx":516
8592 /* "pygame_sdl2/display.pyx":534
84478593 * main_window.flip()
84488594 *
84498595 * def update(rectangles=None): # <<<<<<<<<<<<<<
84668612 return __pyx_r;
84678613 }
84688614
8469 /* "pygame_sdl2/display.pyx":520
8615 /* "pygame_sdl2/display.pyx":538
84708616 * main_window.update(rectangles)
84718617 *
84728618 * def get_driver(): # <<<<<<<<<<<<<<
85018647 int __pyx_clineno = 0;
85028648 __Pyx_RefNannySetupContext("get_driver", 0);
85038649
8504 /* "pygame_sdl2/display.pyx":521
8650 /* "pygame_sdl2/display.pyx":539
85058651 *
85068652 * def get_driver():
85078653 * cdef const char *driver = SDL_GetCurrentVideoDriver() # <<<<<<<<<<<<<<
85108656 */
85118657 __pyx_v_driver = SDL_GetCurrentVideoDriver();
85128658
8513 /* "pygame_sdl2/display.pyx":523
8659 /* "pygame_sdl2/display.pyx":541
85148660 * cdef const char *driver = SDL_GetCurrentVideoDriver()
85158661 *
85168662 * if driver == NULL: # <<<<<<<<<<<<<<
85208666 __pyx_t_1 = ((__pyx_v_driver == NULL) != 0);
85218667 if (unlikely(__pyx_t_1)) {
85228668
8523 /* "pygame_sdl2/display.pyx":524
8669 /* "pygame_sdl2/display.pyx":542
85248670 *
85258671 * if driver == NULL:
85268672 * raise error() # <<<<<<<<<<<<<<
85278673 *
85288674 * return driver
85298675 */
8530 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 524, __pyx_L1_error)
8676 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 542, __pyx_L1_error)
85318677 __Pyx_GOTREF(__pyx_t_3);
85328678 __pyx_t_4 = NULL;
85338679 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
85418687 }
85428688 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
85438689 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8544 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 524, __pyx_L1_error)
8690 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 542, __pyx_L1_error)
85458691 __Pyx_GOTREF(__pyx_t_2);
85468692 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
85478693 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
85488694 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8549 __PYX_ERR(0, 524, __pyx_L1_error)
8550
8551 /* "pygame_sdl2/display.pyx":523
8695 __PYX_ERR(0, 542, __pyx_L1_error)
8696
8697 /* "pygame_sdl2/display.pyx":541
85528698 * cdef const char *driver = SDL_GetCurrentVideoDriver()
85538699 *
85548700 * if driver == NULL: # <<<<<<<<<<<<<<
85578703 */
85588704 }
85598705
8560 /* "pygame_sdl2/display.pyx":526
8706 /* "pygame_sdl2/display.pyx":544
85618707 * raise error()
85628708 *
85638709 * return driver # <<<<<<<<<<<<<<
85658711 * class Info(object):
85668712 */
85678713 __Pyx_XDECREF(__pyx_r);
8568 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_driver); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 526, __pyx_L1_error)
8714 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_driver); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 544, __pyx_L1_error)
85698715 __Pyx_GOTREF(__pyx_t_2);
85708716 __pyx_r = __pyx_t_2;
85718717 __pyx_t_2 = 0;
85728718 goto __pyx_L0;
85738719
8574 /* "pygame_sdl2/display.pyx":520
8720 /* "pygame_sdl2/display.pyx":538
85758721 * main_window.update(rectangles)
85768722 *
85778723 * def get_driver(): # <<<<<<<<<<<<<<
85928738 return __pyx_r;
85938739 }
85948740
8595 /* "pygame_sdl2/display.pyx":530
8741 /* "pygame_sdl2/display.pyx":548
85968742 * class Info(object):
85978743 *
85988744 * def __init__(self): # <<<<<<<<<<<<<<
86318777 int __pyx_clineno = 0;
86328778 __Pyx_RefNannySetupContext("__init__", 0);
86338779
8634 /* "pygame_sdl2/display.pyx":534
8780 /* "pygame_sdl2/display.pyx":552
86358781 * cdef SDL_PixelFormat *format
86368782 *
86378783 * if SDL_GetCurrentDisplayMode(0, &dm): # <<<<<<<<<<<<<<
86418787 __pyx_t_1 = (SDL_GetCurrentDisplayMode(0, (&__pyx_v_dm)) != 0);
86428788 if (unlikely(__pyx_t_1)) {
86438789
8644 /* "pygame_sdl2/display.pyx":535
8790 /* "pygame_sdl2/display.pyx":553
86458791 *
86468792 * if SDL_GetCurrentDisplayMode(0, &dm):
86478793 * raise error() # <<<<<<<<<<<<<<
86488794 *
86498795 * format = SDL_AllocFormat(dm.format)
86508796 */
8651 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 535, __pyx_L1_error)
8797 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 553, __pyx_L1_error)
86528798 __Pyx_GOTREF(__pyx_t_3);
86538799 __pyx_t_4 = NULL;
86548800 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
86628808 }
86638809 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
86648810 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8665 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 535, __pyx_L1_error)
8811 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 553, __pyx_L1_error)
86668812 __Pyx_GOTREF(__pyx_t_2);
86678813 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
86688814 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
86698815 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8670 __PYX_ERR(0, 535, __pyx_L1_error)
8671
8672 /* "pygame_sdl2/display.pyx":534
8816 __PYX_ERR(0, 553, __pyx_L1_error)
8817
8818 /* "pygame_sdl2/display.pyx":552
86738819 * cdef SDL_PixelFormat *format
86748820 *
86758821 * if SDL_GetCurrentDisplayMode(0, &dm): # <<<<<<<<<<<<<<
86788824 */
86798825 }
86808826
8681 /* "pygame_sdl2/display.pyx":537
8827 /* "pygame_sdl2/display.pyx":555
86828828 * raise error()
86838829 *
86848830 * format = SDL_AllocFormat(dm.format) # <<<<<<<<<<<<<<
86878833 */
86888834 __pyx_v_format = SDL_AllocFormat(__pyx_v_dm.format);
86898835
8690 /* "pygame_sdl2/display.pyx":538
8836 /* "pygame_sdl2/display.pyx":556
86918837 *
86928838 * format = SDL_AllocFormat(dm.format)
86938839 * if format == NULL: # <<<<<<<<<<<<<<
86978843 __pyx_t_1 = ((__pyx_v_format == NULL) != 0);
86988844 if (unlikely(__pyx_t_1)) {
86998845
8700 /* "pygame_sdl2/display.pyx":539
8846 /* "pygame_sdl2/display.pyx":557
87018847 * format = SDL_AllocFormat(dm.format)
87028848 * if format == NULL:
87038849 * raise error() # <<<<<<<<<<<<<<
87048850 *
87058851 * self.bitsize = format.BitsPerPixel
87068852 */
8707 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 539, __pyx_L1_error)
8853 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 557, __pyx_L1_error)
87088854 __Pyx_GOTREF(__pyx_t_3);
87098855 __pyx_t_4 = NULL;
87108856 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
87188864 }
87198865 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
87208866 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8721 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 539, __pyx_L1_error)
8867 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 557, __pyx_L1_error)
87228868 __Pyx_GOTREF(__pyx_t_2);
87238869 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
87248870 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
87258871 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8726 __PYX_ERR(0, 539, __pyx_L1_error)
8727
8728 /* "pygame_sdl2/display.pyx":538
8872 __PYX_ERR(0, 557, __pyx_L1_error)
8873
8874 /* "pygame_sdl2/display.pyx":556
87298875 *
87308876 * format = SDL_AllocFormat(dm.format)
87318877 * if format == NULL: # <<<<<<<<<<<<<<
87348880 */
87358881 }
87368882
8737 /* "pygame_sdl2/display.pyx":541
8883 /* "pygame_sdl2/display.pyx":559
87388884 * raise error()
87398885 *
87408886 * self.bitsize = format.BitsPerPixel # <<<<<<<<<<<<<<
87418887 * self.bytesize = format.BytesPerPixel
87428888 *
87438889 */
8744 __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->BitsPerPixel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 541, __pyx_L1_error)
8890 __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->BitsPerPixel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 559, __pyx_L1_error)
87458891 __Pyx_GOTREF(__pyx_t_2);
8746 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_bitsize, __pyx_t_2) < 0) __PYX_ERR(0, 541, __pyx_L1_error)
8892 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_bitsize, __pyx_t_2) < 0) __PYX_ERR(0, 559, __pyx_L1_error)
87478893 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
87488894
8749 /* "pygame_sdl2/display.pyx":542
8895 /* "pygame_sdl2/display.pyx":560
87508896 *
87518897 * self.bitsize = format.BitsPerPixel
87528898 * self.bytesize = format.BytesPerPixel # <<<<<<<<<<<<<<
87538899 *
87548900 * self.masks = (
87558901 */
8756 __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->BytesPerPixel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 542, __pyx_L1_error)
8902 __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->BytesPerPixel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 560, __pyx_L1_error)
87578903 __Pyx_GOTREF(__pyx_t_2);
8758 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_bytesize, __pyx_t_2) < 0) __PYX_ERR(0, 542, __pyx_L1_error)
8904 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_bytesize, __pyx_t_2) < 0) __PYX_ERR(0, 560, __pyx_L1_error)
87598905 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
87608906
8761 /* "pygame_sdl2/display.pyx":545
8907 /* "pygame_sdl2/display.pyx":563
87628908 *
87638909 * self.masks = (
87648910 * format.Rmask, # <<<<<<<<<<<<<<
87658911 * format.Gmask,
87668912 * format.Bmask,
87678913 */
8768 __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_format->Rmask); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 545, __pyx_L1_error)
8914 __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_format->Rmask); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 563, __pyx_L1_error)
87698915 __Pyx_GOTREF(__pyx_t_2);
87708916
8771 /* "pygame_sdl2/display.pyx":546
8917 /* "pygame_sdl2/display.pyx":564
87728918 * self.masks = (
87738919 * format.Rmask,
87748920 * format.Gmask, # <<<<<<<<<<<<<<
87758921 * format.Bmask,
87768922 * format.Amask,
87778923 */
8778 __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_format->Gmask); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 546, __pyx_L1_error)
8924 __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_format->Gmask); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 564, __pyx_L1_error)
87798925 __Pyx_GOTREF(__pyx_t_3);
87808926
8781 /* "pygame_sdl2/display.pyx":547
8927 /* "pygame_sdl2/display.pyx":565
87828928 * format.Rmask,
87838929 * format.Gmask,
87848930 * format.Bmask, # <<<<<<<<<<<<<<
87858931 * format.Amask,
87868932 * )
87878933 */
8788 __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_format->Bmask); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 547, __pyx_L1_error)
8934 __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_format->Bmask); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 565, __pyx_L1_error)
87898935 __Pyx_GOTREF(__pyx_t_4);
87908936
8791 /* "pygame_sdl2/display.pyx":548
8937 /* "pygame_sdl2/display.pyx":566
87928938 * format.Gmask,
87938939 * format.Bmask,
87948940 * format.Amask, # <<<<<<<<<<<<<<
87958941 * )
87968942 *
87978943 */
8798 __pyx_t_5 = __Pyx_PyInt_From_uint32_t(__pyx_v_format->Amask); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 548, __pyx_L1_error)
8944 __pyx_t_5 = __Pyx_PyInt_From_uint32_t(__pyx_v_format->Amask); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 566, __pyx_L1_error)
87998945 __Pyx_GOTREF(__pyx_t_5);
88008946
8801 /* "pygame_sdl2/display.pyx":545
8947 /* "pygame_sdl2/display.pyx":563
88028948 *
88038949 * self.masks = (
88048950 * format.Rmask, # <<<<<<<<<<<<<<
88058951 * format.Gmask,
88068952 * format.Bmask,
88078953 */
8808 __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 545, __pyx_L1_error)
8954 __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 563, __pyx_L1_error)
88098955 __Pyx_GOTREF(__pyx_t_6);
88108956 __Pyx_GIVEREF(__pyx_t_2);
88118957 PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
88208966 __pyx_t_4 = 0;
88218967 __pyx_t_5 = 0;
88228968
8823 /* "pygame_sdl2/display.pyx":544
8969 /* "pygame_sdl2/display.pyx":562
88248970 * self.bytesize = format.BytesPerPixel
88258971 *
88268972 * self.masks = ( # <<<<<<<<<<<<<<
88278973 * format.Rmask,
88288974 * format.Gmask,
88298975 */
8830 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_masks, __pyx_t_6) < 0) __PYX_ERR(0, 544, __pyx_L1_error)
8976 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_masks, __pyx_t_6) < 0) __PYX_ERR(0, 562, __pyx_L1_error)
88318977 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
88328978
8833 /* "pygame_sdl2/display.pyx":552
8979 /* "pygame_sdl2/display.pyx":570
88348980 *
88358981 * self.shifts = (
88368982 * format.Rshift, # <<<<<<<<<<<<<<
88378983 * format.Gshift,
88388984 * format.Bshift,
88398985 */
8840 __pyx_t_6 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Rshift); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 552, __pyx_L1_error)
8986 __pyx_t_6 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Rshift); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 570, __pyx_L1_error)
88418987 __Pyx_GOTREF(__pyx_t_6);
88428988
8843 /* "pygame_sdl2/display.pyx":553
8989 /* "pygame_sdl2/display.pyx":571
88448990 * self.shifts = (
88458991 * format.Rshift,
88468992 * format.Gshift, # <<<<<<<<<<<<<<
88478993 * format.Bshift,
88488994 * format.Ashift,
88498995 */
8850 __pyx_t_5 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Gshift); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 553, __pyx_L1_error)
8996 __pyx_t_5 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Gshift); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 571, __pyx_L1_error)
88518997 __Pyx_GOTREF(__pyx_t_5);
88528998
8853 /* "pygame_sdl2/display.pyx":554
8999 /* "pygame_sdl2/display.pyx":572
88549000 * format.Rshift,
88559001 * format.Gshift,
88569002 * format.Bshift, # <<<<<<<<<<<<<<
88579003 * format.Ashift,
88589004 * )
88599005 */
8860 __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Bshift); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 554, __pyx_L1_error)
9006 __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Bshift); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 572, __pyx_L1_error)
88619007 __Pyx_GOTREF(__pyx_t_4);
88629008
8863 /* "pygame_sdl2/display.pyx":555
9009 /* "pygame_sdl2/display.pyx":573
88649010 * format.Gshift,
88659011 * format.Bshift,
88669012 * format.Ashift, # <<<<<<<<<<<<<<
88679013 * )
88689014 *
88699015 */
8870 __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Ashift); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 555, __pyx_L1_error)
9016 __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Ashift); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 573, __pyx_L1_error)
88719017 __Pyx_GOTREF(__pyx_t_3);
88729018
8873 /* "pygame_sdl2/display.pyx":552
9019 /* "pygame_sdl2/display.pyx":570
88749020 *
88759021 * self.shifts = (
88769022 * format.Rshift, # <<<<<<<<<<<<<<
88779023 * format.Gshift,
88789024 * format.Bshift,
88799025 */
8880 __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 552, __pyx_L1_error)
9026 __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 570, __pyx_L1_error)
88819027 __Pyx_GOTREF(__pyx_t_2);
88829028 __Pyx_GIVEREF(__pyx_t_6);
88839029 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6);
88929038 __pyx_t_4 = 0;
88939039 __pyx_t_3 = 0;
88949040
8895 /* "pygame_sdl2/display.pyx":551
9041 /* "pygame_sdl2/display.pyx":569
88969042 * )
88979043 *
88989044 * self.shifts = ( # <<<<<<<<<<<<<<
88999045 * format.Rshift,
89009046 * format.Gshift,
89019047 */
8902 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_shifts, __pyx_t_2) < 0) __PYX_ERR(0, 551, __pyx_L1_error)
9048 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_shifts, __pyx_t_2) < 0) __PYX_ERR(0, 569, __pyx_L1_error)
89039049 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
89049050
8905 /* "pygame_sdl2/display.pyx":559
9051 /* "pygame_sdl2/display.pyx":577
89069052 *
89079053 * self.losses = (
89089054 * format.Rloss, # <<<<<<<<<<<<<<
89099055 * format.Gloss,
89109056 * format.Bloss,
89119057 */
8912 __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Rloss); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 559, __pyx_L1_error)
9058 __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Rloss); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 577, __pyx_L1_error)
89139059 __Pyx_GOTREF(__pyx_t_2);
89149060
8915 /* "pygame_sdl2/display.pyx":560
9061 /* "pygame_sdl2/display.pyx":578
89169062 * self.losses = (
89179063 * format.Rloss,
89189064 * format.Gloss, # <<<<<<<<<<<<<<
89199065 * format.Bloss,
89209066 * format.Aloss,
89219067 */
8922 __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Gloss); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 560, __pyx_L1_error)
9068 __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Gloss); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 578, __pyx_L1_error)
89239069 __Pyx_GOTREF(__pyx_t_3);
89249070
8925 /* "pygame_sdl2/display.pyx":561
9071 /* "pygame_sdl2/display.pyx":579
89269072 * format.Rloss,
89279073 * format.Gloss,
89289074 * format.Bloss, # <<<<<<<<<<<<<<
89299075 * format.Aloss,
89309076 * )
89319077 */
8932 __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Bloss); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 561, __pyx_L1_error)
9078 __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Bloss); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 579, __pyx_L1_error)
89339079 __Pyx_GOTREF(__pyx_t_4);
89349080
8935 /* "pygame_sdl2/display.pyx":562
9081 /* "pygame_sdl2/display.pyx":580
89369082 * format.Gloss,
89379083 * format.Bloss,
89389084 * format.Aloss, # <<<<<<<<<<<<<<
89399085 * )
89409086 *
89419087 */
8942 __pyx_t_5 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Aloss); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 562, __pyx_L1_error)
9088 __pyx_t_5 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Aloss); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 580, __pyx_L1_error)
89439089 __Pyx_GOTREF(__pyx_t_5);
89449090
8945 /* "pygame_sdl2/display.pyx":559
9091 /* "pygame_sdl2/display.pyx":577
89469092 *
89479093 * self.losses = (
89489094 * format.Rloss, # <<<<<<<<<<<<<<
89499095 * format.Gloss,
89509096 * format.Bloss,
89519097 */
8952 __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 559, __pyx_L1_error)
9098 __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 577, __pyx_L1_error)
89539099 __Pyx_GOTREF(__pyx_t_6);
89549100 __Pyx_GIVEREF(__pyx_t_2);
89559101 PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
89649110 __pyx_t_4 = 0;
89659111 __pyx_t_5 = 0;
89669112
8967 /* "pygame_sdl2/display.pyx":558
9113 /* "pygame_sdl2/display.pyx":576
89689114 * )
89699115 *
89709116 * self.losses = ( # <<<<<<<<<<<<<<
89719117 * format.Rloss,
89729118 * format.Gloss,
89739119 */
8974 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_losses, __pyx_t_6) < 0) __PYX_ERR(0, 558, __pyx_L1_error)
9120 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_losses, __pyx_t_6) < 0) __PYX_ERR(0, 576, __pyx_L1_error)
89759121 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
89769122
8977 /* "pygame_sdl2/display.pyx":565
9123 /* "pygame_sdl2/display.pyx":583
89789124 * )
89799125 *
89809126 * SDL_FreeFormat(format) # <<<<<<<<<<<<<<
89839129 */
89849130 SDL_FreeFormat(__pyx_v_format);
89859131
8986 /* "pygame_sdl2/display.pyx":567
9132 /* "pygame_sdl2/display.pyx":585
89879133 * SDL_FreeFormat(format)
89889134 *
89899135 * if main_window: # <<<<<<<<<<<<<<
89909136 * self.current_w, self.current_h = main_window.surface.get_size()
89919137 * else:
89929138 */
8993 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 567, __pyx_L1_error)
9139 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 585, __pyx_L1_error)
89949140 if (__pyx_t_1) {
89959141
8996 /* "pygame_sdl2/display.pyx":568
9142 /* "pygame_sdl2/display.pyx":586
89979143 *
89989144 * if main_window:
89999145 * self.current_w, self.current_h = main_window.surface.get_size() # <<<<<<<<<<<<<<
90009146 * else:
90019147 *
90029148 */
9003 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window->surface), __pyx_n_s_get_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 568, __pyx_L1_error)
9149 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window->surface), __pyx_n_s_get_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 586, __pyx_L1_error)
90049150 __Pyx_GOTREF(__pyx_t_5);
90059151 __pyx_t_4 = NULL;
90069152 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
90149160 }
90159161 __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
90169162 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
9017 if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 568, __pyx_L1_error)
9163 if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 586, __pyx_L1_error)
90189164 __Pyx_GOTREF(__pyx_t_6);
90199165 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
90209166 if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
90239169 if (unlikely(size != 2)) {
90249170 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
90259171 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
9026 __PYX_ERR(0, 568, __pyx_L1_error)
9172 __PYX_ERR(0, 586, __pyx_L1_error)
90279173 }
90289174 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
90299175 if (likely(PyTuple_CheckExact(sequence))) {
90369182 __Pyx_INCREF(__pyx_t_5);
90379183 __Pyx_INCREF(__pyx_t_4);
90389184 #else
9039 __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 568, __pyx_L1_error)
9185 __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 586, __pyx_L1_error)
90409186 __Pyx_GOTREF(__pyx_t_5);
9041 __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 568, __pyx_L1_error)
9187 __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 586, __pyx_L1_error)
90429188 __Pyx_GOTREF(__pyx_t_4);
90439189 #endif
90449190 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
90459191 } else {
90469192 Py_ssize_t index = -1;
9047 __pyx_t_3 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 568, __pyx_L1_error)
9193 __pyx_t_3 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 586, __pyx_L1_error)
90489194 __Pyx_GOTREF(__pyx_t_3);
90499195 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
90509196 __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext;
90529198 __Pyx_GOTREF(__pyx_t_5);
90539199 index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed;
90549200 __Pyx_GOTREF(__pyx_t_4);
9055 if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_3), 2) < 0) __PYX_ERR(0, 568, __pyx_L1_error)
9201 if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_3), 2) < 0) __PYX_ERR(0, 586, __pyx_L1_error)
90569202 __pyx_t_7 = NULL;
90579203 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
90589204 goto __pyx_L7_unpacking_done;
90609206 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
90619207 __pyx_t_7 = NULL;
90629208 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
9063 __PYX_ERR(0, 568, __pyx_L1_error)
9209 __PYX_ERR(0, 586, __pyx_L1_error)
90649210 __pyx_L7_unpacking_done:;
90659211 }
9066 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_current_w, __pyx_t_5) < 0) __PYX_ERR(0, 568, __pyx_L1_error)
9212 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_current_w, __pyx_t_5) < 0) __PYX_ERR(0, 586, __pyx_L1_error)
90679213 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9068 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_current_h, __pyx_t_4) < 0) __PYX_ERR(0, 568, __pyx_L1_error)
9214 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_current_h, __pyx_t_4) < 0) __PYX_ERR(0, 586, __pyx_L1_error)
90699215 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
90709216
9071 /* "pygame_sdl2/display.pyx":567
9217 /* "pygame_sdl2/display.pyx":585
90729218 * SDL_FreeFormat(format)
90739219 *
90749220 * if main_window: # <<<<<<<<<<<<<<
90789224 goto __pyx_L5;
90799225 }
90809226
9081 /* "pygame_sdl2/display.pyx":571
9227 /* "pygame_sdl2/display.pyx":589
90829228 * else:
90839229 *
90849230 * self.current_w = dm.w # <<<<<<<<<<<<<<
90869232 *
90879233 */
90889234 /*else*/ {
9089 __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_dm.w); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 571, __pyx_L1_error)
9235 __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_dm.w); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 589, __pyx_L1_error)
90909236 __Pyx_GOTREF(__pyx_t_6);
9091 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_current_w, __pyx_t_6) < 0) __PYX_ERR(0, 571, __pyx_L1_error)
9237 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_current_w, __pyx_t_6) < 0) __PYX_ERR(0, 589, __pyx_L1_error)
90929238 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
90939239
9094 /* "pygame_sdl2/display.pyx":572
9240 /* "pygame_sdl2/display.pyx":590
90959241 *
90969242 * self.current_w = dm.w
90979243 * self.current_h = dm.h # <<<<<<<<<<<<<<
90989244 *
90999245 * self.refresh_rate = dm.refresh_rate
91009246 */
9101 __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_dm.h); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 572, __pyx_L1_error)
9247 __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_dm.h); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 590, __pyx_L1_error)
91029248 __Pyx_GOTREF(__pyx_t_6);
9103 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_current_h, __pyx_t_6) < 0) __PYX_ERR(0, 572, __pyx_L1_error)
9249 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_current_h, __pyx_t_6) < 0) __PYX_ERR(0, 590, __pyx_L1_error)
91049250 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
91059251 }
91069252 __pyx_L5:;
91079253
9108 /* "pygame_sdl2/display.pyx":574
9254 /* "pygame_sdl2/display.pyx":592
91099255 * self.current_h = dm.h
91109256 *
91119257 * self.refresh_rate = dm.refresh_rate # <<<<<<<<<<<<<<
91129258 *
91139259 * # The rest of these are just guesses.
91149260 */
9115 __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_dm.refresh_rate); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 574, __pyx_L1_error)
9261 __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_dm.refresh_rate); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 592, __pyx_L1_error)
91169262 __Pyx_GOTREF(__pyx_t_6);
9117 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_refresh_rate, __pyx_t_6) < 0) __PYX_ERR(0, 574, __pyx_L1_error)
9263 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_refresh_rate, __pyx_t_6) < 0) __PYX_ERR(0, 592, __pyx_L1_error)
91189264 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
91199265
9120 /* "pygame_sdl2/display.pyx":577
9266 /* "pygame_sdl2/display.pyx":595
91219267 *
91229268 * # The rest of these are just guesses.
91239269 * self.hw = False # <<<<<<<<<<<<<<
91249270 * self.wm = True
91259271 * self.video_mem = 256 * 1024 * 1024
91269272 */
9127 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_hw, Py_False) < 0) __PYX_ERR(0, 577, __pyx_L1_error)
9128
9129 /* "pygame_sdl2/display.pyx":578
9273 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_hw, Py_False) < 0) __PYX_ERR(0, 595, __pyx_L1_error)
9274
9275 /* "pygame_sdl2/display.pyx":596
91309276 * # The rest of these are just guesses.
91319277 * self.hw = False
91329278 * self.wm = True # <<<<<<<<<<<<<<
91339279 * self.video_mem = 256 * 1024 * 1024
91349280 *
91359281 */
9136 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_wm, Py_True) < 0) __PYX_ERR(0, 578, __pyx_L1_error)
9137
9138 /* "pygame_sdl2/display.pyx":579
9282 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_wm, Py_True) < 0) __PYX_ERR(0, 596, __pyx_L1_error)
9283
9284 /* "pygame_sdl2/display.pyx":597
91399285 * self.hw = False
91409286 * self.wm = True
91419287 * self.video_mem = 256 * 1024 * 1024 # <<<<<<<<<<<<<<
91429288 *
91439289 * self.blit_hw = False
91449290 */
9145 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_video_mem, __pyx_int_268435456) < 0) __PYX_ERR(0, 579, __pyx_L1_error)
9146
9147 /* "pygame_sdl2/display.pyx":581
9291 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_video_mem, __pyx_int_268435456) < 0) __PYX_ERR(0, 597, __pyx_L1_error)
9292
9293 /* "pygame_sdl2/display.pyx":599
91489294 * self.video_mem = 256 * 1024 * 1024
91499295 *
91509296 * self.blit_hw = False # <<<<<<<<<<<<<<
91519297 * self.blit_hw_CC = False
91529298 * self.blit_hw_A = False
91539299 */
9154 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_hw, Py_False) < 0) __PYX_ERR(0, 581, __pyx_L1_error)
9155
9156 /* "pygame_sdl2/display.pyx":582
9300 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_hw, Py_False) < 0) __PYX_ERR(0, 599, __pyx_L1_error)
9301
9302 /* "pygame_sdl2/display.pyx":600
91579303 *
91589304 * self.blit_hw = False
91599305 * self.blit_hw_CC = False # <<<<<<<<<<<<<<
91609306 * self.blit_hw_A = False
91619307 *
91629308 */
9163 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_hw_CC, Py_False) < 0) __PYX_ERR(0, 582, __pyx_L1_error)
9164
9165 /* "pygame_sdl2/display.pyx":583
9309 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_hw_CC, Py_False) < 0) __PYX_ERR(0, 600, __pyx_L1_error)
9310
9311 /* "pygame_sdl2/display.pyx":601
91669312 * self.blit_hw = False
91679313 * self.blit_hw_CC = False
91689314 * self.blit_hw_A = False # <<<<<<<<<<<<<<
91699315 *
91709316 * self.blit_sw = False
91719317 */
9172 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_hw_A, Py_False) < 0) __PYX_ERR(0, 583, __pyx_L1_error)
9173
9174 /* "pygame_sdl2/display.pyx":585
9318 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_hw_A, Py_False) < 0) __PYX_ERR(0, 601, __pyx_L1_error)
9319
9320 /* "pygame_sdl2/display.pyx":603
91759321 * self.blit_hw_A = False
91769322 *
91779323 * self.blit_sw = False # <<<<<<<<<<<<<<
91789324 * self.blit_sw_CC = False
91799325 * self.blit_sw_A = False
91809326 */
9181 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_sw, Py_False) < 0) __PYX_ERR(0, 585, __pyx_L1_error)
9182
9183 /* "pygame_sdl2/display.pyx":586
9327 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_sw, Py_False) < 0) __PYX_ERR(0, 603, __pyx_L1_error)
9328
9329 /* "pygame_sdl2/display.pyx":604
91849330 *
91859331 * self.blit_sw = False
91869332 * self.blit_sw_CC = False # <<<<<<<<<<<<<<
91879333 * self.blit_sw_A = False
91889334 *
91899335 */
9190 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_sw_CC, Py_False) < 0) __PYX_ERR(0, 586, __pyx_L1_error)
9191
9192 /* "pygame_sdl2/display.pyx":587
9336 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_sw_CC, Py_False) < 0) __PYX_ERR(0, 604, __pyx_L1_error)
9337
9338 /* "pygame_sdl2/display.pyx":605
91939339 * self.blit_sw = False
91949340 * self.blit_sw_CC = False
91959341 * self.blit_sw_A = False # <<<<<<<<<<<<<<
91969342 *
91979343 * def __repr__(self):
91989344 */
9199 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_sw_A, Py_False) < 0) __PYX_ERR(0, 587, __pyx_L1_error)
9200
9201 /* "pygame_sdl2/display.pyx":530
9345 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_sw_A, Py_False) < 0) __PYX_ERR(0, 605, __pyx_L1_error)
9346
9347 /* "pygame_sdl2/display.pyx":548
92029348 * class Info(object):
92039349 *
92049350 * def __init__(self): # <<<<<<<<<<<<<<
92239369 return __pyx_r;
92249370 }
92259371
9226 /* "pygame_sdl2/display.pyx":589
9372 /* "pygame_sdl2/display.pyx":607
92279373 * self.blit_sw_A = False
92289374 *
92299375 * def __repr__(self): # <<<<<<<<<<<<<<
92579403 int __pyx_clineno = 0;
92589404 __Pyx_RefNannySetupContext("__repr__", 0);
92599405
9260 /* "pygame_sdl2/display.pyx":590
9406 /* "pygame_sdl2/display.pyx":608
92619407 *
92629408 * def __repr__(self):
92639409 * return "<Info({!r})>".format(self.__dict__) # <<<<<<<<<<<<<<
92659411 *
92669412 */
92679413 __Pyx_XDECREF(__pyx_r);
9268 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Info_r, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 590, __pyx_L1_error)
9414 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Info_r, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 608, __pyx_L1_error)
92699415 __Pyx_GOTREF(__pyx_t_2);
9270 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 590, __pyx_L1_error)
9416 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 608, __pyx_L1_error)
92719417 __Pyx_GOTREF(__pyx_t_3);
92729418 __pyx_t_4 = NULL;
92739419 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
92829428 __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
92839429 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
92849430 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9285 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 590, __pyx_L1_error)
9431 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 608, __pyx_L1_error)
92869432 __Pyx_GOTREF(__pyx_t_1);
92879433 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
92889434 __pyx_r = __pyx_t_1;
92899435 __pyx_t_1 = 0;
92909436 goto __pyx_L0;
92919437
9292 /* "pygame_sdl2/display.pyx":589
9438 /* "pygame_sdl2/display.pyx":607
92939439 * self.blit_sw_A = False
92949440 *
92959441 * def __repr__(self): # <<<<<<<<<<<<<<
93119457 return __pyx_r;
93129458 }
93139459
9314 /* "pygame_sdl2/display.pyx":593
9460 /* "pygame_sdl2/display.pyx":611
93159461 *
93169462 *
93179463 * def get_wm_info(): # <<<<<<<<<<<<<<
93459491 int __pyx_clineno = 0;
93469492 __Pyx_RefNannySetupContext("get_wm_info", 0);
93479493
9348 /* "pygame_sdl2/display.pyx":594
9494 /* "pygame_sdl2/display.pyx":612
93499495 *
93509496 * def get_wm_info():
93519497 * if main_window: # <<<<<<<<<<<<<<
93529498 * return main_window.get_wm_info()
93539499 *
93549500 */
9355 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 594, __pyx_L1_error)
9501 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 612, __pyx_L1_error)
93569502 if (__pyx_t_1) {
93579503
9358 /* "pygame_sdl2/display.pyx":595
9504 /* "pygame_sdl2/display.pyx":613
93599505 * def get_wm_info():
93609506 * if main_window:
93619507 * return main_window.get_wm_info() # <<<<<<<<<<<<<<
93639509 * return {}
93649510 */
93659511 __Pyx_XDECREF(__pyx_r);
9366 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_get_wm_info); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 595, __pyx_L1_error)
9512 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_get_wm_info); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 613, __pyx_L1_error)
93679513 __Pyx_GOTREF(__pyx_t_3);
93689514 __pyx_t_4 = NULL;
93699515 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
93779523 }
93789524 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
93799525 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
9380 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 595, __pyx_L1_error)
9526 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 613, __pyx_L1_error)
93819527 __Pyx_GOTREF(__pyx_t_2);
93829528 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
93839529 __pyx_r = __pyx_t_2;
93849530 __pyx_t_2 = 0;
93859531 goto __pyx_L0;
93869532
9387 /* "pygame_sdl2/display.pyx":594
9533 /* "pygame_sdl2/display.pyx":612
93889534 *
93899535 * def get_wm_info():
93909536 * if main_window: # <<<<<<<<<<<<<<
93939539 */
93949540 }
93959541
9396 /* "pygame_sdl2/display.pyx":597
9542 /* "pygame_sdl2/display.pyx":615
93979543 * return main_window.get_wm_info()
93989544 *
93999545 * return {} # <<<<<<<<<<<<<<
94019547 *
94029548 */
94039549 __Pyx_XDECREF(__pyx_r);
9404 __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 597, __pyx_L1_error)
9550 __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 615, __pyx_L1_error)
94059551 __Pyx_GOTREF(__pyx_t_2);
94069552 __pyx_r = __pyx_t_2;
94079553 __pyx_t_2 = 0;
94089554 goto __pyx_L0;
94099555
9410 /* "pygame_sdl2/display.pyx":593
9556 /* "pygame_sdl2/display.pyx":611
94119557 *
94129558 *
94139559 * def get_wm_info(): # <<<<<<<<<<<<<<
94289574 return __pyx_r;
94299575 }
94309576
9431 /* "pygame_sdl2/display.pyx":600
9577 /* "pygame_sdl2/display.pyx":618
94329578 *
94339579 *
94349580 * def get_num_video_displays(): # <<<<<<<<<<<<<<
94649610 int __pyx_clineno = 0;
94659611 __Pyx_RefNannySetupContext("get_num_video_displays", 0);
94669612
9467 /* "pygame_sdl2/display.pyx":605
9613 /* "pygame_sdl2/display.pyx":623
94689614 * """
94699615 *
94709616 * rv = SDL_GetNumVideoDisplays() # <<<<<<<<<<<<<<
94739619 */
94749620 __pyx_v_rv = SDL_GetNumVideoDisplays();
94759621
9476 /* "pygame_sdl2/display.pyx":607
9622 /* "pygame_sdl2/display.pyx":625
94779623 * rv = SDL_GetNumVideoDisplays()
94789624 *
94799625 * if rv < 0: # <<<<<<<<<<<<<<
94839629 __pyx_t_1 = ((__pyx_v_rv < 0) != 0);
94849630 if (unlikely(__pyx_t_1)) {
94859631
9486 /* "pygame_sdl2/display.pyx":608
9632 /* "pygame_sdl2/display.pyx":626
94879633 *
94889634 * if rv < 0:
94899635 * raise error() # <<<<<<<<<<<<<<
94909636 *
94919637 * return rv
94929638 */
9493 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 608, __pyx_L1_error)
9639 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 626, __pyx_L1_error)
94949640 __Pyx_GOTREF(__pyx_t_3);
94959641 __pyx_t_4 = NULL;
94969642 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
95049650 }
95059651 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
95069652 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
9507 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 608, __pyx_L1_error)
9653 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 626, __pyx_L1_error)
95089654 __Pyx_GOTREF(__pyx_t_2);
95099655 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
95109656 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
95119657 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9512 __PYX_ERR(0, 608, __pyx_L1_error)
9513
9514 /* "pygame_sdl2/display.pyx":607
9658 __PYX_ERR(0, 626, __pyx_L1_error)
9659
9660 /* "pygame_sdl2/display.pyx":625
95159661 * rv = SDL_GetNumVideoDisplays()
95169662 *
95179663 * if rv < 0: # <<<<<<<<<<<<<<
95209666 */
95219667 }
95229668
9523 /* "pygame_sdl2/display.pyx":610
9669 /* "pygame_sdl2/display.pyx":628
95249670 * raise error()
95259671 *
95269672 * return rv # <<<<<<<<<<<<<<
95289674 *
95299675 */
95309676 __Pyx_XDECREF(__pyx_r);
9531 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 610, __pyx_L1_error)
9677 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 628, __pyx_L1_error)
95329678 __Pyx_GOTREF(__pyx_t_2);
95339679 __pyx_r = __pyx_t_2;
95349680 __pyx_t_2 = 0;
95359681 goto __pyx_L0;
95369682
9537 /* "pygame_sdl2/display.pyx":600
9683 /* "pygame_sdl2/display.pyx":618
95389684 *
95399685 *
95409686 * def get_num_video_displays(): # <<<<<<<<<<<<<<
95559701 return __pyx_r;
95569702 }
95579703
9558 /* "pygame_sdl2/display.pyx":613
9704 /* "pygame_sdl2/display.pyx":631
95599705 *
95609706 *
95619707 * def list_modes(depth=0, flags=0, display=0): # <<<<<<<<<<<<<<
96179763 }
96189764 }
96199765 if (unlikely(kw_args > 0)) {
9620 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "list_modes") < 0)) __PYX_ERR(0, 613, __pyx_L3_error)
9766 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "list_modes") < 0)) __PYX_ERR(0, 631, __pyx_L3_error)
96219767 }
96229768 } else {
96239769 switch (PyTuple_GET_SIZE(__pyx_args)) {
96379783 }
96389784 goto __pyx_L4_argument_unpacking_done;
96399785 __pyx_L5_argtuple_error:;
9640 __Pyx_RaiseArgtupleInvalid("list_modes", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 613, __pyx_L3_error)
9786 __Pyx_RaiseArgtupleInvalid("list_modes", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 631, __pyx_L3_error)
96419787 __pyx_L3_error:;
96429788 __Pyx_AddTraceback("pygame_sdl2.display.list_modes", __pyx_clineno, __pyx_lineno, __pyx_filename);
96439789 __Pyx_RefNannyFinishContext();
96719817 int __pyx_clineno = 0;
96729818 __Pyx_RefNannySetupContext("list_modes", 0);
96739819
9674 /* "pygame_sdl2/display.pyx":623
9820 /* "pygame_sdl2/display.pyx":641
96759821 * cdef SDL_DisplayMode mode
96769822 *
96779823 * rv = [ ] # <<<<<<<<<<<<<<
96789824 *
96799825 * num_modes = SDL_GetNumDisplayModes(display)
96809826 */
9681 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L1_error)
9827 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 641, __pyx_L1_error)
96829828 __Pyx_GOTREF(__pyx_t_1);
96839829 __pyx_v_rv = ((PyObject*)__pyx_t_1);
96849830 __pyx_t_1 = 0;
96859831
9686 /* "pygame_sdl2/display.pyx":625
9832 /* "pygame_sdl2/display.pyx":643
96879833 * rv = [ ]
96889834 *
96899835 * num_modes = SDL_GetNumDisplayModes(display) # <<<<<<<<<<<<<<
96909836 * if num_modes < 0:
96919837 * raise error()
96929838 */
9693 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_display); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 625, __pyx_L1_error)
9839 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_display); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 643, __pyx_L1_error)
96949840 __pyx_v_num_modes = SDL_GetNumDisplayModes(__pyx_t_2);
96959841
9696 /* "pygame_sdl2/display.pyx":626
9842 /* "pygame_sdl2/display.pyx":644
96979843 *
96989844 * num_modes = SDL_GetNumDisplayModes(display)
96999845 * if num_modes < 0: # <<<<<<<<<<<<<<
97039849 __pyx_t_3 = ((__pyx_v_num_modes < 0) != 0);
97049850 if (unlikely(__pyx_t_3)) {
97059851
9706 /* "pygame_sdl2/display.pyx":627
9852 /* "pygame_sdl2/display.pyx":645
97079853 * num_modes = SDL_GetNumDisplayModes(display)
97089854 * if num_modes < 0:
97099855 * raise error() # <<<<<<<<<<<<<<
97109856 *
97119857 * for 0 <= i < num_modes:
97129858 */
9713 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 627, __pyx_L1_error)
9859 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 645, __pyx_L1_error)
97149860 __Pyx_GOTREF(__pyx_t_4);
97159861 __pyx_t_5 = NULL;
97169862 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
97249870 }
97259871 __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
97269872 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9727 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 627, __pyx_L1_error)
9873 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 645, __pyx_L1_error)
97289874 __Pyx_GOTREF(__pyx_t_1);
97299875 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
97309876 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
97319877 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9732 __PYX_ERR(0, 627, __pyx_L1_error)
9733
9734 /* "pygame_sdl2/display.pyx":626
9878 __PYX_ERR(0, 645, __pyx_L1_error)
9879
9880 /* "pygame_sdl2/display.pyx":644
97359881 *
97369882 * num_modes = SDL_GetNumDisplayModes(display)
97379883 * if num_modes < 0: # <<<<<<<<<<<<<<
97409886 */
97419887 }
97429888
9743 /* "pygame_sdl2/display.pyx":629
9889 /* "pygame_sdl2/display.pyx":647
97449890 * raise error()
97459891 *
97469892 * for 0 <= i < num_modes: # <<<<<<<<<<<<<<
97509896 __pyx_t_2 = __pyx_v_num_modes;
97519897 for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {
97529898
9753 /* "pygame_sdl2/display.pyx":630
9899 /* "pygame_sdl2/display.pyx":648
97549900 *
97559901 * for 0 <= i < num_modes:
97569902 * if SDL_GetDisplayMode(display, i, &mode) == 0: # <<<<<<<<<<<<<<
97579903 * t = (mode.w, mode.h)
97589904 * if t not in rv:
97599905 */
9760 __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_display); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 630, __pyx_L1_error)
9906 __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_display); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 648, __pyx_L1_error)
97619907 __pyx_t_3 = ((SDL_GetDisplayMode(__pyx_t_6, __pyx_v_i, (&__pyx_v_mode)) == 0) != 0);
97629908 if (__pyx_t_3) {
97639909
9764 /* "pygame_sdl2/display.pyx":631
9910 /* "pygame_sdl2/display.pyx":649
97659911 * for 0 <= i < num_modes:
97669912 * if SDL_GetDisplayMode(display, i, &mode) == 0:
97679913 * t = (mode.w, mode.h) # <<<<<<<<<<<<<<
97689914 * if t not in rv:
97699915 * rv.append(t)
97709916 */
9771 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_mode.w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 631, __pyx_L1_error)
9917 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_mode.w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 649, __pyx_L1_error)
97729918 __Pyx_GOTREF(__pyx_t_1);
9773 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_mode.h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 631, __pyx_L1_error)
9919 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_mode.h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 649, __pyx_L1_error)
97749920 __Pyx_GOTREF(__pyx_t_4);
9775 __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 631, __pyx_L1_error)
9921 __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 649, __pyx_L1_error)
97769922 __Pyx_GOTREF(__pyx_t_5);
97779923 __Pyx_GIVEREF(__pyx_t_1);
97789924 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
97839929 __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_5);
97849930 __pyx_t_5 = 0;
97859931
9786 /* "pygame_sdl2/display.pyx":632
9932 /* "pygame_sdl2/display.pyx":650
97879933 * if SDL_GetDisplayMode(display, i, &mode) == 0:
97889934 * t = (mode.w, mode.h)
97899935 * if t not in rv: # <<<<<<<<<<<<<<
97909936 * rv.append(t)
97919937 *
97929938 */
9793 __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_t, __pyx_v_rv, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 632, __pyx_L1_error)
9939 __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_t, __pyx_v_rv, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 650, __pyx_L1_error)
97949940 __pyx_t_7 = (__pyx_t_3 != 0);
97959941 if (__pyx_t_7) {
97969942
9797 /* "pygame_sdl2/display.pyx":633
9943 /* "pygame_sdl2/display.pyx":651
97989944 * t = (mode.w, mode.h)
97999945 * if t not in rv:
98009946 * rv.append(t) # <<<<<<<<<<<<<<
98019947 *
98029948 * return rv
98039949 */
9804 __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_rv, __pyx_v_t); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 633, __pyx_L1_error)
9805
9806 /* "pygame_sdl2/display.pyx":632
9950 __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_rv, __pyx_v_t); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 651, __pyx_L1_error)
9951
9952 /* "pygame_sdl2/display.pyx":650
98079953 * if SDL_GetDisplayMode(display, i, &mode) == 0:
98089954 * t = (mode.w, mode.h)
98099955 * if t not in rv: # <<<<<<<<<<<<<<
98129958 */
98139959 }
98149960
9815 /* "pygame_sdl2/display.pyx":630
9961 /* "pygame_sdl2/display.pyx":648
98169962 *
98179963 * for 0 <= i < num_modes:
98189964 * if SDL_GetDisplayMode(display, i, &mode) == 0: # <<<<<<<<<<<<<<
98229968 }
98239969 }
98249970
9825 /* "pygame_sdl2/display.pyx":635
9971 /* "pygame_sdl2/display.pyx":653
98269972 * rv.append(t)
98279973 *
98289974 * return rv # <<<<<<<<<<<<<<
98349980 __pyx_r = __pyx_v_rv;
98359981 goto __pyx_L0;
98369982
9837 /* "pygame_sdl2/display.pyx":613
9983 /* "pygame_sdl2/display.pyx":631
98389984 *
98399985 *
98409986 * def list_modes(depth=0, flags=0, display=0): # <<<<<<<<<<<<<<
985710003 return __pyx_r;
985810004 }
985910005
9860 /* "pygame_sdl2/display.pyx":638
10006 /* "pygame_sdl2/display.pyx":656
986110007 *
986210008 *
986310009 * def mode_ok(size, flags=0, depth=0): # <<<<<<<<<<<<<<
991610062 }
991710063 }
991810064 if (unlikely(kw_args > 0)) {
9919 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mode_ok") < 0)) __PYX_ERR(0, 638, __pyx_L3_error)
10065 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mode_ok") < 0)) __PYX_ERR(0, 656, __pyx_L3_error)
992010066 }
992110067 } else {
992210068 switch (PyTuple_GET_SIZE(__pyx_args)) {
993510081 }
993610082 goto __pyx_L4_argument_unpacking_done;
993710083 __pyx_L5_argtuple_error:;
9938 __Pyx_RaiseArgtupleInvalid("mode_ok", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 638, __pyx_L3_error)
10084 __Pyx_RaiseArgtupleInvalid("mode_ok", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 656, __pyx_L3_error)
993910085 __pyx_L3_error:;
994010086 __Pyx_AddTraceback("pygame_sdl2.display.mode_ok", __pyx_clineno, __pyx_lineno, __pyx_filename);
994110087 __Pyx_RefNannyFinishContext();
996110107 int __pyx_clineno = 0;
996210108 __Pyx_RefNannySetupContext("mode_ok", 0);
996310109
9964 /* "pygame_sdl2/display.pyx":643
10110 /* "pygame_sdl2/display.pyx":661
996510111 * """
996610112 *
996710113 * return tuple(size) in list_modes() # <<<<<<<<<<<<<<
996910115 * def gl_reset_attributes():
997010116 */
997110117 __Pyx_XDECREF(__pyx_r);
9972 __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 643, __pyx_L1_error)
10118 __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 661, __pyx_L1_error)
997310119 __Pyx_GOTREF(__pyx_t_1);
9974 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_list_modes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 643, __pyx_L1_error)
10120 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_list_modes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 661, __pyx_L1_error)
997510121 __Pyx_GOTREF(__pyx_t_3);
997610122 __pyx_t_4 = NULL;
997710123 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
998510131 }
998610132 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
998710133 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
9988 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 643, __pyx_L1_error)
10134 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 661, __pyx_L1_error)
998910135 __Pyx_GOTREF(__pyx_t_2);
999010136 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9991 __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 643, __pyx_L1_error)
10137 __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 661, __pyx_L1_error)
999210138 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
999310139 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9994 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 643, __pyx_L1_error)
10140 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 661, __pyx_L1_error)
999510141 __Pyx_GOTREF(__pyx_t_2);
999610142 __pyx_r = __pyx_t_2;
999710143 __pyx_t_2 = 0;
999810144 goto __pyx_L0;
999910145
10000 /* "pygame_sdl2/display.pyx":638
10146 /* "pygame_sdl2/display.pyx":656
1000110147 *
1000210148 *
1000310149 * def mode_ok(size, flags=0, depth=0): # <<<<<<<<<<<<<<
1001910165 return __pyx_r;
1002010166 }
1002110167
10022 /* "pygame_sdl2/display.pyx":645
10168 /* "pygame_sdl2/display.pyx":663
1002310169 * return tuple(size) in list_modes()
1002410170 *
1002510171 * def gl_reset_attributes(): # <<<<<<<<<<<<<<
1004610192 __Pyx_RefNannyDeclarations
1004710193 __Pyx_RefNannySetupContext("gl_reset_attributes", 0);
1004810194
10049 /* "pygame_sdl2/display.pyx":646
10195 /* "pygame_sdl2/display.pyx":664
1005010196 *
1005110197 * def gl_reset_attributes():
1005210198 * SDL_GL_ResetAttributes() # <<<<<<<<<<<<<<
1005510201 */
1005610202 SDL_GL_ResetAttributes();
1005710203
10058 /* "pygame_sdl2/display.pyx":645
10204 /* "pygame_sdl2/display.pyx":663
1005910205 * return tuple(size) in list_modes()
1006010206 *
1006110207 * def gl_reset_attributes(): # <<<<<<<<<<<<<<
1007010216 return __pyx_r;
1007110217 }
1007210218
10073 /* "pygame_sdl2/display.pyx":648
10219 /* "pygame_sdl2/display.pyx":666
1007410220 * SDL_GL_ResetAttributes()
1007510221 *
1007610222 * def gl_set_attribute(flag, value): # <<<<<<<<<<<<<<
1011310259 case 1:
1011410260 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
1011510261 else {
10116 __Pyx_RaiseArgtupleInvalid("gl_set_attribute", 1, 2, 2, 1); __PYX_ERR(0, 648, __pyx_L3_error)
10262 __Pyx_RaiseArgtupleInvalid("gl_set_attribute", 1, 2, 2, 1); __PYX_ERR(0, 666, __pyx_L3_error)
1011710263 }
1011810264 }
1011910265 if (unlikely(kw_args > 0)) {
10120 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gl_set_attribute") < 0)) __PYX_ERR(0, 648, __pyx_L3_error)
10266 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gl_set_attribute") < 0)) __PYX_ERR(0, 666, __pyx_L3_error)
1012110267 }
1012210268 } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
1012310269 goto __pyx_L5_argtuple_error;
1013010276 }
1013110277 goto __pyx_L4_argument_unpacking_done;
1013210278 __pyx_L5_argtuple_error:;
10133 __Pyx_RaiseArgtupleInvalid("gl_set_attribute", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 648, __pyx_L3_error)
10279 __Pyx_RaiseArgtupleInvalid("gl_set_attribute", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 666, __pyx_L3_error)
1013410280 __pyx_L3_error:;
1013510281 __Pyx_AddTraceback("pygame_sdl2.display.gl_set_attribute", __pyx_clineno, __pyx_lineno, __pyx_filename);
1013610282 __Pyx_RefNannyFinishContext();
1015710303 int __pyx_clineno = 0;
1015810304 __Pyx_RefNannySetupContext("gl_set_attribute", 0);
1015910305
10160 /* "pygame_sdl2/display.pyx":650
10306 /* "pygame_sdl2/display.pyx":668
1016110307 * def gl_set_attribute(flag, value):
1016210308 *
1016310309 * if flag == GL_SWAP_CONTROL: # <<<<<<<<<<<<<<
1016410310 * if ios:
1016510311 * return
1016610312 */
10167 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_GL_SWAP_CONTROL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 650, __pyx_L1_error)
10313 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_GL_SWAP_CONTROL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error)
1016810314 __Pyx_GOTREF(__pyx_t_1);
10169 __pyx_t_2 = PyObject_RichCompare(__pyx_v_flag, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 650, __pyx_L1_error)
10315 __pyx_t_2 = PyObject_RichCompare(__pyx_v_flag, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 668, __pyx_L1_error)
1017010316 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10171 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 650, __pyx_L1_error)
10317 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 668, __pyx_L1_error)
1017210318 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1017310319 if (__pyx_t_3) {
1017410320
10175 /* "pygame_sdl2/display.pyx":651
10321 /* "pygame_sdl2/display.pyx":669
1017610322 *
1017710323 * if flag == GL_SWAP_CONTROL:
1017810324 * if ios: # <<<<<<<<<<<<<<
1017910325 * return
1018010326 *
1018110327 */
10182 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ios); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 651, __pyx_L1_error)
10328 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ios); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 669, __pyx_L1_error)
1018310329 __Pyx_GOTREF(__pyx_t_2);
10184 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 651, __pyx_L1_error)
10330 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 669, __pyx_L1_error)
1018510331 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1018610332 if (__pyx_t_3) {
1018710333
10188 /* "pygame_sdl2/display.pyx":652
10334 /* "pygame_sdl2/display.pyx":670
1018910335 * if flag == GL_SWAP_CONTROL:
1019010336 * if ios:
1019110337 * return # <<<<<<<<<<<<<<
1019610342 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
1019710343 goto __pyx_L0;
1019810344
10199 /* "pygame_sdl2/display.pyx":651
10345 /* "pygame_sdl2/display.pyx":669
1020010346 *
1020110347 * if flag == GL_SWAP_CONTROL:
1020210348 * if ios: # <<<<<<<<<<<<<<
1020510351 */
1020610352 }
1020710353
10208 /* "pygame_sdl2/display.pyx":659
10354 /* "pygame_sdl2/display.pyx":677
1020910355 * # to deal with the case where the negative interval isn't
1021010356 * # supported. Then give up and carry on.
1021110357 * if SDL_GL_SetSwapInterval(value): # <<<<<<<<<<<<<<
1021210358 * SDL_GL_SetSwapInterval(-value)
1021310359 *
1021410360 */
10215 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 659, __pyx_L1_error)
10361 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 677, __pyx_L1_error)
1021610362 __pyx_t_3 = (SDL_GL_SetSwapInterval(__pyx_t_4) != 0);
1021710363 if (__pyx_t_3) {
1021810364
10219 /* "pygame_sdl2/display.pyx":660
10365 /* "pygame_sdl2/display.pyx":678
1022010366 * # supported. Then give up and carry on.
1022110367 * if SDL_GL_SetSwapInterval(value):
1022210368 * SDL_GL_SetSwapInterval(-value) # <<<<<<<<<<<<<<
1022310369 *
1022410370 * default_swap_control = value
1022510371 */
10226 __pyx_t_2 = PyNumber_Negative(__pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 660, __pyx_L1_error)
10372 __pyx_t_2 = PyNumber_Negative(__pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 678, __pyx_L1_error)
1022710373 __Pyx_GOTREF(__pyx_t_2);
10228 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 660, __pyx_L1_error)
10374 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 678, __pyx_L1_error)
1022910375 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1023010376 (void)(SDL_GL_SetSwapInterval(__pyx_t_4));
1023110377
10232 /* "pygame_sdl2/display.pyx":659
10378 /* "pygame_sdl2/display.pyx":677
1023310379 * # to deal with the case where the negative interval isn't
1023410380 * # supported. Then give up and carry on.
1023510381 * if SDL_GL_SetSwapInterval(value): # <<<<<<<<<<<<<<
1023810384 */
1023910385 }
1024010386
10241 /* "pygame_sdl2/display.pyx":662
10387 /* "pygame_sdl2/display.pyx":680
1024210388 * SDL_GL_SetSwapInterval(-value)
1024310389 *
1024410390 * default_swap_control = value # <<<<<<<<<<<<<<
1024510391 * return
1024610392 *
1024710393 */
10248 if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_swap_control, __pyx_v_value) < 0) __PYX_ERR(0, 662, __pyx_L1_error)
10249
10250 /* "pygame_sdl2/display.pyx":663
10394 if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_swap_control, __pyx_v_value) < 0) __PYX_ERR(0, 680, __pyx_L1_error)
10395
10396 /* "pygame_sdl2/display.pyx":681
1025110397 *
1025210398 * default_swap_control = value
1025310399 * return # <<<<<<<<<<<<<<
1025810404 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
1025910405 goto __pyx_L0;
1026010406
10261 /* "pygame_sdl2/display.pyx":650
10407 /* "pygame_sdl2/display.pyx":668
1026210408 * def gl_set_attribute(flag, value):
1026310409 *
1026410410 * if flag == GL_SWAP_CONTROL: # <<<<<<<<<<<<<<
1026710413 */
1026810414 }
1026910415
10270 /* "pygame_sdl2/display.pyx":665
10416 /* "pygame_sdl2/display.pyx":683
1027110417 * return
1027210418 *
1027310419 * if SDL_GL_SetAttribute(flag, value): # <<<<<<<<<<<<<<
1027410420 * raise error()
1027510421 *
1027610422 */
10277 __pyx_t_5 = ((SDL_GLattr)__Pyx_PyInt_As_SDL_GLattr(__pyx_v_flag)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 665, __pyx_L1_error)
10278 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 665, __pyx_L1_error)
10423 __pyx_t_5 = ((SDL_GLattr)__Pyx_PyInt_As_SDL_GLattr(__pyx_v_flag)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 683, __pyx_L1_error)
10424 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 683, __pyx_L1_error)
1027910425 __pyx_t_3 = (SDL_GL_SetAttribute(__pyx_t_5, __pyx_t_4) != 0);
1028010426 if (unlikely(__pyx_t_3)) {
1028110427
10282 /* "pygame_sdl2/display.pyx":666
10428 /* "pygame_sdl2/display.pyx":684
1028310429 *
1028410430 * if SDL_GL_SetAttribute(flag, value):
1028510431 * raise error() # <<<<<<<<<<<<<<
1028610432 *
1028710433 * def gl_get_attribute(flag):
1028810434 */
10289 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 666, __pyx_L1_error)
10435 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 684, __pyx_L1_error)
1029010436 __Pyx_GOTREF(__pyx_t_1);
1029110437 __pyx_t_6 = NULL;
1029210438 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
1030010446 }
1030110447 __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
1030210448 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
10303 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 666, __pyx_L1_error)
10449 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 684, __pyx_L1_error)
1030410450 __Pyx_GOTREF(__pyx_t_2);
1030510451 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1030610452 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
1030710453 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10308 __PYX_ERR(0, 666, __pyx_L1_error)
10309
10310 /* "pygame_sdl2/display.pyx":665
10454 __PYX_ERR(0, 684, __pyx_L1_error)
10455
10456 /* "pygame_sdl2/display.pyx":683
1031110457 * return
1031210458 *
1031310459 * if SDL_GL_SetAttribute(flag, value): # <<<<<<<<<<<<<<
1031610462 */
1031710463 }
1031810464
10319 /* "pygame_sdl2/display.pyx":648
10465 /* "pygame_sdl2/display.pyx":666
1032010466 * SDL_GL_ResetAttributes()
1032110467 *
1032210468 * def gl_set_attribute(flag, value): # <<<<<<<<<<<<<<
1033910485 return __pyx_r;
1034010486 }
1034110487
10342 /* "pygame_sdl2/display.pyx":668
10488 /* "pygame_sdl2/display.pyx":686
1034310489 * raise error()
1034410490 *
1034510491 * def gl_get_attribute(flag): # <<<<<<<<<<<<<<
1037510521 int __pyx_clineno = 0;
1037610522 __Pyx_RefNannySetupContext("gl_get_attribute", 0);
1037710523
10378 /* "pygame_sdl2/display.pyx":671
10524 /* "pygame_sdl2/display.pyx":689
1037910525 * cdef int rv
1038010526 *
1038110527 * if flag == GL_SWAP_CONTROL: # <<<<<<<<<<<<<<
1038210528 * return SDL_GL_GetSwapInterval()
1038310529 *
1038410530 */
10385 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_GL_SWAP_CONTROL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 671, __pyx_L1_error)
10531 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_GL_SWAP_CONTROL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 689, __pyx_L1_error)
1038610532 __Pyx_GOTREF(__pyx_t_1);
10387 __pyx_t_2 = PyObject_RichCompare(__pyx_v_flag, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 671, __pyx_L1_error)
10533 __pyx_t_2 = PyObject_RichCompare(__pyx_v_flag, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 689, __pyx_L1_error)
1038810534 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10389 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 671, __pyx_L1_error)
10535 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 689, __pyx_L1_error)
1039010536 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1039110537 if (__pyx_t_3) {
1039210538
10393 /* "pygame_sdl2/display.pyx":672
10539 /* "pygame_sdl2/display.pyx":690
1039410540 *
1039510541 * if flag == GL_SWAP_CONTROL:
1039610542 * return SDL_GL_GetSwapInterval() # <<<<<<<<<<<<<<
1039810544 * if SDL_GL_GetAttribute(flag, &rv):
1039910545 */
1040010546 __Pyx_XDECREF(__pyx_r);
10401 __pyx_t_2 = __Pyx_PyInt_From_int(SDL_GL_GetSwapInterval()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 672, __pyx_L1_error)
10547 __pyx_t_2 = __Pyx_PyInt_From_int(SDL_GL_GetSwapInterval()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 690, __pyx_L1_error)
1040210548 __Pyx_GOTREF(__pyx_t_2);
1040310549 __pyx_r = __pyx_t_2;
1040410550 __pyx_t_2 = 0;
1040510551 goto __pyx_L0;
1040610552
10407 /* "pygame_sdl2/display.pyx":671
10553 /* "pygame_sdl2/display.pyx":689
1040810554 * cdef int rv
1040910555 *
1041010556 * if flag == GL_SWAP_CONTROL: # <<<<<<<<<<<<<<
1041310559 */
1041410560 }
1041510561
10416 /* "pygame_sdl2/display.pyx":674
10562 /* "pygame_sdl2/display.pyx":692
1041710563 * return SDL_GL_GetSwapInterval()
1041810564 *
1041910565 * if SDL_GL_GetAttribute(flag, &rv): # <<<<<<<<<<<<<<
1042010566 * raise error()
1042110567 *
1042210568 */
10423 __pyx_t_4 = ((SDL_GLattr)__Pyx_PyInt_As_SDL_GLattr(__pyx_v_flag)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 674, __pyx_L1_error)
10569 __pyx_t_4 = ((SDL_GLattr)__Pyx_PyInt_As_SDL_GLattr(__pyx_v_flag)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 692, __pyx_L1_error)
1042410570 __pyx_t_3 = (SDL_GL_GetAttribute(__pyx_t_4, (&__pyx_v_rv)) != 0);
1042510571 if (unlikely(__pyx_t_3)) {
1042610572
10427 /* "pygame_sdl2/display.pyx":675
10573 /* "pygame_sdl2/display.pyx":693
1042810574 *
1042910575 * if SDL_GL_GetAttribute(flag, &rv):
1043010576 * raise error() # <<<<<<<<<<<<<<
1043110577 *
1043210578 * return rv
1043310579 */
10434 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 675, __pyx_L1_error)
10580 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 693, __pyx_L1_error)
1043510581 __Pyx_GOTREF(__pyx_t_1);
1043610582 __pyx_t_5 = NULL;
1043710583 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
1044510591 }
1044610592 __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
1044710593 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10448 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 675, __pyx_L1_error)
10594 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 693, __pyx_L1_error)
1044910595 __Pyx_GOTREF(__pyx_t_2);
1045010596 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1045110597 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
1045210598 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10453 __PYX_ERR(0, 675, __pyx_L1_error)
10454
10455 /* "pygame_sdl2/display.pyx":674
10599 __PYX_ERR(0, 693, __pyx_L1_error)
10600
10601 /* "pygame_sdl2/display.pyx":692
1045610602 * return SDL_GL_GetSwapInterval()
1045710603 *
1045810604 * if SDL_GL_GetAttribute(flag, &rv): # <<<<<<<<<<<<<<
1046110607 */
1046210608 }
1046310609
10464 /* "pygame_sdl2/display.pyx":677
10610 /* "pygame_sdl2/display.pyx":695
1046510611 * raise error()
1046610612 *
1046710613 * return rv # <<<<<<<<<<<<<<
1046910615 * def gl_load_library(path):
1047010616 */
1047110617 __Pyx_XDECREF(__pyx_r);
10472 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 677, __pyx_L1_error)
10618 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 695, __pyx_L1_error)
1047310619 __Pyx_GOTREF(__pyx_t_2);
1047410620 __pyx_r = __pyx_t_2;
1047510621 __pyx_t_2 = 0;
1047610622 goto __pyx_L0;
1047710623
10478 /* "pygame_sdl2/display.pyx":668
10624 /* "pygame_sdl2/display.pyx":686
1047910625 * raise error()
1048010626 *
1048110627 * def gl_get_attribute(flag): # <<<<<<<<<<<<<<
1049610642 return __pyx_r;
1049710643 }
1049810644
10499 /* "pygame_sdl2/display.pyx":679
10645 /* "pygame_sdl2/display.pyx":697
1050010646 * return rv
1050110647 *
1050210648 * def gl_load_library(path): # <<<<<<<<<<<<<<
1053210678 int __pyx_clineno = 0;
1053310679 __Pyx_RefNannySetupContext("gl_load_library", 0);
1053410680
10535 /* "pygame_sdl2/display.pyx":680
10681 /* "pygame_sdl2/display.pyx":698
1053610682 *
1053710683 * def gl_load_library(path):
1053810684 * if path is None: # <<<<<<<<<<<<<<
1054310689 __pyx_t_2 = (__pyx_t_1 != 0);
1054410690 if (__pyx_t_2) {
1054510691
10546 /* "pygame_sdl2/display.pyx":681
10692 /* "pygame_sdl2/display.pyx":699
1054710693 * def gl_load_library(path):
1054810694 * if path is None:
1054910695 * if SDL_GL_LoadLibrary(NULL): # <<<<<<<<<<<<<<
1055310699 __pyx_t_2 = (SDL_GL_LoadLibrary(NULL) != 0);
1055410700 if (unlikely(__pyx_t_2)) {
1055510701
10556 /* "pygame_sdl2/display.pyx":682
10702 /* "pygame_sdl2/display.pyx":700
1055710703 * if path is None:
1055810704 * if SDL_GL_LoadLibrary(NULL):
1055910705 * raise error() # <<<<<<<<<<<<<<
1056010706 * else:
1056110707 * if SDL_GL_LoadLibrary(path):
1056210708 */
10563 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 682, __pyx_L1_error)
10709 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 700, __pyx_L1_error)
1056410710 __Pyx_GOTREF(__pyx_t_4);
1056510711 __pyx_t_5 = NULL;
1056610712 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
1057410720 }
1057510721 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
1057610722 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10577 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 682, __pyx_L1_error)
10723 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 700, __pyx_L1_error)
1057810724 __Pyx_GOTREF(__pyx_t_3);
1057910725 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1058010726 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
1058110727 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10582 __PYX_ERR(0, 682, __pyx_L1_error)
10583
10584 /* "pygame_sdl2/display.pyx":681
10728 __PYX_ERR(0, 700, __pyx_L1_error)
10729
10730 /* "pygame_sdl2/display.pyx":699
1058510731 * def gl_load_library(path):
1058610732 * if path is None:
1058710733 * if SDL_GL_LoadLibrary(NULL): # <<<<<<<<<<<<<<
1059010736 */
1059110737 }
1059210738
10593 /* "pygame_sdl2/display.pyx":680
10739 /* "pygame_sdl2/display.pyx":698
1059410740 *
1059510741 * def gl_load_library(path):
1059610742 * if path is None: # <<<<<<<<<<<<<<
1060010746 goto __pyx_L3;
1060110747 }
1060210748
10603 /* "pygame_sdl2/display.pyx":684
10749 /* "pygame_sdl2/display.pyx":702
1060410750 * raise error()
1060510751 * else:
1060610752 * if SDL_GL_LoadLibrary(path): # <<<<<<<<<<<<<<
1060810754 *
1060910755 */
1061010756 /*else*/ {
10611 __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_path); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 684, __pyx_L1_error)
10757 __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_path); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 702, __pyx_L1_error)
1061210758 __pyx_t_2 = (SDL_GL_LoadLibrary(__pyx_t_6) != 0);
1061310759 if (unlikely(__pyx_t_2)) {
1061410760
10615 /* "pygame_sdl2/display.pyx":685
10761 /* "pygame_sdl2/display.pyx":703
1061610762 * else:
1061710763 * if SDL_GL_LoadLibrary(path):
1061810764 * raise error() # <<<<<<<<<<<<<<
1061910765 *
1062010766 * def gl_unload_library():
1062110767 */
10622 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 685, __pyx_L1_error)
10768 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 703, __pyx_L1_error)
1062310769 __Pyx_GOTREF(__pyx_t_4);
1062410770 __pyx_t_5 = NULL;
1062510771 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
1063310779 }
1063410780 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
1063510781 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10636 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 685, __pyx_L1_error)
10782 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 703, __pyx_L1_error)
1063710783 __Pyx_GOTREF(__pyx_t_3);
1063810784 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1063910785 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
1064010786 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10641 __PYX_ERR(0, 685, __pyx_L1_error)
10642
10643 /* "pygame_sdl2/display.pyx":684
10787 __PYX_ERR(0, 703, __pyx_L1_error)
10788
10789 /* "pygame_sdl2/display.pyx":702
1064410790 * raise error()
1064510791 * else:
1064610792 * if SDL_GL_LoadLibrary(path): # <<<<<<<<<<<<<<
1065110797 }
1065210798 __pyx_L3:;
1065310799
10654 /* "pygame_sdl2/display.pyx":679
10800 /* "pygame_sdl2/display.pyx":697
1065510801 * return rv
1065610802 *
1065710803 * def gl_load_library(path): # <<<<<<<<<<<<<<
1067410820 return __pyx_r;
1067510821 }
1067610822
10677 /* "pygame_sdl2/display.pyx":687
10823 /* "pygame_sdl2/display.pyx":705
1067810824 * raise error()
1067910825 *
1068010826 * def gl_unload_library(): # <<<<<<<<<<<<<<
1070110847 __Pyx_RefNannyDeclarations
1070210848 __Pyx_RefNannySetupContext("gl_unload_library", 0);
1070310849
10704 /* "pygame_sdl2/display.pyx":688
10850 /* "pygame_sdl2/display.pyx":706
1070510851 *
1070610852 * def gl_unload_library():
1070710853 * SDL_GL_UnloadLibrary() # <<<<<<<<<<<<<<
1071010856 */
1071110857 SDL_GL_UnloadLibrary();
1071210858
10713 /* "pygame_sdl2/display.pyx":687
10859 /* "pygame_sdl2/display.pyx":705
1071410860 * raise error()
1071510861 *
1071610862 * def gl_unload_library(): # <<<<<<<<<<<<<<
1072510871 return __pyx_r;
1072610872 }
1072710873
10728 /* "pygame_sdl2/display.pyx":690
10874 /* "pygame_sdl2/display.pyx":708
1072910875 * SDL_GL_UnloadLibrary()
1073010876 *
1073110877 * def get_active(): # <<<<<<<<<<<<<<
1075910905 int __pyx_clineno = 0;
1076010906 __Pyx_RefNannySetupContext("get_active", 0);
1076110907
10762 /* "pygame_sdl2/display.pyx":691
10908 /* "pygame_sdl2/display.pyx":709
1076310909 *
1076410910 * def get_active():
1076510911 * if main_window: # <<<<<<<<<<<<<<
1076610912 * return main_window.get_active()
1076710913 * return False
1076810914 */
10769 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 691, __pyx_L1_error)
10915 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 709, __pyx_L1_error)
1077010916 if (__pyx_t_1) {
1077110917
10772 /* "pygame_sdl2/display.pyx":692
10918 /* "pygame_sdl2/display.pyx":710
1077310919 * def get_active():
1077410920 * if main_window:
1077510921 * return main_window.get_active() # <<<<<<<<<<<<<<
1077710923 *
1077810924 */
1077910925 __Pyx_XDECREF(__pyx_r);
10780 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_get_active); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 692, __pyx_L1_error)
10926 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_get_active); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 710, __pyx_L1_error)
1078110927 __Pyx_GOTREF(__pyx_t_3);
1078210928 __pyx_t_4 = NULL;
1078310929 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
1079110937 }
1079210938 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
1079310939 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
10794 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __pyx_L1_error)
10940 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 710, __pyx_L1_error)
1079510941 __Pyx_GOTREF(__pyx_t_2);
1079610942 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1079710943 __pyx_r = __pyx_t_2;
1079810944 __pyx_t_2 = 0;
1079910945 goto __pyx_L0;
1080010946
10801 /* "pygame_sdl2/display.pyx":691
10947 /* "pygame_sdl2/display.pyx":709
1080210948 *
1080310949 * def get_active():
1080410950 * if main_window: # <<<<<<<<<<<<<<
1080710953 */
1080810954 }
1080910955
10810 /* "pygame_sdl2/display.pyx":693
10956 /* "pygame_sdl2/display.pyx":711
1081110957 * if main_window:
1081210958 * return main_window.get_active()
1081310959 * return False # <<<<<<<<<<<<<<
1081910965 __pyx_r = Py_False;
1082010966 goto __pyx_L0;
1082110967
10822 /* "pygame_sdl2/display.pyx":690
10968 /* "pygame_sdl2/display.pyx":708
1082310969 * SDL_GL_UnloadLibrary()
1082410970 *
1082510971 * def get_active(): # <<<<<<<<<<<<<<
1084010986 return __pyx_r;
1084110987 }
1084210988
10843 /* "pygame_sdl2/display.pyx":695
10989 /* "pygame_sdl2/display.pyx":713
1084410990 * return False
1084510991 *
1084610992 * def iconify(): # <<<<<<<<<<<<<<
1087411020 int __pyx_clineno = 0;
1087511021 __Pyx_RefNannySetupContext("iconify", 0);
1087611022
10877 /* "pygame_sdl2/display.pyx":696
11023 /* "pygame_sdl2/display.pyx":714
1087811024 *
1087911025 * def iconify():
1088011026 * if main_window: # <<<<<<<<<<<<<<
1088111027 * return main_window.iconify()
1088211028 *
1088311029 */
10884 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 696, __pyx_L1_error)
11030 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 714, __pyx_L1_error)
1088511031 if (__pyx_t_1) {
1088611032
10887 /* "pygame_sdl2/display.pyx":697
11033 /* "pygame_sdl2/display.pyx":715
1088811034 * def iconify():
1088911035 * if main_window:
1089011036 * return main_window.iconify() # <<<<<<<<<<<<<<
1089211038 * return False
1089311039 */
1089411040 __Pyx_XDECREF(__pyx_r);
10895 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_iconify); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 697, __pyx_L1_error)
11041 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_iconify); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 715, __pyx_L1_error)
1089611042 __Pyx_GOTREF(__pyx_t_3);
1089711043 __pyx_t_4 = NULL;
1089811044 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
1090611052 }
1090711053 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
1090811054 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
10909 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 697, __pyx_L1_error)
11055 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 715, __pyx_L1_error)
1091011056 __Pyx_GOTREF(__pyx_t_2);
1091111057 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1091211058 __pyx_r = __pyx_t_2;
1091311059 __pyx_t_2 = 0;
1091411060 goto __pyx_L0;
1091511061
10916 /* "pygame_sdl2/display.pyx":696
11062 /* "pygame_sdl2/display.pyx":714
1091711063 *
1091811064 * def iconify():
1091911065 * if main_window: # <<<<<<<<<<<<<<
1092211068 */
1092311069 }
1092411070
10925 /* "pygame_sdl2/display.pyx":699
11071 /* "pygame_sdl2/display.pyx":717
1092611072 * return main_window.iconify()
1092711073 *
1092811074 * return False # <<<<<<<<<<<<<<
1093411080 __pyx_r = Py_False;
1093511081 goto __pyx_L0;
1093611082
10937 /* "pygame_sdl2/display.pyx":695
11083 /* "pygame_sdl2/display.pyx":713
1093811084 * return False
1093911085 *
1094011086 * def iconify(): # <<<<<<<<<<<<<<
1095511101 return __pyx_r;
1095611102 }
1095711103
10958 /* "pygame_sdl2/display.pyx":701
11104 /* "pygame_sdl2/display.pyx":719
1095911105 * return False
1096011106 *
1096111107 * def toggle_fullscreen(): # <<<<<<<<<<<<<<
1098911135 int __pyx_clineno = 0;
1099011136 __Pyx_RefNannySetupContext("toggle_fullscreen", 0);
1099111137
10992 /* "pygame_sdl2/display.pyx":702
11138 /* "pygame_sdl2/display.pyx":720
1099311139 *
1099411140 * def toggle_fullscreen():
1099511141 * if main_window: # <<<<<<<<<<<<<<
1099611142 * return main_window.toggle_fullscreen()
1099711143 *
1099811144 */
10999 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 702, __pyx_L1_error)
11145 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 720, __pyx_L1_error)
1100011146 if (__pyx_t_1) {
1100111147
11002 /* "pygame_sdl2/display.pyx":703
11148 /* "pygame_sdl2/display.pyx":721
1100311149 * def toggle_fullscreen():
1100411150 * if main_window:
1100511151 * return main_window.toggle_fullscreen() # <<<<<<<<<<<<<<
1100711153 * return True
1100811154 */
1100911155 __Pyx_XDECREF(__pyx_r);
11010 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_toggle_fullscreen); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 703, __pyx_L1_error)
11156 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_toggle_fullscreen); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 721, __pyx_L1_error)
1101111157 __Pyx_GOTREF(__pyx_t_3);
1101211158 __pyx_t_4 = NULL;
1101311159 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
1102111167 }
1102211168 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
1102311169 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11024 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 703, __pyx_L1_error)
11170 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 721, __pyx_L1_error)
1102511171 __Pyx_GOTREF(__pyx_t_2);
1102611172 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1102711173 __pyx_r = __pyx_t_2;
1102811174 __pyx_t_2 = 0;
1102911175 goto __pyx_L0;
1103011176
11031 /* "pygame_sdl2/display.pyx":702
11177 /* "pygame_sdl2/display.pyx":720
1103211178 *
1103311179 * def toggle_fullscreen():
1103411180 * if main_window: # <<<<<<<<<<<<<<
1103711183 */
1103811184 }
1103911185
11040 /* "pygame_sdl2/display.pyx":705
11186 /* "pygame_sdl2/display.pyx":723
1104111187 * return main_window.toggle_fullscreen()
1104211188 *
1104311189 * return True # <<<<<<<<<<<<<<
1104911195 __pyx_r = Py_True;
1105011196 goto __pyx_L0;
1105111197
11052 /* "pygame_sdl2/display.pyx":701
11198 /* "pygame_sdl2/display.pyx":719
1105311199 * return False
1105411200 *
1105511201 * def toggle_fullscreen(): # <<<<<<<<<<<<<<
1107011216 return __pyx_r;
1107111217 }
1107211218
11073 /* "pygame_sdl2/display.pyx":707
11219 /* "pygame_sdl2/display.pyx":725
1107411220 * return True
1107511221 *
1107611222 * def set_gamma(red, green=None, blue=None): # <<<<<<<<<<<<<<
1112811274 }
1112911275 }
1113011276 if (unlikely(kw_args > 0)) {
11131 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_gamma") < 0)) __PYX_ERR(0, 707, __pyx_L3_error)
11277 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_gamma") < 0)) __PYX_ERR(0, 725, __pyx_L3_error)
1113211278 }
1113311279 } else {
1113411280 switch (PyTuple_GET_SIZE(__pyx_args)) {
1114711293 }
1114811294 goto __pyx_L4_argument_unpacking_done;
1114911295 __pyx_L5_argtuple_error:;
11150 __Pyx_RaiseArgtupleInvalid("set_gamma", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 707, __pyx_L3_error)
11296 __Pyx_RaiseArgtupleInvalid("set_gamma", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 725, __pyx_L3_error)
1115111297 __pyx_L3_error:;
1115211298 __Pyx_AddTraceback("pygame_sdl2.display.set_gamma", __pyx_clineno, __pyx_lineno, __pyx_filename);
1115311299 __Pyx_RefNannyFinishContext();
1117411320 int __pyx_clineno = 0;
1117511321 __Pyx_RefNannySetupContext("set_gamma", 0);
1117611322
11177 /* "pygame_sdl2/display.pyx":708
11323 /* "pygame_sdl2/display.pyx":726
1117811324 *
1117911325 * def set_gamma(red, green=None, blue=None):
1118011326 * if main_window: # <<<<<<<<<<<<<<
1118111327 * return main_window.set_gamma(red, green, blue)
1118211328 * return False
1118311329 */
11184 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 708, __pyx_L1_error)
11330 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 726, __pyx_L1_error)
1118511331 if (__pyx_t_1) {
1118611332
11187 /* "pygame_sdl2/display.pyx":709
11333 /* "pygame_sdl2/display.pyx":727
1118811334 * def set_gamma(red, green=None, blue=None):
1118911335 * if main_window:
1119011336 * return main_window.set_gamma(red, green, blue) # <<<<<<<<<<<<<<
1119211338 *
1119311339 */
1119411340 __Pyx_XDECREF(__pyx_r);
11195 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_set_gamma); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 709, __pyx_L1_error)
11341 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_set_gamma); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 727, __pyx_L1_error)
1119611342 __Pyx_GOTREF(__pyx_t_3);
1119711343 __pyx_t_4 = NULL;
1119811344 __pyx_t_5 = 0;
1120911355 #if CYTHON_FAST_PYCALL
1121011356 if (PyFunction_Check(__pyx_t_3)) {
1121111357 PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_red, __pyx_v_green, __pyx_v_blue};
11212 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 709, __pyx_L1_error)
11358 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 727, __pyx_L1_error)
1121311359 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
1121411360 __Pyx_GOTREF(__pyx_t_2);
1121511361 } else
1121711363 #if CYTHON_FAST_PYCCALL
1121811364 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
1121911365 PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_red, __pyx_v_green, __pyx_v_blue};
11220 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 709, __pyx_L1_error)
11366 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 727, __pyx_L1_error)
1122111367 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
1122211368 __Pyx_GOTREF(__pyx_t_2);
1122311369 } else
1122411370 #endif
1122511371 {
11226 __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 709, __pyx_L1_error)
11372 __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 727, __pyx_L1_error)
1122711373 __Pyx_GOTREF(__pyx_t_6);
1122811374 if (__pyx_t_4) {
1122911375 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
1123711383 __Pyx_INCREF(__pyx_v_blue);
1123811384 __Pyx_GIVEREF(__pyx_v_blue);
1123911385 PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_blue);
11240 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 709, __pyx_L1_error)
11386 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 727, __pyx_L1_error)
1124111387 __Pyx_GOTREF(__pyx_t_2);
1124211388 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
1124311389 }
1124611392 __pyx_t_2 = 0;
1124711393 goto __pyx_L0;
1124811394
11249 /* "pygame_sdl2/display.pyx":708
11395 /* "pygame_sdl2/display.pyx":726
1125011396 *
1125111397 * def set_gamma(red, green=None, blue=None):
1125211398 * if main_window: # <<<<<<<<<<<<<<
1125511401 */
1125611402 }
1125711403
11258 /* "pygame_sdl2/display.pyx":710
11404 /* "pygame_sdl2/display.pyx":728
1125911405 * if main_window:
1126011406 * return main_window.set_gamma(red, green, blue)
1126111407 * return False # <<<<<<<<<<<<<<
1126711413 __pyx_r = Py_False;
1126811414 goto __pyx_L0;
1126911415
11270 /* "pygame_sdl2/display.pyx":707
11416 /* "pygame_sdl2/display.pyx":725
1127111417 * return True
1127211418 *
1127311419 * def set_gamma(red, green=None, blue=None): # <<<<<<<<<<<<<<
1128911435 return __pyx_r;
1129011436 }
1129111437
11292 /* "pygame_sdl2/display.pyx":712
11438 /* "pygame_sdl2/display.pyx":730
1129311439 * return False
1129411440 *
1129511441 * def set_gamma_ramp(red, green, blue): # <<<<<<<<<<<<<<
1133511481 case 1:
1133611482 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_green)) != 0)) kw_args--;
1133711483 else {
11338 __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, 1); __PYX_ERR(0, 712, __pyx_L3_error)
11484 __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, 1); __PYX_ERR(0, 730, __pyx_L3_error)
1133911485 }
1134011486 CYTHON_FALLTHROUGH;
1134111487 case 2:
1134211488 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_blue)) != 0)) kw_args--;
1134311489 else {
11344 __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, 2); __PYX_ERR(0, 712, __pyx_L3_error)
11490 __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, 2); __PYX_ERR(0, 730, __pyx_L3_error)
1134511491 }
1134611492 }
1134711493 if (unlikely(kw_args > 0)) {
11348 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_gamma_ramp") < 0)) __PYX_ERR(0, 712, __pyx_L3_error)
11494 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_gamma_ramp") < 0)) __PYX_ERR(0, 730, __pyx_L3_error)
1134911495 }
1135011496 } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
1135111497 goto __pyx_L5_argtuple_error;
1136011506 }
1136111507 goto __pyx_L4_argument_unpacking_done;
1136211508 __pyx_L5_argtuple_error:;
11363 __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 712, __pyx_L3_error)
11509 __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 730, __pyx_L3_error)
1136411510 __pyx_L3_error:;
1136511511 __Pyx_AddTraceback("pygame_sdl2.display.set_gamma_ramp", __pyx_clineno, __pyx_lineno, __pyx_filename);
1136611512 __Pyx_RefNannyFinishContext();
1138711533 int __pyx_clineno = 0;
1138811534 __Pyx_RefNannySetupContext("set_gamma_ramp", 0);
1138911535
11390 /* "pygame_sdl2/display.pyx":713
11536 /* "pygame_sdl2/display.pyx":731
1139111537 *
1139211538 * def set_gamma_ramp(red, green, blue):
1139311539 * if main_window: # <<<<<<<<<<<<<<
1139411540 * return main_window.set_gamma_ramp(red, green, blue)
1139511541 * return False
1139611542 */
11397 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 713, __pyx_L1_error)
11543 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 731, __pyx_L1_error)
1139811544 if (__pyx_t_1) {
1139911545
11400 /* "pygame_sdl2/display.pyx":714
11546 /* "pygame_sdl2/display.pyx":732
1140111547 * def set_gamma_ramp(red, green, blue):
1140211548 * if main_window:
1140311549 * return main_window.set_gamma_ramp(red, green, blue) # <<<<<<<<<<<<<<
1140511551 *
1140611552 */
1140711553 __Pyx_XDECREF(__pyx_r);
11408 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_set_gamma_ramp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 714, __pyx_L1_error)
11554 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_set_gamma_ramp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 732, __pyx_L1_error)
1140911555 __Pyx_GOTREF(__pyx_t_3);
1141011556 __pyx_t_4 = NULL;
1141111557 __pyx_t_5 = 0;
1142211568 #if CYTHON_FAST_PYCALL
1142311569 if (PyFunction_Check(__pyx_t_3)) {
1142411570 PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_red, __pyx_v_green, __pyx_v_blue};
11425 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 714, __pyx_L1_error)
11571 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 732, __pyx_L1_error)
1142611572 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
1142711573 __Pyx_GOTREF(__pyx_t_2);
1142811574 } else
1143011576 #if CYTHON_FAST_PYCCALL
1143111577 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
1143211578 PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_red, __pyx_v_green, __pyx_v_blue};
11433 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 714, __pyx_L1_error)
11579 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 732, __pyx_L1_error)
1143411580 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
1143511581 __Pyx_GOTREF(__pyx_t_2);
1143611582 } else
1143711583 #endif
1143811584 {
11439 __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 714, __pyx_L1_error)
11585 __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 732, __pyx_L1_error)
1144011586 __Pyx_GOTREF(__pyx_t_6);
1144111587 if (__pyx_t_4) {
1144211588 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
1145011596 __Pyx_INCREF(__pyx_v_blue);
1145111597 __Pyx_GIVEREF(__pyx_v_blue);
1145211598 PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_blue);
11453 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 714, __pyx_L1_error)
11599 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 732, __pyx_L1_error)
1145411600 __Pyx_GOTREF(__pyx_t_2);
1145511601 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
1145611602 }
1145911605 __pyx_t_2 = 0;
1146011606 goto __pyx_L0;
1146111607
11462 /* "pygame_sdl2/display.pyx":713
11608 /* "pygame_sdl2/display.pyx":731
1146311609 *
1146411610 * def set_gamma_ramp(red, green, blue):
1146511611 * if main_window: # <<<<<<<<<<<<<<
1146811614 */
1146911615 }
1147011616
11471 /* "pygame_sdl2/display.pyx":715
11617 /* "pygame_sdl2/display.pyx":733
1147211618 * if main_window:
1147311619 * return main_window.set_gamma_ramp(red, green, blue)
1147411620 * return False # <<<<<<<<<<<<<<
1148011626 __pyx_r = Py_False;
1148111627 goto __pyx_L0;
1148211628
11483 /* "pygame_sdl2/display.pyx":712
11629 /* "pygame_sdl2/display.pyx":730
1148411630 * return False
1148511631 *
1148611632 * def set_gamma_ramp(red, green, blue): # <<<<<<<<<<<<<<
1150211648 return __pyx_r;
1150311649 }
1150411650
11505 /* "pygame_sdl2/display.pyx":717
11651 /* "pygame_sdl2/display.pyx":735
1150611652 * return False
1150711653 *
1150811654 * def set_icon(surface): # <<<<<<<<<<<<<<
1153811684 int __pyx_clineno = 0;
1153911685 __Pyx_RefNannySetupContext("set_icon", 0);
1154011686
11541 /* "pygame_sdl2/display.pyx":720
11687 /* "pygame_sdl2/display.pyx":738
1154211688 * global default_icon
1154311689 *
1154411690 * default_icon = surface.copy() # <<<<<<<<<<<<<<
1154511691 *
1154611692 * if main_window is not None:
1154711693 */
11548 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_surface, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 720, __pyx_L1_error)
11694 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_surface, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 738, __pyx_L1_error)
1154911695 __Pyx_GOTREF(__pyx_t_2);
1155011696 __pyx_t_3 = NULL;
1155111697 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
1155911705 }
1156011706 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
1156111707 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11562 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 720, __pyx_L1_error)
11708 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 738, __pyx_L1_error)
1156311709 __Pyx_GOTREF(__pyx_t_1);
1156411710 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11565 if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_icon, __pyx_t_1) < 0) __PYX_ERR(0, 720, __pyx_L1_error)
11711 if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_icon, __pyx_t_1) < 0) __PYX_ERR(0, 738, __pyx_L1_error)
1156611712 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1156711713
11568 /* "pygame_sdl2/display.pyx":722
11714 /* "pygame_sdl2/display.pyx":740
1156911715 * default_icon = surface.copy()
1157011716 *
1157111717 * if main_window is not None: # <<<<<<<<<<<<<<
1157611722 __pyx_t_5 = (__pyx_t_4 != 0);
1157711723 if (__pyx_t_5) {
1157811724
11579 /* "pygame_sdl2/display.pyx":723
11725 /* "pygame_sdl2/display.pyx":741
1158011726 *
1158111727 * if main_window is not None:
1158211728 * main_window.set_icon(default_icon) # <<<<<<<<<<<<<<
1158311729 *
1158411730 * def set_caption(title, icontitle = None):
1158511731 */
11586 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_set_icon); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 723, __pyx_L1_error)
11732 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_set_icon); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 741, __pyx_L1_error)
1158711733 __Pyx_GOTREF(__pyx_t_2);
11588 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_default_icon); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 723, __pyx_L1_error)
11734 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_default_icon); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 741, __pyx_L1_error)
1158911735 __Pyx_GOTREF(__pyx_t_3);
1159011736 __pyx_t_6 = NULL;
1159111737 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
1160011746 __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
1160111747 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
1160211748 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11603 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 723, __pyx_L1_error)
11749 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 741, __pyx_L1_error)
1160411750 __Pyx_GOTREF(__pyx_t_1);
1160511751 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1160611752 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1160711753
11608 /* "pygame_sdl2/display.pyx":722
11754 /* "pygame_sdl2/display.pyx":740
1160911755 * default_icon = surface.copy()
1161011756 *
1161111757 * if main_window is not None: # <<<<<<<<<<<<<<
1161411760 */
1161511761 }
1161611762
11617 /* "pygame_sdl2/display.pyx":717
11763 /* "pygame_sdl2/display.pyx":735
1161811764 * return False
1161911765 *
1162011766 * def set_icon(surface): # <<<<<<<<<<<<<<
1163811784 return __pyx_r;
1163911785 }
1164011786
11641 /* "pygame_sdl2/display.pyx":725
11787 /* "pygame_sdl2/display.pyx":743
1164211788 * main_window.set_icon(default_icon)
1164311789 *
1164411790 * def set_caption(title, icontitle = None): # <<<<<<<<<<<<<<
1168611832 }
1168711833 }
1168811834 if (unlikely(kw_args > 0)) {
11689 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_caption") < 0)) __PYX_ERR(0, 725, __pyx_L3_error)
11835 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_caption") < 0)) __PYX_ERR(0, 743, __pyx_L3_error)
1169011836 }
1169111837 } else {
1169211838 switch (PyTuple_GET_SIZE(__pyx_args)) {
1170211848 }
1170311849 goto __pyx_L4_argument_unpacking_done;
1170411850 __pyx_L5_argtuple_error:;
11705 __Pyx_RaiseArgtupleInvalid("set_caption", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 725, __pyx_L3_error)
11851 __Pyx_RaiseArgtupleInvalid("set_caption", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 743, __pyx_L3_error)
1170611852 __pyx_L3_error:;
1170711853 __Pyx_AddTraceback("pygame_sdl2.display.set_caption", __pyx_clineno, __pyx_lineno, __pyx_filename);
1170811854 __Pyx_RefNannyFinishContext();
1172811874 int __pyx_clineno = 0;
1172911875 __Pyx_RefNannySetupContext("set_caption", 0);
1173011876
11731 /* "pygame_sdl2/display.pyx":728
11877 /* "pygame_sdl2/display.pyx":746
1173211878 * global default_title
1173311879 *
1173411880 * default_title = title # <<<<<<<<<<<<<<
1173511881 *
1173611882 * if main_window:
1173711883 */
11738 if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_title, __pyx_v_title) < 0) __PYX_ERR(0, 728, __pyx_L1_error)
11739
11740 /* "pygame_sdl2/display.pyx":730
11884 if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_title, __pyx_v_title) < 0) __PYX_ERR(0, 746, __pyx_L1_error)
11885
11886 /* "pygame_sdl2/display.pyx":748
1174111887 * default_title = title
1174211888 *
1174311889 * if main_window: # <<<<<<<<<<<<<<
1174411890 * main_window.set_caption(default_title)
1174511891 *
1174611892 */
11747 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 730, __pyx_L1_error)
11893 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 748, __pyx_L1_error)
1174811894 if (__pyx_t_1) {
1174911895
11750 /* "pygame_sdl2/display.pyx":731
11896 /* "pygame_sdl2/display.pyx":749
1175111897 *
1175211898 * if main_window:
1175311899 * main_window.set_caption(default_title) # <<<<<<<<<<<<<<
1175411900 *
1175511901 * def get_caption():
1175611902 */
11757 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_set_caption); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 731, __pyx_L1_error)
11903 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_set_caption); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 749, __pyx_L1_error)
1175811904 __Pyx_GOTREF(__pyx_t_3);
11759 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_default_title); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 731, __pyx_L1_error)
11905 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_default_title); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 749, __pyx_L1_error)
1176011906 __Pyx_GOTREF(__pyx_t_4);
1176111907 __pyx_t_5 = NULL;
1176211908 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
1177111917 __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
1177211918 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
1177311919 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11774 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 731, __pyx_L1_error)
11920 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 749, __pyx_L1_error)
1177511921 __Pyx_GOTREF(__pyx_t_2);
1177611922 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1177711923 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1177811924
11779 /* "pygame_sdl2/display.pyx":730
11925 /* "pygame_sdl2/display.pyx":748
1178011926 * default_title = title
1178111927 *
1178211928 * if main_window: # <<<<<<<<<<<<<<
1178511931 */
1178611932 }
1178711933
11788 /* "pygame_sdl2/display.pyx":725
11934 /* "pygame_sdl2/display.pyx":743
1178911935 * main_window.set_icon(default_icon)
1179011936 *
1179111937 * def set_caption(title, icontitle = None): # <<<<<<<<<<<<<<
1180911955 return __pyx_r;
1181011956 }
1181111957
11812 /* "pygame_sdl2/display.pyx":733
11958 /* "pygame_sdl2/display.pyx":751
1181311959 * main_window.set_caption(default_title)
1181411960 *
1181511961 * def get_caption(): # <<<<<<<<<<<<<<
1184011986 int __pyx_clineno = 0;
1184111987 __Pyx_RefNannySetupContext("get_caption", 0);
1184211988
11843 /* "pygame_sdl2/display.pyx":734
11989 /* "pygame_sdl2/display.pyx":752
1184411990 *
1184511991 * def get_caption():
1184611992 * return default_title # <<<<<<<<<<<<<<
1184811994 * def get_drawable_size():
1184911995 */
1185011996 __Pyx_XDECREF(__pyx_r);
11851 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_default_title); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 734, __pyx_L1_error)
11997 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_default_title); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 752, __pyx_L1_error)
1185211998 __Pyx_GOTREF(__pyx_t_1);
1185311999 __pyx_r = __pyx_t_1;
1185412000 __pyx_t_1 = 0;
1185512001 goto __pyx_L0;
1185612002
11857 /* "pygame_sdl2/display.pyx":733
12003 /* "pygame_sdl2/display.pyx":751
1185812004 * main_window.set_caption(default_title)
1185912005 *
1186012006 * def get_caption(): # <<<<<<<<<<<<<<
1187312019 return __pyx_r;
1187412020 }
1187512021
11876 /* "pygame_sdl2/display.pyx":736
12022 /* "pygame_sdl2/display.pyx":754
1187712023 * return default_title
1187812024 *
1187912025 * def get_drawable_size(): # <<<<<<<<<<<<<<
1190712053 int __pyx_clineno = 0;
1190812054 __Pyx_RefNannySetupContext("get_drawable_size", 0);
1190912055
11910 /* "pygame_sdl2/display.pyx":737
12056 /* "pygame_sdl2/display.pyx":755
1191112057 *
1191212058 * def get_drawable_size():
1191312059 * if main_window: # <<<<<<<<<<<<<<
1191412060 * return main_window.get_drawable_size()
1191512061 * return None
1191612062 */
11917 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 737, __pyx_L1_error)
12063 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 755, __pyx_L1_error)
1191812064 if (__pyx_t_1) {
1191912065
11920 /* "pygame_sdl2/display.pyx":738
12066 /* "pygame_sdl2/display.pyx":756
1192112067 * def get_drawable_size():
1192212068 * if main_window:
1192312069 * return main_window.get_drawable_size() # <<<<<<<<<<<<<<
1192512071 *
1192612072 */
1192712073 __Pyx_XDECREF(__pyx_r);
11928 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_get_drawable_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 738, __pyx_L1_error)
12074 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_get_drawable_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 756, __pyx_L1_error)
1192912075 __Pyx_GOTREF(__pyx_t_3);
1193012076 __pyx_t_4 = NULL;
1193112077 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
1193912085 }
1194012086 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
1194112087 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11942 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 738, __pyx_L1_error)
12088 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 756, __pyx_L1_error)
1194312089 __Pyx_GOTREF(__pyx_t_2);
1194412090 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1194512091 __pyx_r = __pyx_t_2;
1194612092 __pyx_t_2 = 0;
1194712093 goto __pyx_L0;
1194812094
11949 /* "pygame_sdl2/display.pyx":737
12095 /* "pygame_sdl2/display.pyx":755
1195012096 *
1195112097 * def get_drawable_size():
1195212098 * if main_window: # <<<<<<<<<<<<<<
1195512101 */
1195612102 }
1195712103
11958 /* "pygame_sdl2/display.pyx":739
12104 /* "pygame_sdl2/display.pyx":757
1195912105 * if main_window:
1196012106 * return main_window.get_drawable_size()
1196112107 * return None # <<<<<<<<<<<<<<
1196612112 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
1196712113 goto __pyx_L0;
1196812114
11969 /* "pygame_sdl2/display.pyx":736
12115 /* "pygame_sdl2/display.pyx":754
1197012116 * return default_title
1197112117 *
1197212118 * def get_drawable_size(): # <<<<<<<<<<<<<<
1198712133 return __pyx_r;
1198812134 }
1198912135
11990 /* "pygame_sdl2/display.pyx":741
12136 /* "pygame_sdl2/display.pyx":759
1199112137 * return None
1199212138 *
1199312139 * def get_size(): # <<<<<<<<<<<<<<
1202112167 int __pyx_clineno = 0;
1202212168 __Pyx_RefNannySetupContext("get_size", 0);
1202312169
12024 /* "pygame_sdl2/display.pyx":742
12170 /* "pygame_sdl2/display.pyx":760
1202512171 *
1202612172 * def get_size():
1202712173 * if main_window: # <<<<<<<<<<<<<<
1202812174 * return main_window.get_size()
1202912175 * return None
1203012176 */
12031 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 742, __pyx_L1_error)
12177 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 760, __pyx_L1_error)
1203212178 if (__pyx_t_1) {
1203312179
12034 /* "pygame_sdl2/display.pyx":743
12180 /* "pygame_sdl2/display.pyx":761
1203512181 * def get_size():
1203612182 * if main_window:
1203712183 * return main_window.get_size() # <<<<<<<<<<<<<<
1203912185 *
1204012186 */
1204112187 __Pyx_XDECREF(__pyx_r);
12042 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_get_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 743, __pyx_L1_error)
12188 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_get_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 761, __pyx_L1_error)
1204312189 __Pyx_GOTREF(__pyx_t_3);
1204412190 __pyx_t_4 = NULL;
1204512191 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
1205312199 }
1205412200 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
1205512201 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
12056 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 743, __pyx_L1_error)
12202 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 761, __pyx_L1_error)
1205712203 __Pyx_GOTREF(__pyx_t_2);
1205812204 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1205912205 __pyx_r = __pyx_t_2;
1206012206 __pyx_t_2 = 0;
1206112207 goto __pyx_L0;
1206212208
12063 /* "pygame_sdl2/display.pyx":742
12209 /* "pygame_sdl2/display.pyx":760
1206412210 *
1206512211 * def get_size():
1206612212 * if main_window: # <<<<<<<<<<<<<<
1206912215 */
1207012216 }
1207112217
12072 /* "pygame_sdl2/display.pyx":744
12218 /* "pygame_sdl2/display.pyx":762
1207312219 * if main_window:
1207412220 * return main_window.get_size()
1207512221 * return None # <<<<<<<<<<<<<<
1208012226 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
1208112227 goto __pyx_L0;
1208212228
12083 /* "pygame_sdl2/display.pyx":741
12229 /* "pygame_sdl2/display.pyx":759
1208412230 * return None
1208512231 *
1208612232 * def get_size(): # <<<<<<<<<<<<<<
1210112247 return __pyx_r;
1210212248 }
1210312249
12104 /* "pygame_sdl2/display.pyx":746
12250 /* "pygame_sdl2/display.pyx":764
1210512251 * return None
1210612252 *
1210712253 * def get_num_video_displays(): # <<<<<<<<<<<<<<
1213612282 int __pyx_clineno = 0;
1213712283 __Pyx_RefNannySetupContext("get_num_video_displays", 0);
1213812284
12139 /* "pygame_sdl2/display.pyx":747
12285 /* "pygame_sdl2/display.pyx":765
1214012286 *
1214112287 * def get_num_video_displays():
1214212288 * rv = SDL_GetNumVideoDisplays() # <<<<<<<<<<<<<<
1214512291 */
1214612292 __pyx_v_rv = SDL_GetNumVideoDisplays();
1214712293
12148 /* "pygame_sdl2/display.pyx":748
12294 /* "pygame_sdl2/display.pyx":766
1214912295 * def get_num_video_displays():
1215012296 * rv = SDL_GetNumVideoDisplays()
1215112297 * if rv < 0: # <<<<<<<<<<<<<<
1215512301 __pyx_t_1 = ((__pyx_v_rv < 0) != 0);
1215612302 if (unlikely(__pyx_t_1)) {
1215712303
12158 /* "pygame_sdl2/display.pyx":749
12304 /* "pygame_sdl2/display.pyx":767
1215912305 * rv = SDL_GetNumVideoDisplays()
1216012306 * if rv < 0:
1216112307 * raise error() # <<<<<<<<<<<<<<
1216212308 *
1216312309 * return rv
1216412310 */
12165 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 749, __pyx_L1_error)
12311 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 767, __pyx_L1_error)
1216612312 __Pyx_GOTREF(__pyx_t_3);
1216712313 __pyx_t_4 = NULL;
1216812314 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
1217612322 }
1217712323 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
1217812324 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
12179 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 749, __pyx_L1_error)
12325 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 767, __pyx_L1_error)
1218012326 __Pyx_GOTREF(__pyx_t_2);
1218112327 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1218212328 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
1218312329 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12184 __PYX_ERR(0, 749, __pyx_L1_error)
12185
12186 /* "pygame_sdl2/display.pyx":748
12330 __PYX_ERR(0, 767, __pyx_L1_error)
12331
12332 /* "pygame_sdl2/display.pyx":766
1218712333 * def get_num_video_displays():
1218812334 * rv = SDL_GetNumVideoDisplays()
1218912335 * if rv < 0: # <<<<<<<<<<<<<<
1219212338 */
1219312339 }
1219412340
12195 /* "pygame_sdl2/display.pyx":751
12341 /* "pygame_sdl2/display.pyx":769
1219612342 * raise error()
1219712343 *
1219812344 * return rv # <<<<<<<<<<<<<<
1220012346 * def get_display_bounds(index):
1220112347 */
1220212348 __Pyx_XDECREF(__pyx_r);
12203 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 751, __pyx_L1_error)
12349 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 769, __pyx_L1_error)
1220412350 __Pyx_GOTREF(__pyx_t_2);
1220512351 __pyx_r = __pyx_t_2;
1220612352 __pyx_t_2 = 0;
1220712353 goto __pyx_L0;
1220812354
12209 /* "pygame_sdl2/display.pyx":746
12355 /* "pygame_sdl2/display.pyx":764
1221012356 * return None
1221112357 *
1221212358 * def get_num_video_displays(): # <<<<<<<<<<<<<<
1222712373 return __pyx_r;
1222812374 }
1222912375
12230 /* "pygame_sdl2/display.pyx":753
12376 /* "pygame_sdl2/display.pyx":771
1223112377 * return rv
1223212378 *
1223312379 * def get_display_bounds(index): # <<<<<<<<<<<<<<
1226512411 int __pyx_clineno = 0;
1226612412 __Pyx_RefNannySetupContext("get_display_bounds", 0);
1226712413
12268 /* "pygame_sdl2/display.pyx":755
12414 /* "pygame_sdl2/display.pyx":773
1226912415 * def get_display_bounds(index):
1227012416 * cdef SDL_Rect rect
1227112417 * rv = SDL_GetDisplayBounds(index, &rect) # <<<<<<<<<<<<<<
1227212418 *
1227312419 * return (rect.x, rect.y, rect.w, rect.h)
1227412420 */
12275 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_index); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 755, __pyx_L1_error)
12421 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_index); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 773, __pyx_L1_error)
1227612422 __pyx_v_rv = SDL_GetDisplayBounds(__pyx_t_1, (&__pyx_v_rect));
1227712423
12278 /* "pygame_sdl2/display.pyx":757
12424 /* "pygame_sdl2/display.pyx":775
1227912425 * rv = SDL_GetDisplayBounds(index, &rect)
1228012426 *
1228112427 * return (rect.x, rect.y, rect.w, rect.h) # <<<<<<<<<<<<<<
1228312429 * def set_screensaver(state):
1228412430 */
1228512431 __Pyx_XDECREF(__pyx_r);
12286 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rect.x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 757, __pyx_L1_error)
12432 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rect.x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 775, __pyx_L1_error)
1228712433 __Pyx_GOTREF(__pyx_t_2);
12288 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rect.y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 757, __pyx_L1_error)
12434 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rect.y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 775, __pyx_L1_error)
1228912435 __Pyx_GOTREF(__pyx_t_3);
12290 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_rect.w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 757, __pyx_L1_error)
12436 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_rect.w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 775, __pyx_L1_error)
1229112437 __Pyx_GOTREF(__pyx_t_4);
12292 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_rect.h); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 757, __pyx_L1_error)
12438 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_rect.h); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 775, __pyx_L1_error)
1229312439 __Pyx_GOTREF(__pyx_t_5);
12294 __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 757, __pyx_L1_error)
12440 __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 775, __pyx_L1_error)
1229512441 __Pyx_GOTREF(__pyx_t_6);
1229612442 __Pyx_GIVEREF(__pyx_t_2);
1229712443 PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
1230912455 __pyx_t_6 = 0;
1231012456 goto __pyx_L0;
1231112457
12312 /* "pygame_sdl2/display.pyx":753
12458 /* "pygame_sdl2/display.pyx":771
1231312459 * return rv
1231412460 *
1231512461 * def get_display_bounds(index): # <<<<<<<<<<<<<<
1233212478 return __pyx_r;
1233312479 }
1233412480
12335 /* "pygame_sdl2/display.pyx":759
12481 /* "pygame_sdl2/display.pyx":777
1233612482 * return (rect.x, rect.y, rect.w, rect.h)
1233712483 *
1233812484 * def set_screensaver(state): # <<<<<<<<<<<<<<
1236412510 int __pyx_clineno = 0;
1236512511 __Pyx_RefNannySetupContext("set_screensaver", 0);
1236612512
12367 /* "pygame_sdl2/display.pyx":764
12513 /* "pygame_sdl2/display.pyx":782
1236812514 * """
1236912515 *
1237012516 * if state: # <<<<<<<<<<<<<<
1237112517 * SDL_EnableScreenSaver()
1237212518 * else:
1237312519 */
12374 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_state); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 764, __pyx_L1_error)
12520 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_state); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 782, __pyx_L1_error)
1237512521 if (__pyx_t_1) {
1237612522
12377 /* "pygame_sdl2/display.pyx":765
12523 /* "pygame_sdl2/display.pyx":783
1237812524 *
1237912525 * if state:
1238012526 * SDL_EnableScreenSaver() # <<<<<<<<<<<<<<
1238312529 */
1238412530 SDL_EnableScreenSaver();
1238512531
12386 /* "pygame_sdl2/display.pyx":764
12532 /* "pygame_sdl2/display.pyx":782
1238712533 * """
1238812534 *
1238912535 * if state: # <<<<<<<<<<<<<<
1239312539 goto __pyx_L3;
1239412540 }
1239512541
12396 /* "pygame_sdl2/display.pyx":767
12542 /* "pygame_sdl2/display.pyx":785
1239712543 * SDL_EnableScreenSaver()
1239812544 * else:
1239912545 * SDL_DisableScreenSaver() # <<<<<<<<<<<<<<
1240512551 }
1240612552 __pyx_L3:;
1240712553
12408 /* "pygame_sdl2/display.pyx":759
12554 /* "pygame_sdl2/display.pyx":777
1240912555 * return (rect.x, rect.y, rect.w, rect.h)
1241012556 *
1241112557 * def set_screensaver(state): # <<<<<<<<<<<<<<
1242512571 return __pyx_r;
1242612572 }
1242712573
12428 /* "pygame_sdl2/display.pyx":769
12574 /* "pygame_sdl2/display.pyx":787
1242912575 * SDL_DisableScreenSaver()
1243012576 *
1243112577 * def get_platform(): # <<<<<<<<<<<<<<
1245612602 int __pyx_clineno = 0;
1245712603 __Pyx_RefNannySetupContext("get_platform", 0);
1245812604
12459 /* "pygame_sdl2/display.pyx":770
12605 /* "pygame_sdl2/display.pyx":788
1246012606 *
1246112607 * def get_platform():
1246212608 * return SDL_GetPlatform() # <<<<<<<<<<<<<<
1246412610 * cdef api SDL_Window *PyWindow_AsWindow(window):
1246512611 */
1246612612 __Pyx_XDECREF(__pyx_r);
12467 __pyx_t_1 = __Pyx_PyBytes_FromString(SDL_GetPlatform()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 770, __pyx_L1_error)
12613 __pyx_t_1 = __Pyx_PyBytes_FromString(SDL_GetPlatform()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 788, __pyx_L1_error)
1246812614 __Pyx_GOTREF(__pyx_t_1);
1246912615 __pyx_r = __pyx_t_1;
1247012616 __pyx_t_1 = 0;
1247112617 goto __pyx_L0;
1247212618
12473 /* "pygame_sdl2/display.pyx":769
12619 /* "pygame_sdl2/display.pyx":787
1247412620 * SDL_DisableScreenSaver()
1247512621 *
1247612622 * def get_platform(): # <<<<<<<<<<<<<<
1248912635 return __pyx_r;
1249012636 }
1249112637
12492 /* "pygame_sdl2/display.pyx":772
12638 /* "pygame_sdl2/display.pyx":790
1249312639 * return SDL_GetPlatform()
1249412640 *
1249512641 * cdef api SDL_Window *PyWindow_AsWindow(window): # <<<<<<<<<<<<<<
1250512651 __Pyx_RefNannySetupContext("PyWindow_AsWindow", 0);
1250612652 __Pyx_INCREF(__pyx_v_window);
1250712653
12508 /* "pygame_sdl2/display.pyx":779
12654 /* "pygame_sdl2/display.pyx":797
1250912655 * """
1251012656 *
1251112657 * if window is None: # <<<<<<<<<<<<<<
1251612662 __pyx_t_2 = (__pyx_t_1 != 0);
1251712663 if (__pyx_t_2) {
1251812664
12519 /* "pygame_sdl2/display.pyx":780
12665 /* "pygame_sdl2/display.pyx":798
1252012666 *
1252112667 * if window is None:
1252212668 * window = main_window # <<<<<<<<<<<<<<
1252612672 __Pyx_INCREF(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window));
1252712673 __Pyx_DECREF_SET(__pyx_v_window, ((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window));
1252812674
12529 /* "pygame_sdl2/display.pyx":779
12675 /* "pygame_sdl2/display.pyx":797
1253012676 * """
1253112677 *
1253212678 * if window is None: # <<<<<<<<<<<<<<
1253512681 */
1253612682 }
1253712683
12538 /* "pygame_sdl2/display.pyx":782
12684 /* "pygame_sdl2/display.pyx":800
1253912685 * window = main_window
1254012686 *
1254112687 * if window is None: # <<<<<<<<<<<<<<
1254612692 __pyx_t_1 = (__pyx_t_2 != 0);
1254712693 if (__pyx_t_1) {
1254812694
12549 /* "pygame_sdl2/display.pyx":783
12695 /* "pygame_sdl2/display.pyx":801
1255012696 *
1255112697 * if window is None:
1255212698 * return NULL # <<<<<<<<<<<<<<
1255612702 __pyx_r = NULL;
1255712703 goto __pyx_L0;
1255812704
12559 /* "pygame_sdl2/display.pyx":782
12705 /* "pygame_sdl2/display.pyx":800
1256012706 * window = main_window
1256112707 *
1256212708 * if window is None: # <<<<<<<<<<<<<<
1256512711 */
1256612712 }
1256712713
12568 /* "pygame_sdl2/display.pyx":785
12714 /* "pygame_sdl2/display.pyx":803
1256912715 * return NULL
1257012716 *
1257112717 * return (<Window> window).window # <<<<<<<<<<<<<<
1257312719 __pyx_r = ((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_window)->window;
1257412720 goto __pyx_L0;
1257512721
12576 /* "pygame_sdl2/display.pyx":772
12722 /* "pygame_sdl2/display.pyx":790
1257712723 * return SDL_GetPlatform()
1257812724 *
1257912725 * cdef api SDL_Window *PyWindow_AsWindow(window): # <<<<<<<<<<<<<<
1266912815 {"restore", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_41restore, METH_NOARGS, 0},
1267012816 {"maximize", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_43maximize, METH_NOARGS, 0},
1267112817 {"minimize", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_45minimize, METH_NOARGS, 0},
12672 {"__reduce_cython__", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_47__reduce_cython__, METH_NOARGS, 0},
12673 {"__setstate_cython__", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_49__setstate_cython__, METH_O, 0},
12818 {"get_sdl_window_pointer", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_47get_sdl_window_pointer, METH_NOARGS, __pyx_doc_11pygame_sdl2_7display_6Window_46get_sdl_window_pointer},
12819 {"__reduce_cython__", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_49__reduce_cython__, METH_NOARGS, 0},
12820 {"__setstate_cython__", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_51__setstate_cython__, METH_O, 0},
1267412821 {0, 0, 0, 0}
1267512822 };
1267612823
1281212959 {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
1281312960 {&__pyx_n_s_Window, __pyx_k_Window, sizeof(__pyx_k_Window), 0, 0, 1, 1},
1281412961 {&__pyx_n_s_androidembed, __pyx_k_androidembed, sizeof(__pyx_k_androidembed), 0, 0, 1, 1},
12815 {&__pyx_n_s_before_first_window, __pyx_k_before_first_window, sizeof(__pyx_k_before_first_window), 0, 0, 1, 1},
1281612962 {&__pyx_n_s_bitsize, __pyx_k_bitsize, sizeof(__pyx_k_bitsize), 0, 0, 1, 1},
1281712963 {&__pyx_n_s_blit_hw, __pyx_k_blit_hw, sizeof(__pyx_k_blit_hw), 0, 0, 1, 1},
1281812964 {&__pyx_n_s_blit_hw_A, __pyx_k_blit_hw_A, sizeof(__pyx_k_blit_hw_A), 0, 0, 1, 1},
1282212968 {&__pyx_n_s_blit_sw_CC, __pyx_k_blit_sw_CC, sizeof(__pyx_k_blit_sw_CC), 0, 0, 1, 1},
1282312969 {&__pyx_n_s_blue, __pyx_k_blue, sizeof(__pyx_k_blue), 0, 0, 1, 1},
1282412970 {&__pyx_n_s_bytesize, __pyx_k_bytesize, sizeof(__pyx_k_bytesize), 0, 0, 1, 1},
12971 {&__pyx_n_s_c_void_p, __pyx_k_c_void_p, sizeof(__pyx_k_c_void_p), 0, 0, 1, 1},
1282512972 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
12826 {&__pyx_n_s_close_window, __pyx_k_close_window, sizeof(__pyx_k_close_window), 0, 0, 1, 1},
1282712973 {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
1282812974 {&__pyx_n_s_create_surface, __pyx_k_create_surface, sizeof(__pyx_k_create_surface), 0, 0, 1, 1},
12975 {&__pyx_n_s_ctypes, __pyx_k_ctypes, sizeof(__pyx_k_ctypes), 0, 0, 1, 1},
1282912976 {&__pyx_n_s_current_h, __pyx_k_current_h, sizeof(__pyx_k_current_h), 0, 0, 1, 1},
1283012977 {&__pyx_n_s_current_w, __pyx_k_current_w, sizeof(__pyx_k_current_w), 0, 0, 1, 1},
1283112978 {&__pyx_n_s_default, __pyx_k_default, sizeof(__pyx_k_default), 0, 0, 1, 1},
1293613083 {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
1293713084 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
1293813085 {&__pyx_n_s_shifts, __pyx_k_shifts, sizeof(__pyx_k_shifts), 0, 0, 1, 1},
12939 {&__pyx_n_s_shown_first_window, __pyx_k_shown_first_window, sizeof(__pyx_k_shown_first_window), 0, 0, 1, 1},
1294013086 {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
1294113087 {&__pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_k_src_pygame_sdl2_display_pyx, sizeof(__pyx_k_src_pygame_sdl2_display_pyx), 0, 0, 1, 0},
1294213088 {&__pyx_n_s_startswith, __pyx_k_startswith, sizeof(__pyx_k_startswith), 0, 0, 1, 1},
1295513101 {0, 0, 0, 0, 0, 0, 0}
1295613102 };
1295713103 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
12958 __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 528, __pyx_L1_error)
12959 __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(0, 139, __pyx_L1_error)
12960 __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 361, __pyx_L1_error)
12961 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 425, __pyx_L1_error)
13104 __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(0, 125, __pyx_L1_error)
13105 __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 546, __pyx_L1_error)
13106 __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 362, __pyx_L1_error)
13107 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 426, __pyx_L1_error)
1296213108 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
1296313109 return 0;
1296413110 __pyx_L1_error:;
1298013126 __Pyx_GOTREF(__pyx_tuple_);
1298113127 __Pyx_GIVEREF(__pyx_tuple_);
1298213128
12983 /* "pygame_sdl2/display.pyx":145
13129 /* "pygame_sdl2/display.pyx":130
1298413130 *
1298513131 * cdef class Window:
1298613132 * def __init__(self, title, resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): # <<<<<<<<<<<<<<
1298713133 *
1298813134 * if not isinstance(title, bytes):
1298913135 */
12990 __pyx_tuple__2 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 145, __pyx_L1_error)
13136 __pyx_tuple__2 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 130, __pyx_L1_error)
1299113137 __Pyx_GOTREF(__pyx_tuple__2);
1299213138 __Pyx_GIVEREF(__pyx_tuple__2);
1299313139
12994 /* "pygame_sdl2/display.pyx":156
13140 /* "pygame_sdl2/display.pyx":139
1299513141 * # If we do not get the AVOID_GL hint, we always create a GL-compatible
1299613142 * # window. This lets us change the OPENGL flag later on.
1299713143 * if int(_get_hint("PYGAME_SDL2_AVOID_GL", "0")): # <<<<<<<<<<<<<<
1299813144 * gl_flag = 0
1299913145 * else:
1300013146 */
13001 __pyx_tuple__4 = PyTuple_Pack(2, __pyx_n_s_PYGAME_SDL2_AVOID_GL, __pyx_kp_s_0); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 156, __pyx_L1_error)
13147 __pyx_tuple__4 = PyTuple_Pack(2, __pyx_n_s_PYGAME_SDL2_AVOID_GL, __pyx_kp_s_0); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 139, __pyx_L1_error)
1300213148 __Pyx_GOTREF(__pyx_tuple__4);
1300313149 __Pyx_GIVEREF(__pyx_tuple__4);
1300413150
13005 /* "pygame_sdl2/display.pyx":218
13151 /* "pygame_sdl2/display.pyx":219
1300613152 * if self.window_surface.format.BitsPerPixel == 32:
1300713153 *
1300813154 * self.surface = Surface(()) # <<<<<<<<<<<<<<
1300913155 * self.surface.surface = self.window_surface
1301013156 * self.surface.owns_surface = False
1301113157 */
13012 __pyx_tuple__5 = PyTuple_Pack(1, __pyx_empty_tuple); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 218, __pyx_L1_error)
13158 __pyx_tuple__5 = PyTuple_Pack(1, __pyx_empty_tuple); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 219, __pyx_L1_error)
1301313159 __Pyx_GOTREF(__pyx_tuple__5);
1301413160 __Pyx_GIVEREF(__pyx_tuple__5);
1301513161
13016 /* "pygame_sdl2/display.pyx":361
13162 /* "pygame_sdl2/display.pyx":362
1301713163 * rects = <SDL_Rect *> calloc(len(rectangles), sizeof(SDL_Rect))
1301813164 * if rects == NULL:
1301913165 * raise MemoryError("Couldn't allocate rectangles.") # <<<<<<<<<<<<<<
1302013166 *
1302113167 * try:
1302213168 */
13023 __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_Couldn_t_allocate_rectangles); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 361, __pyx_L1_error)
13169 __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_Couldn_t_allocate_rectangles); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 362, __pyx_L1_error)
1302413170 __Pyx_GOTREF(__pyx_tuple__6);
1302513171 __Pyx_GIVEREF(__pyx_tuple__6);
1302613172
1310313249 */
1310413250 __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_init, 116, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 116, __pyx_L1_error)
1310513251
13106 /* "pygame_sdl2/display.pyx":126
13107 * _shown_first_window = False
13108 *
13109 * def _before_first_window(): # <<<<<<<<<<<<<<
13110 * global _shown_first_window
13111 *
13112 */
13113 __pyx_tuple__18 = PyTuple_Pack(1, __pyx_n_s_androidembed); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 126, __pyx_L1_error)
13252 /* "pygame_sdl2/display.pyx":488
13253 * default_swap_control = 1
13254 *
13255 * def set_mode(resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): # <<<<<<<<<<<<<<
13256 * global main_window
13257 *
13258 */
13259 __pyx_tuple__18 = PyTuple_Pack(5, __pyx_n_s_resolution, __pyx_n_s_flags, __pyx_n_s_depth, __pyx_n_s_pos, __pyx_n_s_RESIZE_FLAGS); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 488, __pyx_L1_error)
1311413260 __Pyx_GOTREF(__pyx_tuple__18);
1311513261 __Pyx_GIVEREF(__pyx_tuple__18);
13116 __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_before_first_window, 126, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 126, __pyx_L1_error)
13117
13118 /* "pygame_sdl2/display.pyx":477
13119 * default_swap_control = 1
13120 *
13121 * def set_mode(resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): # <<<<<<<<<<<<<<
13262 __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_mode, 488, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 488, __pyx_L1_error)
13263
13264 /* "pygame_sdl2/display.pyx":509
13265 * return main_window.surface
13266 *
13267 * def destroy(): # <<<<<<<<<<<<<<
1312213268 * global main_window
1312313269 *
1312413270 */
13125 __pyx_tuple__20 = PyTuple_Pack(5, __pyx_n_s_resolution, __pyx_n_s_flags, __pyx_n_s_depth, __pyx_n_s_pos, __pyx_n_s_RESIZE_FLAGS); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 477, __pyx_L1_error)
13126 __Pyx_GOTREF(__pyx_tuple__20);
13127 __Pyx_GIVEREF(__pyx_tuple__20);
13128 __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_mode, 477, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 477, __pyx_L1_error)
13129
13130 /* "pygame_sdl2/display.pyx":498
13131 * return main_window.surface
13271 __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_destroy, 509, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 509, __pyx_L1_error)
13272
13273 /* "pygame_sdl2/display.pyx":516
13274 * main_window = None
1313213275 *
1313313276 * def get_surface(): # <<<<<<<<<<<<<<
1313413277 * if main_window is None:
1313513278 * return None
1313613279 */
13137 __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_surface, 498, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 498, __pyx_L1_error)
13138
13139 /* "pygame_sdl2/display.pyx":504
13280 __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_surface, 516, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 516, __pyx_L1_error)
13281
13282 /* "pygame_sdl2/display.pyx":522
1314013283 * return main_window.get_surface()
1314113284 *
1314213285 * def get_window(): # <<<<<<<<<<<<<<
1314313286 * """
1314413287 * Returns the Window created by set_mode, or None if no such window
1314513288 */
13146 __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_window, 504, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 504, __pyx_L1_error)
13147
13148 /* "pygame_sdl2/display.pyx":512
13289 __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_window, 522, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 522, __pyx_L1_error)
13290
13291 /* "pygame_sdl2/display.pyx":530
1314913292 * return main_window
1315013293 *
1315113294 * def flip(): # <<<<<<<<<<<<<<
1315213295 * if main_window:
1315313296 * main_window.flip()
1315413297 */
13155 __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_flip, 512, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 512, __pyx_L1_error)
13156
13157 /* "pygame_sdl2/display.pyx":516
13298 __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_flip, 530, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 530, __pyx_L1_error)
13299
13300 /* "pygame_sdl2/display.pyx":534
1315813301 * main_window.flip()
1315913302 *
1316013303 * def update(rectangles=None): # <<<<<<<<<<<<<<
1316113304 * if main_window:
1316213305 * main_window.update(rectangles)
1316313306 */
13164 __pyx_tuple__25 = PyTuple_Pack(1, __pyx_n_s_rectangles); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 516, __pyx_L1_error)
13165 __Pyx_GOTREF(__pyx_tuple__25);
13166 __Pyx_GIVEREF(__pyx_tuple__25);
13167 __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_update, 516, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 516, __pyx_L1_error)
13168
13169 /* "pygame_sdl2/display.pyx":520
13307 __pyx_tuple__24 = PyTuple_Pack(1, __pyx_n_s_rectangles); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 534, __pyx_L1_error)
13308 __Pyx_GOTREF(__pyx_tuple__24);
13309 __Pyx_GIVEREF(__pyx_tuple__24);
13310 __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_update, 534, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 534, __pyx_L1_error)
13311
13312 /* "pygame_sdl2/display.pyx":538
1317013313 * main_window.update(rectangles)
1317113314 *
1317213315 * def get_driver(): # <<<<<<<<<<<<<<
1317313316 * cdef const char *driver = SDL_GetCurrentVideoDriver()
1317413317 *
1317513318 */
13176 __pyx_tuple__27 = PyTuple_Pack(1, __pyx_n_s_driver); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 520, __pyx_L1_error)
13177 __Pyx_GOTREF(__pyx_tuple__27);
13178 __Pyx_GIVEREF(__pyx_tuple__27);
13179 __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_driver, 520, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 520, __pyx_L1_error)
13180
13181 /* "pygame_sdl2/display.pyx":528
13319 __pyx_tuple__26 = PyTuple_Pack(1, __pyx_n_s_driver); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 538, __pyx_L1_error)
13320 __Pyx_GOTREF(__pyx_tuple__26);
13321 __Pyx_GIVEREF(__pyx_tuple__26);
13322 __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_driver, 538, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 538, __pyx_L1_error)
13323
13324 /* "pygame_sdl2/display.pyx":546
1318213325 * return driver
1318313326 *
1318413327 * class Info(object): # <<<<<<<<<<<<<<
1318513328 *
1318613329 * def __init__(self):
1318713330 */
13188 __pyx_tuple__29 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 528, __pyx_L1_error)
13189 __Pyx_GOTREF(__pyx_tuple__29);
13190 __Pyx_GIVEREF(__pyx_tuple__29);
13191
13192 /* "pygame_sdl2/display.pyx":530
13331 __pyx_tuple__28 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 546, __pyx_L1_error)
13332 __Pyx_GOTREF(__pyx_tuple__28);
13333 __Pyx_GIVEREF(__pyx_tuple__28);
13334
13335 /* "pygame_sdl2/display.pyx":548
1319313336 * class Info(object):
1319413337 *
1319513338 * def __init__(self): # <<<<<<<<<<<<<<
1319613339 * cdef SDL_DisplayMode dm
1319713340 * cdef SDL_PixelFormat *format
1319813341 */
13199 __pyx_tuple__30 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_dm, __pyx_n_s_format); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 530, __pyx_L1_error)
13200 __Pyx_GOTREF(__pyx_tuple__30);
13201 __Pyx_GIVEREF(__pyx_tuple__30);
13202 __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_init_2, 530, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 530, __pyx_L1_error)
13203
13204 /* "pygame_sdl2/display.pyx":589
13342 __pyx_tuple__29 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_dm, __pyx_n_s_format); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 548, __pyx_L1_error)
13343 __Pyx_GOTREF(__pyx_tuple__29);
13344 __Pyx_GIVEREF(__pyx_tuple__29);
13345 __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_init_2, 548, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 548, __pyx_L1_error)
13346
13347 /* "pygame_sdl2/display.pyx":607
1320513348 * self.blit_sw_A = False
1320613349 *
1320713350 * def __repr__(self): # <<<<<<<<<<<<<<
1320813351 * return "<Info({!r})>".format(self.__dict__)
1320913352 *
1321013353 */
13211 __pyx_tuple__32 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 589, __pyx_L1_error)
13212 __Pyx_GOTREF(__pyx_tuple__32);
13213 __Pyx_GIVEREF(__pyx_tuple__32);
13214 __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_repr, 589, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 589, __pyx_L1_error)
13215
13216 /* "pygame_sdl2/display.pyx":593
13354 __pyx_tuple__31 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 607, __pyx_L1_error)
13355 __Pyx_GOTREF(__pyx_tuple__31);
13356 __Pyx_GIVEREF(__pyx_tuple__31);
13357 __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_repr, 607, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 607, __pyx_L1_error)
13358
13359 /* "pygame_sdl2/display.pyx":611
1321713360 *
1321813361 *
1321913362 * def get_wm_info(): # <<<<<<<<<<<<<<
1322013363 * if main_window:
1322113364 * return main_window.get_wm_info()
1322213365 */
13223 __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_wm_info, 593, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 593, __pyx_L1_error)
13224
13225 /* "pygame_sdl2/display.pyx":600
13366 __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_wm_info, 611, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 611, __pyx_L1_error)
13367
13368 /* "pygame_sdl2/display.pyx":618
1322613369 *
1322713370 *
1322813371 * def get_num_video_displays(): # <<<<<<<<<<<<<<
1322913372 * """
1323013373 * Returns the number of video displays connected to the system.
1323113374 */
13232 __pyx_tuple__35 = PyTuple_Pack(1, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 600, __pyx_L1_error)
13233 __Pyx_GOTREF(__pyx_tuple__35);
13234 __Pyx_GIVEREF(__pyx_tuple__35);
13235 __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_num_video_displays, 600, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 600, __pyx_L1_error)
13236
13237 /* "pygame_sdl2/display.pyx":613
13375 __pyx_tuple__34 = PyTuple_Pack(1, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 618, __pyx_L1_error)
13376 __Pyx_GOTREF(__pyx_tuple__34);
13377 __Pyx_GIVEREF(__pyx_tuple__34);
13378 __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_num_video_displays, 618, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 618, __pyx_L1_error)
13379
13380 /* "pygame_sdl2/display.pyx":631
1323813381 *
1323913382 *
1324013383 * def list_modes(depth=0, flags=0, display=0): # <<<<<<<<<<<<<<
1324113384 * """
1324213385 * Returns a list of possible display modes for the display `display`.
1324313386 */
13244 __pyx_tuple__37 = PyTuple_Pack(8, __pyx_n_s_depth, __pyx_n_s_flags, __pyx_n_s_display, __pyx_n_s_num_modes, __pyx_n_s_i, __pyx_n_s_mode, __pyx_n_s_rv, __pyx_n_s_t); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 613, __pyx_L1_error)
13245 __Pyx_GOTREF(__pyx_tuple__37);
13246 __Pyx_GIVEREF(__pyx_tuple__37);
13247 __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_list_modes, 613, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 613, __pyx_L1_error)
13248
13249 /* "pygame_sdl2/display.pyx":638
13387 __pyx_tuple__36 = PyTuple_Pack(8, __pyx_n_s_depth, __pyx_n_s_flags, __pyx_n_s_display, __pyx_n_s_num_modes, __pyx_n_s_i, __pyx_n_s_mode, __pyx_n_s_rv, __pyx_n_s_t); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 631, __pyx_L1_error)
13388 __Pyx_GOTREF(__pyx_tuple__36);
13389 __Pyx_GIVEREF(__pyx_tuple__36);
13390 __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_list_modes, 631, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 631, __pyx_L1_error)
13391
13392 /* "pygame_sdl2/display.pyx":656
1325013393 *
1325113394 *
1325213395 * def mode_ok(size, flags=0, depth=0): # <<<<<<<<<<<<<<
1325313396 * """
1325413397 * Returns true if size is in the result of list_modes().
1325513398 */
13256 __pyx_tuple__39 = PyTuple_Pack(3, __pyx_n_s_size, __pyx_n_s_flags, __pyx_n_s_depth); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 638, __pyx_L1_error)
13257 __Pyx_GOTREF(__pyx_tuple__39);
13258 __Pyx_GIVEREF(__pyx_tuple__39);
13259 __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_mode_ok, 638, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 638, __pyx_L1_error)
13260
13261 /* "pygame_sdl2/display.pyx":645
13399 __pyx_tuple__38 = PyTuple_Pack(3, __pyx_n_s_size, __pyx_n_s_flags, __pyx_n_s_depth); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 656, __pyx_L1_error)
13400 __Pyx_GOTREF(__pyx_tuple__38);
13401 __Pyx_GIVEREF(__pyx_tuple__38);
13402 __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_mode_ok, 656, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 656, __pyx_L1_error)
13403
13404 /* "pygame_sdl2/display.pyx":663
1326213405 * return tuple(size) in list_modes()
1326313406 *
1326413407 * def gl_reset_attributes(): # <<<<<<<<<<<<<<
1326513408 * SDL_GL_ResetAttributes()
1326613409 *
1326713410 */
13268 __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_gl_reset_attributes, 645, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 645, __pyx_L1_error)
13269
13270 /* "pygame_sdl2/display.pyx":648
13411 __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_gl_reset_attributes, 663, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 663, __pyx_L1_error)
13412
13413 /* "pygame_sdl2/display.pyx":666
1327113414 * SDL_GL_ResetAttributes()
1327213415 *
1327313416 * def gl_set_attribute(flag, value): # <<<<<<<<<<<<<<
1327413417 *
1327513418 * if flag == GL_SWAP_CONTROL:
1327613419 */
13277 __pyx_tuple__42 = PyTuple_Pack(2, __pyx_n_s_flag, __pyx_n_s_value); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 648, __pyx_L1_error)
13278 __Pyx_GOTREF(__pyx_tuple__42);
13279 __Pyx_GIVEREF(__pyx_tuple__42);
13280 __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_gl_set_attribute, 648, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 648, __pyx_L1_error)
13281
13282 /* "pygame_sdl2/display.pyx":668
13420 __pyx_tuple__41 = PyTuple_Pack(2, __pyx_n_s_flag, __pyx_n_s_value); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 666, __pyx_L1_error)
13421 __Pyx_GOTREF(__pyx_tuple__41);
13422 __Pyx_GIVEREF(__pyx_tuple__41);
13423 __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_gl_set_attribute, 666, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 666, __pyx_L1_error)
13424
13425 /* "pygame_sdl2/display.pyx":686
1328313426 * raise error()
1328413427 *
1328513428 * def gl_get_attribute(flag): # <<<<<<<<<<<<<<
1328613429 * cdef int rv
1328713430 *
1328813431 */
13289 __pyx_tuple__44 = PyTuple_Pack(2, __pyx_n_s_flag, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 668, __pyx_L1_error)
13290 __Pyx_GOTREF(__pyx_tuple__44);
13291 __Pyx_GIVEREF(__pyx_tuple__44);
13292 __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_gl_get_attribute, 668, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(0, 668, __pyx_L1_error)
13293
13294 /* "pygame_sdl2/display.pyx":679
13432 __pyx_tuple__43 = PyTuple_Pack(2, __pyx_n_s_flag, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 686, __pyx_L1_error)
13433 __Pyx_GOTREF(__pyx_tuple__43);
13434 __Pyx_GIVEREF(__pyx_tuple__43);
13435 __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_gl_get_attribute, 686, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 686, __pyx_L1_error)
13436
13437 /* "pygame_sdl2/display.pyx":697
1329513438 * return rv
1329613439 *
1329713440 * def gl_load_library(path): # <<<<<<<<<<<<<<
1329813441 * if path is None:
1329913442 * if SDL_GL_LoadLibrary(NULL):
1330013443 */
13301 __pyx_tuple__46 = PyTuple_Pack(1, __pyx_n_s_path); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 679, __pyx_L1_error)
13302 __Pyx_GOTREF(__pyx_tuple__46);
13303 __Pyx_GIVEREF(__pyx_tuple__46);
13304 __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_gl_load_library, 679, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 679, __pyx_L1_error)
13305
13306 /* "pygame_sdl2/display.pyx":687
13444 __pyx_tuple__45 = PyTuple_Pack(1, __pyx_n_s_path); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 697, __pyx_L1_error)
13445 __Pyx_GOTREF(__pyx_tuple__45);
13446 __Pyx_GIVEREF(__pyx_tuple__45);
13447 __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_gl_load_library, 697, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 697, __pyx_L1_error)
13448
13449 /* "pygame_sdl2/display.pyx":705
1330713450 * raise error()
1330813451 *
1330913452 * def gl_unload_library(): # <<<<<<<<<<<<<<
1331013453 * SDL_GL_UnloadLibrary()
1331113454 *
1331213455 */
13313 __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_gl_unload_library, 687, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 687, __pyx_L1_error)
13314
13315 /* "pygame_sdl2/display.pyx":690
13456 __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_gl_unload_library, 705, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 705, __pyx_L1_error)
13457
13458 /* "pygame_sdl2/display.pyx":708
1331613459 * SDL_GL_UnloadLibrary()
1331713460 *
1331813461 * def get_active(): # <<<<<<<<<<<<<<
1331913462 * if main_window:
1332013463 * return main_window.get_active()
1332113464 */
13322 __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_active, 690, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 690, __pyx_L1_error)
13323
13324 /* "pygame_sdl2/display.pyx":695
13465 __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_active, 708, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 708, __pyx_L1_error)
13466
13467 /* "pygame_sdl2/display.pyx":713
1332513468 * return False
1332613469 *
1332713470 * def iconify(): # <<<<<<<<<<<<<<
1332813471 * if main_window:
1332913472 * return main_window.iconify()
1333013473 */
13331 __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_iconify, 695, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 695, __pyx_L1_error)
13332
13333 /* "pygame_sdl2/display.pyx":701
13474 __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_iconify, 713, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 713, __pyx_L1_error)
13475
13476 /* "pygame_sdl2/display.pyx":719
1333413477 * return False
1333513478 *
1333613479 * def toggle_fullscreen(): # <<<<<<<<<<<<<<
1333713480 * if main_window:
1333813481 * return main_window.toggle_fullscreen()
1333913482 */
13340 __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_toggle_fullscreen, 701, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 701, __pyx_L1_error)
13341
13342 /* "pygame_sdl2/display.pyx":707
13483 __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_toggle_fullscreen, 719, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 719, __pyx_L1_error)
13484
13485 /* "pygame_sdl2/display.pyx":725
1334313486 * return True
1334413487 *
1334513488 * def set_gamma(red, green=None, blue=None): # <<<<<<<<<<<<<<
1334613489 * if main_window:
1334713490 * return main_window.set_gamma(red, green, blue)
1334813491 */
13349 __pyx_tuple__52 = PyTuple_Pack(3, __pyx_n_s_red, __pyx_n_s_green, __pyx_n_s_blue); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 707, __pyx_L1_error)
13350 __Pyx_GOTREF(__pyx_tuple__52);
13351 __Pyx_GIVEREF(__pyx_tuple__52);
13352 __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_gamma, 707, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 707, __pyx_L1_error)
13353
13354 /* "pygame_sdl2/display.pyx":712
13492 __pyx_tuple__51 = PyTuple_Pack(3, __pyx_n_s_red, __pyx_n_s_green, __pyx_n_s_blue); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 725, __pyx_L1_error)
13493 __Pyx_GOTREF(__pyx_tuple__51);
13494 __Pyx_GIVEREF(__pyx_tuple__51);
13495 __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_gamma, 725, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 725, __pyx_L1_error)
13496
13497 /* "pygame_sdl2/display.pyx":730
1335513498 * return False
1335613499 *
1335713500 * def set_gamma_ramp(red, green, blue): # <<<<<<<<<<<<<<
1335813501 * if main_window:
1335913502 * return main_window.set_gamma_ramp(red, green, blue)
1336013503 */
13361 __pyx_tuple__54 = PyTuple_Pack(3, __pyx_n_s_red, __pyx_n_s_green, __pyx_n_s_blue); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 712, __pyx_L1_error)
13362 __Pyx_GOTREF(__pyx_tuple__54);
13363 __Pyx_GIVEREF(__pyx_tuple__54);
13364 __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_gamma_ramp, 712, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 712, __pyx_L1_error)
13365
13366 /* "pygame_sdl2/display.pyx":717
13504 __pyx_tuple__53 = PyTuple_Pack(3, __pyx_n_s_red, __pyx_n_s_green, __pyx_n_s_blue); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 730, __pyx_L1_error)
13505 __Pyx_GOTREF(__pyx_tuple__53);
13506 __Pyx_GIVEREF(__pyx_tuple__53);
13507 __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_gamma_ramp, 730, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 730, __pyx_L1_error)
13508
13509 /* "pygame_sdl2/display.pyx":735
1336713510 * return False
1336813511 *
1336913512 * def set_icon(surface): # <<<<<<<<<<<<<<
1337013513 * global default_icon
1337113514 *
1337213515 */
13373 __pyx_tuple__56 = PyTuple_Pack(1, __pyx_n_s_surface); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 717, __pyx_L1_error)
13374 __Pyx_GOTREF(__pyx_tuple__56);
13375 __Pyx_GIVEREF(__pyx_tuple__56);
13376 __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_icon, 717, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(0, 717, __pyx_L1_error)
13377
13378 /* "pygame_sdl2/display.pyx":725
13516 __pyx_tuple__55 = PyTuple_Pack(1, __pyx_n_s_surface); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 735, __pyx_L1_error)
13517 __Pyx_GOTREF(__pyx_tuple__55);
13518 __Pyx_GIVEREF(__pyx_tuple__55);
13519 __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_icon, 735, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(0, 735, __pyx_L1_error)
13520
13521 /* "pygame_sdl2/display.pyx":743
1337913522 * main_window.set_icon(default_icon)
1338013523 *
1338113524 * def set_caption(title, icontitle = None): # <<<<<<<<<<<<<<
1338213525 * global default_title
1338313526 *
1338413527 */
13385 __pyx_tuple__58 = PyTuple_Pack(2, __pyx_n_s_title, __pyx_n_s_icontitle); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 725, __pyx_L1_error)
13386 __Pyx_GOTREF(__pyx_tuple__58);
13387 __Pyx_GIVEREF(__pyx_tuple__58);
13388 __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_caption, 725, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 725, __pyx_L1_error)
13389
13390 /* "pygame_sdl2/display.pyx":733
13528 __pyx_tuple__57 = PyTuple_Pack(2, __pyx_n_s_title, __pyx_n_s_icontitle); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 743, __pyx_L1_error)
13529 __Pyx_GOTREF(__pyx_tuple__57);
13530 __Pyx_GIVEREF(__pyx_tuple__57);
13531 __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_caption, 743, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 743, __pyx_L1_error)
13532
13533 /* "pygame_sdl2/display.pyx":751
1339113534 * main_window.set_caption(default_title)
1339213535 *
1339313536 * def get_caption(): # <<<<<<<<<<<<<<
1339413537 * return default_title
1339513538 *
1339613539 */
13397 __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_caption, 733, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 733, __pyx_L1_error)
13398
13399 /* "pygame_sdl2/display.pyx":736
13540 __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_caption, 751, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 751, __pyx_L1_error)
13541
13542 /* "pygame_sdl2/display.pyx":754
1340013543 * return default_title
1340113544 *
1340213545 * def get_drawable_size(): # <<<<<<<<<<<<<<
1340313546 * if main_window:
1340413547 * return main_window.get_drawable_size()
1340513548 */
13406 __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_drawable_size, 736, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(0, 736, __pyx_L1_error)
13407
13408 /* "pygame_sdl2/display.pyx":741
13549 __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_drawable_size, 754, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 754, __pyx_L1_error)
13550
13551 /* "pygame_sdl2/display.pyx":759
1340913552 * return None
1341013553 *
1341113554 * def get_size(): # <<<<<<<<<<<<<<
1341213555 * if main_window:
1341313556 * return main_window.get_size()
1341413557 */
13415 __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_size, 741, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(0, 741, __pyx_L1_error)
13416
13417 /* "pygame_sdl2/display.pyx":746
13558 __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_size, 759, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(0, 759, __pyx_L1_error)
13559
13560 /* "pygame_sdl2/display.pyx":764
1341813561 * return None
1341913562 *
1342013563 * def get_num_video_displays(): # <<<<<<<<<<<<<<
1342113564 * rv = SDL_GetNumVideoDisplays()
1342213565 * if rv < 0:
1342313566 */
13424 __pyx_tuple__63 = PyTuple_Pack(1, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 746, __pyx_L1_error)
13425 __Pyx_GOTREF(__pyx_tuple__63);
13426 __Pyx_GIVEREF(__pyx_tuple__63);
13427 __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_num_video_displays, 746, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(0, 746, __pyx_L1_error)
13428
13429 /* "pygame_sdl2/display.pyx":753
13567 __pyx_tuple__62 = PyTuple_Pack(1, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 764, __pyx_L1_error)
13568 __Pyx_GOTREF(__pyx_tuple__62);
13569 __Pyx_GIVEREF(__pyx_tuple__62);
13570 __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__62, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_num_video_displays, 764, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(0, 764, __pyx_L1_error)
13571
13572 /* "pygame_sdl2/display.pyx":771
1343013573 * return rv
1343113574 *
1343213575 * def get_display_bounds(index): # <<<<<<<<<<<<<<
1343313576 * cdef SDL_Rect rect
1343413577 * rv = SDL_GetDisplayBounds(index, &rect)
1343513578 */
13436 __pyx_tuple__65 = PyTuple_Pack(3, __pyx_n_s_index, __pyx_n_s_rect, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 753, __pyx_L1_error)
13437 __Pyx_GOTREF(__pyx_tuple__65);
13438 __Pyx_GIVEREF(__pyx_tuple__65);
13439 __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_display_bounds, 753, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(0, 753, __pyx_L1_error)
13440
13441 /* "pygame_sdl2/display.pyx":759
13579 __pyx_tuple__64 = PyTuple_Pack(3, __pyx_n_s_index, __pyx_n_s_rect, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 771, __pyx_L1_error)
13580 __Pyx_GOTREF(__pyx_tuple__64);
13581 __Pyx_GIVEREF(__pyx_tuple__64);
13582 __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_display_bounds, 771, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 771, __pyx_L1_error)
13583
13584 /* "pygame_sdl2/display.pyx":777
1344213585 * return (rect.x, rect.y, rect.w, rect.h)
1344313586 *
1344413587 * def set_screensaver(state): # <<<<<<<<<<<<<<
1344513588 * """
1344613589 * Sets the screenslaver to `state`.
1344713590 */
13448 __pyx_tuple__67 = PyTuple_Pack(1, __pyx_n_s_state); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 759, __pyx_L1_error)
13449 __Pyx_GOTREF(__pyx_tuple__67);
13450 __Pyx_GIVEREF(__pyx_tuple__67);
13451 __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_screensaver, 759, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(0, 759, __pyx_L1_error)
13452
13453 /* "pygame_sdl2/display.pyx":769
13591 __pyx_tuple__66 = PyTuple_Pack(1, __pyx_n_s_state); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 777, __pyx_L1_error)
13592 __Pyx_GOTREF(__pyx_tuple__66);
13593 __Pyx_GIVEREF(__pyx_tuple__66);
13594 __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_screensaver, 777, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(0, 777, __pyx_L1_error)
13595
13596 /* "pygame_sdl2/display.pyx":787
1345413597 * SDL_DisableScreenSaver()
1345513598 *
1345613599 * def get_platform(): # <<<<<<<<<<<<<<
1345713600 * return SDL_GetPlatform()
1345813601 *
1345913602 */
13460 __pyx_codeobj__69 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_platform, 769, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__69)) __PYX_ERR(0, 769, __pyx_L1_error)
13603 __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_platform, 787, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(0, 787, __pyx_L1_error)
1346113604 __Pyx_RefNannyFinishContext();
1346213605 return 0;
1346313606 __pyx_L1_error:;
1353013673 int __pyx_clineno = 0;
1353113674 __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
1353213675 /*--- Type init code ---*/
13533 if (PyType_Ready(&__pyx_type_11pygame_sdl2_7display_Window) < 0) __PYX_ERR(0, 144, __pyx_L1_error)
13676 if (PyType_Ready(&__pyx_type_11pygame_sdl2_7display_Window) < 0) __PYX_ERR(0, 129, __pyx_L1_error)
1353413677 #if PY_VERSION_HEX < 0x030800B1
1353513678 __pyx_type_11pygame_sdl2_7display_Window.tp_print = 0;
1353613679 #endif
1353713680 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11pygame_sdl2_7display_Window.tp_dictoffset && __pyx_type_11pygame_sdl2_7display_Window.tp_getattro == PyObject_GenericGetAttr)) {
1353813681 __pyx_type_11pygame_sdl2_7display_Window.tp_getattro = __Pyx_PyObject_GenericGetAttr;
1353913682 }
13540 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Window, (PyObject *)&__pyx_type_11pygame_sdl2_7display_Window) < 0) __PYX_ERR(0, 144, __pyx_L1_error)
13683 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Window, (PyObject *)&__pyx_type_11pygame_sdl2_7display_Window) < 0) __PYX_ERR(0, 129, __pyx_L1_error)
1354113684 if (__pyx_type_11pygame_sdl2_7display_Window.tp_weaklistoffset == 0) __pyx_type_11pygame_sdl2_7display_Window.tp_weaklistoffset = offsetof(struct __pyx_obj_11pygame_sdl2_7display_Window, __weakref__);
13542 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_11pygame_sdl2_7display_Window) < 0) __PYX_ERR(0, 144, __pyx_L1_error)
13685 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_11pygame_sdl2_7display_Window) < 0) __PYX_ERR(0, 129, __pyx_L1_error)
1354313686 __pyx_ptype_11pygame_sdl2_7display_Window = &__pyx_type_11pygame_sdl2_7display_Window;
1354413687 __Pyx_RefNannyFinishContext();
1354513688 return 0;
1370013843 PyObject *__pyx_t_2 = NULL;
1370113844 int __pyx_t_3;
1370213845 PyObject *__pyx_t_4 = NULL;
13846 PyObject *__pyx_t_5 = NULL;
13847 PyObject *__pyx_t_6 = NULL;
13848 PyObject *__pyx_t_7 = NULL;
13849 int __pyx_t_8;
1370313850 int __pyx_lineno = 0;
1370413851 const char *__pyx_filename = NULL;
1370513852 int __pyx_clineno = 0;
1406814215 * # The window that is used by the various module globals.
1406914216 * main_window = None # <<<<<<<<<<<<<<
1407014217 *
14071 * # Have we shown the first window?
14218 * try:
1407214219 */
1407314220 __Pyx_INCREF(Py_None);
1407414221 __Pyx_XGOTREF(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window));
1407514222 __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_7display_main_window, ((struct __pyx_obj_11pygame_sdl2_7display_Window *)Py_None));
1407614223 __Pyx_GIVEREF(Py_None);
1407714224
14078 /* "pygame_sdl2/display.pyx":124
14079 *
14080 * # Have we shown the first window?
14081 * _shown_first_window = False # <<<<<<<<<<<<<<
14082 *
14083 * def _before_first_window():
14084 */
14085 if (PyDict_SetItem(__pyx_d, __pyx_n_s_shown_first_window, Py_False) < 0) __PYX_ERR(0, 124, __pyx_L1_error)
14086
14087 /* "pygame_sdl2/display.pyx":126
14088 * _shown_first_window = False
14089 *
14090 * def _before_first_window(): # <<<<<<<<<<<<<<
14091 * global _shown_first_window
14092 *
14093 */
14094 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_13_before_first_window, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error)
14095 __Pyx_GOTREF(__pyx_t_1);
14096 if (PyDict_SetItem(__pyx_d, __pyx_n_s_before_first_window, __pyx_t_1) < 0) __PYX_ERR(0, 126, __pyx_L1_error)
14097 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14098
14099 /* "pygame_sdl2/display.pyx":145
14225 /* "pygame_sdl2/display.pyx":123
14226 * main_window = None
14227 *
14228 * try: # <<<<<<<<<<<<<<
14229 * import androidembed
14230 * except ImportError:
14231 */
14232 {
14233 __Pyx_PyThreadState_declare
14234 __Pyx_PyThreadState_assign
14235 __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
14236 __Pyx_XGOTREF(__pyx_t_5);
14237 __Pyx_XGOTREF(__pyx_t_6);
14238 __Pyx_XGOTREF(__pyx_t_7);
14239 /*try:*/ {
14240
14241 /* "pygame_sdl2/display.pyx":124
14242 *
14243 * try:
14244 * import androidembed # <<<<<<<<<<<<<<
14245 * except ImportError:
14246 * androidembed = None
14247 */
14248 __pyx_t_1 = __Pyx_Import(__pyx_n_s_androidembed, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L2_error)
14249 __Pyx_GOTREF(__pyx_t_1);
14250 if (PyDict_SetItem(__pyx_d, __pyx_n_s_androidembed, __pyx_t_1) < 0) __PYX_ERR(0, 124, __pyx_L2_error)
14251 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14252
14253 /* "pygame_sdl2/display.pyx":123
14254 * main_window = None
14255 *
14256 * try: # <<<<<<<<<<<<<<
14257 * import androidembed
14258 * except ImportError:
14259 */
14260 }
14261 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14262 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
14263 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
14264 goto __pyx_L7_try_end;
14265 __pyx_L2_error:;
14266 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
14267 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
14268 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
14269
14270 /* "pygame_sdl2/display.pyx":125
14271 * try:
14272 * import androidembed
14273 * except ImportError: # <<<<<<<<<<<<<<
14274 * androidembed = None
14275 *
14276 */
14277 __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
14278 if (__pyx_t_8) {
14279 __Pyx_AddTraceback("pygame_sdl2.display", __pyx_clineno, __pyx_lineno, __pyx_filename);
14280 if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_4, &__pyx_t_2) < 0) __PYX_ERR(0, 125, __pyx_L4_except_error)
14281 __Pyx_GOTREF(__pyx_t_1);
14282 __Pyx_GOTREF(__pyx_t_4);
14283 __Pyx_GOTREF(__pyx_t_2);
14284
14285 /* "pygame_sdl2/display.pyx":126
14286 * import androidembed
14287 * except ImportError:
14288 * androidembed = None # <<<<<<<<<<<<<<
14289 *
14290 *
14291 */
14292 if (PyDict_SetItem(__pyx_d, __pyx_n_s_androidembed, Py_None) < 0) __PYX_ERR(0, 126, __pyx_L4_except_error)
14293 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
14294 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
14295 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
14296 goto __pyx_L3_exception_handled;
14297 }
14298 goto __pyx_L4_except_error;
14299 __pyx_L4_except_error:;
14300
14301 /* "pygame_sdl2/display.pyx":123
14302 * main_window = None
14303 *
14304 * try: # <<<<<<<<<<<<<<
14305 * import androidembed
14306 * except ImportError:
14307 */
14308 __Pyx_XGIVEREF(__pyx_t_5);
14309 __Pyx_XGIVEREF(__pyx_t_6);
14310 __Pyx_XGIVEREF(__pyx_t_7);
14311 __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
14312 goto __pyx_L1_error;
14313 __pyx_L3_exception_handled:;
14314 __Pyx_XGIVEREF(__pyx_t_5);
14315 __Pyx_XGIVEREF(__pyx_t_6);
14316 __Pyx_XGIVEREF(__pyx_t_7);
14317 __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
14318 __pyx_L7_try_end:;
14319 }
14320
14321 /* "pygame_sdl2/display.pyx":130
1410014322 *
1410114323 * cdef class Window:
1410214324 * def __init__(self, title, resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): # <<<<<<<<<<<<<<
1410314325 *
1410414326 * if not isinstance(title, bytes):
1410514327 */
14106 __pyx_t_1 = __Pyx_PyInt_From_int(SDL_WINDOWPOS_UNDEFINED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error)
14328 __pyx_t_2 = __Pyx_PyInt_From_int(SDL_WINDOWPOS_UNDEFINED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 130, __pyx_L1_error)
14329 __Pyx_GOTREF(__pyx_t_2);
14330 __pyx_t_4 = __Pyx_PyInt_From_int(SDL_WINDOWPOS_UNDEFINED); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 130, __pyx_L1_error)
14331 __Pyx_GOTREF(__pyx_t_4);
14332 __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 130, __pyx_L1_error)
1410714333 __Pyx_GOTREF(__pyx_t_1);
14108 __pyx_t_4 = __Pyx_PyInt_From_int(SDL_WINDOWPOS_UNDEFINED); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 145, __pyx_L1_error)
14334 __Pyx_GIVEREF(__pyx_t_2);
14335 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
14336 __Pyx_GIVEREF(__pyx_t_4);
14337 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
14338 __pyx_t_2 = 0;
14339 __pyx_t_4 = 0;
14340 __pyx_k__3 = __pyx_t_1;
14341 __Pyx_GIVEREF(__pyx_t_1);
14342 __pyx_t_1 = 0;
14343
14344 /* "pygame_sdl2/display.pyx":480
14345 *
14346 * # The icon that's used for new windows.
14347 * default_icon = None # <<<<<<<<<<<<<<
14348 *
14349 * # The title that's used for new windows.
14350 */
14351 if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_icon, Py_None) < 0) __PYX_ERR(0, 480, __pyx_L1_error)
14352
14353 /* "pygame_sdl2/display.pyx":483
14354 *
14355 * # The title that's used for new windows.
14356 * default_title = "pygame window" # <<<<<<<<<<<<<<
14357 *
14358 * # The default gl_swap_control
14359 */
14360 if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_title, __pyx_kp_s_pygame_window) < 0) __PYX_ERR(0, 483, __pyx_L1_error)
14361
14362 /* "pygame_sdl2/display.pyx":486
14363 *
14364 * # The default gl_swap_control
14365 * default_swap_control = 1 # <<<<<<<<<<<<<<
14366 *
14367 * def set_mode(resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)):
14368 */
14369 if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_swap_control, __pyx_int_1) < 0) __PYX_ERR(0, 486, __pyx_L1_error)
14370
14371 /* "pygame_sdl2/display.pyx":488
14372 * default_swap_control = 1
14373 *
14374 * def set_mode(resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): # <<<<<<<<<<<<<<
14375 * global main_window
14376 *
14377 */
14378 __pyx_t_1 = __Pyx_PyInt_From_int(SDL_WINDOWPOS_UNDEFINED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 488, __pyx_L1_error)
14379 __Pyx_GOTREF(__pyx_t_1);
14380 __pyx_t_4 = __Pyx_PyInt_From_int(SDL_WINDOWPOS_UNDEFINED); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 488, __pyx_L1_error)
1410914381 __Pyx_GOTREF(__pyx_t_4);
14110 __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error)
14382 __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 488, __pyx_L1_error)
1411114383 __Pyx_GOTREF(__pyx_t_2);
1411214384 __Pyx_GIVEREF(__pyx_t_1);
1411314385 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
1411514387 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
1411614388 __pyx_t_1 = 0;
1411714389 __pyx_t_4 = 0;
14118 __pyx_k__3 = __pyx_t_2;
14390 __pyx_k__9 = __pyx_t_2;
1411914391 __Pyx_GIVEREF(__pyx_t_2);
1412014392 __pyx_t_2 = 0;
14121
14122 /* "pygame_sdl2/display.pyx":469
14123 *
14124 * # The icon that's used for new windows.
14125 * default_icon = None # <<<<<<<<<<<<<<
14126 *
14127 * # The title that's used for new windows.
14128 */
14129 if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_icon, Py_None) < 0) __PYX_ERR(0, 469, __pyx_L1_error)
14130
14131 /* "pygame_sdl2/display.pyx":472
14132 *
14133 * # The title that's used for new windows.
14134 * default_title = "pygame window" # <<<<<<<<<<<<<<
14135 *
14136 * # The default gl_swap_control
14137 */
14138 if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_title, __pyx_kp_s_pygame_window) < 0) __PYX_ERR(0, 472, __pyx_L1_error)
14139
14140 /* "pygame_sdl2/display.pyx":475
14141 *
14142 * # The default gl_swap_control
14143 * default_swap_control = 1 # <<<<<<<<<<<<<<
14144 *
14145 * def set_mode(resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)):
14146 */
14147 if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_swap_control, __pyx_int_1) < 0) __PYX_ERR(0, 475, __pyx_L1_error)
14148
14149 /* "pygame_sdl2/display.pyx":477
14150 * default_swap_control = 1
14151 *
14152 * def set_mode(resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): # <<<<<<<<<<<<<<
14393 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_13set_mode, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 488, __pyx_L1_error)
14394 __Pyx_GOTREF(__pyx_t_2);
14395 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_mode, __pyx_t_2) < 0) __PYX_ERR(0, 488, __pyx_L1_error)
14396 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14397
14398 /* "pygame_sdl2/display.pyx":509
14399 * return main_window.surface
14400 *
14401 * def destroy(): # <<<<<<<<<<<<<<
1415314402 * global main_window
1415414403 *
1415514404 */
14156 __pyx_t_2 = __Pyx_PyInt_From_int(SDL_WINDOWPOS_UNDEFINED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 477, __pyx_L1_error)
14405 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_15destroy, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 509, __pyx_L1_error)
1415714406 __Pyx_GOTREF(__pyx_t_2);
14158 __pyx_t_4 = __Pyx_PyInt_From_int(SDL_WINDOWPOS_UNDEFINED); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 477, __pyx_L1_error)
14159 __Pyx_GOTREF(__pyx_t_4);
14160 __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 477, __pyx_L1_error)
14161 __Pyx_GOTREF(__pyx_t_1);
14162 __Pyx_GIVEREF(__pyx_t_2);
14163 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
14164 __Pyx_GIVEREF(__pyx_t_4);
14165 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
14166 __pyx_t_2 = 0;
14167 __pyx_t_4 = 0;
14168 __pyx_k__9 = __pyx_t_1;
14169 __Pyx_GIVEREF(__pyx_t_1);
14170 __pyx_t_1 = 0;
14171 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_15set_mode, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 477, __pyx_L1_error)
14172 __Pyx_GOTREF(__pyx_t_1);
14173 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_mode, __pyx_t_1) < 0) __PYX_ERR(0, 477, __pyx_L1_error)
14174 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14175
14176 /* "pygame_sdl2/display.pyx":498
14177 * return main_window.surface
14407 if (PyDict_SetItem(__pyx_d, __pyx_n_s_destroy, __pyx_t_2) < 0) __PYX_ERR(0, 509, __pyx_L1_error)
14408 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14409
14410 /* "pygame_sdl2/display.pyx":516
14411 * main_window = None
1417814412 *
1417914413 * def get_surface(): # <<<<<<<<<<<<<<
1418014414 * if main_window is None:
1418114415 * return None
1418214416 */
14183 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_17get_surface, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 498, __pyx_L1_error)
14184 __Pyx_GOTREF(__pyx_t_1);
14185 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_surface, __pyx_t_1) < 0) __PYX_ERR(0, 498, __pyx_L1_error)
14186 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14187
14188 /* "pygame_sdl2/display.pyx":504
14417 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_17get_surface, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 516, __pyx_L1_error)
14418 __Pyx_GOTREF(__pyx_t_2);
14419 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_surface, __pyx_t_2) < 0) __PYX_ERR(0, 516, __pyx_L1_error)
14420 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14421
14422 /* "pygame_sdl2/display.pyx":522
1418914423 * return main_window.get_surface()
1419014424 *
1419114425 * def get_window(): # <<<<<<<<<<<<<<
1419214426 * """
1419314427 * Returns the Window created by set_mode, or None if no such window
1419414428 */
14195 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_19get_window, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error)
14196 __Pyx_GOTREF(__pyx_t_1);
14197 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_window, __pyx_t_1) < 0) __PYX_ERR(0, 504, __pyx_L1_error)
14198 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14199
14200 /* "pygame_sdl2/display.pyx":512
14429 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_19get_window, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 522, __pyx_L1_error)
14430 __Pyx_GOTREF(__pyx_t_2);
14431 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_window, __pyx_t_2) < 0) __PYX_ERR(0, 522, __pyx_L1_error)
14432 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14433
14434 /* "pygame_sdl2/display.pyx":530
1420114435 * return main_window
1420214436 *
1420314437 * def flip(): # <<<<<<<<<<<<<<
1420414438 * if main_window:
1420514439 * main_window.flip()
1420614440 */
14207 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_21flip, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error)
14208 __Pyx_GOTREF(__pyx_t_1);
14209 if (PyDict_SetItem(__pyx_d, __pyx_n_s_flip, __pyx_t_1) < 0) __PYX_ERR(0, 512, __pyx_L1_error)
14210 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14211
14212 /* "pygame_sdl2/display.pyx":516
14441 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_21flip, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 530, __pyx_L1_error)
14442 __Pyx_GOTREF(__pyx_t_2);
14443 if (PyDict_SetItem(__pyx_d, __pyx_n_s_flip, __pyx_t_2) < 0) __PYX_ERR(0, 530, __pyx_L1_error)
14444 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14445
14446 /* "pygame_sdl2/display.pyx":534
1421314447 * main_window.flip()
1421414448 *
1421514449 * def update(rectangles=None): # <<<<<<<<<<<<<<
1421614450 * if main_window:
1421714451 * main_window.update(rectangles)
1421814452 */
14219 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_23update, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error)
14220 __Pyx_GOTREF(__pyx_t_1);
14221 if (PyDict_SetItem(__pyx_d, __pyx_n_s_update, __pyx_t_1) < 0) __PYX_ERR(0, 516, __pyx_L1_error)
14222 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14223
14224 /* "pygame_sdl2/display.pyx":520
14453 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_23update, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 534, __pyx_L1_error)
14454 __Pyx_GOTREF(__pyx_t_2);
14455 if (PyDict_SetItem(__pyx_d, __pyx_n_s_update, __pyx_t_2) < 0) __PYX_ERR(0, 534, __pyx_L1_error)
14456 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14457
14458 /* "pygame_sdl2/display.pyx":538
1422514459 * main_window.update(rectangles)
1422614460 *
1422714461 * def get_driver(): # <<<<<<<<<<<<<<
1422814462 * cdef const char *driver = SDL_GetCurrentVideoDriver()
1422914463 *
1423014464 */
14231 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_25get_driver, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error)
14232 __Pyx_GOTREF(__pyx_t_1);
14233 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_driver, __pyx_t_1) < 0) __PYX_ERR(0, 520, __pyx_L1_error)
14234 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14235
14236 /* "pygame_sdl2/display.pyx":528
14465 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_25get_driver, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 538, __pyx_L1_error)
14466 __Pyx_GOTREF(__pyx_t_2);
14467 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_driver, __pyx_t_2) < 0) __PYX_ERR(0, 538, __pyx_L1_error)
14468 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14469
14470 /* "pygame_sdl2/display.pyx":546
1423714471 * return driver
1423814472 *
1423914473 * class Info(object): # <<<<<<<<<<<<<<
1424014474 *
1424114475 * def __init__(self):
1424214476 */
14243 __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__29); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 528, __pyx_L1_error)
14244 __Pyx_GOTREF(__pyx_t_1);
14245 __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_tuple__29, __pyx_n_s_Info, __pyx_n_s_Info, (PyObject *) NULL, __pyx_n_s_pygame_sdl2_display, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 528, __pyx_L1_error)
14477 __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__28); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 546, __pyx_L1_error)
14478 __Pyx_GOTREF(__pyx_t_2);
14479 __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_tuple__28, __pyx_n_s_Info, __pyx_n_s_Info, (PyObject *) NULL, __pyx_n_s_pygame_sdl2_display, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 546, __pyx_L1_error)
1424614480 __Pyx_GOTREF(__pyx_t_4);
1424714481
14248 /* "pygame_sdl2/display.pyx":530
14482 /* "pygame_sdl2/display.pyx":548
1424914483 * class Info(object):
1425014484 *
1425114485 * def __init__(self): # <<<<<<<<<<<<<<
1425214486 * cdef SDL_DisplayMode dm
1425314487 * cdef SDL_PixelFormat *format
1425414488 */
14255 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_4Info_1__init__, 0, __pyx_n_s_Info___init, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 530, __pyx_L1_error)
14256 __Pyx_GOTREF(__pyx_t_2);
14257 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_init_2, __pyx_t_2) < 0) __PYX_ERR(0, 530, __pyx_L1_error)
14258 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14259
14260 /* "pygame_sdl2/display.pyx":589
14489 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_4Info_1__init__, 0, __pyx_n_s_Info___init, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 548, __pyx_L1_error)
14490 __Pyx_GOTREF(__pyx_t_1);
14491 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_init_2, __pyx_t_1) < 0) __PYX_ERR(0, 548, __pyx_L1_error)
14492 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14493
14494 /* "pygame_sdl2/display.pyx":607
1426114495 * self.blit_sw_A = False
1426214496 *
1426314497 * def __repr__(self): # <<<<<<<<<<<<<<
1426414498 * return "<Info({!r})>".format(self.__dict__)
1426514499 *
1426614500 */
14267 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_4Info_3__repr__, 0, __pyx_n_s_Info___repr, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 589, __pyx_L1_error)
14268 __Pyx_GOTREF(__pyx_t_2);
14269 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_repr, __pyx_t_2) < 0) __PYX_ERR(0, 589, __pyx_L1_error)
14501 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_4Info_3__repr__, 0, __pyx_n_s_Info___repr, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 607, __pyx_L1_error)
14502 __Pyx_GOTREF(__pyx_t_1);
14503 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_repr, __pyx_t_1) < 0) __PYX_ERR(0, 607, __pyx_L1_error)
14504 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14505
14506 /* "pygame_sdl2/display.pyx":546
14507 * return driver
14508 *
14509 * class Info(object): # <<<<<<<<<<<<<<
14510 *
14511 * def __init__(self):
14512 */
14513 __pyx_t_1 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Info, __pyx_tuple__28, __pyx_t_4, NULL, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 546, __pyx_L1_error)
14514 __Pyx_GOTREF(__pyx_t_1);
14515 if (PyDict_SetItem(__pyx_d, __pyx_n_s_Info, __pyx_t_1) < 0) __PYX_ERR(0, 546, __pyx_L1_error)
14516 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14517 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1427014518 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1427114519
14272 /* "pygame_sdl2/display.pyx":528
14273 * return driver
14274 *
14275 * class Info(object): # <<<<<<<<<<<<<<
14276 *
14277 * def __init__(self):
14278 */
14279 __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Info, __pyx_tuple__29, __pyx_t_4, NULL, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 528, __pyx_L1_error)
14280 __Pyx_GOTREF(__pyx_t_2);
14281 if (PyDict_SetItem(__pyx_d, __pyx_n_s_Info, __pyx_t_2) < 0) __PYX_ERR(0, 528, __pyx_L1_error)
14282 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14283 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14284 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14285
14286 /* "pygame_sdl2/display.pyx":593
14520 /* "pygame_sdl2/display.pyx":611
1428714521 *
1428814522 *
1428914523 * def get_wm_info(): # <<<<<<<<<<<<<<
1429014524 * if main_window:
1429114525 * return main_window.get_wm_info()
1429214526 */
14293 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_27get_wm_info, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 593, __pyx_L1_error)
14294 __Pyx_GOTREF(__pyx_t_1);
14295 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_wm_info, __pyx_t_1) < 0) __PYX_ERR(0, 593, __pyx_L1_error)
14296 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14297
14298 /* "pygame_sdl2/display.pyx":600
14527 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_27get_wm_info, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 611, __pyx_L1_error)
14528 __Pyx_GOTREF(__pyx_t_2);
14529 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_wm_info, __pyx_t_2) < 0) __PYX_ERR(0, 611, __pyx_L1_error)
14530 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14531
14532 /* "pygame_sdl2/display.pyx":618
1429914533 *
1430014534 *
1430114535 * def get_num_video_displays(): # <<<<<<<<<<<<<<
1430214536 * """
1430314537 * Returns the number of video displays connected to the system.
1430414538 */
14305 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_29get_num_video_displays, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 600, __pyx_L1_error)
14306 __Pyx_GOTREF(__pyx_t_1);
14307 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_num_video_displays, __pyx_t_1) < 0) __PYX_ERR(0, 600, __pyx_L1_error)
14308 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14309
14310 /* "pygame_sdl2/display.pyx":613
14539 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_29get_num_video_displays, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 618, __pyx_L1_error)
14540 __Pyx_GOTREF(__pyx_t_2);
14541 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_num_video_displays, __pyx_t_2) < 0) __PYX_ERR(0, 618, __pyx_L1_error)
14542 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14543
14544 /* "pygame_sdl2/display.pyx":631
1431114545 *
1431214546 *
1431314547 * def list_modes(depth=0, flags=0, display=0): # <<<<<<<<<<<<<<
1431414548 * """
1431514549 * Returns a list of possible display modes for the display `display`.
1431614550 */
14317 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_31list_modes, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 613, __pyx_L1_error)
14318 __Pyx_GOTREF(__pyx_t_1);
14319 if (PyDict_SetItem(__pyx_d, __pyx_n_s_list_modes, __pyx_t_1) < 0) __PYX_ERR(0, 613, __pyx_L1_error)
14320 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14321
14322 /* "pygame_sdl2/display.pyx":638
14551 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_31list_modes, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 631, __pyx_L1_error)
14552 __Pyx_GOTREF(__pyx_t_2);
14553 if (PyDict_SetItem(__pyx_d, __pyx_n_s_list_modes, __pyx_t_2) < 0) __PYX_ERR(0, 631, __pyx_L1_error)
14554 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14555
14556 /* "pygame_sdl2/display.pyx":656
1432314557 *
1432414558 *
1432514559 * def mode_ok(size, flags=0, depth=0): # <<<<<<<<<<<<<<
1432614560 * """
1432714561 * Returns true if size is in the result of list_modes().
1432814562 */
14329 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_33mode_ok, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 638, __pyx_L1_error)
14330 __Pyx_GOTREF(__pyx_t_1);
14331 if (PyDict_SetItem(__pyx_d, __pyx_n_s_mode_ok, __pyx_t_1) < 0) __PYX_ERR(0, 638, __pyx_L1_error)
14332 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14333
14334 /* "pygame_sdl2/display.pyx":645
14563 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_33mode_ok, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 656, __pyx_L1_error)
14564 __Pyx_GOTREF(__pyx_t_2);
14565 if (PyDict_SetItem(__pyx_d, __pyx_n_s_mode_ok, __pyx_t_2) < 0) __PYX_ERR(0, 656, __pyx_L1_error)
14566 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14567
14568 /* "pygame_sdl2/display.pyx":663
1433514569 * return tuple(size) in list_modes()
1433614570 *
1433714571 * def gl_reset_attributes(): # <<<<<<<<<<<<<<
1433814572 * SDL_GL_ResetAttributes()
1433914573 *
1434014574 */
14341 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_35gl_reset_attributes, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 645, __pyx_L1_error)
14342 __Pyx_GOTREF(__pyx_t_1);
14343 if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_reset_attributes, __pyx_t_1) < 0) __PYX_ERR(0, 645, __pyx_L1_error)
14344 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14345
14346 /* "pygame_sdl2/display.pyx":648
14575 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_35gl_reset_attributes, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error)
14576 __Pyx_GOTREF(__pyx_t_2);
14577 if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_reset_attributes, __pyx_t_2) < 0) __PYX_ERR(0, 663, __pyx_L1_error)
14578 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14579
14580 /* "pygame_sdl2/display.pyx":666
1434714581 * SDL_GL_ResetAttributes()
1434814582 *
1434914583 * def gl_set_attribute(flag, value): # <<<<<<<<<<<<<<
1435014584 *
1435114585 * if flag == GL_SWAP_CONTROL:
1435214586 */
14353 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_37gl_set_attribute, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 648, __pyx_L1_error)
14354 __Pyx_GOTREF(__pyx_t_1);
14355 if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_set_attribute, __pyx_t_1) < 0) __PYX_ERR(0, 648, __pyx_L1_error)
14356 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14357
14358 /* "pygame_sdl2/display.pyx":668
14587 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_37gl_set_attribute, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 666, __pyx_L1_error)
14588 __Pyx_GOTREF(__pyx_t_2);
14589 if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_set_attribute, __pyx_t_2) < 0) __PYX_ERR(0, 666, __pyx_L1_error)
14590 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14591
14592 /* "pygame_sdl2/display.pyx":686
1435914593 * raise error()
1436014594 *
1436114595 * def gl_get_attribute(flag): # <<<<<<<<<<<<<<
1436214596 * cdef int rv
1436314597 *
1436414598 */
14365 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_39gl_get_attribute, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error)
14366 __Pyx_GOTREF(__pyx_t_1);
14367 if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_get_attribute, __pyx_t_1) < 0) __PYX_ERR(0, 668, __pyx_L1_error)
14368 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14369
14370 /* "pygame_sdl2/display.pyx":679
14599 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_39gl_get_attribute, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 686, __pyx_L1_error)
14600 __Pyx_GOTREF(__pyx_t_2);
14601 if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_get_attribute, __pyx_t_2) < 0) __PYX_ERR(0, 686, __pyx_L1_error)
14602 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14603
14604 /* "pygame_sdl2/display.pyx":697
1437114605 * return rv
1437214606 *
1437314607 * def gl_load_library(path): # <<<<<<<<<<<<<<
1437414608 * if path is None:
1437514609 * if SDL_GL_LoadLibrary(NULL):
1437614610 */
14377 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_41gl_load_library, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 679, __pyx_L1_error)
14378 __Pyx_GOTREF(__pyx_t_1);
14379 if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_load_library, __pyx_t_1) < 0) __PYX_ERR(0, 679, __pyx_L1_error)
14380 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14381
14382 /* "pygame_sdl2/display.pyx":687
14611 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_41gl_load_library, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 697, __pyx_L1_error)
14612 __Pyx_GOTREF(__pyx_t_2);
14613 if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_load_library, __pyx_t_2) < 0) __PYX_ERR(0, 697, __pyx_L1_error)
14614 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14615
14616 /* "pygame_sdl2/display.pyx":705
1438314617 * raise error()
1438414618 *
1438514619 * def gl_unload_library(): # <<<<<<<<<<<<<<
1438614620 * SDL_GL_UnloadLibrary()
1438714621 *
1438814622 */
14389 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_43gl_unload_library, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 687, __pyx_L1_error)
14390 __Pyx_GOTREF(__pyx_t_1);
14391 if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_unload_library, __pyx_t_1) < 0) __PYX_ERR(0, 687, __pyx_L1_error)
14392 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14393
14394 /* "pygame_sdl2/display.pyx":690
14623 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_43gl_unload_library, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 705, __pyx_L1_error)
14624 __Pyx_GOTREF(__pyx_t_2);
14625 if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_unload_library, __pyx_t_2) < 0) __PYX_ERR(0, 705, __pyx_L1_error)
14626 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14627
14628 /* "pygame_sdl2/display.pyx":708
1439514629 * SDL_GL_UnloadLibrary()
1439614630 *
1439714631 * def get_active(): # <<<<<<<<<<<<<<
1439814632 * if main_window:
1439914633 * return main_window.get_active()
1440014634 */
14401 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_45get_active, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 690, __pyx_L1_error)
14402 __Pyx_GOTREF(__pyx_t_1);
14403 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_active, __pyx_t_1) < 0) __PYX_ERR(0, 690, __pyx_L1_error)
14404 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14405
14406 /* "pygame_sdl2/display.pyx":695
14635 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_45get_active, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 708, __pyx_L1_error)
14636 __Pyx_GOTREF(__pyx_t_2);
14637 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_active, __pyx_t_2) < 0) __PYX_ERR(0, 708, __pyx_L1_error)
14638 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14639
14640 /* "pygame_sdl2/display.pyx":713
1440714641 * return False
1440814642 *
1440914643 * def iconify(): # <<<<<<<<<<<<<<
1441014644 * if main_window:
1441114645 * return main_window.iconify()
1441214646 */
14413 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_47iconify, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 695, __pyx_L1_error)
14414 __Pyx_GOTREF(__pyx_t_1);
14415 if (PyDict_SetItem(__pyx_d, __pyx_n_s_iconify, __pyx_t_1) < 0) __PYX_ERR(0, 695, __pyx_L1_error)
14416 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14417
14418 /* "pygame_sdl2/display.pyx":701
14647 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_47iconify, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 713, __pyx_L1_error)
14648 __Pyx_GOTREF(__pyx_t_2);
14649 if (PyDict_SetItem(__pyx_d, __pyx_n_s_iconify, __pyx_t_2) < 0) __PYX_ERR(0, 713, __pyx_L1_error)
14650 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14651
14652 /* "pygame_sdl2/display.pyx":719
1441914653 * return False
1442014654 *
1442114655 * def toggle_fullscreen(): # <<<<<<<<<<<<<<
1442214656 * if main_window:
1442314657 * return main_window.toggle_fullscreen()
1442414658 */
14425 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_49toggle_fullscreen, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 701, __pyx_L1_error)
14426 __Pyx_GOTREF(__pyx_t_1);
14427 if (PyDict_SetItem(__pyx_d, __pyx_n_s_toggle_fullscreen, __pyx_t_1) < 0) __PYX_ERR(0, 701, __pyx_L1_error)
14428 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14429
14430 /* "pygame_sdl2/display.pyx":707
14659 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_49toggle_fullscreen, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 719, __pyx_L1_error)
14660 __Pyx_GOTREF(__pyx_t_2);
14661 if (PyDict_SetItem(__pyx_d, __pyx_n_s_toggle_fullscreen, __pyx_t_2) < 0) __PYX_ERR(0, 719, __pyx_L1_error)
14662 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14663
14664 /* "pygame_sdl2/display.pyx":725
1443114665 * return True
1443214666 *
1443314667 * def set_gamma(red, green=None, blue=None): # <<<<<<<<<<<<<<
1443414668 * if main_window:
1443514669 * return main_window.set_gamma(red, green, blue)
1443614670 */
14437 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_51set_gamma, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 707, __pyx_L1_error)
14438 __Pyx_GOTREF(__pyx_t_1);
14439 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_gamma, __pyx_t_1) < 0) __PYX_ERR(0, 707, __pyx_L1_error)
14440 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14441
14442 /* "pygame_sdl2/display.pyx":712
14671 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_51set_gamma, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 725, __pyx_L1_error)
14672 __Pyx_GOTREF(__pyx_t_2);
14673 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_gamma, __pyx_t_2) < 0) __PYX_ERR(0, 725, __pyx_L1_error)
14674 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14675
14676 /* "pygame_sdl2/display.pyx":730
1444314677 * return False
1444414678 *
1444514679 * def set_gamma_ramp(red, green, blue): # <<<<<<<<<<<<<<
1444614680 * if main_window:
1444714681 * return main_window.set_gamma_ramp(red, green, blue)
1444814682 */
14449 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_53set_gamma_ramp, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 712, __pyx_L1_error)
14450 __Pyx_GOTREF(__pyx_t_1);
14451 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_gamma_ramp, __pyx_t_1) < 0) __PYX_ERR(0, 712, __pyx_L1_error)
14452 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14453
14454 /* "pygame_sdl2/display.pyx":717
14683 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_53set_gamma_ramp, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L1_error)
14684 __Pyx_GOTREF(__pyx_t_2);
14685 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_gamma_ramp, __pyx_t_2) < 0) __PYX_ERR(0, 730, __pyx_L1_error)
14686 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14687
14688 /* "pygame_sdl2/display.pyx":735
1445514689 * return False
1445614690 *
1445714691 * def set_icon(surface): # <<<<<<<<<<<<<<
1445814692 * global default_icon
1445914693 *
1446014694 */
14461 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_55set_icon, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 717, __pyx_L1_error)
14462 __Pyx_GOTREF(__pyx_t_1);
14463 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_icon, __pyx_t_1) < 0) __PYX_ERR(0, 717, __pyx_L1_error)
14464 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14465
14466 /* "pygame_sdl2/display.pyx":725
14695 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_55set_icon, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 735, __pyx_L1_error)
14696 __Pyx_GOTREF(__pyx_t_2);
14697 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_icon, __pyx_t_2) < 0) __PYX_ERR(0, 735, __pyx_L1_error)
14698 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14699
14700 /* "pygame_sdl2/display.pyx":743
1446714701 * main_window.set_icon(default_icon)
1446814702 *
1446914703 * def set_caption(title, icontitle = None): # <<<<<<<<<<<<<<
1447014704 * global default_title
1447114705 *
1447214706 */
14473 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_57set_caption, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 725, __pyx_L1_error)
14474 __Pyx_GOTREF(__pyx_t_1);
14475 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_caption, __pyx_t_1) < 0) __PYX_ERR(0, 725, __pyx_L1_error)
14476 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14477
14478 /* "pygame_sdl2/display.pyx":733
14707 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_57set_caption, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 743, __pyx_L1_error)
14708 __Pyx_GOTREF(__pyx_t_2);
14709 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_caption, __pyx_t_2) < 0) __PYX_ERR(0, 743, __pyx_L1_error)
14710 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14711
14712 /* "pygame_sdl2/display.pyx":751
1447914713 * main_window.set_caption(default_title)
1448014714 *
1448114715 * def get_caption(): # <<<<<<<<<<<<<<
1448214716 * return default_title
1448314717 *
1448414718 */
14485 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_59get_caption, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 733, __pyx_L1_error)
14486 __Pyx_GOTREF(__pyx_t_1);
14487 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_caption, __pyx_t_1) < 0) __PYX_ERR(0, 733, __pyx_L1_error)
14488 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14489
14490 /* "pygame_sdl2/display.pyx":736
14719 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_59get_caption, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 751, __pyx_L1_error)
14720 __Pyx_GOTREF(__pyx_t_2);
14721 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_caption, __pyx_t_2) < 0) __PYX_ERR(0, 751, __pyx_L1_error)
14722 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14723
14724 /* "pygame_sdl2/display.pyx":754
1449114725 * return default_title
1449214726 *
1449314727 * def get_drawable_size(): # <<<<<<<<<<<<<<
1449414728 * if main_window:
1449514729 * return main_window.get_drawable_size()
1449614730 */
14497 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_61get_drawable_size, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 736, __pyx_L1_error)
14498 __Pyx_GOTREF(__pyx_t_1);
14499 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_drawable_size, __pyx_t_1) < 0) __PYX_ERR(0, 736, __pyx_L1_error)
14500 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14501
14502 /* "pygame_sdl2/display.pyx":741
14731 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_61get_drawable_size, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 754, __pyx_L1_error)
14732 __Pyx_GOTREF(__pyx_t_2);
14733 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_drawable_size, __pyx_t_2) < 0) __PYX_ERR(0, 754, __pyx_L1_error)
14734 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14735
14736 /* "pygame_sdl2/display.pyx":759
1450314737 * return None
1450414738 *
1450514739 * def get_size(): # <<<<<<<<<<<<<<
1450614740 * if main_window:
1450714741 * return main_window.get_size()
1450814742 */
14509 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_63get_size, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 741, __pyx_L1_error)
14510 __Pyx_GOTREF(__pyx_t_1);
14511 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_size, __pyx_t_1) < 0) __PYX_ERR(0, 741, __pyx_L1_error)
14512 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14513
14514 /* "pygame_sdl2/display.pyx":746
14743 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_63get_size, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 759, __pyx_L1_error)
14744 __Pyx_GOTREF(__pyx_t_2);
14745 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_size, __pyx_t_2) < 0) __PYX_ERR(0, 759, __pyx_L1_error)
14746 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14747
14748 /* "pygame_sdl2/display.pyx":764
1451514749 * return None
1451614750 *
1451714751 * def get_num_video_displays(): # <<<<<<<<<<<<<<
1451814752 * rv = SDL_GetNumVideoDisplays()
1451914753 * if rv < 0:
1452014754 */
14521 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_65get_num_video_displays, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 746, __pyx_L1_error)
14522 __Pyx_GOTREF(__pyx_t_1);
14523 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_num_video_displays, __pyx_t_1) < 0) __PYX_ERR(0, 746, __pyx_L1_error)
14524 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14525
14526 /* "pygame_sdl2/display.pyx":753
14755 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_65get_num_video_displays, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 764, __pyx_L1_error)
14756 __Pyx_GOTREF(__pyx_t_2);
14757 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_num_video_displays, __pyx_t_2) < 0) __PYX_ERR(0, 764, __pyx_L1_error)
14758 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14759
14760 /* "pygame_sdl2/display.pyx":771
1452714761 * return rv
1452814762 *
1452914763 * def get_display_bounds(index): # <<<<<<<<<<<<<<
1453014764 * cdef SDL_Rect rect
1453114765 * rv = SDL_GetDisplayBounds(index, &rect)
1453214766 */
14533 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_67get_display_bounds, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 753, __pyx_L1_error)
14534 __Pyx_GOTREF(__pyx_t_1);
14535 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_display_bounds, __pyx_t_1) < 0) __PYX_ERR(0, 753, __pyx_L1_error)
14536 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14537
14538 /* "pygame_sdl2/display.pyx":759
14767 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_67get_display_bounds, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 771, __pyx_L1_error)
14768 __Pyx_GOTREF(__pyx_t_2);
14769 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_display_bounds, __pyx_t_2) < 0) __PYX_ERR(0, 771, __pyx_L1_error)
14770 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14771
14772 /* "pygame_sdl2/display.pyx":777
1453914773 * return (rect.x, rect.y, rect.w, rect.h)
1454014774 *
1454114775 * def set_screensaver(state): # <<<<<<<<<<<<<<
1454214776 * """
1454314777 * Sets the screenslaver to `state`.
1454414778 */
14545 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_69set_screensaver, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 759, __pyx_L1_error)
14546 __Pyx_GOTREF(__pyx_t_1);
14547 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_screensaver, __pyx_t_1) < 0) __PYX_ERR(0, 759, __pyx_L1_error)
14548 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14549
14550 /* "pygame_sdl2/display.pyx":769
14779 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_69set_screensaver, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 777, __pyx_L1_error)
14780 __Pyx_GOTREF(__pyx_t_2);
14781 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_screensaver, __pyx_t_2) < 0) __PYX_ERR(0, 777, __pyx_L1_error)
14782 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14783
14784 /* "pygame_sdl2/display.pyx":787
1455114785 * SDL_DisableScreenSaver()
1455214786 *
1455314787 * def get_platform(): # <<<<<<<<<<<<<<
1455414788 * return SDL_GetPlatform()
1455514789 *
1455614790 */
14557 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_71get_platform, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 769, __pyx_L1_error)
14558 __Pyx_GOTREF(__pyx_t_1);
14559 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_platform, __pyx_t_1) < 0) __PYX_ERR(0, 769, __pyx_L1_error)
14560 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14791 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_71get_platform, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 787, __pyx_L1_error)
14792 __Pyx_GOTREF(__pyx_t_2);
14793 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_platform, __pyx_t_2) < 0) __PYX_ERR(0, 787, __pyx_L1_error)
14794 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1456114795
1456214796 /* "pygame_sdl2/display.pyx":1
1456314797 * # Copyright 2014 Patrick Dawson <pat@dw.is> # <<<<<<<<<<<<<<
1456414798 * # Copyright 2014 Tom Rothamel <tom@rothamel.us>
1456514799 * #
1456614800 */
14567 __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
14568 __Pyx_GOTREF(__pyx_t_1);
14569 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
14570 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14801 __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
14802 __Pyx_GOTREF(__pyx_t_2);
14803 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
14804 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1457114805
1457214806 /*--- Wrapped vars code ---*/
1457314807
1541615650 }
1541715651 #endif
1541815652
15653 /* GetTopmostException */
15654 #if CYTHON_USE_EXC_INFO_STACK
15655 static _PyErr_StackItem *
15656 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
15657 {
15658 _PyErr_StackItem *exc_info = tstate->exc_info;
15659 while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
15660 exc_info->previous_item != NULL)
15661 {
15662 exc_info = exc_info->previous_item;
15663 }
15664 return exc_info;
15665 }
15666 #endif
15667
15668 /* SaveResetException */
15669 #if CYTHON_FAST_THREAD_STATE
15670 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
15671 #if CYTHON_USE_EXC_INFO_STACK
15672 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
15673 *type = exc_info->exc_type;
15674 *value = exc_info->exc_value;
15675 *tb = exc_info->exc_traceback;
15676 #else
15677 *type = tstate->exc_type;
15678 *value = tstate->exc_value;
15679 *tb = tstate->exc_traceback;
15680 #endif
15681 Py_XINCREF(*type);
15682 Py_XINCREF(*value);
15683 Py_XINCREF(*tb);
15684 }
15685 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
15686 PyObject *tmp_type, *tmp_value, *tmp_tb;
15687 #if CYTHON_USE_EXC_INFO_STACK
15688 _PyErr_StackItem *exc_info = tstate->exc_info;
15689 tmp_type = exc_info->exc_type;
15690 tmp_value = exc_info->exc_value;
15691 tmp_tb = exc_info->exc_traceback;
15692 exc_info->exc_type = type;
15693 exc_info->exc_value = value;
15694 exc_info->exc_traceback = tb;
15695 #else
15696 tmp_type = tstate->exc_type;
15697 tmp_value = tstate->exc_value;
15698 tmp_tb = tstate->exc_traceback;
15699 tstate->exc_type = type;
15700 tstate->exc_value = value;
15701 tstate->exc_traceback = tb;
15702 #endif
15703 Py_XDECREF(tmp_type);
15704 Py_XDECREF(tmp_value);
15705 Py_XDECREF(tmp_tb);
15706 }
15707 #endif
15708
15709 /* GetException */
15710 #if CYTHON_FAST_THREAD_STATE
15711 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
15712 #else
15713 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
15714 #endif
15715 {
15716 PyObject *local_type, *local_value, *local_tb;
15717 #if CYTHON_FAST_THREAD_STATE
15718 PyObject *tmp_type, *tmp_value, *tmp_tb;
15719 local_type = tstate->curexc_type;
15720 local_value = tstate->curexc_value;
15721 local_tb = tstate->curexc_traceback;
15722 tstate->curexc_type = 0;
15723 tstate->curexc_value = 0;
15724 tstate->curexc_traceback = 0;
15725 #else
15726 PyErr_Fetch(&local_type, &local_value, &local_tb);
15727 #endif
15728 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
15729 #if CYTHON_FAST_THREAD_STATE
15730 if (unlikely(tstate->curexc_type))
15731 #else
15732 if (unlikely(PyErr_Occurred()))
15733 #endif
15734 goto bad;
15735 #if PY_MAJOR_VERSION >= 3
15736 if (local_tb) {
15737 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
15738 goto bad;
15739 }
15740 #endif
15741 Py_XINCREF(local_tb);
15742 Py_XINCREF(local_type);
15743 Py_XINCREF(local_value);
15744 *type = local_type;
15745 *value = local_value;
15746 *tb = local_tb;
15747 #if CYTHON_FAST_THREAD_STATE
15748 #if CYTHON_USE_EXC_INFO_STACK
15749 {
15750 _PyErr_StackItem *exc_info = tstate->exc_info;
15751 tmp_type = exc_info->exc_type;
15752 tmp_value = exc_info->exc_value;
15753 tmp_tb = exc_info->exc_traceback;
15754 exc_info->exc_type = local_type;
15755 exc_info->exc_value = local_value;
15756 exc_info->exc_traceback = local_tb;
15757 }
15758 #else
15759 tmp_type = tstate->exc_type;
15760 tmp_value = tstate->exc_value;
15761 tmp_tb = tstate->exc_traceback;
15762 tstate->exc_type = local_type;
15763 tstate->exc_value = local_value;
15764 tstate->exc_traceback = local_tb;
15765 #endif
15766 Py_XDECREF(tmp_type);
15767 Py_XDECREF(tmp_value);
15768 Py_XDECREF(tmp_tb);
15769 #else
15770 PyErr_SetExcInfo(local_type, local_value, local_tb);
15771 #endif
15772 return 0;
15773 bad:
15774 *type = 0;
15775 *value = 0;
15776 *tb = 0;
15777 Py_XDECREF(local_type);
15778 Py_XDECREF(local_value);
15779 Py_XDECREF(local_tb);
15780 return -1;
15781 }
15782
15783 /* RaiseTooManyValuesToUnpack */
15784 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
15785 PyErr_Format(PyExc_ValueError,
15786 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
15787 }
15788
15789 /* RaiseNeedMoreValuesToUnpack */
15790 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
15791 PyErr_Format(PyExc_ValueError,
15792 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
15793 index, (index == 1) ? "" : "s");
15794 }
15795
15796 /* IterFinish */
15797 static CYTHON_INLINE int __Pyx_IterFinish(void) {
15798 #if CYTHON_FAST_THREAD_STATE
15799 PyThreadState *tstate = __Pyx_PyThreadState_Current;
15800 PyObject* exc_type = tstate->curexc_type;
15801 if (unlikely(exc_type)) {
15802 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
15803 PyObject *exc_value, *exc_tb;
15804 exc_value = tstate->curexc_value;
15805 exc_tb = tstate->curexc_traceback;
15806 tstate->curexc_type = 0;
15807 tstate->curexc_value = 0;
15808 tstate->curexc_traceback = 0;
15809 Py_DECREF(exc_type);
15810 Py_XDECREF(exc_value);
15811 Py_XDECREF(exc_tb);
15812 return 0;
15813 } else {
15814 return -1;
15815 }
15816 }
15817 return 0;
15818 #else
15819 if (unlikely(PyErr_Occurred())) {
15820 if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
15821 PyErr_Clear();
15822 return 0;
15823 } else {
15824 return -1;
15825 }
15826 }
15827 return 0;
15828 #endif
15829 }
15830
15831 /* UnpackItemEndCheck */
15832 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
15833 if (unlikely(retval)) {
15834 Py_DECREF(retval);
15835 __Pyx_RaiseTooManyValuesError(expected);
15836 return -1;
15837 } else {
15838 return __Pyx_IterFinish();
15839 }
15840 return 0;
15841 }
15842
15843 /* SwapException */
15844 #if CYTHON_FAST_THREAD_STATE
15845 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
15846 PyObject *tmp_type, *tmp_value, *tmp_tb;
15847 #if CYTHON_USE_EXC_INFO_STACK
15848 _PyErr_StackItem *exc_info = tstate->exc_info;
15849 tmp_type = exc_info->exc_type;
15850 tmp_value = exc_info->exc_value;
15851 tmp_tb = exc_info->exc_traceback;
15852 exc_info->exc_type = *type;
15853 exc_info->exc_value = *value;
15854 exc_info->exc_traceback = *tb;
15855 #else
15856 tmp_type = tstate->exc_type;
15857 tmp_value = tstate->exc_value;
15858 tmp_tb = tstate->exc_traceback;
15859 tstate->exc_type = *type;
15860 tstate->exc_value = *value;
15861 tstate->exc_traceback = *tb;
15862 #endif
15863 *type = tmp_type;
15864 *value = tmp_value;
15865 *tb = tmp_tb;
15866 }
15867 #else
15868 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
15869 PyObject *tmp_type, *tmp_value, *tmp_tb;
15870 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
15871 PyErr_SetExcInfo(*type, *value, *tb);
15872 *type = tmp_type;
15873 *value = tmp_value;
15874 *tb = tmp_tb;
15875 }
15876 #endif
15877
15878 /* ArgTypeTest */
15879 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
15880 {
15881 if (unlikely(!type)) {
15882 PyErr_SetString(PyExc_SystemError, "Missing type object");
15883 return 0;
15884 }
15885 else if (exact) {
15886 #if PY_MAJOR_VERSION == 2
15887 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
15888 #endif
15889 }
15890 else {
15891 if (likely(__Pyx_TypeCheck(obj, type))) return 1;
15892 }
15893 PyErr_Format(PyExc_TypeError,
15894 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
15895 name, type->tp_name, Py_TYPE(obj)->tp_name);
15896 return 0;
15897 }
15898
1541915899 /* Import */
1542015900 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
1542115901 PyObject *empty_list = 0;
1548115961 return module;
1548215962 }
1548315963
15484 /* GetTopmostException */
15485 #if CYTHON_USE_EXC_INFO_STACK
15486 static _PyErr_StackItem *
15487 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
15488 {
15489 _PyErr_StackItem *exc_info = tstate->exc_info;
15490 while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
15491 exc_info->previous_item != NULL)
15492 {
15493 exc_info = exc_info->previous_item;
15494 }
15495 return exc_info;
15496 }
15497 #endif
15498
15499 /* SaveResetException */
15500 #if CYTHON_FAST_THREAD_STATE
15501 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
15502 #if CYTHON_USE_EXC_INFO_STACK
15503 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
15504 *type = exc_info->exc_type;
15505 *value = exc_info->exc_value;
15506 *tb = exc_info->exc_traceback;
15507 #else
15508 *type = tstate->exc_type;
15509 *value = tstate->exc_value;
15510 *tb = tstate->exc_traceback;
15511 #endif
15512 Py_XINCREF(*type);
15513 Py_XINCREF(*value);
15514 Py_XINCREF(*tb);
15515 }
15516 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
15517 PyObject *tmp_type, *tmp_value, *tmp_tb;
15518 #if CYTHON_USE_EXC_INFO_STACK
15519 _PyErr_StackItem *exc_info = tstate->exc_info;
15520 tmp_type = exc_info->exc_type;
15521 tmp_value = exc_info->exc_value;
15522 tmp_tb = exc_info->exc_traceback;
15523 exc_info->exc_type = type;
15524 exc_info->exc_value = value;
15525 exc_info->exc_traceback = tb;
15526 #else
15527 tmp_type = tstate->exc_type;
15528 tmp_value = tstate->exc_value;
15529 tmp_tb = tstate->exc_traceback;
15530 tstate->exc_type = type;
15531 tstate->exc_value = value;
15532 tstate->exc_traceback = tb;
15533 #endif
15534 Py_XDECREF(tmp_type);
15535 Py_XDECREF(tmp_value);
15536 Py_XDECREF(tmp_tb);
15537 }
15538 #endif
15539
15540 /* PyErrExceptionMatches */
15541 #if CYTHON_FAST_THREAD_STATE
15542 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
15543 Py_ssize_t i, n;
15544 n = PyTuple_GET_SIZE(tuple);
15545 #if PY_MAJOR_VERSION >= 3
15546 for (i=0; i<n; i++) {
15547 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
15548 }
15549 #endif
15550 for (i=0; i<n; i++) {
15551 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
15552 }
15553 return 0;
15554 }
15555 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
15556 PyObject *exc_type = tstate->curexc_type;
15557 if (exc_type == err) return 1;
15558 if (unlikely(!exc_type)) return 0;
15559 if (unlikely(PyTuple_Check(err)))
15560 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
15561 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
15562 }
15563 #endif
15564
15565 /* GetException */
15566 #if CYTHON_FAST_THREAD_STATE
15567 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
15568 #else
15569 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
15570 #endif
15571 {
15572 PyObject *local_type, *local_value, *local_tb;
15573 #if CYTHON_FAST_THREAD_STATE
15574 PyObject *tmp_type, *tmp_value, *tmp_tb;
15575 local_type = tstate->curexc_type;
15576 local_value = tstate->curexc_value;
15577 local_tb = tstate->curexc_traceback;
15578 tstate->curexc_type = 0;
15579 tstate->curexc_value = 0;
15580 tstate->curexc_traceback = 0;
15581 #else
15582 PyErr_Fetch(&local_type, &local_value, &local_tb);
15583 #endif
15584 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
15585 #if CYTHON_FAST_THREAD_STATE
15586 if (unlikely(tstate->curexc_type))
15587 #else
15588 if (unlikely(PyErr_Occurred()))
15589 #endif
15590 goto bad;
15591 #if PY_MAJOR_VERSION >= 3
15592 if (local_tb) {
15593 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
15594 goto bad;
15595 }
15596 #endif
15597 Py_XINCREF(local_tb);
15598 Py_XINCREF(local_type);
15599 Py_XINCREF(local_value);
15600 *type = local_type;
15601 *value = local_value;
15602 *tb = local_tb;
15603 #if CYTHON_FAST_THREAD_STATE
15604 #if CYTHON_USE_EXC_INFO_STACK
15605 {
15606 _PyErr_StackItem *exc_info = tstate->exc_info;
15607 tmp_type = exc_info->exc_type;
15608 tmp_value = exc_info->exc_value;
15609 tmp_tb = exc_info->exc_traceback;
15610 exc_info->exc_type = local_type;
15611 exc_info->exc_value = local_value;
15612 exc_info->exc_traceback = local_tb;
15613 }
15614 #else
15615 tmp_type = tstate->exc_type;
15616 tmp_value = tstate->exc_value;
15617 tmp_tb = tstate->exc_traceback;
15618 tstate->exc_type = local_type;
15619 tstate->exc_value = local_value;
15620 tstate->exc_traceback = local_tb;
15621 #endif
15622 Py_XDECREF(tmp_type);
15623 Py_XDECREF(tmp_value);
15624 Py_XDECREF(tmp_tb);
15625 #else
15626 PyErr_SetExcInfo(local_type, local_value, local_tb);
15627 #endif
15628 return 0;
15629 bad:
15630 *type = 0;
15631 *value = 0;
15632 *tb = 0;
15633 Py_XDECREF(local_type);
15634 Py_XDECREF(local_value);
15635 Py_XDECREF(local_tb);
15636 return -1;
15637 }
15638
15639 /* RaiseTooManyValuesToUnpack */
15640 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
15641 PyErr_Format(PyExc_ValueError,
15642 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
15643 }
15644
15645 /* RaiseNeedMoreValuesToUnpack */
15646 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
15647 PyErr_Format(PyExc_ValueError,
15648 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
15649 index, (index == 1) ? "" : "s");
15650 }
15651
15652 /* IterFinish */
15653 static CYTHON_INLINE int __Pyx_IterFinish(void) {
15654 #if CYTHON_FAST_THREAD_STATE
15655 PyThreadState *tstate = __Pyx_PyThreadState_Current;
15656 PyObject* exc_type = tstate->curexc_type;
15657 if (unlikely(exc_type)) {
15658 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
15659 PyObject *exc_value, *exc_tb;
15660 exc_value = tstate->curexc_value;
15661 exc_tb = tstate->curexc_traceback;
15662 tstate->curexc_type = 0;
15663 tstate->curexc_value = 0;
15664 tstate->curexc_traceback = 0;
15665 Py_DECREF(exc_type);
15666 Py_XDECREF(exc_value);
15667 Py_XDECREF(exc_tb);
15668 return 0;
15669 } else {
15670 return -1;
15671 }
15672 }
15673 return 0;
15674 #else
15675 if (unlikely(PyErr_Occurred())) {
15676 if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
15677 PyErr_Clear();
15678 return 0;
15679 } else {
15680 return -1;
15681 }
15682 }
15683 return 0;
15684 #endif
15685 }
15686
15687 /* UnpackItemEndCheck */
15688 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
15689 if (unlikely(retval)) {
15690 Py_DECREF(retval);
15691 __Pyx_RaiseTooManyValuesError(expected);
15692 return -1;
15693 } else {
15694 return __Pyx_IterFinish();
15695 }
15696 return 0;
15697 }
15698
15699 /* SwapException */
15700 #if CYTHON_FAST_THREAD_STATE
15701 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
15702 PyObject *tmp_type, *tmp_value, *tmp_tb;
15703 #if CYTHON_USE_EXC_INFO_STACK
15704 _PyErr_StackItem *exc_info = tstate->exc_info;
15705 tmp_type = exc_info->exc_type;
15706 tmp_value = exc_info->exc_value;
15707 tmp_tb = exc_info->exc_traceback;
15708 exc_info->exc_type = *type;
15709 exc_info->exc_value = *value;
15710 exc_info->exc_traceback = *tb;
15711 #else
15712 tmp_type = tstate->exc_type;
15713 tmp_value = tstate->exc_value;
15714 tmp_tb = tstate->exc_traceback;
15715 tstate->exc_type = *type;
15716 tstate->exc_value = *value;
15717 tstate->exc_traceback = *tb;
15718 #endif
15719 *type = tmp_type;
15720 *value = tmp_value;
15721 *tb = tmp_tb;
15722 }
15723 #else
15724 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
15725 PyObject *tmp_type, *tmp_value, *tmp_tb;
15726 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
15727 PyErr_SetExcInfo(*type, *value, *tb);
15728 *type = tmp_type;
15729 *value = tmp_value;
15730 *tb = tmp_tb;
15731 }
15732 #endif
15733
15734 /* ArgTypeTest */
15735 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
15736 {
15737 if (unlikely(!type)) {
15738 PyErr_SetString(PyExc_SystemError, "Missing type object");
15739 return 0;
15740 }
15741 else if (exact) {
15742 #if PY_MAJOR_VERSION == 2
15743 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
15744 #endif
15745 }
15746 else {
15747 if (likely(__Pyx_TypeCheck(obj, type))) return 1;
15748 }
15749 PyErr_Format(PyExc_TypeError,
15750 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
15751 name, type->tp_name, Py_TYPE(obj)->tp_name);
15752 return 0;
15753 }
15754
1575515964 /* ExtTypeTest */
1575615965 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
1575715966 if (unlikely(!type)) {
1582616035 return PyObject_GenericGetAttr(obj, attr_name);
1582716036 }
1582816037 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
16038 }
16039 #endif
16040
16041 /* PyErrExceptionMatches */
16042 #if CYTHON_FAST_THREAD_STATE
16043 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
16044 Py_ssize_t i, n;
16045 n = PyTuple_GET_SIZE(tuple);
16046 #if PY_MAJOR_VERSION >= 3
16047 for (i=0; i<n; i++) {
16048 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
16049 }
16050 #endif
16051 for (i=0; i<n; i++) {
16052 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
16053 }
16054 return 0;
16055 }
16056 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
16057 PyObject *exc_type = tstate->curexc_type;
16058 if (exc_type == err) return 1;
16059 if (unlikely(!exc_type)) return 0;
16060 if (unlikely(PyTuple_Check(err)))
16061 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
16062 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
1582916063 }
1583016064 #endif
1583116065
1713917373 int one = 1; int little = (int)*(unsigned char *)&one;
1714017374 unsigned char *bytes = (unsigned char *)&value;
1714117375 return _PyLong_FromByteArray(bytes, sizeof(uint32_t),
17376 little, !is_unsigned);
17377 }
17378 }
17379
17380 /* CIntToPy */
17381 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_long(unsigned long value) {
17382 const unsigned long neg_one = (unsigned long) ((unsigned long) 0 - (unsigned long) 1), const_zero = (unsigned long) 0;
17383 const int is_unsigned = neg_one > const_zero;
17384 if (is_unsigned) {
17385 if (sizeof(unsigned long) < sizeof(long)) {
17386 return PyInt_FromLong((long) value);
17387 } else if (sizeof(unsigned long) <= sizeof(unsigned long)) {
17388 return PyLong_FromUnsignedLong((unsigned long) value);
17389 #ifdef HAVE_LONG_LONG
17390 } else if (sizeof(unsigned long) <= sizeof(unsigned PY_LONG_LONG)) {
17391 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
17392 #endif
17393 }
17394 } else {
17395 if (sizeof(unsigned long) <= sizeof(long)) {
17396 return PyInt_FromLong((long) value);
17397 #ifdef HAVE_LONG_LONG
17398 } else if (sizeof(unsigned long) <= sizeof(PY_LONG_LONG)) {
17399 return PyLong_FromLongLong((PY_LONG_LONG) value);
17400 #endif
17401 }
17402 }
17403 {
17404 int one = 1; int little = (int)*(unsigned char *)&one;
17405 unsigned char *bytes = (unsigned char *)&value;
17406 return _PyLong_FromByteArray(bytes, sizeof(unsigned long),
1714217407 little, !is_unsigned);
1714317408 }
1714417409 }
11841184 /* RaiseException.proto */
11851185 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
11861186
1187 /* Import.proto */
1188 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1189
11901187 /* GetTopmostException.proto */
11911188 #if CYTHON_USE_EXC_INFO_STACK
11921189 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
12031200 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
12041201 #endif
12051202
1206 /* PyErrExceptionMatches.proto */
1207 #if CYTHON_FAST_THREAD_STATE
1208 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1209 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1210 #else
1211 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1212 #endif
1213
12141203 /* GetException.proto */
12151204 #if CYTHON_FAST_THREAD_STATE
12161205 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
12441233 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
12451234 __Pyx__ArgTypeTest(obj, type, name, exact))
12461235 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
1236
1237 /* Import.proto */
1238 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
12471239
12481240 /* ExtTypeTest.proto */
12491241 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
12861278 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
12871279 #else
12881280 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
1281 #endif
1282
1283 /* PyErrExceptionMatches.proto */
1284 #if CYTHON_FAST_THREAD_STATE
1285 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1286 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1287 #else
1288 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
12891289 #endif
12901290
12911291 /* PyObjectGetAttrStrNoError.proto */
14331433 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value);
14341434
14351435 /* CIntToPy.proto */
1436 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_long(unsigned long value);
1437
1438 /* CIntToPy.proto */
14361439 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value);
14371440
14381441 /* CIntFromPy.proto */
15101513 int __pyx_module_is_main_pygame_sdl2__display = 0;
15111514
15121515 /* Implementation of 'pygame_sdl2.display' */
1516 static PyObject *__pyx_builtin_ImportError;
15131517 static PyObject *__pyx_builtin_object;
1514 static PyObject *__pyx_builtin_ImportError;
15151518 static PyObject *__pyx_builtin_MemoryError;
15161519 static PyObject *__pyx_builtin_range;
15171520 static PyObject *__pyx_builtin_TypeError;
15591562 static const char __pyx_k_value[] = "value";
15601563 static const char __pyx_k_Info_r[] = "<Info({!r})>";
15611564 static const char __pyx_k_Window[] = "Window";
1565 static const char __pyx_k_ctypes[] = "ctypes";
15621566 static const char __pyx_k_driver[] = "driver";
15631567 static const char __pyx_k_encode[] = "encode";
15641568 static const char __pyx_k_format[] = "format";
15851589 static const char __pyx_k_surface[] = "surface";
15861590 static const char __pyx_k_SRCALPHA[] = "SRCALPHA";
15871591 static const char __pyx_k_bytesize[] = "bytesize";
1592 static const char __pyx_k_c_void_p[] = "c_void_p";
15881593 static const char __pyx_k_get_hint[] = "_get_hint";
15891594 static const char __pyx_k_get_init[] = "get_init";
15901595 static const char __pyx_k_get_size[] = "get_size";
16341639 static const char __pyx_k_set_caption[] = "set_caption";
16351640 static const char __pyx_k_RESIZE_FLAGS[] = "RESIZE_FLAGS";
16361641 static const char __pyx_k_androidembed[] = "androidembed";
1637 static const char __pyx_k_close_window[] = "close_window";
16381642 static const char __pyx_k_default_icon[] = "default_icon";
16391643 static const char __pyx_k_get_platform[] = "get_platform";
16401644 static const char __pyx_k_pygame_hints[] = "_pygame_hints";
16611665 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
16621666 static const char __pyx_k_get_display_bounds[] = "get_display_bounds";
16631667 static const char __pyx_k_pygame_sdl2_locals[] = "pygame_sdl2.locals";
1664 static const char __pyx_k_shown_first_window[] = "_shown_first_window";
1665 static const char __pyx_k_before_first_window[] = "_before_first_window";
16661668 static const char __pyx_k_gl_reset_attributes[] = "gl_reset_attributes";
16671669 static const char __pyx_k_pygame_sdl2_display[] = "pygame_sdl2.display";
16681670 static const char __pyx_k_PYGAME_SDL2_AVOID_GL[] = "PYGAME_SDL2_AVOID_GL";
16911693 static PyObject *__pyx_n_s_TypeError;
16921694 static PyObject *__pyx_n_s_Window;
16931695 static PyObject *__pyx_n_s_androidembed;
1694 static PyObject *__pyx_n_s_before_first_window;
16951696 static PyObject *__pyx_n_s_bitsize;
16961697 static PyObject *__pyx_n_s_blit_hw;
16971698 static PyObject *__pyx_n_s_blit_hw_A;
17011702 static PyObject *__pyx_n_s_blit_sw_CC;
17021703 static PyObject *__pyx_n_s_blue;
17031704 static PyObject *__pyx_n_s_bytesize;
1705 static PyObject *__pyx_n_s_c_void_p;
17041706 static PyObject *__pyx_n_s_cline_in_traceback;
1705 static PyObject *__pyx_n_s_close_window;
17061707 static PyObject *__pyx_n_s_copy;
17071708 static PyObject *__pyx_n_s_create_surface;
1709 static PyObject *__pyx_n_s_ctypes;
17081710 static PyObject *__pyx_n_s_current_h;
17091711 static PyObject *__pyx_n_s_current_w;
17101712 static PyObject *__pyx_n_s_default;
18151817 static PyObject *__pyx_n_s_setstate;
18161818 static PyObject *__pyx_n_s_setstate_cython;
18171819 static PyObject *__pyx_n_s_shifts;
1818 static PyObject *__pyx_n_s_shown_first_window;
18191820 static PyObject *__pyx_n_s_size;
18201821 static PyObject *__pyx_kp_s_src_pygame_sdl2_display_pyx;
18211822 static PyObject *__pyx_n_s_startswith;
18371838 static PyObject *__pyx_pf_11pygame_sdl2_7display_6init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
18381839 static PyObject *__pyx_pf_11pygame_sdl2_7display_8quit(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
18391840 static PyObject *__pyx_pf_11pygame_sdl2_7display_10get_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
1840 static PyObject *__pyx_pf_11pygame_sdl2_7display_12_before_first_window(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
18411841 static int __pyx_pf_11pygame_sdl2_7display_6Window___init__(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_title, PyObject *__pyx_v_resolution, PyObject *__pyx_v_flags, CYTHON_UNUSED PyObject *__pyx_v_depth, PyObject *__pyx_v_pos); /* proto */
18421842 static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_2create_surface(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */
18431843 static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_4destroy(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */
18611861 static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_40restore(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */
18621862 static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_42maximize(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */
18631863 static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_44minimize(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */
1864 static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_46get_sdl_window_pointer(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */
18641865 static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_7surface___get__(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */
18651866 static int __pyx_pf_11pygame_sdl2_7display_6Window_7surface_2__set__(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
18661867 static int __pyx_pf_11pygame_sdl2_7display_6Window_7surface_4__del__(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */
1867 static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_46__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */
1868 static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_48__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
1869 static PyObject *__pyx_pf_11pygame_sdl2_7display_14set_mode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_resolution, PyObject *__pyx_v_flags, PyObject *__pyx_v_depth, PyObject *__pyx_v_pos); /* proto */
1868 static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_48__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */
1869 static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_50__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
1870 static PyObject *__pyx_pf_11pygame_sdl2_7display_12set_mode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_resolution, PyObject *__pyx_v_flags, PyObject *__pyx_v_depth, PyObject *__pyx_v_pos); /* proto */
1871 static PyObject *__pyx_pf_11pygame_sdl2_7display_14destroy(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
18701872 static PyObject *__pyx_pf_11pygame_sdl2_7display_16get_surface(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
18711873 static PyObject *__pyx_pf_11pygame_sdl2_7display_18get_window(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
18721874 static PyObject *__pyx_pf_11pygame_sdl2_7display_20flip(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
19141916 static PyObject *__pyx_tuple__10;
19151917 static PyObject *__pyx_tuple__12;
19161918 static PyObject *__pyx_tuple__18;
1917 static PyObject *__pyx_tuple__20;
1918 static PyObject *__pyx_tuple__25;
1919 static PyObject *__pyx_tuple__27;
1919 static PyObject *__pyx_tuple__24;
1920 static PyObject *__pyx_tuple__26;
1921 static PyObject *__pyx_tuple__28;
19201922 static PyObject *__pyx_tuple__29;
1921 static PyObject *__pyx_tuple__30;
1922 static PyObject *__pyx_tuple__32;
1923 static PyObject *__pyx_tuple__35;
1924 static PyObject *__pyx_tuple__37;
1925 static PyObject *__pyx_tuple__39;
1926 static PyObject *__pyx_tuple__42;
1927 static PyObject *__pyx_tuple__44;
1928 static PyObject *__pyx_tuple__46;
1929 static PyObject *__pyx_tuple__52;
1930 static PyObject *__pyx_tuple__54;
1931 static PyObject *__pyx_tuple__56;
1932 static PyObject *__pyx_tuple__58;
1933 static PyObject *__pyx_tuple__63;
1934 static PyObject *__pyx_tuple__65;
1935 static PyObject *__pyx_tuple__67;
1923 static PyObject *__pyx_tuple__31;
1924 static PyObject *__pyx_tuple__34;
1925 static PyObject *__pyx_tuple__36;
1926 static PyObject *__pyx_tuple__38;
1927 static PyObject *__pyx_tuple__41;
1928 static PyObject *__pyx_tuple__43;
1929 static PyObject *__pyx_tuple__45;
1930 static PyObject *__pyx_tuple__51;
1931 static PyObject *__pyx_tuple__53;
1932 static PyObject *__pyx_tuple__55;
1933 static PyObject *__pyx_tuple__57;
1934 static PyObject *__pyx_tuple__62;
1935 static PyObject *__pyx_tuple__64;
1936 static PyObject *__pyx_tuple__66;
19361937 static PyObject *__pyx_codeobj__11;
19371938 static PyObject *__pyx_codeobj__13;
19381939 static PyObject *__pyx_codeobj__14;
19401941 static PyObject *__pyx_codeobj__16;
19411942 static PyObject *__pyx_codeobj__17;
19421943 static PyObject *__pyx_codeobj__19;
1944 static PyObject *__pyx_codeobj__20;
19431945 static PyObject *__pyx_codeobj__21;
19441946 static PyObject *__pyx_codeobj__22;
19451947 static PyObject *__pyx_codeobj__23;
1946 static PyObject *__pyx_codeobj__24;
1947 static PyObject *__pyx_codeobj__26;
1948 static PyObject *__pyx_codeobj__28;
1949 static PyObject *__pyx_codeobj__31;
1948 static PyObject *__pyx_codeobj__25;
1949 static PyObject *__pyx_codeobj__27;
1950 static PyObject *__pyx_codeobj__30;
1951 static PyObject *__pyx_codeobj__32;
19501952 static PyObject *__pyx_codeobj__33;
1951 static PyObject *__pyx_codeobj__34;
1952 static PyObject *__pyx_codeobj__36;
1953 static PyObject *__pyx_codeobj__38;
1953 static PyObject *__pyx_codeobj__35;
1954 static PyObject *__pyx_codeobj__37;
1955 static PyObject *__pyx_codeobj__39;
19541956 static PyObject *__pyx_codeobj__40;
1955 static PyObject *__pyx_codeobj__41;
1956 static PyObject *__pyx_codeobj__43;
1957 static PyObject *__pyx_codeobj__45;
1957 static PyObject *__pyx_codeobj__42;
1958 static PyObject *__pyx_codeobj__44;
1959 static PyObject *__pyx_codeobj__46;
19581960 static PyObject *__pyx_codeobj__47;
19591961 static PyObject *__pyx_codeobj__48;
19601962 static PyObject *__pyx_codeobj__49;
19611963 static PyObject *__pyx_codeobj__50;
1962 static PyObject *__pyx_codeobj__51;
1963 static PyObject *__pyx_codeobj__53;
1964 static PyObject *__pyx_codeobj__55;
1965 static PyObject *__pyx_codeobj__57;
1964 static PyObject *__pyx_codeobj__52;
1965 static PyObject *__pyx_codeobj__54;
1966 static PyObject *__pyx_codeobj__56;
1967 static PyObject *__pyx_codeobj__58;
19661968 static PyObject *__pyx_codeobj__59;
19671969 static PyObject *__pyx_codeobj__60;
19681970 static PyObject *__pyx_codeobj__61;
1969 static PyObject *__pyx_codeobj__62;
1970 static PyObject *__pyx_codeobj__64;
1971 static PyObject *__pyx_codeobj__66;
1971 static PyObject *__pyx_codeobj__63;
1972 static PyObject *__pyx_codeobj__65;
1973 static PyObject *__pyx_codeobj__67;
19721974 static PyObject *__pyx_codeobj__68;
1973 static PyObject *__pyx_codeobj__69;
19741975 /* Late includes */
19751976
19761977 /* "pygame_sdl2/display.pyx":40
30563057 return __pyx_r;
30573058 }
30583059
3059 /* "pygame_sdl2/display.pyx":126
3060 * _shown_first_window = False
3061 *
3062 * def _before_first_window(): # <<<<<<<<<<<<<<
3063 * global _shown_first_window
3064 *
3065 */
3066
3067 /* Python wrapper */
3068 static PyObject *__pyx_pw_11pygame_sdl2_7display_13_before_first_window(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
3069 static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_13_before_first_window = {"_before_first_window", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_13_before_first_window, METH_NOARGS, 0};
3070 static PyObject *__pyx_pw_11pygame_sdl2_7display_13_before_first_window(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
3071 PyObject *__pyx_r = 0;
3072 __Pyx_RefNannyDeclarations
3073 __Pyx_RefNannySetupContext("_before_first_window (wrapper)", 0);
3074 __pyx_r = __pyx_pf_11pygame_sdl2_7display_12_before_first_window(__pyx_self);
3075
3076 /* function exit code */
3077 __Pyx_RefNannyFinishContext();
3078 return __pyx_r;
3079 }
3080
3081 static PyObject *__pyx_pf_11pygame_sdl2_7display_12_before_first_window(CYTHON_UNUSED PyObject *__pyx_self) {
3082 PyObject *__pyx_v_androidembed = NULL;
3083 PyObject *__pyx_r = NULL;
3084 __Pyx_RefNannyDeclarations
3085 PyObject *__pyx_t_1 = NULL;
3086 int __pyx_t_2;
3087 PyObject *__pyx_t_3 = NULL;
3088 PyObject *__pyx_t_4 = NULL;
3089 PyObject *__pyx_t_5 = NULL;
3090 PyObject *__pyx_t_6 = NULL;
3091 PyObject *__pyx_t_7 = NULL;
3092 int __pyx_t_8;
3093 int __pyx_lineno = 0;
3094 const char *__pyx_filename = NULL;
3095 int __pyx_clineno = 0;
3096 __Pyx_RefNannySetupContext("_before_first_window", 0);
3097
3098 /* "pygame_sdl2/display.pyx":129
3099 * global _shown_first_window
3100 *
3101 * if _shown_first_window: # <<<<<<<<<<<<<<
3102 * return
3103 *
3104 */
3105 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_shown_first_window); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __pyx_L1_error)
3106 __Pyx_GOTREF(__pyx_t_1);
3107 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 129, __pyx_L1_error)
3108 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3109 if (__pyx_t_2) {
3110
3111 /* "pygame_sdl2/display.pyx":130
3112 *
3113 * if _shown_first_window:
3114 * return # <<<<<<<<<<<<<<
3115 *
3116 * _shown_first_window = True
3117 */
3118 __Pyx_XDECREF(__pyx_r);
3119 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3120 goto __pyx_L0;
3121
3122 /* "pygame_sdl2/display.pyx":129
3123 * global _shown_first_window
3124 *
3125 * if _shown_first_window: # <<<<<<<<<<<<<<
3126 * return
3127 *
3128 */
3129 }
3130
3131 /* "pygame_sdl2/display.pyx":132
3132 * return
3133 *
3134 * _shown_first_window = True # <<<<<<<<<<<<<<
3135 *
3136 * # If we're on android, we have to close the splash window before opening
3137 */
3138 if (PyDict_SetItem(__pyx_d, __pyx_n_s_shown_first_window, Py_True) < 0) __PYX_ERR(0, 132, __pyx_L1_error)
3139
3140 /* "pygame_sdl2/display.pyx":136
3141 * # If we're on android, we have to close the splash window before opening
3142 * # our window.
3143 * try: # <<<<<<<<<<<<<<
3144 * import androidembed
3145 * androidembed.close_window()
3146 */
3147 {
3148 __Pyx_PyThreadState_declare
3149 __Pyx_PyThreadState_assign
3150 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
3151 __Pyx_XGOTREF(__pyx_t_3);
3152 __Pyx_XGOTREF(__pyx_t_4);
3153 __Pyx_XGOTREF(__pyx_t_5);
3154 /*try:*/ {
3155
3156 /* "pygame_sdl2/display.pyx":137
3157 * # our window.
3158 * try:
3159 * import androidembed # <<<<<<<<<<<<<<
3160 * androidembed.close_window()
3161 * except ImportError:
3162 */
3163 __pyx_t_1 = __Pyx_Import(__pyx_n_s_androidembed, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L4_error)
3164 __Pyx_GOTREF(__pyx_t_1);
3165 __pyx_v_androidembed = __pyx_t_1;
3166 __pyx_t_1 = 0;
3167
3168 /* "pygame_sdl2/display.pyx":138
3169 * try:
3170 * import androidembed
3171 * androidembed.close_window() # <<<<<<<<<<<<<<
3172 * except ImportError:
3173 * pass
3174 */
3175 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_androidembed, __pyx_n_s_close_window); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 138, __pyx_L4_error)
3176 __Pyx_GOTREF(__pyx_t_6);
3177 __pyx_t_7 = NULL;
3178 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
3179 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
3180 if (likely(__pyx_t_7)) {
3181 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
3182 __Pyx_INCREF(__pyx_t_7);
3183 __Pyx_INCREF(function);
3184 __Pyx_DECREF_SET(__pyx_t_6, function);
3185 }
3186 }
3187 __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
3188 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
3189 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 138, __pyx_L4_error)
3190 __Pyx_GOTREF(__pyx_t_1);
3191 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3192 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3193
3194 /* "pygame_sdl2/display.pyx":136
3195 * # If we're on android, we have to close the splash window before opening
3196 * # our window.
3197 * try: # <<<<<<<<<<<<<<
3198 * import androidembed
3199 * androidembed.close_window()
3200 */
3201 }
3202 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
3203 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3204 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3205 goto __pyx_L9_try_end;
3206 __pyx_L4_error:;
3207 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
3208 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
3209 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
3210
3211 /* "pygame_sdl2/display.pyx":139
3212 * import androidembed
3213 * androidembed.close_window()
3214 * except ImportError: # <<<<<<<<<<<<<<
3215 * pass
3216 *
3217 */
3218 __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
3219 if (__pyx_t_8) {
3220 __Pyx_ErrRestore(0,0,0);
3221 goto __pyx_L5_exception_handled;
3222 }
3223 goto __pyx_L6_except_error;
3224 __pyx_L6_except_error:;
3225
3226 /* "pygame_sdl2/display.pyx":136
3227 * # If we're on android, we have to close the splash window before opening
3228 * # our window.
3229 * try: # <<<<<<<<<<<<<<
3230 * import androidembed
3231 * androidembed.close_window()
3232 */
3233 __Pyx_XGIVEREF(__pyx_t_3);
3234 __Pyx_XGIVEREF(__pyx_t_4);
3235 __Pyx_XGIVEREF(__pyx_t_5);
3236 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
3237 goto __pyx_L1_error;
3238 __pyx_L5_exception_handled:;
3239 __Pyx_XGIVEREF(__pyx_t_3);
3240 __Pyx_XGIVEREF(__pyx_t_4);
3241 __Pyx_XGIVEREF(__pyx_t_5);
3242 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
3243 __pyx_L9_try_end:;
3244 }
3245
3246 /* "pygame_sdl2/display.pyx":126
3247 * _shown_first_window = False
3248 *
3249 * def _before_first_window(): # <<<<<<<<<<<<<<
3250 * global _shown_first_window
3251 *
3252 */
3253
3254 /* function exit code */
3255 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3256 goto __pyx_L0;
3257 __pyx_L1_error:;
3258 __Pyx_XDECREF(__pyx_t_1);
3259 __Pyx_XDECREF(__pyx_t_6);
3260 __Pyx_XDECREF(__pyx_t_7);
3261 __Pyx_AddTraceback("pygame_sdl2.display._before_first_window", __pyx_clineno, __pyx_lineno, __pyx_filename);
3262 __pyx_r = NULL;
3263 __pyx_L0:;
3264 __Pyx_XDECREF(__pyx_v_androidembed);
3265 __Pyx_XGIVEREF(__pyx_r);
3266 __Pyx_RefNannyFinishContext();
3267 return __pyx_r;
3268 }
3269
3270 /* "pygame_sdl2/display.pyx":145
3060 /* "pygame_sdl2/display.pyx":130
32713061 *
32723062 * cdef class Window:
32733063 * def __init__(self, title, resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): # <<<<<<<<<<<<<<
33443134 }
33453135 }
33463136 if (unlikely(kw_args > 0)) {
3347 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 145, __pyx_L3_error)
3137 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 130, __pyx_L3_error)
33483138 }
33493139 } else {
33503140 switch (PyTuple_GET_SIZE(__pyx_args)) {
33693159 }
33703160 goto __pyx_L4_argument_unpacking_done;
33713161 __pyx_L5_argtuple_error:;
3372 __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 145, __pyx_L3_error)
3162 __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 130, __pyx_L3_error)
33733163 __pyx_L3_error:;
33743164 __Pyx_AddTraceback("pygame_sdl2.display.Window.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
33753165 __Pyx_RefNannyFinishContext();
33933183 PyObject *__pyx_t_5 = NULL;
33943184 Uint32 __pyx_t_6;
33953185 char const *__pyx_t_7;
3396 int __pyx_t_8;
3186 char const *__pyx_t_8;
33973187 int __pyx_t_9;
33983188 int __pyx_t_10;
33993189 int __pyx_t_11;
3400 PyObject *__pyx_t_12 = NULL;
3190 int __pyx_t_12;
34013191 PyObject *__pyx_t_13 = NULL;
34023192 PyObject *__pyx_t_14 = NULL;
34033193 PyObject *__pyx_t_15 = NULL;
34043194 PyObject *__pyx_t_16 = NULL;
34053195 PyObject *__pyx_t_17 = NULL;
3196 PyObject *__pyx_t_18 = NULL;
34063197 int __pyx_lineno = 0;
34073198 const char *__pyx_filename = NULL;
34083199 int __pyx_clineno = 0;
34093200 __Pyx_RefNannySetupContext("__init__", 0);
34103201 __Pyx_INCREF(__pyx_v_title);
34113202
3412 /* "pygame_sdl2/display.pyx":147
3203 /* "pygame_sdl2/display.pyx":132
34133204 * def __init__(self, title, resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)):
34143205 *
34153206 * if not isinstance(title, bytes): # <<<<<<<<<<<<<<
34203211 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
34213212 if (__pyx_t_2) {
34223213
3423 /* "pygame_sdl2/display.pyx":148
3214 /* "pygame_sdl2/display.pyx":133
34243215 *
34253216 * if not isinstance(title, bytes):
34263217 * title = title.encode("utf-8") # <<<<<<<<<<<<<<
34273218 *
3428 * _before_first_window()
3429 */
3430 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_title, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 148, __pyx_L1_error)
3219 * self.create_flags = flags
3220 */
3221 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_title, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 133, __pyx_L1_error)
34313222 __Pyx_GOTREF(__pyx_t_4);
34323223 __pyx_t_5 = NULL;
34333224 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
34413232 }
34423233 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_s_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_s_utf_8);
34433234 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3444 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 148, __pyx_L1_error)
3235 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 133, __pyx_L1_error)
34453236 __Pyx_GOTREF(__pyx_t_3);
34463237 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
34473238 __Pyx_DECREF_SET(__pyx_v_title, __pyx_t_3);
34483239 __pyx_t_3 = 0;
34493240
3450 /* "pygame_sdl2/display.pyx":147
3241 /* "pygame_sdl2/display.pyx":132
34513242 * def __init__(self, title, resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)):
34523243 *
34533244 * if not isinstance(title, bytes): # <<<<<<<<<<<<<<
34563247 */
34573248 }
34583249
3459 /* "pygame_sdl2/display.pyx":150
3250 /* "pygame_sdl2/display.pyx":135
34603251 * title = title.encode("utf-8")
34613252 *
3462 * _before_first_window() # <<<<<<<<<<<<<<
3463 *
3464 * self.create_flags = flags
3465 */
3466 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_before_first_window); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 150, __pyx_L1_error)
3467 __Pyx_GOTREF(__pyx_t_4);
3468 __pyx_t_5 = NULL;
3469 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
3470 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
3471 if (likely(__pyx_t_5)) {
3472 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
3473 __Pyx_INCREF(__pyx_t_5);
3474 __Pyx_INCREF(function);
3475 __Pyx_DECREF_SET(__pyx_t_4, function);
3476 }
3477 }
3478 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
3479 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3480 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 150, __pyx_L1_error)
3481 __Pyx_GOTREF(__pyx_t_3);
3482 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3483 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3484
3485 /* "pygame_sdl2/display.pyx":152
3486 * _before_first_window()
3487 *
34883253 * self.create_flags = flags # <<<<<<<<<<<<<<
34893254 *
34903255 * # If we do not get the AVOID_GL hint, we always create a GL-compatible
34913256 */
3492 __pyx_t_6 = __Pyx_PyInt_As_uint32_t(__pyx_v_flags); if (unlikely((__pyx_t_6 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 152, __pyx_L1_error)
3257 __pyx_t_6 = __Pyx_PyInt_As_uint32_t(__pyx_v_flags); if (unlikely((__pyx_t_6 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 135, __pyx_L1_error)
34933258 __pyx_v_self->create_flags = __pyx_t_6;
34943259
3495 /* "pygame_sdl2/display.pyx":156
3260 /* "pygame_sdl2/display.pyx":139
34963261 * # If we do not get the AVOID_GL hint, we always create a GL-compatible
34973262 * # window. This lets us change the OPENGL flag later on.
34983263 * if int(_get_hint("PYGAME_SDL2_AVOID_GL", "0")): # <<<<<<<<<<<<<<
34993264 * gl_flag = 0
35003265 * else:
35013266 */
3502 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_get_hint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 156, __pyx_L1_error)
3267 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_get_hint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error)
35033268 __Pyx_GOTREF(__pyx_t_3);
3504 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 156, __pyx_L1_error)
3269 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 139, __pyx_L1_error)
35053270 __Pyx_GOTREF(__pyx_t_4);
35063271 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3507 __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 156, __pyx_L1_error)
3272 __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error)
35083273 __Pyx_GOTREF(__pyx_t_3);
35093274 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3510 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 156, __pyx_L1_error)
3275 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 139, __pyx_L1_error)
35113276 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
35123277 if (__pyx_t_2) {
35133278
3514 /* "pygame_sdl2/display.pyx":157
3279 /* "pygame_sdl2/display.pyx":140
35153280 * # window. This lets us change the OPENGL flag later on.
35163281 * if int(_get_hint("PYGAME_SDL2_AVOID_GL", "0")):
35173282 * gl_flag = 0 # <<<<<<<<<<<<<<
35203285 */
35213286 __pyx_v_gl_flag = 0;
35223287
3523 /* "pygame_sdl2/display.pyx":156
3288 /* "pygame_sdl2/display.pyx":139
35243289 * # If we do not get the AVOID_GL hint, we always create a GL-compatible
35253290 * # window. This lets us change the OPENGL flag later on.
35263291 * if int(_get_hint("PYGAME_SDL2_AVOID_GL", "0")): # <<<<<<<<<<<<<<
35303295 goto __pyx_L4;
35313296 }
35323297
3533 /* "pygame_sdl2/display.pyx":159
3298 /* "pygame_sdl2/display.pyx":142
35343299 * gl_flag = 0
35353300 * else:
35363301 * gl_flag = SDL_WINDOW_OPENGL # <<<<<<<<<<<<<<
35373302 *
3538 * self.window = SDL_CreateWindow(
3303 * self.window = NULL
35393304 */
35403305 /*else*/ {
35413306 __pyx_v_gl_flag = SDL_WINDOW_OPENGL;
35423307 }
35433308 __pyx_L4:;
35443309
3545 /* "pygame_sdl2/display.pyx":162
3546 *
3547 * self.window = SDL_CreateWindow(
3548 * title, # <<<<<<<<<<<<<<
3549 * pos[0], pos[1],
3550 * resolution[0], resolution[1], flags | gl_flag)
3551 */
3552 __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_title); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 162, __pyx_L1_error)
3553
3554 /* "pygame_sdl2/display.pyx":163
3555 * self.window = SDL_CreateWindow(
3556 * title,
3557 * pos[0], pos[1], # <<<<<<<<<<<<<<
3558 * resolution[0], resolution[1], flags | gl_flag)
3559 *
3560 */
3561 __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pos, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error)
3310 /* "pygame_sdl2/display.pyx":144
3311 * gl_flag = SDL_WINDOW_OPENGL
3312 *
3313 * self.window = NULL # <<<<<<<<<<<<<<
3314 *
3315 * if androidembed is not None:
3316 */
3317 __pyx_v_self->window = NULL;
3318
3319 /* "pygame_sdl2/display.pyx":146
3320 * self.window = NULL
3321 *
3322 * if androidembed is not None: # <<<<<<<<<<<<<<
3323 * self.window = SDL_GL_GetCurrentWindow()
3324 *
3325 */
3326 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_androidembed); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 146, __pyx_L1_error)
35623327 __Pyx_GOTREF(__pyx_t_3);
3563 __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 163, __pyx_L1_error)
3328 __pyx_t_2 = (__pyx_t_3 != Py_None);
35643329 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3565 __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pos, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error)
3566 __Pyx_GOTREF(__pyx_t_3);
3567 __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 163, __pyx_L1_error)
3568 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3569
3570 /* "pygame_sdl2/display.pyx":164
3571 * title,
3572 * pos[0], pos[1],
3573 * resolution[0], resolution[1], flags | gl_flag) # <<<<<<<<<<<<<<
3330 __pyx_t_1 = (__pyx_t_2 != 0);
3331 if (__pyx_t_1) {
3332
3333 /* "pygame_sdl2/display.pyx":147
3334 *
3335 * if androidembed is not None:
3336 * self.window = SDL_GL_GetCurrentWindow() # <<<<<<<<<<<<<<
3337 *
3338 * if self.window:
3339 */
3340 __pyx_v_self->window = SDL_GL_GetCurrentWindow();
3341
3342 /* "pygame_sdl2/display.pyx":149
3343 * self.window = SDL_GL_GetCurrentWindow()
3344 *
3345 * if self.window: # <<<<<<<<<<<<<<
3346 *
3347 * # Android bug - a RGB_565 format is likely to mean the window
3348 */
3349 __pyx_t_1 = (__pyx_v_self->window != 0);
3350 if (__pyx_t_1) {
3351
3352 /* "pygame_sdl2/display.pyx":153
3353 * # Android bug - a RGB_565 format is likely to mean the window
3354 * # wasn't created properly, so re-make it.
3355 * if SDL_GetWindowPixelFormat(self.window) == SDL_PIXELFORMAT_RGB565: # <<<<<<<<<<<<<<
3356 * SDL_DestroyWindow(self.window)
3357 * self.window = NULL
3358 */
3359 __pyx_t_1 = ((SDL_GetWindowPixelFormat(__pyx_v_self->window) == SDL_PIXELFORMAT_RGB565) != 0);
3360 if (__pyx_t_1) {
3361
3362 /* "pygame_sdl2/display.pyx":154
3363 * # wasn't created properly, so re-make it.
3364 * if SDL_GetWindowPixelFormat(self.window) == SDL_PIXELFORMAT_RGB565:
3365 * SDL_DestroyWindow(self.window) # <<<<<<<<<<<<<<
3366 * self.window = NULL
3367 * else:
3368 */
3369 SDL_DestroyWindow(__pyx_v_self->window);
3370
3371 /* "pygame_sdl2/display.pyx":155
3372 * if SDL_GetWindowPixelFormat(self.window) == SDL_PIXELFORMAT_RGB565:
3373 * SDL_DestroyWindow(self.window)
3374 * self.window = NULL # <<<<<<<<<<<<<<
3375 * else:
3376 * SDL_SetWindowTitle(self.window, title)
3377 */
3378 __pyx_v_self->window = NULL;
3379
3380 /* "pygame_sdl2/display.pyx":153
3381 * # Android bug - a RGB_565 format is likely to mean the window
3382 * # wasn't created properly, so re-make it.
3383 * if SDL_GetWindowPixelFormat(self.window) == SDL_PIXELFORMAT_RGB565: # <<<<<<<<<<<<<<
3384 * SDL_DestroyWindow(self.window)
3385 * self.window = NULL
3386 */
3387 goto __pyx_L7;
3388 }
3389
3390 /* "pygame_sdl2/display.pyx":157
3391 * self.window = NULL
3392 * else:
3393 * SDL_SetWindowTitle(self.window, title) # <<<<<<<<<<<<<<
35743394 *
35753395 * if not self.window:
35763396 */
3577 __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_resolution, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 164, __pyx_L1_error)
3578 __Pyx_GOTREF(__pyx_t_3);
3579 __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 164, __pyx_L1_error)
3580 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3581 __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_resolution, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 164, __pyx_L1_error)
3582 __Pyx_GOTREF(__pyx_t_3);
3583 __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 164, __pyx_L1_error)
3584 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3585 __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_gl_flag); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 164, __pyx_L1_error)
3586 __Pyx_GOTREF(__pyx_t_3);
3587 __pyx_t_4 = PyNumber_Or(__pyx_v_flags, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 164, __pyx_L1_error)
3588 __Pyx_GOTREF(__pyx_t_4);
3589 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3590 __pyx_t_6 = __Pyx_PyInt_As_uint32_t(__pyx_t_4); if (unlikely((__pyx_t_6 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 164, __pyx_L1_error)
3591 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3592
3593 /* "pygame_sdl2/display.pyx":161
3594 * gl_flag = SDL_WINDOW_OPENGL
3595 *
3596 * self.window = SDL_CreateWindow( # <<<<<<<<<<<<<<
3597 * title,
3598 * pos[0], pos[1],
3599 */
3600 __pyx_v_self->window = SDL_CreateWindow(__pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_t_11, __pyx_t_6);
3601
3602 /* "pygame_sdl2/display.pyx":166
3603 * resolution[0], resolution[1], flags | gl_flag)
3397 /*else*/ {
3398 __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_title); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 157, __pyx_L1_error)
3399 SDL_SetWindowTitle(__pyx_v_self->window, __pyx_t_7);
3400 }
3401 __pyx_L7:;
3402
3403 /* "pygame_sdl2/display.pyx":149
3404 * self.window = SDL_GL_GetCurrentWindow()
3405 *
3406 * if self.window: # <<<<<<<<<<<<<<
3407 *
3408 * # Android bug - a RGB_565 format is likely to mean the window
3409 */
3410 }
3411
3412 /* "pygame_sdl2/display.pyx":146
3413 * self.window = NULL
3414 *
3415 * if androidembed is not None: # <<<<<<<<<<<<<<
3416 * self.window = SDL_GL_GetCurrentWindow()
3417 *
3418 */
3419 }
3420
3421 /* "pygame_sdl2/display.pyx":159
3422 * SDL_SetWindowTitle(self.window, title)
3423 *
3424 * if not self.window: # <<<<<<<<<<<<<<
3425 * self.window = SDL_CreateWindow(
3426 * title,
3427 */
3428 __pyx_t_1 = ((!(__pyx_v_self->window != 0)) != 0);
3429 if (__pyx_t_1) {
3430
3431 /* "pygame_sdl2/display.pyx":161
3432 * if not self.window:
3433 * self.window = SDL_CreateWindow(
3434 * title, # <<<<<<<<<<<<<<
3435 * pos[0], pos[1],
3436 * resolution[0], resolution[1], flags | gl_flag)
3437 */
3438 __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_v_title); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 161, __pyx_L1_error)
3439
3440 /* "pygame_sdl2/display.pyx":162
3441 * self.window = SDL_CreateWindow(
3442 * title,
3443 * pos[0], pos[1], # <<<<<<<<<<<<<<
3444 * resolution[0], resolution[1], flags | gl_flag)
3445 *
3446 */
3447 __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pos, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 162, __pyx_L1_error)
3448 __Pyx_GOTREF(__pyx_t_3);
3449 __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 162, __pyx_L1_error)
3450 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3451 __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pos, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 162, __pyx_L1_error)
3452 __Pyx_GOTREF(__pyx_t_3);
3453 __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 162, __pyx_L1_error)
3454 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3455
3456 /* "pygame_sdl2/display.pyx":163
3457 * title,
3458 * pos[0], pos[1],
3459 * resolution[0], resolution[1], flags | gl_flag) # <<<<<<<<<<<<<<
3460 *
3461 * if not self.window:
3462 */
3463 __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_resolution, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error)
3464 __Pyx_GOTREF(__pyx_t_3);
3465 __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 163, __pyx_L1_error)
3466 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3467 __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_resolution, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error)
3468 __Pyx_GOTREF(__pyx_t_3);
3469 __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 163, __pyx_L1_error)
3470 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3471 __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_gl_flag); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error)
3472 __Pyx_GOTREF(__pyx_t_3);
3473 __pyx_t_4 = PyNumber_Or(__pyx_v_flags, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error)
3474 __Pyx_GOTREF(__pyx_t_4);
3475 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3476 __pyx_t_6 = __Pyx_PyInt_As_uint32_t(__pyx_t_4); if (unlikely((__pyx_t_6 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 163, __pyx_L1_error)
3477 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3478
3479 /* "pygame_sdl2/display.pyx":160
3480 *
3481 * if not self.window:
3482 * self.window = SDL_CreateWindow( # <<<<<<<<<<<<<<
3483 * title,
3484 * pos[0], pos[1],
3485 */
3486 __pyx_v_self->window = SDL_CreateWindow(__pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_t_11, __pyx_t_12, __pyx_t_6);
3487
3488 /* "pygame_sdl2/display.pyx":159
3489 * SDL_SetWindowTitle(self.window, title)
3490 *
3491 * if not self.window: # <<<<<<<<<<<<<<
3492 * self.window = SDL_CreateWindow(
3493 * title,
3494 */
3495 }
3496
3497 /* "pygame_sdl2/display.pyx":165
3498 * resolution[0], resolution[1], flags | gl_flag)
36043499 *
36053500 * if not self.window: # <<<<<<<<<<<<<<
36063501 * raise error()
36073502 *
36083503 */
3609 __pyx_t_2 = ((!(__pyx_v_self->window != 0)) != 0);
3610 if (unlikely(__pyx_t_2)) {
3611
3612 /* "pygame_sdl2/display.pyx":167
3504 __pyx_t_1 = ((!(__pyx_v_self->window != 0)) != 0);
3505 if (unlikely(__pyx_t_1)) {
3506
3507 /* "pygame_sdl2/display.pyx":166
36133508 *
36143509 * if not self.window:
36153510 * raise error() # <<<<<<<<<<<<<<
36163511 *
36173512 * # From here on, the window exists. So we have to call self.destroy if
36183513 */
3619 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 167, __pyx_L1_error)
3514 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 166, __pyx_L1_error)
36203515 __Pyx_GOTREF(__pyx_t_3);
36213516 __pyx_t_5 = NULL;
36223517 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
36303525 }
36313526 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
36323527 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3633 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L1_error)
3528 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 166, __pyx_L1_error)
36343529 __Pyx_GOTREF(__pyx_t_4);
36353530 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
36363531 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
36373532 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3638 __PYX_ERR(0, 167, __pyx_L1_error)
3639
3640 /* "pygame_sdl2/display.pyx":166
3641 * resolution[0], resolution[1], flags | gl_flag)
3533 __PYX_ERR(0, 166, __pyx_L1_error)
3534
3535 /* "pygame_sdl2/display.pyx":165
3536 * resolution[0], resolution[1], flags | gl_flag)
36423537 *
36433538 * if not self.window: # <<<<<<<<<<<<<<
36443539 * raise error()
36463541 */
36473542 }
36483543
3649 /* "pygame_sdl2/display.pyx":172
3544 /* "pygame_sdl2/display.pyx":171
36503545 * # an exception occurs.
36513546 *
36523547 * try: # <<<<<<<<<<<<<<
36563551 {
36573552 __Pyx_PyThreadState_declare
36583553 __Pyx_PyThreadState_assign
3659 __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
3660 __Pyx_XGOTREF(__pyx_t_12);
3554 __Pyx_ExceptionSave(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
36613555 __Pyx_XGOTREF(__pyx_t_13);
36623556 __Pyx_XGOTREF(__pyx_t_14);
3557 __Pyx_XGOTREF(__pyx_t_15);
36633558 /*try:*/ {
36643559
3665 /* "pygame_sdl2/display.pyx":174
3560 /* "pygame_sdl2/display.pyx":173
36663561 * try:
36673562 *
36683563 * if flags & SDL_WINDOW_OPENGL: # <<<<<<<<<<<<<<
36693564 *
36703565 * self.gl_context = SDL_GL_CreateContext(self.window)
36713566 */
3672 __pyx_t_4 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_OPENGL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 174, __pyx_L6_error)
3567 __pyx_t_4 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_OPENGL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 173, __pyx_L10_error)
36733568 __Pyx_GOTREF(__pyx_t_4);
3674 __pyx_t_3 = PyNumber_And(__pyx_v_flags, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 174, __pyx_L6_error)
3569 __pyx_t_3 = PyNumber_And(__pyx_v_flags, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 173, __pyx_L10_error)
36753570 __Pyx_GOTREF(__pyx_t_3);
36763571 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3677 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 174, __pyx_L6_error)
3572 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 173, __pyx_L10_error)
36783573 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3679 if (__pyx_t_2) {
3680
3681 /* "pygame_sdl2/display.pyx":176
3574 if (__pyx_t_1) {
3575
3576 /* "pygame_sdl2/display.pyx":175
36823577 * if flags & SDL_WINDOW_OPENGL:
36833578 *
36843579 * self.gl_context = SDL_GL_CreateContext(self.window) # <<<<<<<<<<<<<<
36873582 */
36883583 __pyx_v_self->gl_context = SDL_GL_CreateContext(__pyx_v_self->window);
36893584
3690 /* "pygame_sdl2/display.pyx":178
3585 /* "pygame_sdl2/display.pyx":177
36913586 * self.gl_context = SDL_GL_CreateContext(self.window)
36923587 *
36933588 * if self.gl_context == NULL: # <<<<<<<<<<<<<<
36943589 * raise error()
36953590 *
36963591 */
3697 __pyx_t_2 = ((__pyx_v_self->gl_context == NULL) != 0);
3698 if (unlikely(__pyx_t_2)) {
3699
3700 /* "pygame_sdl2/display.pyx":179
3592 __pyx_t_1 = ((__pyx_v_self->gl_context == NULL) != 0);
3593 if (unlikely(__pyx_t_1)) {
3594
3595 /* "pygame_sdl2/display.pyx":178
37013596 *
37023597 * if self.gl_context == NULL:
37033598 * raise error() # <<<<<<<<<<<<<<
37043599 *
3705 * if not ios:
3706 */
3707 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 179, __pyx_L6_error)
3600 * SDL_GL_MakeCurrent(self.window, self.gl_context)
3601 */
3602 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 178, __pyx_L10_error)
37083603 __Pyx_GOTREF(__pyx_t_4);
37093604 __pyx_t_5 = NULL;
37103605 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
37183613 }
37193614 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
37203615 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3721 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 179, __pyx_L6_error)
3616 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 178, __pyx_L10_error)
37223617 __Pyx_GOTREF(__pyx_t_3);
37233618 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37243619 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
37253620 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3726 __PYX_ERR(0, 179, __pyx_L6_error)
3727
3728 /* "pygame_sdl2/display.pyx":178
3621 __PYX_ERR(0, 178, __pyx_L10_error)
3622
3623 /* "pygame_sdl2/display.pyx":177
37293624 * self.gl_context = SDL_GL_CreateContext(self.window)
37303625 *
37313626 * if self.gl_context == NULL: # <<<<<<<<<<<<<<
37343629 */
37353630 }
37363631
3737 /* "pygame_sdl2/display.pyx":181
3632 /* "pygame_sdl2/display.pyx":180
37383633 * raise error()
3634 *
3635 * SDL_GL_MakeCurrent(self.window, self.gl_context) # <<<<<<<<<<<<<<
3636 *
3637 * if not ios:
3638 */
3639 (void)(SDL_GL_MakeCurrent(__pyx_v_self->window, __pyx_v_self->gl_context));
3640
3641 /* "pygame_sdl2/display.pyx":182
3642 * SDL_GL_MakeCurrent(self.window, self.gl_context)
37393643 *
37403644 * if not ios: # <<<<<<<<<<<<<<
37413645 * # Try setting the swap interval - first positive, then negated
37423646 * # to deal with the case where the negative interval isn't
37433647 */
3744 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ios); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 181, __pyx_L6_error)
3648 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ios); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 182, __pyx_L10_error)
37453649 __Pyx_GOTREF(__pyx_t_3);
3746 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 181, __pyx_L6_error)
3650 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 182, __pyx_L10_error)
37473651 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3748 __pyx_t_1 = ((!__pyx_t_2) != 0);
3749 if (__pyx_t_1) {
3750
3751 /* "pygame_sdl2/display.pyx":185
3652 __pyx_t_2 = ((!__pyx_t_1) != 0);
3653 if (__pyx_t_2) {
3654
3655 /* "pygame_sdl2/display.pyx":186
37523656 * # to deal with the case where the negative interval isn't
37533657 * # supported. Then give up and carry on.
37543658 * if SDL_GL_SetSwapInterval(default_swap_control): # <<<<<<<<<<<<<<
3755 * SDL_GL_SetSwapInterval(-default_swap_control)
3756 *
3757 */
3758 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_default_swap_control); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 185, __pyx_L6_error)
3659 * if default_swap_control < 0:
3660 * SDL_GL_SetSwapInterval(-default_swap_control)
3661 */
3662 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_default_swap_control); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 186, __pyx_L10_error)
37593663 __Pyx_GOTREF(__pyx_t_3);
3760 __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 185, __pyx_L6_error)
3664 __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 186, __pyx_L10_error)
37613665 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3762 __pyx_t_1 = (SDL_GL_SetSwapInterval(__pyx_t_11) != 0);
3763 if (__pyx_t_1) {
3764
3765 /* "pygame_sdl2/display.pyx":186
3666 __pyx_t_2 = (SDL_GL_SetSwapInterval(__pyx_t_12) != 0);
3667 if (__pyx_t_2) {
3668
3669 /* "pygame_sdl2/display.pyx":187
37663670 * # supported. Then give up and carry on.
37673671 * if SDL_GL_SetSwapInterval(default_swap_control):
3768 * SDL_GL_SetSwapInterval(-default_swap_control) # <<<<<<<<<<<<<<
3769 *
3770 *
3771 */
3772 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_default_swap_control); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 186, __pyx_L6_error)
3672 * if default_swap_control < 0: # <<<<<<<<<<<<<<
3673 * SDL_GL_SetSwapInterval(-default_swap_control)
3674 *
3675 */
3676 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_default_swap_control); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L10_error)
37733677 __Pyx_GOTREF(__pyx_t_3);
3774 __pyx_t_4 = PyNumber_Negative(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 186, __pyx_L6_error)
3775 __Pyx_GOTREF(__pyx_t_4);
3678 __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L10_error)
37763679 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3777 __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 186, __pyx_L6_error)
3680 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 187, __pyx_L10_error)
37783681 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3779 (void)(SDL_GL_SetSwapInterval(__pyx_t_11));
3780
3781 /* "pygame_sdl2/display.pyx":185
3682 if (__pyx_t_2) {
3683
3684 /* "pygame_sdl2/display.pyx":188
3685 * if SDL_GL_SetSwapInterval(default_swap_control):
3686 * if default_swap_control < 0:
3687 * SDL_GL_SetSwapInterval(-default_swap_control) # <<<<<<<<<<<<<<
3688 *
3689 * self.create_surface()
3690 */
3691 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_default_swap_control); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 188, __pyx_L10_error)
3692 __Pyx_GOTREF(__pyx_t_4);
3693 __pyx_t_3 = PyNumber_Negative(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 188, __pyx_L10_error)
3694 __Pyx_GOTREF(__pyx_t_3);
3695 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3696 __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 188, __pyx_L10_error)
3697 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3698 (void)(SDL_GL_SetSwapInterval(__pyx_t_12));
3699
3700 /* "pygame_sdl2/display.pyx":187
3701 * # supported. Then give up and carry on.
3702 * if SDL_GL_SetSwapInterval(default_swap_control):
3703 * if default_swap_control < 0: # <<<<<<<<<<<<<<
3704 * SDL_GL_SetSwapInterval(-default_swap_control)
3705 *
3706 */
3707 }
3708
3709 /* "pygame_sdl2/display.pyx":186
37823710 * # to deal with the case where the negative interval isn't
37833711 * # supported. Then give up and carry on.
37843712 * if SDL_GL_SetSwapInterval(default_swap_control): # <<<<<<<<<<<<<<
3785 * SDL_GL_SetSwapInterval(-default_swap_control)
3786 *
3713 * if default_swap_control < 0:
3714 * SDL_GL_SetSwapInterval(-default_swap_control)
37873715 */
37883716 }
37893717
3790 /* "pygame_sdl2/display.pyx":181
3791 * raise error()
3718 /* "pygame_sdl2/display.pyx":182
3719 * SDL_GL_MakeCurrent(self.window, self.gl_context)
37923720 *
37933721 * if not ios: # <<<<<<<<<<<<<<
37943722 * # Try setting the swap interval - first positive, then negated
37963724 */
37973725 }
37983726
3799 /* "pygame_sdl2/display.pyx":174
3727 /* "pygame_sdl2/display.pyx":173
38003728 * try:
38013729 *
38023730 * if flags & SDL_WINDOW_OPENGL: # <<<<<<<<<<<<<<
38053733 */
38063734 }
38073735
3808 /* "pygame_sdl2/display.pyx":189
3809 *
3736 /* "pygame_sdl2/display.pyx":190
3737 * SDL_GL_SetSwapInterval(-default_swap_control)
38103738 *
38113739 * self.create_surface() # <<<<<<<<<<<<<<
38123740 *
38133741 * except:
38143742 */
3815 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_create_surface); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 189, __pyx_L6_error)
3816 __Pyx_GOTREF(__pyx_t_3);
3743 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_create_surface); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 190, __pyx_L10_error)
3744 __Pyx_GOTREF(__pyx_t_4);
38173745 __pyx_t_5 = NULL;
3818 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3819 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3746 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
3747 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
38203748 if (likely(__pyx_t_5)) {
3821 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3749 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
38223750 __Pyx_INCREF(__pyx_t_5);
38233751 __Pyx_INCREF(function);
3824 __Pyx_DECREF_SET(__pyx_t_3, function);
3752 __Pyx_DECREF_SET(__pyx_t_4, function);
38253753 }
38263754 }
3827 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
3755 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
38283756 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3829 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 189, __pyx_L6_error)
3830 __Pyx_GOTREF(__pyx_t_4);
3757 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 190, __pyx_L10_error)
3758 __Pyx_GOTREF(__pyx_t_3);
3759 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
38313760 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3832 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3833
3834 /* "pygame_sdl2/display.pyx":172
3761
3762 /* "pygame_sdl2/display.pyx":171
38353763 * # an exception occurs.
38363764 *
38373765 * try: # <<<<<<<<<<<<<<
38393767 * if flags & SDL_WINDOW_OPENGL:
38403768 */
38413769 }
3842 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
38433770 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
38443771 __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
3845 goto __pyx_L11_try_end;
3846 __pyx_L6_error:;
3772 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
3773 goto __pyx_L15_try_end;
3774 __pyx_L10_error:;
38473775 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
38483776 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
38493777 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
38503778
3851 /* "pygame_sdl2/display.pyx":191
3779 /* "pygame_sdl2/display.pyx":192
38523780 * self.create_surface()
38533781 *
38543782 * except: # <<<<<<<<<<<<<<
38573785 */
38583786 /*except:*/ {
38593787 __Pyx_AddTraceback("pygame_sdl2.display.Window.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3860 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_3, &__pyx_t_5) < 0) __PYX_ERR(0, 191, __pyx_L8_except_error)
3788 if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5) < 0) __PYX_ERR(0, 192, __pyx_L12_except_error)
3789 __Pyx_GOTREF(__pyx_t_3);
38613790 __Pyx_GOTREF(__pyx_t_4);
3862 __Pyx_GOTREF(__pyx_t_3);
38633791 __Pyx_GOTREF(__pyx_t_5);
38643792
3865 /* "pygame_sdl2/display.pyx":192
3793 /* "pygame_sdl2/display.pyx":193
38663794 *
38673795 * except:
38683796 * self.destroy() # <<<<<<<<<<<<<<
38693797 * raise
38703798 *
38713799 */
3872 __pyx_t_16 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_destroy); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 192, __pyx_L8_except_error)
3873 __Pyx_GOTREF(__pyx_t_16);
3874 __pyx_t_17 = NULL;
3875 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_16))) {
3876 __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_16);
3877 if (likely(__pyx_t_17)) {
3878 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16);
3879 __Pyx_INCREF(__pyx_t_17);
3800 __pyx_t_17 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_destroy); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 193, __pyx_L12_except_error)
3801 __Pyx_GOTREF(__pyx_t_17);
3802 __pyx_t_18 = NULL;
3803 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_17))) {
3804 __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_17);
3805 if (likely(__pyx_t_18)) {
3806 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
3807 __Pyx_INCREF(__pyx_t_18);
38803808 __Pyx_INCREF(function);
3881 __Pyx_DECREF_SET(__pyx_t_16, function);
3809 __Pyx_DECREF_SET(__pyx_t_17, function);
38823810 }
38833811 }
3884 __pyx_t_15 = (__pyx_t_17) ? __Pyx_PyObject_CallOneArg(__pyx_t_16, __pyx_t_17) : __Pyx_PyObject_CallNoArg(__pyx_t_16);
3885 __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
3886 if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 192, __pyx_L8_except_error)
3887 __Pyx_GOTREF(__pyx_t_15);
3812 __pyx_t_16 = (__pyx_t_18) ? __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_t_18) : __Pyx_PyObject_CallNoArg(__pyx_t_17);
3813 __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
3814 if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 193, __pyx_L12_except_error)
3815 __Pyx_GOTREF(__pyx_t_16);
3816 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
38883817 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3889 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3890
3891 /* "pygame_sdl2/display.pyx":193
3818
3819 /* "pygame_sdl2/display.pyx":194
38923820 * except:
38933821 * self.destroy()
38943822 * raise # <<<<<<<<<<<<<<
38953823 *
38963824 * def create_surface(self):
38973825 */
3826 __Pyx_GIVEREF(__pyx_t_3);
38983827 __Pyx_GIVEREF(__pyx_t_4);
3899 __Pyx_GIVEREF(__pyx_t_3);
39003828 __Pyx_XGIVEREF(__pyx_t_5);
3901 __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_3, __pyx_t_5);
3902 __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_5 = 0;
3903 __PYX_ERR(0, 193, __pyx_L8_except_error)
3904 }
3905 __pyx_L8_except_error:;
3906
3907 /* "pygame_sdl2/display.pyx":172
3829 __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_4, __pyx_t_5);
3830 __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0;
3831 __PYX_ERR(0, 194, __pyx_L12_except_error)
3832 }
3833 __pyx_L12_except_error:;
3834
3835 /* "pygame_sdl2/display.pyx":171
39083836 * # an exception occurs.
39093837 *
39103838 * try: # <<<<<<<<<<<<<<
39113839 *
39123840 * if flags & SDL_WINDOW_OPENGL:
39133841 */
3914 __Pyx_XGIVEREF(__pyx_t_12);
39153842 __Pyx_XGIVEREF(__pyx_t_13);
39163843 __Pyx_XGIVEREF(__pyx_t_14);
3917 __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
3844 __Pyx_XGIVEREF(__pyx_t_15);
3845 __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15);
39183846 goto __pyx_L1_error;
3919 __pyx_L11_try_end:;
3847 __pyx_L15_try_end:;
39203848 }
39213849
3922 /* "pygame_sdl2/display.pyx":145
3850 /* "pygame_sdl2/display.pyx":130
39233851 *
39243852 * cdef class Window:
39253853 * def __init__(self, title, resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): # <<<<<<<<<<<<<<
39343862 __Pyx_XDECREF(__pyx_t_3);
39353863 __Pyx_XDECREF(__pyx_t_4);
39363864 __Pyx_XDECREF(__pyx_t_5);
3937 __Pyx_XDECREF(__pyx_t_15);
39383865 __Pyx_XDECREF(__pyx_t_16);
39393866 __Pyx_XDECREF(__pyx_t_17);
3867 __Pyx_XDECREF(__pyx_t_18);
39403868 __Pyx_AddTraceback("pygame_sdl2.display.Window.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
39413869 __pyx_r = -1;
39423870 __pyx_L0:;
39453873 return __pyx_r;
39463874 }
39473875
3948 /* "pygame_sdl2/display.pyx":195
3876 /* "pygame_sdl2/display.pyx":196
39493877 * raise
39503878 *
39513879 * def create_surface(self): # <<<<<<<<<<<<<<
39823910 int __pyx_clineno = 0;
39833911 __Pyx_RefNannySetupContext("create_surface", 0);
39843912
3985 /* "pygame_sdl2/display.pyx":201
3913 /* "pygame_sdl2/display.pyx":202
39863914 *
39873915 * cdef int w, h
39883916 * SDL_GetWindowSize(self.window, &w, &h) # <<<<<<<<<<<<<<
39913919 */
39923920 SDL_GetWindowSize(__pyx_v_self->window, (&__pyx_v_w), (&__pyx_v_h));
39933921
3994 /* "pygame_sdl2/display.pyx":203
3922 /* "pygame_sdl2/display.pyx":204
39953923 * SDL_GetWindowSize(self.window, &w, &h)
39963924 *
39973925 * if self.gl_context: # <<<<<<<<<<<<<<
40013929 __pyx_t_1 = (__pyx_v_self->gl_context != 0);
40023930 if (__pyx_t_1) {
40033931
4004 /* "pygame_sdl2/display.pyx":208
3932 /* "pygame_sdl2/display.pyx":209
40053933 * # TODO: Make this a bit less wasteful of memory, even if it means
40063934 * # we lie about the actual size of the pixel array.
40073935 * self.surface = Surface((w, h), SRCALPHA, 32) # <<<<<<<<<<<<<<
40083936 *
40093937 * else:
40103938 */
4011 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_w); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 208, __pyx_L1_error)
3939 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_w); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 209, __pyx_L1_error)
40123940 __Pyx_GOTREF(__pyx_t_2);
4013 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_h); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 208, __pyx_L1_error)
3941 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_h); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 209, __pyx_L1_error)
40143942 __Pyx_GOTREF(__pyx_t_3);
4015 __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 208, __pyx_L1_error)
3943 __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 209, __pyx_L1_error)
40163944 __Pyx_GOTREF(__pyx_t_4);
40173945 __Pyx_GIVEREF(__pyx_t_2);
40183946 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
40203948 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
40213949 __pyx_t_2 = 0;
40223950 __pyx_t_3 = 0;
4023 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SRCALPHA); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 208, __pyx_L1_error)
3951 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SRCALPHA); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 209, __pyx_L1_error)
40243952 __Pyx_GOTREF(__pyx_t_3);
4025 __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 208, __pyx_L1_error)
3953 __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 209, __pyx_L1_error)
40263954 __Pyx_GOTREF(__pyx_t_2);
40273955 __Pyx_GIVEREF(__pyx_t_4);
40283956 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
40333961 PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_int_32);
40343962 __pyx_t_4 = 0;
40353963 __pyx_t_3 = 0;
4036 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 208, __pyx_L1_error)
3964 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 209, __pyx_L1_error)
40373965 __Pyx_GOTREF(__pyx_t_3);
40383966 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
40393967 __Pyx_GIVEREF(__pyx_t_3);
40423970 __pyx_v_self->surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_3);
40433971 __pyx_t_3 = 0;
40443972
4045 /* "pygame_sdl2/display.pyx":203
3973 /* "pygame_sdl2/display.pyx":204
40463974 * SDL_GetWindowSize(self.window, &w, &h)
40473975 *
40483976 * if self.gl_context: # <<<<<<<<<<<<<<
40523980 goto __pyx_L3;
40533981 }
40543982
4055 /* "pygame_sdl2/display.pyx":212
3983 /* "pygame_sdl2/display.pyx":213
40563984 * else:
40573985 *
40583986 * self.window_surface = SDL_GetWindowSurface(self.window) # <<<<<<<<<<<<<<
40623990 /*else*/ {
40633991 __pyx_v_self->window_surface = SDL_GetWindowSurface(__pyx_v_self->window);
40643992
4065 /* "pygame_sdl2/display.pyx":216
3993 /* "pygame_sdl2/display.pyx":217
40663994 * # If the surface is 32-bit, we can use it directly. Otherwise,
40673995 * # we need to create a 32-bit proxy surface.
40683996 * if self.window_surface.format.BitsPerPixel == 32: # <<<<<<<<<<<<<<
40724000 __pyx_t_1 = ((__pyx_v_self->window_surface->format->BitsPerPixel == 32) != 0);
40734001 if (__pyx_t_1) {
40744002
4075 /* "pygame_sdl2/display.pyx":218
4003 /* "pygame_sdl2/display.pyx":219
40764004 * if self.window_surface.format.BitsPerPixel == 32:
40774005 *
40784006 * self.surface = Surface(()) # <<<<<<<<<<<<<<
40794007 * self.surface.surface = self.window_surface
40804008 * self.surface.owns_surface = False
40814009 */
4082 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 218, __pyx_L1_error)
4010 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 219, __pyx_L1_error)
40834011 __Pyx_GOTREF(__pyx_t_3);
40844012 __Pyx_GIVEREF(__pyx_t_3);
40854013 __Pyx_GOTREF(__pyx_v_self->surface);
40874015 __pyx_v_self->surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_3);
40884016 __pyx_t_3 = 0;
40894017
4090 /* "pygame_sdl2/display.pyx":219
4018 /* "pygame_sdl2/display.pyx":220
40914019 *
40924020 * self.surface = Surface(())
40934021 * self.surface.surface = self.window_surface # <<<<<<<<<<<<<<
40974025 __pyx_t_5 = __pyx_v_self->window_surface;
40984026 __pyx_v_self->surface->surface = __pyx_t_5;
40994027
4100 /* "pygame_sdl2/display.pyx":220
4028 /* "pygame_sdl2/display.pyx":221
41014029 * self.surface = Surface(())
41024030 * self.surface.surface = self.window_surface
41034031 * self.surface.owns_surface = False # <<<<<<<<<<<<<<
41064034 */
41074035 __pyx_v_self->surface->owns_surface = 0;
41084036
4109 /* "pygame_sdl2/display.pyx":221
4037 /* "pygame_sdl2/display.pyx":222
41104038 * self.surface.surface = self.window_surface
41114039 * self.surface.owns_surface = False
41124040 * self.surface.window_surface = True # <<<<<<<<<<<<<<
41154043 */
41164044 __pyx_v_self->surface->window_surface = 1;
41174045
4118 /* "pygame_sdl2/display.pyx":216
4046 /* "pygame_sdl2/display.pyx":217
41194047 * # If the surface is 32-bit, we can use it directly. Otherwise,
41204048 * # we need to create a 32-bit proxy surface.
41214049 * if self.window_surface.format.BitsPerPixel == 32: # <<<<<<<<<<<<<<
41254053 goto __pyx_L4;
41264054 }
41274055
4128 /* "pygame_sdl2/display.pyx":224
4056 /* "pygame_sdl2/display.pyx":225
41294057 *
41304058 * else:
41314059 * self.surface = Surface((w, h), 0, 32) # <<<<<<<<<<<<<<
41334061 * self.surface.get_window_flags = self.get_window_flags
41344062 */
41354063 /*else*/ {
4136 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 224, __pyx_L1_error)
4064 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 225, __pyx_L1_error)
41374065 __Pyx_GOTREF(__pyx_t_3);
4138 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error)
4066 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 225, __pyx_L1_error)
41394067 __Pyx_GOTREF(__pyx_t_2);
4140 __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 224, __pyx_L1_error)
4068 __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 225, __pyx_L1_error)
41414069 __Pyx_GOTREF(__pyx_t_4);
41424070 __Pyx_GIVEREF(__pyx_t_3);
41434071 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
41454073 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
41464074 __pyx_t_3 = 0;
41474075 __pyx_t_2 = 0;
4148 __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error)
4076 __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 225, __pyx_L1_error)
41494077 __Pyx_GOTREF(__pyx_t_2);
41504078 __Pyx_GIVEREF(__pyx_t_4);
41514079 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
41564084 __Pyx_GIVEREF(__pyx_int_32);
41574085 PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_int_32);
41584086 __pyx_t_4 = 0;
4159 __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 224, __pyx_L1_error)
4087 __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 225, __pyx_L1_error)
41604088 __Pyx_GOTREF(__pyx_t_4);
41614089 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
41624090 __Pyx_GIVEREF(__pyx_t_4);
41694097 }
41704098 __pyx_L3:;
41714099
4172 /* "pygame_sdl2/display.pyx":226
4100 /* "pygame_sdl2/display.pyx":227
41734101 * self.surface = Surface((w, h), 0, 32)
41744102 *
41754103 * self.surface.get_window_flags = self.get_window_flags # <<<<<<<<<<<<<<
41764104 *
41774105 *
41784106 */
4179 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_window_flags); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 226, __pyx_L1_error)
4107 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_window_flags); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 227, __pyx_L1_error)
41804108 __Pyx_GOTREF(__pyx_t_4);
41814109 __Pyx_GIVEREF(__pyx_t_4);
41824110 __Pyx_GOTREF(__pyx_v_self->surface->get_window_flags);
41844112 __pyx_v_self->surface->get_window_flags = __pyx_t_4;
41854113 __pyx_t_4 = 0;
41864114
4187 /* "pygame_sdl2/display.pyx":195
4115 /* "pygame_sdl2/display.pyx":196
41884116 * raise
41894117 *
41904118 * def create_surface(self): # <<<<<<<<<<<<<<
42074135 return __pyx_r;
42084136 }
42094137
4210 /* "pygame_sdl2/display.pyx":229
4138 /* "pygame_sdl2/display.pyx":230
42114139 *
42124140 *
42134141 * def destroy(self): # <<<<<<<<<<<<<<
42384166 int __pyx_clineno = 0;
42394167 __Pyx_RefNannySetupContext("destroy", 0);
42404168
4241 /* "pygame_sdl2/display.pyx":234
4169 /* "pygame_sdl2/display.pyx":235
42424170 * """
42434171 *
42444172 * if self.gl_context != NULL: # <<<<<<<<<<<<<<
42484176 __pyx_t_1 = ((__pyx_v_self->gl_context != NULL) != 0);
42494177 if (__pyx_t_1) {
42504178
4251 /* "pygame_sdl2/display.pyx":235
4179 /* "pygame_sdl2/display.pyx":236
42524180 *
42534181 * if self.gl_context != NULL:
42544182 * SDL_GL_DeleteContext(self.gl_context) # <<<<<<<<<<<<<<
42574185 */
42584186 SDL_GL_DeleteContext(__pyx_v_self->gl_context);
42594187
4260 /* "pygame_sdl2/display.pyx":234
4188 /* "pygame_sdl2/display.pyx":235
42614189 * """
42624190 *
42634191 * if self.gl_context != NULL: # <<<<<<<<<<<<<<
42664194 */
42674195 }
42684196
4269 /* "pygame_sdl2/display.pyx":237
4197 /* "pygame_sdl2/display.pyx":238
42704198 * SDL_GL_DeleteContext(self.gl_context)
42714199 *
42724200 * if self.surface: # <<<<<<<<<<<<<<
42734201 *
42744202 * # Break the cycle that prevents refcounting from collecting this
42754203 */
4276 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->surface)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 237, __pyx_L1_error)
4204 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->surface)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 238, __pyx_L1_error)
42774205 if (__pyx_t_1) {
42784206
4279 /* "pygame_sdl2/display.pyx":241
4207 /* "pygame_sdl2/display.pyx":242
42804208 * # Break the cycle that prevents refcounting from collecting this
42814209 * # object.
42824210 * self.surface.get_window_flags = None # <<<<<<<<<<<<<<
42894217 __Pyx_DECREF(__pyx_v_self->surface->get_window_flags);
42904218 __pyx_v_self->surface->get_window_flags = Py_None;
42914219
4292 /* "pygame_sdl2/display.pyx":244
4220 /* "pygame_sdl2/display.pyx":245
42934221 *
42944222 * # Necessary to collect the GL surface, doesn't hurt the window surface.
42954223 * self.surface = None # <<<<<<<<<<<<<<
43024230 __Pyx_DECREF(((PyObject *)__pyx_v_self->surface));
43034231 __pyx_v_self->surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None);
43044232
4305 /* "pygame_sdl2/display.pyx":237
4233 /* "pygame_sdl2/display.pyx":238
43064234 * SDL_GL_DeleteContext(self.gl_context)
43074235 *
43084236 * if self.surface: # <<<<<<<<<<<<<<
43114239 */
43124240 }
43134241
4314 /* "pygame_sdl2/display.pyx":246
4242 /* "pygame_sdl2/display.pyx":247
43154243 * self.surface = None
43164244 *
43174245 * SDL_DestroyWindow(self.window) # <<<<<<<<<<<<<<
43204248 */
43214249 SDL_DestroyWindow(__pyx_v_self->window);
43224250
4323 /* "pygame_sdl2/display.pyx":229
4251 /* "pygame_sdl2/display.pyx":230
43244252 *
43254253 *
43264254 * def destroy(self): # <<<<<<<<<<<<<<
43404268 return __pyx_r;
43414269 }
43424270
4343 /* "pygame_sdl2/display.pyx":248
4271 /* "pygame_sdl2/display.pyx":249
43444272 * SDL_DestroyWindow(self.window)
43454273 *
43464274 * def resize(self, size, opengl=False, fullscreen=None): # <<<<<<<<<<<<<<
43984326 }
43994327 }
44004328 if (unlikely(kw_args > 0)) {
4401 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "resize") < 0)) __PYX_ERR(0, 248, __pyx_L3_error)
4329 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "resize") < 0)) __PYX_ERR(0, 249, __pyx_L3_error)
44024330 }
44034331 } else {
44044332 switch (PyTuple_GET_SIZE(__pyx_args)) {
44174345 }
44184346 goto __pyx_L4_argument_unpacking_done;
44194347 __pyx_L5_argtuple_error:;
4420 __Pyx_RaiseArgtupleInvalid("resize", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 248, __pyx_L3_error)
4348 __Pyx_RaiseArgtupleInvalid("resize", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 249, __pyx_L3_error)
44214349 __pyx_L3_error:;
44224350 __Pyx_AddTraceback("pygame_sdl2.display.Window.resize", __pyx_clineno, __pyx_lineno, __pyx_filename);
44234351 __Pyx_RefNannyFinishContext();
44524380 __Pyx_RefNannySetupContext("resize", 0);
44534381 __Pyx_INCREF(__pyx_v_fullscreen);
44544382
4455 /* "pygame_sdl2/display.pyx":255
4383 /* "pygame_sdl2/display.pyx":256
44564384 * """
44574385 *
44584386 * if fullscreen is None: # <<<<<<<<<<<<<<
44634391 __pyx_t_2 = (__pyx_t_1 != 0);
44644392 if (__pyx_t_2) {
44654393
4466 /* "pygame_sdl2/display.pyx":256
4394 /* "pygame_sdl2/display.pyx":257
44674395 *
44684396 * if fullscreen is None:
44694397 * fullscreen = SDL_GetWindowFlags(self.window) & SDL_WINDOW_FULLSCREEN_DESKTOP # <<<<<<<<<<<<<<
44704398 *
44714399 * # Prevents a loop between the surface and this object.
44724400 */
4473 __pyx_t_3 = __Pyx_PyInt_From_uint32_t((SDL_GetWindowFlags(__pyx_v_self->window) & SDL_WINDOW_FULLSCREEN_DESKTOP)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 256, __pyx_L1_error)
4401 __pyx_t_3 = __Pyx_PyInt_From_uint32_t((SDL_GetWindowFlags(__pyx_v_self->window) & SDL_WINDOW_FULLSCREEN_DESKTOP)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 257, __pyx_L1_error)
44744402 __Pyx_GOTREF(__pyx_t_3);
44754403 __Pyx_DECREF_SET(__pyx_v_fullscreen, __pyx_t_3);
44764404 __pyx_t_3 = 0;
44774405
4478 /* "pygame_sdl2/display.pyx":255
4406 /* "pygame_sdl2/display.pyx":256
44794407 * """
44804408 *
44814409 * if fullscreen is None: # <<<<<<<<<<<<<<
44844412 */
44854413 }
44864414
4487 /* "pygame_sdl2/display.pyx":259
4415 /* "pygame_sdl2/display.pyx":260
44884416 *
44894417 * # Prevents a loop between the surface and this object.
44904418 * self.surface.get_window_flags = None # <<<<<<<<<<<<<<
44974425 __Pyx_DECREF(__pyx_v_self->surface->get_window_flags);
44984426 __pyx_v_self->surface->get_window_flags = Py_None;
44994427
4500 /* "pygame_sdl2/display.pyx":261
4428 /* "pygame_sdl2/display.pyx":262
45014429 * self.surface.get_window_flags = None
45024430 *
45034431 * if self.gl_context and not opengl: # <<<<<<<<<<<<<<
45104438 __pyx_t_2 = __pyx_t_1;
45114439 goto __pyx_L5_bool_binop_done;
45124440 }
4513 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_opengl); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 261, __pyx_L1_error)
4441 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_opengl); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 262, __pyx_L1_error)
45144442 __pyx_t_4 = ((!__pyx_t_1) != 0);
45154443 __pyx_t_2 = __pyx_t_4;
45164444 __pyx_L5_bool_binop_done:;
45174445 if (__pyx_t_2) {
45184446
4519 /* "pygame_sdl2/display.pyx":262
4447 /* "pygame_sdl2/display.pyx":263
45204448 *
45214449 * if self.gl_context and not opengl:
45224450 * SDL_GL_DeleteContext(self.gl_context) # <<<<<<<<<<<<<<
45254453 */
45264454 SDL_GL_DeleteContext(__pyx_v_self->gl_context);
45274455
4528 /* "pygame_sdl2/display.pyx":263
4456 /* "pygame_sdl2/display.pyx":264
45294457 * if self.gl_context and not opengl:
45304458 * SDL_GL_DeleteContext(self.gl_context)
45314459 * self.gl_context = NULL # <<<<<<<<<<<<<<
45344462 */
45354463 __pyx_v_self->gl_context = NULL;
45364464
4537 /* "pygame_sdl2/display.pyx":261
4465 /* "pygame_sdl2/display.pyx":262
45384466 * self.surface.get_window_flags = None
45394467 *
45404468 * if self.gl_context and not opengl: # <<<<<<<<<<<<<<
45434471 */
45444472 }
45454473
4546 /* "pygame_sdl2/display.pyx":265
4474 /* "pygame_sdl2/display.pyx":266
45474475 * self.gl_context = NULL
45484476 *
45494477 * cdef int cur_width = 0 # <<<<<<<<<<<<<<
45524480 */
45534481 __pyx_v_cur_width = 0;
45544482
4555 /* "pygame_sdl2/display.pyx":266
4483 /* "pygame_sdl2/display.pyx":267
45564484 *
45574485 * cdef int cur_width = 0
45584486 * cdef int cur_height = 0 # <<<<<<<<<<<<<<
45614489 */
45624490 __pyx_v_cur_height = 0;
45634491
4564 /* "pygame_sdl2/display.pyx":268
4492 /* "pygame_sdl2/display.pyx":269
45654493 * cdef int cur_height = 0
45664494 *
45674495 * if fullscreen: # <<<<<<<<<<<<<<
45684496 * if SDL_SetWindowFullscreen(self.window, SDL_WINDOW_FULLSCREEN_DESKTOP):
45694497 * fullscreen = False
45704498 */
4571 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_fullscreen); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 268, __pyx_L1_error)
4499 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_fullscreen); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 269, __pyx_L1_error)
45724500 if (__pyx_t_2) {
45734501
4574 /* "pygame_sdl2/display.pyx":269
4502 /* "pygame_sdl2/display.pyx":270
45754503 *
45764504 * if fullscreen:
45774505 * if SDL_SetWindowFullscreen(self.window, SDL_WINDOW_FULLSCREEN_DESKTOP): # <<<<<<<<<<<<<<
45814509 __pyx_t_2 = (SDL_SetWindowFullscreen(__pyx_v_self->window, SDL_WINDOW_FULLSCREEN_DESKTOP) != 0);
45824510 if (__pyx_t_2) {
45834511
4584 /* "pygame_sdl2/display.pyx":270
4512 /* "pygame_sdl2/display.pyx":271
45854513 * if fullscreen:
45864514 * if SDL_SetWindowFullscreen(self.window, SDL_WINDOW_FULLSCREEN_DESKTOP):
45874515 * fullscreen = False # <<<<<<<<<<<<<<
45914519 __Pyx_INCREF(Py_False);
45924520 __Pyx_DECREF_SET(__pyx_v_fullscreen, Py_False);
45934521
4594 /* "pygame_sdl2/display.pyx":269
4522 /* "pygame_sdl2/display.pyx":270
45954523 *
45964524 * if fullscreen:
45974525 * if SDL_SetWindowFullscreen(self.window, SDL_WINDOW_FULLSCREEN_DESKTOP): # <<<<<<<<<<<<<<
46004528 */
46014529 }
46024530
4603 /* "pygame_sdl2/display.pyx":268
4531 /* "pygame_sdl2/display.pyx":269
46044532 * cdef int cur_height = 0
46054533 *
46064534 * if fullscreen: # <<<<<<<<<<<<<<
46094537 */
46104538 }
46114539
4612 /* "pygame_sdl2/display.pyx":272
4540 /* "pygame_sdl2/display.pyx":273
46134541 * fullscreen = False
46144542 *
46154543 * if not fullscreen: # <<<<<<<<<<<<<<
46164544 * SDL_SetWindowFullscreen(self.window, 0)
46174545 *
46184546 */
4619 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_fullscreen); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 272, __pyx_L1_error)
4547 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_fullscreen); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 273, __pyx_L1_error)
46204548 __pyx_t_4 = ((!__pyx_t_2) != 0);
46214549 if (__pyx_t_4) {
46224550
4623 /* "pygame_sdl2/display.pyx":273
4551 /* "pygame_sdl2/display.pyx":274
46244552 *
46254553 * if not fullscreen:
46264554 * SDL_SetWindowFullscreen(self.window, 0) # <<<<<<<<<<<<<<
46294557 */
46304558 (void)(SDL_SetWindowFullscreen(__pyx_v_self->window, 0));
46314559
4632 /* "pygame_sdl2/display.pyx":275
4560 /* "pygame_sdl2/display.pyx":276
46334561 * SDL_SetWindowFullscreen(self.window, 0)
46344562 *
46354563 * width, height = size # <<<<<<<<<<<<<<
46424570 if (unlikely(size != 2)) {
46434571 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
46444572 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
4645 __PYX_ERR(0, 275, __pyx_L1_error)
4573 __PYX_ERR(0, 276, __pyx_L1_error)
46464574 }
46474575 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
46484576 if (likely(PyTuple_CheckExact(sequence))) {
46554583 __Pyx_INCREF(__pyx_t_3);
46564584 __Pyx_INCREF(__pyx_t_5);
46574585 #else
4658 __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 275, __pyx_L1_error)
4586 __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 276, __pyx_L1_error)
46594587 __Pyx_GOTREF(__pyx_t_3);
4660 __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 275, __pyx_L1_error)
4588 __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 276, __pyx_L1_error)
46614589 __Pyx_GOTREF(__pyx_t_5);
46624590 #endif
46634591 } else {
46644592 Py_ssize_t index = -1;
4665 __pyx_t_6 = PyObject_GetIter(__pyx_v_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 275, __pyx_L1_error)
4593 __pyx_t_6 = PyObject_GetIter(__pyx_v_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 276, __pyx_L1_error)
46664594 __Pyx_GOTREF(__pyx_t_6);
46674595 __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
46684596 index = 0; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L10_unpacking_failed;
46694597 __Pyx_GOTREF(__pyx_t_3);
46704598 index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L10_unpacking_failed;
46714599 __Pyx_GOTREF(__pyx_t_5);
4672 if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 275, __pyx_L1_error)
4600 if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 276, __pyx_L1_error)
46734601 __pyx_t_7 = NULL;
46744602 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
46754603 goto __pyx_L11_unpacking_done;
46774605 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
46784606 __pyx_t_7 = NULL;
46794607 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
4680 __PYX_ERR(0, 275, __pyx_L1_error)
4608 __PYX_ERR(0, 276, __pyx_L1_error)
46814609 __pyx_L11_unpacking_done:;
46824610 }
46834611 __pyx_v_width = __pyx_t_3;
46854613 __pyx_v_height = __pyx_t_5;
46864614 __pyx_t_5 = 0;
46874615
4688 /* "pygame_sdl2/display.pyx":277
4616 /* "pygame_sdl2/display.pyx":278
46894617 * width, height = size
46904618 *
46914619 * SDL_GetWindowSize(self.window, &cur_width, &cur_height) # <<<<<<<<<<<<<<
46944622 */
46954623 SDL_GetWindowSize(__pyx_v_self->window, (&__pyx_v_cur_width), (&__pyx_v_cur_height));
46964624
4697 /* "pygame_sdl2/display.pyx":279
4625 /* "pygame_sdl2/display.pyx":280
46984626 * SDL_GetWindowSize(self.window, &cur_width, &cur_height)
46994627 *
47004628 * if (cur_width != width) or (cur_height != height): # <<<<<<<<<<<<<<
47014629 * SDL_SetWindowSize(self.window, width, height)
47024630 *
47034631 */
4704 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_cur_width); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 279, __pyx_L1_error)
4632 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_cur_width); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 280, __pyx_L1_error)
47054633 __Pyx_GOTREF(__pyx_t_5);
4706 __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_width, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 279, __pyx_L1_error)
4634 __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_width, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 280, __pyx_L1_error)
47074635 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4708 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 279, __pyx_L1_error)
4636 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 280, __pyx_L1_error)
47094637 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
47104638 if (!__pyx_t_2) {
47114639 } else {
47124640 __pyx_t_4 = __pyx_t_2;
47134641 goto __pyx_L13_bool_binop_done;
47144642 }
4715 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_cur_height); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 279, __pyx_L1_error)
4643 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_cur_height); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 280, __pyx_L1_error)
47164644 __Pyx_GOTREF(__pyx_t_3);
4717 __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_v_height, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 279, __pyx_L1_error)
4645 __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_v_height, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 280, __pyx_L1_error)
47184646 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4719 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 279, __pyx_L1_error)
4647 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 280, __pyx_L1_error)
47204648 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
47214649 __pyx_t_4 = __pyx_t_2;
47224650 __pyx_L13_bool_binop_done:;
47234651 if (__pyx_t_4) {
47244652
4725 /* "pygame_sdl2/display.pyx":280
4653 /* "pygame_sdl2/display.pyx":281
47264654 *
47274655 * if (cur_width != width) or (cur_height != height):
47284656 * SDL_SetWindowSize(self.window, width, height) # <<<<<<<<<<<<<<
47294657 *
47304658 * # Create a missing GL context.
47314659 */
4732 __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_width); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 280, __pyx_L1_error)
4733 __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_height); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 280, __pyx_L1_error)
4660 __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_width); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 281, __pyx_L1_error)
4661 __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_height); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 281, __pyx_L1_error)
47344662 SDL_SetWindowSize(__pyx_v_self->window, __pyx_t_8, __pyx_t_9);
47354663
4736 /* "pygame_sdl2/display.pyx":279
4664 /* "pygame_sdl2/display.pyx":280
47374665 * SDL_GetWindowSize(self.window, &cur_width, &cur_height)
47384666 *
47394667 * if (cur_width != width) or (cur_height != height): # <<<<<<<<<<<<<<
47424670 */
47434671 }
47444672
4745 /* "pygame_sdl2/display.pyx":272
4673 /* "pygame_sdl2/display.pyx":273
47464674 * fullscreen = False
47474675 *
47484676 * if not fullscreen: # <<<<<<<<<<<<<<
47514679 */
47524680 }
47534681
4754 /* "pygame_sdl2/display.pyx":283
4682 /* "pygame_sdl2/display.pyx":284
47554683 *
47564684 * # Create a missing GL context.
47574685 * if opengl and not self.gl_context: # <<<<<<<<<<<<<<
47584686 * self.gl_context = SDL_GL_CreateContext(self.window)
47594687 *
47604688 */
4761 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_opengl); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 283, __pyx_L1_error)
4689 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_opengl); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 284, __pyx_L1_error)
47624690 if (__pyx_t_2) {
47634691 } else {
47644692 __pyx_t_4 = __pyx_t_2;
47694697 __pyx_L16_bool_binop_done:;
47704698 if (__pyx_t_4) {
47714699
4772 /* "pygame_sdl2/display.pyx":284
4700 /* "pygame_sdl2/display.pyx":285
47734701 * # Create a missing GL context.
47744702 * if opengl and not self.gl_context:
47754703 * self.gl_context = SDL_GL_CreateContext(self.window) # <<<<<<<<<<<<<<
47784706 */
47794707 __pyx_v_self->gl_context = SDL_GL_CreateContext(__pyx_v_self->window);
47804708
4781 /* "pygame_sdl2/display.pyx":286
4709 /* "pygame_sdl2/display.pyx":287
47824710 * self.gl_context = SDL_GL_CreateContext(self.window)
47834711 *
47844712 * if self.gl_context == NULL: # <<<<<<<<<<<<<<
47884716 __pyx_t_4 = ((__pyx_v_self->gl_context == NULL) != 0);
47894717 if (unlikely(__pyx_t_4)) {
47904718
4791 /* "pygame_sdl2/display.pyx":287
4719 /* "pygame_sdl2/display.pyx":288
47924720 *
47934721 * if self.gl_context == NULL:
47944722 * raise error() # <<<<<<<<<<<<<<
47954723 *
47964724 * self.create_surface()
47974725 */
4798 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 287, __pyx_L1_error)
4726 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 288, __pyx_L1_error)
47994727 __Pyx_GOTREF(__pyx_t_3);
48004728 __pyx_t_6 = NULL;
48014729 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
48094737 }
48104738 __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
48114739 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
4812 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 287, __pyx_L1_error)
4740 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 288, __pyx_L1_error)
48134741 __Pyx_GOTREF(__pyx_t_5);
48144742 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
48154743 __Pyx_Raise(__pyx_t_5, 0, 0, 0);
48164744 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4817 __PYX_ERR(0, 287, __pyx_L1_error)
4818
4819 /* "pygame_sdl2/display.pyx":286
4745 __PYX_ERR(0, 288, __pyx_L1_error)
4746
4747 /* "pygame_sdl2/display.pyx":287
48204748 * self.gl_context = SDL_GL_CreateContext(self.window)
48214749 *
48224750 * if self.gl_context == NULL: # <<<<<<<<<<<<<<
48254753 */
48264754 }
48274755
4828 /* "pygame_sdl2/display.pyx":283
4756 /* "pygame_sdl2/display.pyx":284
48294757 *
48304758 * # Create a missing GL context.
48314759 * if opengl and not self.gl_context: # <<<<<<<<<<<<<<
48344762 */
48354763 }
48364764
4837 /* "pygame_sdl2/display.pyx":289
4765 /* "pygame_sdl2/display.pyx":290
48384766 * raise error()
48394767 *
48404768 * self.create_surface() # <<<<<<<<<<<<<<
48414769 *
48424770 * def recreate_gl_context(self):
48434771 */
4844 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_create_surface); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 289, __pyx_L1_error)
4772 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_create_surface); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 290, __pyx_L1_error)
48454773 __Pyx_GOTREF(__pyx_t_3);
48464774 __pyx_t_6 = NULL;
48474775 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
48554783 }
48564784 __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
48574785 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
4858 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 289, __pyx_L1_error)
4786 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 290, __pyx_L1_error)
48594787 __Pyx_GOTREF(__pyx_t_5);
48604788 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
48614789 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
48624790
4863 /* "pygame_sdl2/display.pyx":248
4791 /* "pygame_sdl2/display.pyx":249
48644792 * SDL_DestroyWindow(self.window)
48654793 *
48664794 * def resize(self, size, opengl=False, fullscreen=None): # <<<<<<<<<<<<<<
48864814 return __pyx_r;
48874815 }
48884816
4889 /* "pygame_sdl2/display.pyx":291
4817 /* "pygame_sdl2/display.pyx":292
48904818 * self.create_surface()
48914819 *
48924820 * def recreate_gl_context(self): # <<<<<<<<<<<<<<
49204848 int __pyx_clineno = 0;
49214849 __Pyx_RefNannySetupContext("recreate_gl_context", 0);
49224850
4923 /* "pygame_sdl2/display.pyx":296
4851 /* "pygame_sdl2/display.pyx":297
49244852 * """
49254853 *
4926 * if <unsigned int> SDL_GL_GetCurrentContext(): # <<<<<<<<<<<<<<
4854 * if <unsigned long> SDL_GL_GetCurrentContext(): # <<<<<<<<<<<<<<
49274855 * return False
49284856 *
49294857 */
4930 __pyx_t_1 = (((unsigned int)SDL_GL_GetCurrentContext()) != 0);
4858 __pyx_t_1 = (((unsigned long)SDL_GL_GetCurrentContext()) != 0);
49314859 if (__pyx_t_1) {
49324860
4933 /* "pygame_sdl2/display.pyx":297
4934 *
4935 * if <unsigned int> SDL_GL_GetCurrentContext():
4861 /* "pygame_sdl2/display.pyx":298
4862 *
4863 * if <unsigned long> SDL_GL_GetCurrentContext():
49364864 * return False # <<<<<<<<<<<<<<
49374865 *
49384866 * self.gl_context = SDL_GL_CreateContext(self.window)
49424870 __pyx_r = Py_False;
49434871 goto __pyx_L0;
49444872
4945 /* "pygame_sdl2/display.pyx":296
4873 /* "pygame_sdl2/display.pyx":297
49464874 * """
49474875 *
4948 * if <unsigned int> SDL_GL_GetCurrentContext(): # <<<<<<<<<<<<<<
4876 * if <unsigned long> SDL_GL_GetCurrentContext(): # <<<<<<<<<<<<<<
49494877 * return False
49504878 *
49514879 */
49524880 }
49534881
4954 /* "pygame_sdl2/display.pyx":299
4882 /* "pygame_sdl2/display.pyx":300
49554883 * return False
49564884 *
49574885 * self.gl_context = SDL_GL_CreateContext(self.window) # <<<<<<<<<<<<<<
49604888 */
49614889 __pyx_v_self->gl_context = SDL_GL_CreateContext(__pyx_v_self->window);
49624890
4963 /* "pygame_sdl2/display.pyx":301
4891 /* "pygame_sdl2/display.pyx":302
49644892 * self.gl_context = SDL_GL_CreateContext(self.window)
49654893 *
49664894 * if self.gl_context == NULL: # <<<<<<<<<<<<<<
49704898 __pyx_t_1 = ((__pyx_v_self->gl_context == NULL) != 0);
49714899 if (unlikely(__pyx_t_1)) {
49724900
4973 /* "pygame_sdl2/display.pyx":302
4901 /* "pygame_sdl2/display.pyx":303
49744902 *
49754903 * if self.gl_context == NULL:
49764904 * raise error() # <<<<<<<<<<<<<<
49774905 *
49784906 * return True
49794907 */
4980 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 302, __pyx_L1_error)
4908 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 303, __pyx_L1_error)
49814909 __Pyx_GOTREF(__pyx_t_3);
49824910 __pyx_t_4 = NULL;
49834911 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
49914919 }
49924920 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
49934921 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
4994 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 302, __pyx_L1_error)
4922 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 303, __pyx_L1_error)
49954923 __Pyx_GOTREF(__pyx_t_2);
49964924 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
49974925 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
49984926 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4999 __PYX_ERR(0, 302, __pyx_L1_error)
5000
5001 /* "pygame_sdl2/display.pyx":301
4927 __PYX_ERR(0, 303, __pyx_L1_error)
4928
4929 /* "pygame_sdl2/display.pyx":302
50024930 * self.gl_context = SDL_GL_CreateContext(self.window)
50034931 *
50044932 * if self.gl_context == NULL: # <<<<<<<<<<<<<<
50074935 */
50084936 }
50094937
5010 /* "pygame_sdl2/display.pyx":304
4938 /* "pygame_sdl2/display.pyx":305
50114939 * raise error()
50124940 *
50134941 * return True # <<<<<<<<<<<<<<
50194947 __pyx_r = Py_True;
50204948 goto __pyx_L0;
50214949
5022 /* "pygame_sdl2/display.pyx":291
4950 /* "pygame_sdl2/display.pyx":292
50234951 * self.create_surface()
50244952 *
50254953 * def recreate_gl_context(self): # <<<<<<<<<<<<<<
50404968 return __pyx_r;
50414969 }
50424970
5043 /* "pygame_sdl2/display.pyx":306
4971 /* "pygame_sdl2/display.pyx":307
50444972 * return True
50454973 *
50464974 * def get_window_flags(self): # <<<<<<<<<<<<<<
50735001 int __pyx_clineno = 0;
50745002 __Pyx_RefNannySetupContext("get_window_flags", 0);
50755003
5076 /* "pygame_sdl2/display.pyx":307
5004 /* "pygame_sdl2/display.pyx":308
50775005 *
50785006 * def get_window_flags(self):
50795007 * rv = SDL_GetWindowFlags(self.window) # <<<<<<<<<<<<<<
50805008 *
50815009 * if self.gl_context:
50825010 */
5083 __pyx_t_1 = __Pyx_PyInt_From_uint32_t(SDL_GetWindowFlags(__pyx_v_self->window)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error)
5011 __pyx_t_1 = __Pyx_PyInt_From_uint32_t(SDL_GetWindowFlags(__pyx_v_self->window)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __pyx_L1_error)
50845012 __Pyx_GOTREF(__pyx_t_1);
50855013 __pyx_v_rv = __pyx_t_1;
50865014 __pyx_t_1 = 0;
50875015
5088 /* "pygame_sdl2/display.pyx":309
5016 /* "pygame_sdl2/display.pyx":310
50895017 * rv = SDL_GetWindowFlags(self.window)
50905018 *
50915019 * if self.gl_context: # <<<<<<<<<<<<<<
50955023 __pyx_t_2 = (__pyx_v_self->gl_context != 0);
50965024 if (__pyx_t_2) {
50975025
5098 /* "pygame_sdl2/display.pyx":310
5026 /* "pygame_sdl2/display.pyx":311
50995027 *
51005028 * if self.gl_context:
51015029 * rv |= SDL_WINDOW_OPENGL # <<<<<<<<<<<<<<
51025030 * else:
51035031 * rv &= ~SDL_WINDOW_OPENGL
51045032 */
5105 __pyx_t_1 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_OPENGL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error)
5033 __pyx_t_1 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_OPENGL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 311, __pyx_L1_error)
51065034 __Pyx_GOTREF(__pyx_t_1);
5107 __pyx_t_3 = PyNumber_InPlaceOr(__pyx_v_rv, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 310, __pyx_L1_error)
5035 __pyx_t_3 = PyNumber_InPlaceOr(__pyx_v_rv, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 311, __pyx_L1_error)
51085036 __Pyx_GOTREF(__pyx_t_3);
51095037 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
51105038 __Pyx_DECREF_SET(__pyx_v_rv, __pyx_t_3);
51115039 __pyx_t_3 = 0;
51125040
5113 /* "pygame_sdl2/display.pyx":309
5041 /* "pygame_sdl2/display.pyx":310
51145042 * rv = SDL_GetWindowFlags(self.window)
51155043 *
51165044 * if self.gl_context: # <<<<<<<<<<<<<<
51205048 goto __pyx_L3;
51215049 }
51225050
5123 /* "pygame_sdl2/display.pyx":312
5051 /* "pygame_sdl2/display.pyx":313
51245052 * rv |= SDL_WINDOW_OPENGL
51255053 * else:
51265054 * rv &= ~SDL_WINDOW_OPENGL # <<<<<<<<<<<<<<
51285056 * return rv
51295057 */
51305058 /*else*/ {
5131 __pyx_t_3 = __Pyx_PyInt_From_int((~SDL_WINDOW_OPENGL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 312, __pyx_L1_error)
5059 __pyx_t_3 = __Pyx_PyInt_From_int((~SDL_WINDOW_OPENGL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 313, __pyx_L1_error)
51325060 __Pyx_GOTREF(__pyx_t_3);
5133 __pyx_t_1 = PyNumber_InPlaceAnd(__pyx_v_rv, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 312, __pyx_L1_error)
5061 __pyx_t_1 = PyNumber_InPlaceAnd(__pyx_v_rv, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 313, __pyx_L1_error)
51345062 __Pyx_GOTREF(__pyx_t_1);
51355063 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
51365064 __Pyx_DECREF_SET(__pyx_v_rv, __pyx_t_1);
51385066 }
51395067 __pyx_L3:;
51405068
5141 /* "pygame_sdl2/display.pyx":314
5069 /* "pygame_sdl2/display.pyx":315
51425070 * rv &= ~SDL_WINDOW_OPENGL
51435071 *
51445072 * return rv # <<<<<<<<<<<<<<
51505078 __pyx_r = __pyx_v_rv;
51515079 goto __pyx_L0;
51525080
5153 /* "pygame_sdl2/display.pyx":306
5081 /* "pygame_sdl2/display.pyx":307
51545082 * return True
51555083 *
51565084 * def get_window_flags(self): # <<<<<<<<<<<<<<
51715099 return __pyx_r;
51725100 }
51735101
5174 /* "pygame_sdl2/display.pyx":316
5102 /* "pygame_sdl2/display.pyx":317
51755103 * return rv
51765104 *
51775105 * def proxy_window_surface(self): # <<<<<<<<<<<<<<
51975125 __Pyx_RefNannyDeclarations
51985126 __Pyx_RefNannySetupContext("proxy_window_surface", 0);
51995127
5200 /* "pygame_sdl2/display.pyx":317
5128 /* "pygame_sdl2/display.pyx":318
52015129 *
52025130 * def proxy_window_surface(self):
52035131 * SDL_UpperBlit(self.surface.surface, NULL, self.window_surface, NULL) # <<<<<<<<<<<<<<
52065134 */
52075135 (void)(SDL_UpperBlit(__pyx_v_self->surface->surface, NULL, __pyx_v_self->window_surface, NULL));
52085136
5209 /* "pygame_sdl2/display.pyx":316
5137 /* "pygame_sdl2/display.pyx":317
52105138 * return rv
52115139 *
52125140 * def proxy_window_surface(self): # <<<<<<<<<<<<<<
52215149 return __pyx_r;
52225150 }
52235151
5224 /* "pygame_sdl2/display.pyx":319
5152 /* "pygame_sdl2/display.pyx":320
52255153 * SDL_UpperBlit(self.surface.surface, NULL, self.window_surface, NULL)
52265154 *
52275155 * def flip(self): # <<<<<<<<<<<<<<
52565184 int __pyx_clineno = 0;
52575185 __Pyx_RefNannySetupContext("flip", 0);
52585186
5259 /* "pygame_sdl2/display.pyx":322
5187 /* "pygame_sdl2/display.pyx":323
52605188 * cdef const char *err
52615189 *
52625190 * if self.gl_context != NULL: # <<<<<<<<<<<<<<
52665194 __pyx_t_1 = ((__pyx_v_self->gl_context != NULL) != 0);
52675195 if (__pyx_t_1) {
52685196
5269 /* "pygame_sdl2/display.pyx":323
5197 /* "pygame_sdl2/display.pyx":324
52705198 *
52715199 * if self.gl_context != NULL:
52725200 * with nogil: # <<<<<<<<<<<<<<
52815209 #endif
52825210 /*try:*/ {
52835211
5284 /* "pygame_sdl2/display.pyx":324
5212 /* "pygame_sdl2/display.pyx":325
52855213 * if self.gl_context != NULL:
52865214 * with nogil:
52875215 * SDL_ClearError(); # <<<<<<<<<<<<<<
52905218 */
52915219 SDL_ClearError();
52925220
5293 /* "pygame_sdl2/display.pyx":326
5221 /* "pygame_sdl2/display.pyx":327
52945222 * SDL_ClearError();
52955223 *
52965224 * SDL_GL_SwapWindow(self.window) # <<<<<<<<<<<<<<
52995227 */
53005228 SDL_GL_SwapWindow(__pyx_v_self->window);
53015229
5302 /* "pygame_sdl2/display.pyx":328
5230 /* "pygame_sdl2/display.pyx":329
53035231 * SDL_GL_SwapWindow(self.window)
53045232 *
53055233 * err = SDL_GetError() # <<<<<<<<<<<<<<
53095237 __pyx_v_err = SDL_GetError();
53105238 }
53115239
5312 /* "pygame_sdl2/display.pyx":323
5240 /* "pygame_sdl2/display.pyx":324
53135241 *
53145242 * if self.gl_context != NULL:
53155243 * with nogil: # <<<<<<<<<<<<<<
53285256 }
53295257 }
53305258
5331 /* "pygame_sdl2/display.pyx":330
5259 /* "pygame_sdl2/display.pyx":331
53325260 * err = SDL_GetError()
53335261 *
53345262 * if err[0]: # <<<<<<<<<<<<<<
53385266 __pyx_t_1 = ((__pyx_v_err[0]) != 0);
53395267 if (unlikely(__pyx_t_1)) {
53405268
5341 /* "pygame_sdl2/display.pyx":331
5269 /* "pygame_sdl2/display.pyx":332
53425270 *
53435271 * if err[0]:
53445272 * raise error(err) # <<<<<<<<<<<<<<
53455273 *
53465274 * else:
53475275 */
5348 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 331, __pyx_L1_error)
5276 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 332, __pyx_L1_error)
53495277 __Pyx_GOTREF(__pyx_t_3);
5350 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_err); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 331, __pyx_L1_error)
5278 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_err); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 332, __pyx_L1_error)
53515279 __Pyx_GOTREF(__pyx_t_4);
53525280 __pyx_t_5 = NULL;
53535281 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
53625290 __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
53635291 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
53645292 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5365 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 331, __pyx_L1_error)
5293 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
53665294 __Pyx_GOTREF(__pyx_t_2);
53675295 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
53685296 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
53695297 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5370 __PYX_ERR(0, 331, __pyx_L1_error)
5371
5372 /* "pygame_sdl2/display.pyx":330
5298 __PYX_ERR(0, 332, __pyx_L1_error)
5299
5300 /* "pygame_sdl2/display.pyx":331
53735301 * err = SDL_GetError()
53745302 *
53755303 * if err[0]: # <<<<<<<<<<<<<<
53785306 */
53795307 }
53805308
5381 /* "pygame_sdl2/display.pyx":322
5309 /* "pygame_sdl2/display.pyx":323
53825310 * cdef const char *err
53835311 *
53845312 * if self.gl_context != NULL: # <<<<<<<<<<<<<<
53885316 goto __pyx_L3;
53895317 }
53905318
5391 /* "pygame_sdl2/display.pyx":335
5319 /* "pygame_sdl2/display.pyx":336
53925320 * else:
53935321 *
53945322 * if self.surface.surface != self.window_surface: # <<<<<<<<<<<<<<
53995327 __pyx_t_1 = ((__pyx_v_self->surface->surface != __pyx_v_self->window_surface) != 0);
54005328 if (__pyx_t_1) {
54015329
5402 /* "pygame_sdl2/display.pyx":336
5330 /* "pygame_sdl2/display.pyx":337
54035331 *
54045332 * if self.surface.surface != self.window_surface:
54055333 * self.proxy_window_surface() # <<<<<<<<<<<<<<
54065334 *
54075335 * with nogil:
54085336 */
5409 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_proxy_window_surface); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 336, __pyx_L1_error)
5337 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_proxy_window_surface); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 337, __pyx_L1_error)
54105338 __Pyx_GOTREF(__pyx_t_3);
54115339 __pyx_t_4 = NULL;
54125340 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
54205348 }
54215349 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
54225350 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
5423 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 336, __pyx_L1_error)
5351 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error)
54245352 __Pyx_GOTREF(__pyx_t_2);
54255353 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
54265354 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
54275355
5428 /* "pygame_sdl2/display.pyx":335
5356 /* "pygame_sdl2/display.pyx":336
54295357 * else:
54305358 *
54315359 * if self.surface.surface != self.window_surface: # <<<<<<<<<<<<<<
54345362 */
54355363 }
54365364
5437 /* "pygame_sdl2/display.pyx":338
5365 /* "pygame_sdl2/display.pyx":339
54385366 * self.proxy_window_surface()
54395367 *
54405368 * with nogil: # <<<<<<<<<<<<<<
54495377 #endif
54505378 /*try:*/ {
54515379
5452 /* "pygame_sdl2/display.pyx":339
5380 /* "pygame_sdl2/display.pyx":340
54535381 *
54545382 * with nogil:
54555383 * SDL_UpdateWindowSurface(self.window) # <<<<<<<<<<<<<<
54595387 (void)(SDL_UpdateWindowSurface(__pyx_v_self->window));
54605388 }
54615389
5462 /* "pygame_sdl2/display.pyx":338
5390 /* "pygame_sdl2/display.pyx":339
54635391 * self.proxy_window_surface()
54645392 *
54655393 * with nogil: # <<<<<<<<<<<<<<
54805408 }
54815409 __pyx_L3:;
54825410
5483 /* "pygame_sdl2/display.pyx":319
5411 /* "pygame_sdl2/display.pyx":320
54845412 * SDL_UpperBlit(self.surface.surface, NULL, self.window_surface, NULL)
54855413 *
54865414 * def flip(self): # <<<<<<<<<<<<<<
55045432 return __pyx_r;
55055433 }
55065434
5507 /* "pygame_sdl2/display.pyx":341
5435 /* "pygame_sdl2/display.pyx":342
55085436 * SDL_UpdateWindowSurface(self.window)
55095437 *
55105438 * def get_surface(self): # <<<<<<<<<<<<<<
55305458 __Pyx_RefNannyDeclarations
55315459 __Pyx_RefNannySetupContext("get_surface", 0);
55325460
5533 /* "pygame_sdl2/display.pyx":342
5461 /* "pygame_sdl2/display.pyx":343
55345462 *
55355463 * def get_surface(self):
55365464 * return self.surface # <<<<<<<<<<<<<<
55425470 __pyx_r = ((PyObject *)__pyx_v_self->surface);
55435471 goto __pyx_L0;
55445472
5545 /* "pygame_sdl2/display.pyx":341
5473 /* "pygame_sdl2/display.pyx":342
55465474 * SDL_UpdateWindowSurface(self.window)
55475475 *
55485476 * def get_surface(self): # <<<<<<<<<<<<<<
55575485 return __pyx_r;
55585486 }
55595487
5560 /* "pygame_sdl2/display.pyx":344
5488 /* "pygame_sdl2/display.pyx":345
55615489 * return self.surface
55625490 *
55635491 * def update(self, rectangles=None): # <<<<<<<<<<<<<<
55975525 }
55985526 }
55995527 if (unlikely(kw_args > 0)) {
5600 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "update") < 0)) __PYX_ERR(0, 344, __pyx_L3_error)
5528 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "update") < 0)) __PYX_ERR(0, 345, __pyx_L3_error)
56015529 }
56025530 } else {
56035531 switch (PyTuple_GET_SIZE(__pyx_args)) {
56115539 }
56125540 goto __pyx_L4_argument_unpacking_done;
56135541 __pyx_L5_argtuple_error:;
5614 __Pyx_RaiseArgtupleInvalid("update", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 344, __pyx_L3_error)
5542 __Pyx_RaiseArgtupleInvalid("update", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 345, __pyx_L3_error)
56155543 __pyx_L3_error:;
56165544 __Pyx_AddTraceback("pygame_sdl2.display.Window.update", __pyx_clineno, __pyx_lineno, __pyx_filename);
56175545 __Pyx_RefNannyFinishContext();
56525580 __Pyx_RefNannySetupContext("update", 0);
56535581 __Pyx_INCREF(__pyx_v_rectangles);
56545582
5655 /* "pygame_sdl2/display.pyx":347
5583 /* "pygame_sdl2/display.pyx":348
56565584 *
56575585 * cdef SDL_Rect *rects
56585586 * cdef int count = 0 # <<<<<<<<<<<<<<
56615589 */
56625590 __pyx_v_count = 0;
56635591
5664 /* "pygame_sdl2/display.pyx":349
5592 /* "pygame_sdl2/display.pyx":350
56655593 * cdef int count = 0
56665594 *
56675595 * if rectangles is None: # <<<<<<<<<<<<<<
56725600 __pyx_t_2 = (__pyx_t_1 != 0);
56735601 if (__pyx_t_2) {
56745602
5675 /* "pygame_sdl2/display.pyx":350
5603 /* "pygame_sdl2/display.pyx":351
56765604 *
56775605 * if rectangles is None:
56785606 * self.flip() # <<<<<<<<<<<<<<
56795607 * return
56805608 *
56815609 */
5682 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flip); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 350, __pyx_L1_error)
5610 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flip); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 351, __pyx_L1_error)
56835611 __Pyx_GOTREF(__pyx_t_4);
56845612 __pyx_t_5 = NULL;
56855613 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
56935621 }
56945622 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
56955623 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
5696 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 350, __pyx_L1_error)
5624 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 351, __pyx_L1_error)
56975625 __Pyx_GOTREF(__pyx_t_3);
56985626 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
56995627 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
57005628
5701 /* "pygame_sdl2/display.pyx":351
5629 /* "pygame_sdl2/display.pyx":352
57025630 * if rectangles is None:
57035631 * self.flip()
57045632 * return # <<<<<<<<<<<<<<
57095637 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
57105638 goto __pyx_L0;
57115639
5712 /* "pygame_sdl2/display.pyx":349
5640 /* "pygame_sdl2/display.pyx":350
57135641 * cdef int count = 0
57145642 *
57155643 * if rectangles is None: # <<<<<<<<<<<<<<
57185646 */
57195647 }
57205648
5721 /* "pygame_sdl2/display.pyx":353
5649 /* "pygame_sdl2/display.pyx":354
57225650 * return
57235651 *
57245652 * if self.surface.surface != self.window_surface: # <<<<<<<<<<<<<<
57285656 __pyx_t_2 = ((__pyx_v_self->surface->surface != __pyx_v_self->window_surface) != 0);
57295657 if (__pyx_t_2) {
57305658
5731 /* "pygame_sdl2/display.pyx":354
5659 /* "pygame_sdl2/display.pyx":355
57325660 *
57335661 * if self.surface.surface != self.window_surface:
57345662 * self.proxy_window_surface() # <<<<<<<<<<<<<<
57355663 *
57365664 * if not isinstance(rectangles, list):
57375665 */
5738 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_proxy_window_surface); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 354, __pyx_L1_error)
5666 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_proxy_window_surface); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 355, __pyx_L1_error)
57395667 __Pyx_GOTREF(__pyx_t_4);
57405668 __pyx_t_5 = NULL;
57415669 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
57495677 }
57505678 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
57515679 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
5752 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 354, __pyx_L1_error)
5680 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 355, __pyx_L1_error)
57535681 __Pyx_GOTREF(__pyx_t_3);
57545682 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
57555683 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
57565684
5757 /* "pygame_sdl2/display.pyx":353
5685 /* "pygame_sdl2/display.pyx":354
57585686 * return
57595687 *
57605688 * if self.surface.surface != self.window_surface: # <<<<<<<<<<<<<<
57635691 */
57645692 }
57655693
5766 /* "pygame_sdl2/display.pyx":356
5694 /* "pygame_sdl2/display.pyx":357
57675695 * self.proxy_window_surface()
57685696 *
57695697 * if not isinstance(rectangles, list): # <<<<<<<<<<<<<<
57745702 __pyx_t_1 = ((!(__pyx_t_2 != 0)) != 0);
57755703 if (__pyx_t_1) {
57765704
5777 /* "pygame_sdl2/display.pyx":357
5705 /* "pygame_sdl2/display.pyx":358
57785706 *
57795707 * if not isinstance(rectangles, list):
57805708 * rectangles = [ rectangles ] # <<<<<<<<<<<<<<
57815709 *
57825710 * rects = <SDL_Rect *> calloc(len(rectangles), sizeof(SDL_Rect))
57835711 */
5784 __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 357, __pyx_L1_error)
5712 __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 358, __pyx_L1_error)
57855713 __Pyx_GOTREF(__pyx_t_3);
57865714 __Pyx_INCREF(__pyx_v_rectangles);
57875715 __Pyx_GIVEREF(__pyx_v_rectangles);
57895717 __Pyx_DECREF_SET(__pyx_v_rectangles, __pyx_t_3);
57905718 __pyx_t_3 = 0;
57915719
5792 /* "pygame_sdl2/display.pyx":356
5720 /* "pygame_sdl2/display.pyx":357
57935721 * self.proxy_window_surface()
57945722 *
57955723 * if not isinstance(rectangles, list): # <<<<<<<<<<<<<<
57985726 */
57995727 }
58005728
5801 /* "pygame_sdl2/display.pyx":359
5729 /* "pygame_sdl2/display.pyx":360
58025730 * rectangles = [ rectangles ]
58035731 *
58045732 * rects = <SDL_Rect *> calloc(len(rectangles), sizeof(SDL_Rect)) # <<<<<<<<<<<<<<
58055733 * if rects == NULL:
58065734 * raise MemoryError("Couldn't allocate rectangles.")
58075735 */
5808 __pyx_t_6 = PyObject_Length(__pyx_v_rectangles); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 359, __pyx_L1_error)
5736 __pyx_t_6 = PyObject_Length(__pyx_v_rectangles); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 360, __pyx_L1_error)
58095737 __pyx_v_rects = ((SDL_Rect *)calloc(__pyx_t_6, (sizeof(SDL_Rect))));
58105738
5811 /* "pygame_sdl2/display.pyx":360
5739 /* "pygame_sdl2/display.pyx":361
58125740 *
58135741 * rects = <SDL_Rect *> calloc(len(rectangles), sizeof(SDL_Rect))
58145742 * if rects == NULL: # <<<<<<<<<<<<<<
58185746 __pyx_t_1 = ((__pyx_v_rects == NULL) != 0);
58195747 if (unlikely(__pyx_t_1)) {
58205748
5821 /* "pygame_sdl2/display.pyx":361
5749 /* "pygame_sdl2/display.pyx":362
58225750 * rects = <SDL_Rect *> calloc(len(rectangles), sizeof(SDL_Rect))
58235751 * if rects == NULL:
58245752 * raise MemoryError("Couldn't allocate rectangles.") # <<<<<<<<<<<<<<
58255753 *
58265754 * try:
58275755 */
5828 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 361, __pyx_L1_error)
5756 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 362, __pyx_L1_error)
58295757 __Pyx_GOTREF(__pyx_t_3);
58305758 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
58315759 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5832 __PYX_ERR(0, 361, __pyx_L1_error)
5833
5834 /* "pygame_sdl2/display.pyx":360
5760 __PYX_ERR(0, 362, __pyx_L1_error)
5761
5762 /* "pygame_sdl2/display.pyx":361
58355763 *
58365764 * rects = <SDL_Rect *> calloc(len(rectangles), sizeof(SDL_Rect))
58375765 * if rects == NULL: # <<<<<<<<<<<<<<
58405768 */
58415769 }
58425770
5843 /* "pygame_sdl2/display.pyx":363
5771 /* "pygame_sdl2/display.pyx":364
58445772 * raise MemoryError("Couldn't allocate rectangles.")
58455773 *
58465774 * try: # <<<<<<<<<<<<<<
58495777 */
58505778 /*try:*/ {
58515779
5852 /* "pygame_sdl2/display.pyx":365
5780 /* "pygame_sdl2/display.pyx":366
58535781 * try:
58545782 *
58555783 * for i in rectangles: # <<<<<<<<<<<<<<
58605788 __pyx_t_3 = __pyx_v_rectangles; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0;
58615789 __pyx_t_7 = NULL;
58625790 } else {
5863 __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_rectangles); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 365, __pyx_L8_error)
5791 __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_rectangles); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 366, __pyx_L8_error)
58645792 __Pyx_GOTREF(__pyx_t_3);
5865 __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 365, __pyx_L8_error)
5793 __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 366, __pyx_L8_error)
58665794 }
58675795 for (;;) {
58685796 if (likely(!__pyx_t_7)) {
58695797 if (likely(PyList_CheckExact(__pyx_t_3))) {
58705798 if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break;
58715799 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5872 __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 365, __pyx_L8_error)
5800 __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 366, __pyx_L8_error)
58735801 #else
5874 __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 365, __pyx_L8_error)
5802 __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 366, __pyx_L8_error)
58755803 __Pyx_GOTREF(__pyx_t_4);
58765804 #endif
58775805 } else {
58785806 if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
58795807 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5880 __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_ERR(0, 365, __pyx_L8_error)
5808 __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_ERR(0, 366, __pyx_L8_error)
58815809 #else
5882 __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 365, __pyx_L8_error)
5810 __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 366, __pyx_L8_error)
58835811 __Pyx_GOTREF(__pyx_t_4);
58845812 #endif
58855813 }
58895817 PyObject* exc_type = PyErr_Occurred();
58905818 if (exc_type) {
58915819 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
5892 else __PYX_ERR(0, 365, __pyx_L8_error)
5820 else __PYX_ERR(0, 366, __pyx_L8_error)
58935821 }
58945822 break;
58955823 }
58985826 __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4);
58995827 __pyx_t_4 = 0;
59005828
5901 /* "pygame_sdl2/display.pyx":366
5829 /* "pygame_sdl2/display.pyx":367
59025830 *
59035831 * for i in rectangles:
59045832 * if i is None: # <<<<<<<<<<<<<<
59095837 __pyx_t_2 = (__pyx_t_1 != 0);
59105838 if (__pyx_t_2) {
59115839
5912 /* "pygame_sdl2/display.pyx":367
5840 /* "pygame_sdl2/display.pyx":368
59135841 * for i in rectangles:
59145842 * if i is None:
59155843 * continue # <<<<<<<<<<<<<<
59185846 */
59195847 goto __pyx_L10_continue;
59205848
5921 /* "pygame_sdl2/display.pyx":366
5849 /* "pygame_sdl2/display.pyx":367
59225850 *
59235851 * for i in rectangles:
59245852 * if i is None: # <<<<<<<<<<<<<<
59275855 */
59285856 }
59295857
5930 /* "pygame_sdl2/display.pyx":369
5858 /* "pygame_sdl2/display.pyx":370
59315859 * continue
59325860 *
59335861 * to_sdl_rect(i, &rects[count]) # <<<<<<<<<<<<<<
59345862 * count += 1
59355863 *
59365864 */
5937 __pyx_t_8 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_i, (&(__pyx_v_rects[__pyx_v_count])), NULL); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 369, __pyx_L8_error)
5938
5939 /* "pygame_sdl2/display.pyx":370
5865 __pyx_t_8 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_i, (&(__pyx_v_rects[__pyx_v_count])), NULL); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 370, __pyx_L8_error)
5866
5867 /* "pygame_sdl2/display.pyx":371
59405868 *
59415869 * to_sdl_rect(i, &rects[count])
59425870 * count += 1 # <<<<<<<<<<<<<<
59455873 */
59465874 __pyx_v_count = (__pyx_v_count + 1);
59475875
5948 /* "pygame_sdl2/display.pyx":365
5876 /* "pygame_sdl2/display.pyx":366
59495877 * try:
59505878 *
59515879 * for i in rectangles: # <<<<<<<<<<<<<<
59565884 }
59575885 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
59585886
5959 /* "pygame_sdl2/display.pyx":372
5887 /* "pygame_sdl2/display.pyx":373
59605888 * count += 1
59615889 *
59625890 * SDL_UpdateWindowSurfaceRects(self.window, rects, count) # <<<<<<<<<<<<<<
59665894 (void)(SDL_UpdateWindowSurfaceRects(__pyx_v_self->window, __pyx_v_rects, __pyx_v_count));
59675895 }
59685896
5969 /* "pygame_sdl2/display.pyx":375
5897 /* "pygame_sdl2/display.pyx":376
59705898 *
59715899 * finally:
59725900 * free(rects) # <<<<<<<<<<<<<<
60155943 __pyx_L9:;
60165944 }
60175945
6018 /* "pygame_sdl2/display.pyx":344
5946 /* "pygame_sdl2/display.pyx":345
60195947 * return self.surface
60205948 *
60215949 * def update(self, rectangles=None): # <<<<<<<<<<<<<<
60405968 return __pyx_r;
60415969 }
60425970
6043 /* "pygame_sdl2/display.pyx":377
5971 /* "pygame_sdl2/display.pyx":378
60445972 * free(rects)
60455973 *
60465974 * def get_wm_info(self): # <<<<<<<<<<<<<<
60705998 int __pyx_clineno = 0;
60715999 __Pyx_RefNannySetupContext("get_wm_info", 0);
60726000
6073 /* "pygame_sdl2/display.pyx":378
6001 /* "pygame_sdl2/display.pyx":379
60746002 *
60756003 * def get_wm_info(self):
60766004 * return { } # <<<<<<<<<<<<<<
60786006 * def get_active(self):
60796007 */
60806008 __Pyx_XDECREF(__pyx_r);
6081 __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 378, __pyx_L1_error)
6009 __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 379, __pyx_L1_error)
60826010 __Pyx_GOTREF(__pyx_t_1);
60836011 __pyx_r = __pyx_t_1;
60846012 __pyx_t_1 = 0;
60856013 goto __pyx_L0;
60866014
6087 /* "pygame_sdl2/display.pyx":377
6015 /* "pygame_sdl2/display.pyx":378
60886016 * free(rects)
60896017 *
60906018 * def get_wm_info(self): # <<<<<<<<<<<<<<
61036031 return __pyx_r;
61046032 }
61056033
6106 /* "pygame_sdl2/display.pyx":380
6034 /* "pygame_sdl2/display.pyx":381
61076035 * return { }
61086036 *
61096037 * def get_active(self): # <<<<<<<<<<<<<<
61306058 int __pyx_t_1;
61316059 __Pyx_RefNannySetupContext("get_active", 0);
61326060
6133 /* "pygame_sdl2/display.pyx":381
6061 /* "pygame_sdl2/display.pyx":382
61346062 *
61356063 * def get_active(self):
61366064 * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_HIDDEN | SDL_WINDOW_MINIMIZED): # <<<<<<<<<<<<<<
61406068 __pyx_t_1 = ((SDL_GetWindowFlags(__pyx_v_self->window) & (SDL_WINDOW_HIDDEN | SDL_WINDOW_MINIMIZED)) != 0);
61416069 if (__pyx_t_1) {
61426070
6143 /* "pygame_sdl2/display.pyx":382
6071 /* "pygame_sdl2/display.pyx":383
61446072 * def get_active(self):
61456073 * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_HIDDEN | SDL_WINDOW_MINIMIZED):
61466074 * return False # <<<<<<<<<<<<<<
61526080 __pyx_r = Py_False;
61536081 goto __pyx_L0;
61546082
6155 /* "pygame_sdl2/display.pyx":381
6083 /* "pygame_sdl2/display.pyx":382
61566084 *
61576085 * def get_active(self):
61586086 * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_HIDDEN | SDL_WINDOW_MINIMIZED): # <<<<<<<<<<<<<<
61616089 */
61626090 }
61636091
6164 /* "pygame_sdl2/display.pyx":384
6092 /* "pygame_sdl2/display.pyx":385
61656093 * return False
61666094 * else:
61676095 * return True # <<<<<<<<<<<<<<
61756103 goto __pyx_L0;
61766104 }
61776105
6178 /* "pygame_sdl2/display.pyx":380
6106 /* "pygame_sdl2/display.pyx":381
61796107 * return { }
61806108 *
61816109 * def get_active(self): # <<<<<<<<<<<<<<
61906118 return __pyx_r;
61916119 }
61926120
6193 /* "pygame_sdl2/display.pyx":386
6121 /* "pygame_sdl2/display.pyx":387
61946122 * return True
61956123 *
61966124 * def iconify(self): # <<<<<<<<<<<<<<
62166144 __Pyx_RefNannyDeclarations
62176145 __Pyx_RefNannySetupContext("iconify", 0);
62186146
6219 /* "pygame_sdl2/display.pyx":387
6147 /* "pygame_sdl2/display.pyx":388
62206148 *
62216149 * def iconify(self):
62226150 * SDL_MinimizeWindow(self.window) # <<<<<<<<<<<<<<
62256153 */
62266154 SDL_MinimizeWindow(__pyx_v_self->window);
62276155
6228 /* "pygame_sdl2/display.pyx":388
6156 /* "pygame_sdl2/display.pyx":389
62296157 * def iconify(self):
62306158 * SDL_MinimizeWindow(self.window)
62316159 * return True # <<<<<<<<<<<<<<
62376165 __pyx_r = Py_True;
62386166 goto __pyx_L0;
62396167
6240 /* "pygame_sdl2/display.pyx":386
6168 /* "pygame_sdl2/display.pyx":387
62416169 * return True
62426170 *
62436171 * def iconify(self): # <<<<<<<<<<<<<<
62526180 return __pyx_r;
62536181 }
62546182
6255 /* "pygame_sdl2/display.pyx":390
6183 /* "pygame_sdl2/display.pyx":391
62566184 * return True
62576185 *
62586186 * def toggle_fullscreen(self): # <<<<<<<<<<<<<<
62856213 int __pyx_clineno = 0;
62866214 __Pyx_RefNannySetupContext("toggle_fullscreen", 0);
62876215
6288 /* "pygame_sdl2/display.pyx":391
6216 /* "pygame_sdl2/display.pyx":392
62896217 *
62906218 * def toggle_fullscreen(self):
62916219 * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_FULLSCREEN_DESKTOP): # <<<<<<<<<<<<<<
62956223 __pyx_t_1 = ((SDL_GetWindowFlags(__pyx_v_self->window) & SDL_WINDOW_FULLSCREEN_DESKTOP) != 0);
62966224 if (__pyx_t_1) {
62976225
6298 /* "pygame_sdl2/display.pyx":392
6226 /* "pygame_sdl2/display.pyx":393
62996227 * def toggle_fullscreen(self):
63006228 * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_FULLSCREEN_DESKTOP):
63016229 * if SDL_SetWindowFullscreen(self.window, 0): # <<<<<<<<<<<<<<
63056233 __pyx_t_1 = (SDL_SetWindowFullscreen(__pyx_v_self->window, 0) != 0);
63066234 if (unlikely(__pyx_t_1)) {
63076235
6308 /* "pygame_sdl2/display.pyx":393
6236 /* "pygame_sdl2/display.pyx":394
63096237 * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_FULLSCREEN_DESKTOP):
63106238 * if SDL_SetWindowFullscreen(self.window, 0):
63116239 * raise error() # <<<<<<<<<<<<<<
63126240 * else:
63136241 * if SDL_SetWindowFullscreen(self.window, SDL_WINDOW_FULLSCREEN_DESKTOP):
63146242 */
6315 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 393, __pyx_L1_error)
6243 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 394, __pyx_L1_error)
63166244 __Pyx_GOTREF(__pyx_t_3);
63176245 __pyx_t_4 = NULL;
63186246 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
63266254 }
63276255 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
63286256 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6329 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 393, __pyx_L1_error)
6257 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 394, __pyx_L1_error)
63306258 __Pyx_GOTREF(__pyx_t_2);
63316259 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
63326260 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
63336261 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6334 __PYX_ERR(0, 393, __pyx_L1_error)
6335
6336 /* "pygame_sdl2/display.pyx":392
6262 __PYX_ERR(0, 394, __pyx_L1_error)
6263
6264 /* "pygame_sdl2/display.pyx":393
63376265 * def toggle_fullscreen(self):
63386266 * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_FULLSCREEN_DESKTOP):
63396267 * if SDL_SetWindowFullscreen(self.window, 0): # <<<<<<<<<<<<<<
63426270 */
63436271 }
63446272
6345 /* "pygame_sdl2/display.pyx":391
6273 /* "pygame_sdl2/display.pyx":392
63466274 *
63476275 * def toggle_fullscreen(self):
63486276 * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_FULLSCREEN_DESKTOP): # <<<<<<<<<<<<<<
63526280 goto __pyx_L3;
63536281 }
63546282
6355 /* "pygame_sdl2/display.pyx":395
6283 /* "pygame_sdl2/display.pyx":396
63566284 * raise error()
63576285 * else:
63586286 * if SDL_SetWindowFullscreen(self.window, SDL_WINDOW_FULLSCREEN_DESKTOP): # <<<<<<<<<<<<<<
63636291 __pyx_t_1 = (SDL_SetWindowFullscreen(__pyx_v_self->window, SDL_WINDOW_FULLSCREEN_DESKTOP) != 0);
63646292 if (unlikely(__pyx_t_1)) {
63656293
6366 /* "pygame_sdl2/display.pyx":396
6294 /* "pygame_sdl2/display.pyx":397
63676295 * else:
63686296 * if SDL_SetWindowFullscreen(self.window, SDL_WINDOW_FULLSCREEN_DESKTOP):
63696297 * raise error() # <<<<<<<<<<<<<<
63706298 *
63716299 * return True
63726300 */
6373 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 396, __pyx_L1_error)
6301 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 397, __pyx_L1_error)
63746302 __Pyx_GOTREF(__pyx_t_3);
63756303 __pyx_t_4 = NULL;
63766304 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
63846312 }
63856313 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
63866314 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6387 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 396, __pyx_L1_error)
6315 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 397, __pyx_L1_error)
63886316 __Pyx_GOTREF(__pyx_t_2);
63896317 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
63906318 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
63916319 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6392 __PYX_ERR(0, 396, __pyx_L1_error)
6393
6394 /* "pygame_sdl2/display.pyx":395
6320 __PYX_ERR(0, 397, __pyx_L1_error)
6321
6322 /* "pygame_sdl2/display.pyx":396
63956323 * raise error()
63966324 * else:
63976325 * if SDL_SetWindowFullscreen(self.window, SDL_WINDOW_FULLSCREEN_DESKTOP): # <<<<<<<<<<<<<<
64026330 }
64036331 __pyx_L3:;
64046332
6405 /* "pygame_sdl2/display.pyx":398
6333 /* "pygame_sdl2/display.pyx":399
64066334 * raise error()
64076335 *
64086336 * return True # <<<<<<<<<<<<<<
64146342 __pyx_r = Py_True;
64156343 goto __pyx_L0;
64166344
6417 /* "pygame_sdl2/display.pyx":390
6345 /* "pygame_sdl2/display.pyx":391
64186346 * return True
64196347 *
64206348 * def toggle_fullscreen(self): # <<<<<<<<<<<<<<
64356363 return __pyx_r;
64366364 }
64376365
6438 /* "pygame_sdl2/display.pyx":400
6366 /* "pygame_sdl2/display.pyx":401
64396367 * return True
64406368 *
64416369 * def set_gamma(self, red, green=None, blue=None): # <<<<<<<<<<<<<<
64926420 }
64936421 }
64946422 if (unlikely(kw_args > 0)) {
6495 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_gamma") < 0)) __PYX_ERR(0, 400, __pyx_L3_error)
6423 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_gamma") < 0)) __PYX_ERR(0, 401, __pyx_L3_error)
64966424 }
64976425 } else {
64986426 switch (PyTuple_GET_SIZE(__pyx_args)) {
65116439 }
65126440 goto __pyx_L4_argument_unpacking_done;
65136441 __pyx_L5_argtuple_error:;
6514 __Pyx_RaiseArgtupleInvalid("set_gamma", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 400, __pyx_L3_error)
6442 __Pyx_RaiseArgtupleInvalid("set_gamma", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 401, __pyx_L3_error)
65156443 __pyx_L3_error:;
65166444 __Pyx_AddTraceback("pygame_sdl2.display.Window.set_gamma", __pyx_clineno, __pyx_lineno, __pyx_filename);
65176445 __Pyx_RefNannyFinishContext();
65406468 __Pyx_INCREF(__pyx_v_green);
65416469 __Pyx_INCREF(__pyx_v_blue);
65426470
6543 /* "pygame_sdl2/display.pyx":401
6471 /* "pygame_sdl2/display.pyx":402
65446472 *
65456473 * def set_gamma(self, red, green=None, blue=None):
65466474 * if green is None: # <<<<<<<<<<<<<<
65516479 __pyx_t_2 = (__pyx_t_1 != 0);
65526480 if (__pyx_t_2) {
65536481
6554 /* "pygame_sdl2/display.pyx":402
6482 /* "pygame_sdl2/display.pyx":403
65556483 * def set_gamma(self, red, green=None, blue=None):
65566484 * if green is None:
65576485 * green = red # <<<<<<<<<<<<<<
65616489 __Pyx_INCREF(__pyx_v_red);
65626490 __Pyx_DECREF_SET(__pyx_v_green, __pyx_v_red);
65636491
6564 /* "pygame_sdl2/display.pyx":401
6492 /* "pygame_sdl2/display.pyx":402
65656493 *
65666494 * def set_gamma(self, red, green=None, blue=None):
65676495 * if green is None: # <<<<<<<<<<<<<<
65706498 */
65716499 }
65726500
6573 /* "pygame_sdl2/display.pyx":403
6501 /* "pygame_sdl2/display.pyx":404
65746502 * if green is None:
65756503 * green = red
65766504 * if blue is None: # <<<<<<<<<<<<<<
65816509 __pyx_t_1 = (__pyx_t_2 != 0);
65826510 if (__pyx_t_1) {
65836511
6584 /* "pygame_sdl2/display.pyx":404
6512 /* "pygame_sdl2/display.pyx":405
65856513 * green = red
65866514 * if blue is None:
65876515 * blue = red # <<<<<<<<<<<<<<
65916519 __Pyx_INCREF(__pyx_v_red);
65926520 __Pyx_DECREF_SET(__pyx_v_blue, __pyx_v_red);
65936521
6594 /* "pygame_sdl2/display.pyx":403
6522 /* "pygame_sdl2/display.pyx":404
65956523 * if green is None:
65966524 * green = red
65976525 * if blue is None: # <<<<<<<<<<<<<<
66006528 */
66016529 }
66026530
6603 /* "pygame_sdl2/display.pyx":410
6531 /* "pygame_sdl2/display.pyx":411
66046532 * cdef Uint16 blue_gamma[256]
66056533 *
66066534 * SDL_CalculateGammaRamp(red, red_gamma) # <<<<<<<<<<<<<<
66076535 * SDL_CalculateGammaRamp(green, green_gamma)
66086536 * SDL_CalculateGammaRamp(blue, blue_gamma)
66096537 */
6610 __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_v_red); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 410, __pyx_L1_error)
6538 __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_v_red); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 411, __pyx_L1_error)
66116539 SDL_CalculateGammaRamp(__pyx_t_3, __pyx_v_red_gamma);
66126540
6613 /* "pygame_sdl2/display.pyx":411
6541 /* "pygame_sdl2/display.pyx":412
66146542 *
66156543 * SDL_CalculateGammaRamp(red, red_gamma)
66166544 * SDL_CalculateGammaRamp(green, green_gamma) # <<<<<<<<<<<<<<
66176545 * SDL_CalculateGammaRamp(blue, blue_gamma)
66186546 *
66196547 */
6620 __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_v_green); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 411, __pyx_L1_error)
6548 __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_v_green); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 412, __pyx_L1_error)
66216549 SDL_CalculateGammaRamp(__pyx_t_3, __pyx_v_green_gamma);
66226550
6623 /* "pygame_sdl2/display.pyx":412
6551 /* "pygame_sdl2/display.pyx":413
66246552 * SDL_CalculateGammaRamp(red, red_gamma)
66256553 * SDL_CalculateGammaRamp(green, green_gamma)
66266554 * SDL_CalculateGammaRamp(blue, blue_gamma) # <<<<<<<<<<<<<<
66276555 *
66286556 * if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma):
66296557 */
6630 __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_v_blue); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 412, __pyx_L1_error)
6558 __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_v_blue); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 413, __pyx_L1_error)
66316559 SDL_CalculateGammaRamp(__pyx_t_3, __pyx_v_blue_gamma);
66326560
6633 /* "pygame_sdl2/display.pyx":414
6561 /* "pygame_sdl2/display.pyx":415
66346562 * SDL_CalculateGammaRamp(blue, blue_gamma)
66356563 *
66366564 * if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma): # <<<<<<<<<<<<<<
66406568 __pyx_t_1 = (SDL_SetWindowGammaRamp(__pyx_v_self->window, __pyx_v_red_gamma, __pyx_v_green_gamma, __pyx_v_blue_gamma) != 0);
66416569 if (__pyx_t_1) {
66426570
6643 /* "pygame_sdl2/display.pyx":415
6571 /* "pygame_sdl2/display.pyx":416
66446572 *
66456573 * if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma):
66466574 * return False # <<<<<<<<<<<<<<
66526580 __pyx_r = Py_False;
66536581 goto __pyx_L0;
66546582
6655 /* "pygame_sdl2/display.pyx":414
6583 /* "pygame_sdl2/display.pyx":415
66566584 * SDL_CalculateGammaRamp(blue, blue_gamma)
66576585 *
66586586 * if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma): # <<<<<<<<<<<<<<
66616589 */
66626590 }
66636591
6664 /* "pygame_sdl2/display.pyx":417
6592 /* "pygame_sdl2/display.pyx":418
66656593 * return False
66666594 *
66676595 * return True # <<<<<<<<<<<<<<
66736601 __pyx_r = Py_True;
66746602 goto __pyx_L0;
66756603
6676 /* "pygame_sdl2/display.pyx":400
6604 /* "pygame_sdl2/display.pyx":401
66776605 * return True
66786606 *
66796607 * def set_gamma(self, red, green=None, blue=None): # <<<<<<<<<<<<<<
66936621 return __pyx_r;
66946622 }
66956623
6696 /* "pygame_sdl2/display.pyx":419
6624 /* "pygame_sdl2/display.pyx":420
66976625 * return True
66986626 *
66996627 * def set_gamma_ramp(self, red, green, blue): # <<<<<<<<<<<<<<
67386666 case 1:
67396667 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_green)) != 0)) kw_args--;
67406668 else {
6741 __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, 1); __PYX_ERR(0, 419, __pyx_L3_error)
6669 __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, 1); __PYX_ERR(0, 420, __pyx_L3_error)
67426670 }
67436671 CYTHON_FALLTHROUGH;
67446672 case 2:
67456673 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_blue)) != 0)) kw_args--;
67466674 else {
6747 __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, 2); __PYX_ERR(0, 419, __pyx_L3_error)
6675 __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, 2); __PYX_ERR(0, 420, __pyx_L3_error)
67486676 }
67496677 }
67506678 if (unlikely(kw_args > 0)) {
6751 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_gamma_ramp") < 0)) __PYX_ERR(0, 419, __pyx_L3_error)
6679 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_gamma_ramp") < 0)) __PYX_ERR(0, 420, __pyx_L3_error)
67526680 }
67536681 } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
67546682 goto __pyx_L5_argtuple_error;
67636691 }
67646692 goto __pyx_L4_argument_unpacking_done;
67656693 __pyx_L5_argtuple_error:;
6766 __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 419, __pyx_L3_error)
6694 __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 420, __pyx_L3_error)
67676695 __pyx_L3_error:;
67686696 __Pyx_AddTraceback("pygame_sdl2.display.Window.set_gamma_ramp", __pyx_clineno, __pyx_lineno, __pyx_filename);
67696697 __Pyx_RefNannyFinishContext();
67926720 int __pyx_clineno = 0;
67936721 __Pyx_RefNannySetupContext("set_gamma_ramp", 0);
67946722
6795 /* "pygame_sdl2/display.pyx":425
6723 /* "pygame_sdl2/display.pyx":426
67966724 * cdef Uint16 blue_gamma[256]
67976725 *
67986726 * for i in range(256): # <<<<<<<<<<<<<<
68026730 for (__pyx_t_1 = 0; __pyx_t_1 < 0x100; __pyx_t_1+=1) {
68036731 __pyx_v_i = __pyx_t_1;
68046732
6805 /* "pygame_sdl2/display.pyx":426
6733 /* "pygame_sdl2/display.pyx":427
68066734 *
68076735 * for i in range(256):
68086736 * red_gamma[i] = red[i] # <<<<<<<<<<<<<<
68096737 * green_gamma[i] = green[i]
68106738 * blue_gamma[i] = blue[i]
68116739 */
6812 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_red, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 426, __pyx_L1_error)
6740 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_red, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 427, __pyx_L1_error)
68136741 __Pyx_GOTREF(__pyx_t_2);
6814 __pyx_t_3 = __Pyx_PyInt_As_uint16_t(__pyx_t_2); if (unlikely((__pyx_t_3 == ((Uint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 426, __pyx_L1_error)
6742 __pyx_t_3 = __Pyx_PyInt_As_uint16_t(__pyx_t_2); if (unlikely((__pyx_t_3 == ((Uint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 427, __pyx_L1_error)
68156743 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
68166744 (__pyx_v_red_gamma[__pyx_v_i]) = __pyx_t_3;
68176745
6818 /* "pygame_sdl2/display.pyx":427
6746 /* "pygame_sdl2/display.pyx":428
68196747 * for i in range(256):
68206748 * red_gamma[i] = red[i]
68216749 * green_gamma[i] = green[i] # <<<<<<<<<<<<<<
68226750 * blue_gamma[i] = blue[i]
68236751 *
68246752 */
6825 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_green, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 427, __pyx_L1_error)
6753 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_green, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 428, __pyx_L1_error)
68266754 __Pyx_GOTREF(__pyx_t_2);
6827 __pyx_t_3 = __Pyx_PyInt_As_uint16_t(__pyx_t_2); if (unlikely((__pyx_t_3 == ((Uint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 427, __pyx_L1_error)
6755 __pyx_t_3 = __Pyx_PyInt_As_uint16_t(__pyx_t_2); if (unlikely((__pyx_t_3 == ((Uint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 428, __pyx_L1_error)
68286756 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
68296757 (__pyx_v_green_gamma[__pyx_v_i]) = __pyx_t_3;
68306758
6831 /* "pygame_sdl2/display.pyx":428
6759 /* "pygame_sdl2/display.pyx":429
68326760 * red_gamma[i] = red[i]
68336761 * green_gamma[i] = green[i]
68346762 * blue_gamma[i] = blue[i] # <<<<<<<<<<<<<<
68356763 *
68366764 * if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma):
68376765 */
6838 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_blue, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 428, __pyx_L1_error)
6766 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_blue, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 429, __pyx_L1_error)
68396767 __Pyx_GOTREF(__pyx_t_2);
6840 __pyx_t_3 = __Pyx_PyInt_As_uint16_t(__pyx_t_2); if (unlikely((__pyx_t_3 == ((Uint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 428, __pyx_L1_error)
6768 __pyx_t_3 = __Pyx_PyInt_As_uint16_t(__pyx_t_2); if (unlikely((__pyx_t_3 == ((Uint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 429, __pyx_L1_error)
68416769 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
68426770 (__pyx_v_blue_gamma[__pyx_v_i]) = __pyx_t_3;
68436771 }
68446772
6845 /* "pygame_sdl2/display.pyx":430
6773 /* "pygame_sdl2/display.pyx":431
68466774 * blue_gamma[i] = blue[i]
68476775 *
68486776 * if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma): # <<<<<<<<<<<<<<
68526780 __pyx_t_4 = (SDL_SetWindowGammaRamp(__pyx_v_self->window, __pyx_v_red_gamma, __pyx_v_green_gamma, __pyx_v_blue_gamma) != 0);
68536781 if (__pyx_t_4) {
68546782
6855 /* "pygame_sdl2/display.pyx":431
6783 /* "pygame_sdl2/display.pyx":432
68566784 *
68576785 * if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma):
68586786 * return False # <<<<<<<<<<<<<<
68646792 __pyx_r = Py_False;
68656793 goto __pyx_L0;
68666794
6867 /* "pygame_sdl2/display.pyx":430
6795 /* "pygame_sdl2/display.pyx":431
68686796 * blue_gamma[i] = blue[i]
68696797 *
68706798 * if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma): # <<<<<<<<<<<<<<
68736801 */
68746802 }
68756803
6876 /* "pygame_sdl2/display.pyx":433
6804 /* "pygame_sdl2/display.pyx":434
68776805 * return False
68786806 *
68796807 * return True # <<<<<<<<<<<<<<
68856813 __pyx_r = Py_True;
68866814 goto __pyx_L0;
68876815
6888 /* "pygame_sdl2/display.pyx":419
6816 /* "pygame_sdl2/display.pyx":420
68896817 * return True
68906818 *
68916819 * def set_gamma_ramp(self, red, green, blue): # <<<<<<<<<<<<<<
69046832 return __pyx_r;
69056833 }
69066834
6907 /* "pygame_sdl2/display.pyx":435
6835 /* "pygame_sdl2/display.pyx":436
69086836 * return True
69096837 *
69106838 * def set_icon(self, Surface surface): # <<<<<<<<<<<<<<
69216849 PyObject *__pyx_r = 0;
69226850 __Pyx_RefNannyDeclarations
69236851 __Pyx_RefNannySetupContext("set_icon (wrapper)", 0);
6924 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 435, __pyx_L1_error)
6852 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 436, __pyx_L1_error)
69256853 __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_32set_icon(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self), ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_surface));
69266854
69276855 /* function exit code */
69386866 __Pyx_RefNannyDeclarations
69396867 __Pyx_RefNannySetupContext("set_icon", 0);
69406868
6941 /* "pygame_sdl2/display.pyx":436
6869 /* "pygame_sdl2/display.pyx":437
69426870 *
69436871 * def set_icon(self, Surface surface):
69446872 * SDL_SetWindowIcon(self.window, surface.surface) # <<<<<<<<<<<<<<
69476875 */
69486876 SDL_SetWindowIcon(__pyx_v_self->window, __pyx_v_surface->surface);
69496877
6950 /* "pygame_sdl2/display.pyx":435
6878 /* "pygame_sdl2/display.pyx":436
69516879 * return True
69526880 *
69536881 * def set_icon(self, Surface surface): # <<<<<<<<<<<<<<
69626890 return __pyx_r;
69636891 }
69646892
6965 /* "pygame_sdl2/display.pyx":438
6893 /* "pygame_sdl2/display.pyx":439
69666894 * SDL_SetWindowIcon(self.window, surface.surface)
69676895 *
69686896 * def set_caption(self, title): # <<<<<<<<<<<<<<
69986926 __Pyx_RefNannySetupContext("set_caption", 0);
69996927 __Pyx_INCREF(__pyx_v_title);
70006928
7001 /* "pygame_sdl2/display.pyx":440
6929 /* "pygame_sdl2/display.pyx":441
70026930 * def set_caption(self, title):
70036931 *
70046932 * if not isinstance(title, bytes): # <<<<<<<<<<<<<<
70096937 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
70106938 if (__pyx_t_2) {
70116939
7012 /* "pygame_sdl2/display.pyx":441
6940 /* "pygame_sdl2/display.pyx":442
70136941 *
70146942 * if not isinstance(title, bytes):
70156943 * title = title.encode("utf-8") # <<<<<<<<<<<<<<
70166944 *
70176945 * SDL_SetWindowTitle(self.window, title)
70186946 */
7019 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_title, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 441, __pyx_L1_error)
6947 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_title, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 442, __pyx_L1_error)
70206948 __Pyx_GOTREF(__pyx_t_4);
70216949 __pyx_t_5 = NULL;
70226950 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
70306958 }
70316959 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_s_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_s_utf_8);
70326960 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
7033 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 441, __pyx_L1_error)
6961 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 442, __pyx_L1_error)
70346962 __Pyx_GOTREF(__pyx_t_3);
70356963 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
70366964 __Pyx_DECREF_SET(__pyx_v_title, __pyx_t_3);
70376965 __pyx_t_3 = 0;
70386966
7039 /* "pygame_sdl2/display.pyx":440
6967 /* "pygame_sdl2/display.pyx":441
70406968 * def set_caption(self, title):
70416969 *
70426970 * if not isinstance(title, bytes): # <<<<<<<<<<<<<<
70456973 */
70466974 }
70476975
7048 /* "pygame_sdl2/display.pyx":443
6976 /* "pygame_sdl2/display.pyx":444
70496977 * title = title.encode("utf-8")
70506978 *
70516979 * SDL_SetWindowTitle(self.window, title) # <<<<<<<<<<<<<<
70526980 *
70536981 * def get_drawable_size(self):
70546982 */
7055 __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_title); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 443, __pyx_L1_error)
6983 __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_title); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 444, __pyx_L1_error)
70566984 SDL_SetWindowTitle(__pyx_v_self->window, __pyx_t_6);
70576985
7058 /* "pygame_sdl2/display.pyx":438
6986 /* "pygame_sdl2/display.pyx":439
70596987 * SDL_SetWindowIcon(self.window, surface.surface)
70606988 *
70616989 * def set_caption(self, title): # <<<<<<<<<<<<<<
70797007 return __pyx_r;
70807008 }
70817009
7082 /* "pygame_sdl2/display.pyx":445
7010 /* "pygame_sdl2/display.pyx":446
70837011 * SDL_SetWindowTitle(self.window, title)
70847012 *
70857013 * def get_drawable_size(self): # <<<<<<<<<<<<<<
71137041 int __pyx_clineno = 0;
71147042 __Pyx_RefNannySetupContext("get_drawable_size", 0);
71157043
7116 /* "pygame_sdl2/display.pyx":448
7044 /* "pygame_sdl2/display.pyx":449
71177045 * cdef int w, h
71187046 *
71197047 * SDL_GL_GetDrawableSize(self.window, &w, &h) # <<<<<<<<<<<<<<
71227050 */
71237051 SDL_GL_GetDrawableSize(__pyx_v_self->window, (&__pyx_v_w), (&__pyx_v_h));
71247052
7125 /* "pygame_sdl2/display.pyx":449
7053 /* "pygame_sdl2/display.pyx":450
71267054 *
71277055 * SDL_GL_GetDrawableSize(self.window, &w, &h)
71287056 * return w, h # <<<<<<<<<<<<<<
71307058 *
71317059 */
71327060 __Pyx_XDECREF(__pyx_r);
7133 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L1_error)
7061 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 450, __pyx_L1_error)
71347062 __Pyx_GOTREF(__pyx_t_1);
7135 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 449, __pyx_L1_error)
7063 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 450, __pyx_L1_error)
71367064 __Pyx_GOTREF(__pyx_t_2);
7137 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 449, __pyx_L1_error)
7065 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 450, __pyx_L1_error)
71387066 __Pyx_GOTREF(__pyx_t_3);
71397067 __Pyx_GIVEREF(__pyx_t_1);
71407068 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
71467074 __pyx_t_3 = 0;
71477075 goto __pyx_L0;
71487076
7149 /* "pygame_sdl2/display.pyx":445
7077 /* "pygame_sdl2/display.pyx":446
71507078 * SDL_SetWindowTitle(self.window, title)
71517079 *
71527080 * def get_drawable_size(self): # <<<<<<<<<<<<<<
71677095 return __pyx_r;
71687096 }
71697097
7170 /* "pygame_sdl2/display.pyx":452
7098 /* "pygame_sdl2/display.pyx":453
71717099 *
71727100 *
71737101 * def get_size(self): # <<<<<<<<<<<<<<
72017129 int __pyx_clineno = 0;
72027130 __Pyx_RefNannySetupContext("get_size", 0);
72037131
7204 /* "pygame_sdl2/display.pyx":455
7132 /* "pygame_sdl2/display.pyx":456
72057133 * cdef int w, h
72067134 *
72077135 * SDL_GetWindowSize(self.window, &w, &h) # <<<<<<<<<<<<<<
72107138 */
72117139 SDL_GetWindowSize(__pyx_v_self->window, (&__pyx_v_w), (&__pyx_v_h));
72127140
7213 /* "pygame_sdl2/display.pyx":456
7141 /* "pygame_sdl2/display.pyx":457
72147142 *
72157143 * SDL_GetWindowSize(self.window, &w, &h)
72167144 * return w, h # <<<<<<<<<<<<<<
72187146 * def restore(self):
72197147 */
72207148 __Pyx_XDECREF(__pyx_r);
7221 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error)
7149 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L1_error)
72227150 __Pyx_GOTREF(__pyx_t_1);
7223 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 456, __pyx_L1_error)
7151 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 457, __pyx_L1_error)
72247152 __Pyx_GOTREF(__pyx_t_2);
7225 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error)
7153 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 457, __pyx_L1_error)
72267154 __Pyx_GOTREF(__pyx_t_3);
72277155 __Pyx_GIVEREF(__pyx_t_1);
72287156 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
72347162 __pyx_t_3 = 0;
72357163 goto __pyx_L0;
72367164
7237 /* "pygame_sdl2/display.pyx":452
7165 /* "pygame_sdl2/display.pyx":453
72387166 *
72397167 *
72407168 * def get_size(self): # <<<<<<<<<<<<<<
72557183 return __pyx_r;
72567184 }
72577185
7258 /* "pygame_sdl2/display.pyx":458
7186 /* "pygame_sdl2/display.pyx":459
72597187 * return w, h
72607188 *
72617189 * def restore(self): # <<<<<<<<<<<<<<
72817209 __Pyx_RefNannyDeclarations
72827210 __Pyx_RefNannySetupContext("restore", 0);
72837211
7284 /* "pygame_sdl2/display.pyx":459
7212 /* "pygame_sdl2/display.pyx":460
72857213 *
72867214 * def restore(self):
72877215 * SDL_RestoreWindow(self.window) # <<<<<<<<<<<<<<
72907218 */
72917219 SDL_RestoreWindow(__pyx_v_self->window);
72927220
7293 /* "pygame_sdl2/display.pyx":458
7221 /* "pygame_sdl2/display.pyx":459
72947222 * return w, h
72957223 *
72967224 * def restore(self): # <<<<<<<<<<<<<<
73057233 return __pyx_r;
73067234 }
73077235
7308 /* "pygame_sdl2/display.pyx":461
7236 /* "pygame_sdl2/display.pyx":462
73097237 * SDL_RestoreWindow(self.window)
73107238 *
73117239 * def maximize(self): # <<<<<<<<<<<<<<
73317259 __Pyx_RefNannyDeclarations
73327260 __Pyx_RefNannySetupContext("maximize", 0);
73337261
7334 /* "pygame_sdl2/display.pyx":462
7262 /* "pygame_sdl2/display.pyx":463
73357263 *
73367264 * def maximize(self):
73377265 * SDL_MaximizeWindow(self.window) # <<<<<<<<<<<<<<
73407268 */
73417269 SDL_MaximizeWindow(__pyx_v_self->window);
73427270
7343 /* "pygame_sdl2/display.pyx":461
7271 /* "pygame_sdl2/display.pyx":462
73447272 * SDL_RestoreWindow(self.window)
73457273 *
73467274 * def maximize(self): # <<<<<<<<<<<<<<
73557283 return __pyx_r;
73567284 }
73577285
7358 /* "pygame_sdl2/display.pyx":464
7286 /* "pygame_sdl2/display.pyx":465
73597287 * SDL_MaximizeWindow(self.window)
73607288 *
73617289 * def minimize(self): # <<<<<<<<<<<<<<
73817309 __Pyx_RefNannyDeclarations
73827310 __Pyx_RefNannySetupContext("minimize", 0);
73837311
7384 /* "pygame_sdl2/display.pyx":465
7312 /* "pygame_sdl2/display.pyx":466
73857313 *
73867314 * def minimize(self):
73877315 * SDL_MinimizeWindow(self.window) # <<<<<<<<<<<<<<
73887316 *
7389 *
7317 * def get_sdl_window_pointer(self):
73907318 */
73917319 SDL_MinimizeWindow(__pyx_v_self->window);
73927320
7393 /* "pygame_sdl2/display.pyx":464
7321 /* "pygame_sdl2/display.pyx":465
73947322 * SDL_MaximizeWindow(self.window)
73957323 *
73967324 * def minimize(self): # <<<<<<<<<<<<<<
74007328
74017329 /* function exit code */
74027330 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7331 __Pyx_XGIVEREF(__pyx_r);
7332 __Pyx_RefNannyFinishContext();
7333 return __pyx_r;
7334 }
7335
7336 /* "pygame_sdl2/display.pyx":468
7337 * SDL_MinimizeWindow(self.window)
7338 *
7339 * def get_sdl_window_pointer(self): # <<<<<<<<<<<<<<
7340 * """
7341 * Returns the pointer to the SDL_Window corresponding to this window.
7342 */
7343
7344 /* Python wrapper */
7345 static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_47get_sdl_window_pointer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
7346 static char __pyx_doc_11pygame_sdl2_7display_6Window_46get_sdl_window_pointer[] = "\n Returns the pointer to the SDL_Window corresponding to this window.\n ";
7347 static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_47get_sdl_window_pointer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
7348 PyObject *__pyx_r = 0;
7349 __Pyx_RefNannyDeclarations
7350 __Pyx_RefNannySetupContext("get_sdl_window_pointer (wrapper)", 0);
7351 __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_46get_sdl_window_pointer(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self));
7352
7353 /* function exit code */
7354 __Pyx_RefNannyFinishContext();
7355 return __pyx_r;
7356 }
7357
7358 static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_46get_sdl_window_pointer(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) {
7359 PyObject *__pyx_v_ctypes = NULL;
7360 PyObject *__pyx_r = NULL;
7361 __Pyx_RefNannyDeclarations
7362 PyObject *__pyx_t_1 = NULL;
7363 PyObject *__pyx_t_2 = NULL;
7364 PyObject *__pyx_t_3 = NULL;
7365 PyObject *__pyx_t_4 = NULL;
7366 int __pyx_lineno = 0;
7367 const char *__pyx_filename = NULL;
7368 int __pyx_clineno = 0;
7369 __Pyx_RefNannySetupContext("get_sdl_window_pointer", 0);
7370
7371 /* "pygame_sdl2/display.pyx":473
7372 * """
7373 *
7374 * import ctypes # <<<<<<<<<<<<<<
7375 * return ctypes.c_void_p(<unsigned long> self.window)
7376 *
7377 */
7378 __pyx_t_1 = __Pyx_Import(__pyx_n_s_ctypes, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 473, __pyx_L1_error)
7379 __Pyx_GOTREF(__pyx_t_1);
7380 __pyx_v_ctypes = __pyx_t_1;
7381 __pyx_t_1 = 0;
7382
7383 /* "pygame_sdl2/display.pyx":474
7384 *
7385 * import ctypes
7386 * return ctypes.c_void_p(<unsigned long> self.window) # <<<<<<<<<<<<<<
7387 *
7388 *
7389 */
7390 __Pyx_XDECREF(__pyx_r);
7391 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_ctypes, __pyx_n_s_c_void_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 474, __pyx_L1_error)
7392 __Pyx_GOTREF(__pyx_t_2);
7393 __pyx_t_3 = __Pyx_PyInt_From_unsigned_long(((unsigned long)__pyx_v_self->window)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 474, __pyx_L1_error)
7394 __Pyx_GOTREF(__pyx_t_3);
7395 __pyx_t_4 = NULL;
7396 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
7397 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
7398 if (likely(__pyx_t_4)) {
7399 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
7400 __Pyx_INCREF(__pyx_t_4);
7401 __Pyx_INCREF(function);
7402 __Pyx_DECREF_SET(__pyx_t_2, function);
7403 }
7404 }
7405 __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
7406 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
7407 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7408 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error)
7409 __Pyx_GOTREF(__pyx_t_1);
7410 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7411 __pyx_r = __pyx_t_1;
7412 __pyx_t_1 = 0;
7413 goto __pyx_L0;
7414
7415 /* "pygame_sdl2/display.pyx":468
7416 * SDL_MinimizeWindow(self.window)
7417 *
7418 * def get_sdl_window_pointer(self): # <<<<<<<<<<<<<<
7419 * """
7420 * Returns the pointer to the SDL_Window corresponding to this window.
7421 */
7422
7423 /* function exit code */
7424 __pyx_L1_error:;
7425 __Pyx_XDECREF(__pyx_t_1);
7426 __Pyx_XDECREF(__pyx_t_2);
7427 __Pyx_XDECREF(__pyx_t_3);
7428 __Pyx_XDECREF(__pyx_t_4);
7429 __Pyx_AddTraceback("pygame_sdl2.display.Window.get_sdl_window_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
7430 __pyx_r = NULL;
7431 __pyx_L0:;
7432 __Pyx_XDECREF(__pyx_v_ctypes);
74037433 __Pyx_XGIVEREF(__pyx_r);
74047434 __Pyx_RefNannyFinishContext();
74057435 return __pyx_r;
75207550 */
75217551
75227552 /* Python wrapper */
7523 static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_47__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
7524 static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_47__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
7553 static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_49__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
7554 static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_49__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
75257555 PyObject *__pyx_r = 0;
75267556 __Pyx_RefNannyDeclarations
75277557 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
7528 __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_46__reduce_cython__(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self));
7558 __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_48__reduce_cython__(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self));
75297559
75307560 /* function exit code */
75317561 __Pyx_RefNannyFinishContext();
75327562 return __pyx_r;
75337563 }
75347564
7535 static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_46__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) {
7565 static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_48__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) {
75367566 PyObject *__pyx_r = NULL;
75377567 __Pyx_RefNannyDeclarations
75387568 PyObject *__pyx_t_1 = NULL;
75777607 */
75787608
75797609 /* Python wrapper */
7580 static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_49__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
7581 static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_49__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
7610 static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_51__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
7611 static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_51__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
75827612 PyObject *__pyx_r = 0;
75837613 __Pyx_RefNannyDeclarations
75847614 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
7585 __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_48__setstate_cython__(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
7615 __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_50__setstate_cython__(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
75867616
75877617 /* function exit code */
75887618 __Pyx_RefNannyFinishContext();
75897619 return __pyx_r;
75907620 }
75917621
7592 static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_48__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
7622 static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_50__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
75937623 PyObject *__pyx_r = NULL;
75947624 __Pyx_RefNannyDeclarations
75957625 PyObject *__pyx_t_1 = NULL;
76267656 return __pyx_r;
76277657 }
76287658
7629 /* "pygame_sdl2/display.pyx":477
7659 /* "pygame_sdl2/display.pyx":488
76307660 * default_swap_control = 1
76317661 *
76327662 * def set_mode(resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): # <<<<<<<<<<<<<<
76357665 */
76367666
76377667 /* Python wrapper */
7638 static PyObject *__pyx_pw_11pygame_sdl2_7display_15set_mode(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7639 static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_15set_mode = {"set_mode", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_7display_15set_mode, METH_VARARGS|METH_KEYWORDS, 0};
7640 static PyObject *__pyx_pw_11pygame_sdl2_7display_15set_mode(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7668 static PyObject *__pyx_pw_11pygame_sdl2_7display_13set_mode(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7669 static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_13set_mode = {"set_mode", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_7display_13set_mode, METH_VARARGS|METH_KEYWORDS, 0};
7670 static PyObject *__pyx_pw_11pygame_sdl2_7display_13set_mode(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
76417671 PyObject *__pyx_v_resolution = 0;
76427672 PyObject *__pyx_v_flags = 0;
76437673 PyObject *__pyx_v_depth = 0;
76977727 }
76987728 }
76997729 if (unlikely(kw_args > 0)) {
7700 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_mode") < 0)) __PYX_ERR(0, 477, __pyx_L3_error)
7730 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_mode") < 0)) __PYX_ERR(0, 488, __pyx_L3_error)
77017731 }
77027732 } else {
77037733 switch (PyTuple_GET_SIZE(__pyx_args)) {
77207750 }
77217751 goto __pyx_L4_argument_unpacking_done;
77227752 __pyx_L5_argtuple_error:;
7723 __Pyx_RaiseArgtupleInvalid("set_mode", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 477, __pyx_L3_error)
7753 __Pyx_RaiseArgtupleInvalid("set_mode", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 488, __pyx_L3_error)
77247754 __pyx_L3_error:;
77257755 __Pyx_AddTraceback("pygame_sdl2.display.set_mode", __pyx_clineno, __pyx_lineno, __pyx_filename);
77267756 __Pyx_RefNannyFinishContext();
77277757 return NULL;
77287758 __pyx_L4_argument_unpacking_done:;
7729 __pyx_r = __pyx_pf_11pygame_sdl2_7display_14set_mode(__pyx_self, __pyx_v_resolution, __pyx_v_flags, __pyx_v_depth, __pyx_v_pos);
7759 __pyx_r = __pyx_pf_11pygame_sdl2_7display_12set_mode(__pyx_self, __pyx_v_resolution, __pyx_v_flags, __pyx_v_depth, __pyx_v_pos);
77307760
77317761 /* function exit code */
77327762 __Pyx_RefNannyFinishContext();
77337763 return __pyx_r;
77347764 }
77357765
7736 static PyObject *__pyx_pf_11pygame_sdl2_7display_14set_mode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_resolution, PyObject *__pyx_v_flags, PyObject *__pyx_v_depth, PyObject *__pyx_v_pos) {
7766 static PyObject *__pyx_pf_11pygame_sdl2_7display_12set_mode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_resolution, PyObject *__pyx_v_flags, PyObject *__pyx_v_depth, PyObject *__pyx_v_pos) {
77377767 int __pyx_v_RESIZE_FLAGS;
77387768 PyObject *__pyx_r = NULL;
77397769 __Pyx_RefNannyDeclarations
77517781 int __pyx_clineno = 0;
77527782 __Pyx_RefNannySetupContext("set_mode", 0);
77537783
7754 /* "pygame_sdl2/display.pyx":480
7784 /* "pygame_sdl2/display.pyx":491
77557785 * global main_window
77567786 *
77577787 * RESIZE_FLAGS = SDL_WINDOW_OPENGL | SDL_WINDOW_FULLSCREEN_DESKTOP # <<<<<<<<<<<<<<
77607790 */
77617791 __pyx_v_RESIZE_FLAGS = (SDL_WINDOW_OPENGL | SDL_WINDOW_FULLSCREEN_DESKTOP);
77627792
7763 /* "pygame_sdl2/display.pyx":482
7793 /* "pygame_sdl2/display.pyx":493
77647794 * RESIZE_FLAGS = SDL_WINDOW_OPENGL | SDL_WINDOW_FULLSCREEN_DESKTOP
77657795 *
77667796 * if main_window: # <<<<<<<<<<<<<<
77677797 *
77687798 * if (flags & ~RESIZE_FLAGS) == (main_window.create_flags & ~RESIZE_FLAGS):
77697799 */
7770 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 482, __pyx_L1_error)
7800 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 493, __pyx_L1_error)
77717801 if (__pyx_t_1) {
77727802
7773 /* "pygame_sdl2/display.pyx":484
7803 /* "pygame_sdl2/display.pyx":495
77747804 * if main_window:
77757805 *
77767806 * if (flags & ~RESIZE_FLAGS) == (main_window.create_flags & ~RESIZE_FLAGS): # <<<<<<<<<<<<<<
77777807 * main_window.resize(resolution, flags & SDL_WINDOW_OPENGL, flags & SDL_WINDOW_FULLSCREEN_DESKTOP)
77787808 * return main_window.surface
77797809 */
7780 __pyx_t_2 = __Pyx_PyInt_From_int((~__pyx_v_RESIZE_FLAGS)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 484, __pyx_L1_error)
7810 __pyx_t_2 = __Pyx_PyInt_From_int((~__pyx_v_RESIZE_FLAGS)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 495, __pyx_L1_error)
77817811 __Pyx_GOTREF(__pyx_t_2);
7782 __pyx_t_3 = PyNumber_And(__pyx_v_flags, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 484, __pyx_L1_error)
7812 __pyx_t_3 = PyNumber_And(__pyx_v_flags, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 495, __pyx_L1_error)
77837813 __Pyx_GOTREF(__pyx_t_3);
77847814 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7785 __pyx_t_2 = __Pyx_PyInt_From_uint32_t((__pyx_v_11pygame_sdl2_7display_main_window->create_flags & (~__pyx_v_RESIZE_FLAGS))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 484, __pyx_L1_error)
7815 __pyx_t_2 = __Pyx_PyInt_From_uint32_t((__pyx_v_11pygame_sdl2_7display_main_window->create_flags & (~__pyx_v_RESIZE_FLAGS))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 495, __pyx_L1_error)
77867816 __Pyx_GOTREF(__pyx_t_2);
7787 __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 484, __pyx_L1_error)
7817 __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 495, __pyx_L1_error)
77887818 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
77897819 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7790 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 484, __pyx_L1_error)
7820 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 495, __pyx_L1_error)
77917821 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
77927822 if (__pyx_t_1) {
77937823
7794 /* "pygame_sdl2/display.pyx":485
7824 /* "pygame_sdl2/display.pyx":496
77957825 *
77967826 * if (flags & ~RESIZE_FLAGS) == (main_window.create_flags & ~RESIZE_FLAGS):
77977827 * main_window.resize(resolution, flags & SDL_WINDOW_OPENGL, flags & SDL_WINDOW_FULLSCREEN_DESKTOP) # <<<<<<<<<<<<<<
77987828 * return main_window.surface
77997829 *
78007830 */
7801 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_resize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 485, __pyx_L1_error)
7831 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_resize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 496, __pyx_L1_error)
78027832 __Pyx_GOTREF(__pyx_t_2);
7803 __pyx_t_3 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_OPENGL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 485, __pyx_L1_error)
7833 __pyx_t_3 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_OPENGL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 496, __pyx_L1_error)
78047834 __Pyx_GOTREF(__pyx_t_3);
7805 __pyx_t_5 = PyNumber_And(__pyx_v_flags, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 485, __pyx_L1_error)
7835 __pyx_t_5 = PyNumber_And(__pyx_v_flags, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 496, __pyx_L1_error)
78067836 __Pyx_GOTREF(__pyx_t_5);
78077837 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7808 __pyx_t_3 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_FULLSCREEN_DESKTOP); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 485, __pyx_L1_error)
7838 __pyx_t_3 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_FULLSCREEN_DESKTOP); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 496, __pyx_L1_error)
78097839 __Pyx_GOTREF(__pyx_t_3);
7810 __pyx_t_6 = PyNumber_And(__pyx_v_flags, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 485, __pyx_L1_error)
7840 __pyx_t_6 = PyNumber_And(__pyx_v_flags, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 496, __pyx_L1_error)
78117841 __Pyx_GOTREF(__pyx_t_6);
78127842 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
78137843 __pyx_t_3 = NULL;
78257855 #if CYTHON_FAST_PYCALL
78267856 if (PyFunction_Check(__pyx_t_2)) {
78277857 PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_resolution, __pyx_t_5, __pyx_t_6};
7828 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 485, __pyx_L1_error)
7858 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 496, __pyx_L1_error)
78297859 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
78307860 __Pyx_GOTREF(__pyx_t_4);
78317861 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
78357865 #if CYTHON_FAST_PYCCALL
78367866 if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
78377867 PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_resolution, __pyx_t_5, __pyx_t_6};
7838 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 485, __pyx_L1_error)
7868 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 496, __pyx_L1_error)
78397869 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
78407870 __Pyx_GOTREF(__pyx_t_4);
78417871 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
78437873 } else
78447874 #endif
78457875 {
7846 __pyx_t_8 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 485, __pyx_L1_error)
7876 __pyx_t_8 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 496, __pyx_L1_error)
78477877 __Pyx_GOTREF(__pyx_t_8);
78487878 if (__pyx_t_3) {
78497879 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); __pyx_t_3 = NULL;
78577887 PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_t_6);
78587888 __pyx_t_5 = 0;
78597889 __pyx_t_6 = 0;
7860 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 485, __pyx_L1_error)
7890 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 496, __pyx_L1_error)
78617891 __Pyx_GOTREF(__pyx_t_4);
78627892 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
78637893 }
78647894 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
78657895 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
78667896
7867 /* "pygame_sdl2/display.pyx":486
7897 /* "pygame_sdl2/display.pyx":497
78687898 * if (flags & ~RESIZE_FLAGS) == (main_window.create_flags & ~RESIZE_FLAGS):
78697899 * main_window.resize(resolution, flags & SDL_WINDOW_OPENGL, flags & SDL_WINDOW_FULLSCREEN_DESKTOP)
78707900 * return main_window.surface # <<<<<<<<<<<<<<
78767906 __pyx_r = ((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window->surface);
78777907 goto __pyx_L0;
78787908
7879 /* "pygame_sdl2/display.pyx":484
7909 /* "pygame_sdl2/display.pyx":495
78807910 * if main_window:
78817911 *
78827912 * if (flags & ~RESIZE_FLAGS) == (main_window.create_flags & ~RESIZE_FLAGS): # <<<<<<<<<<<<<<
78857915 */
78867916 }
78877917
7888 /* "pygame_sdl2/display.pyx":489
7918 /* "pygame_sdl2/display.pyx":500
78897919 *
78907920 * else:
78917921 * main_window.destroy() # <<<<<<<<<<<<<<
78937923 * main_window = Window(default_title, resolution, flags, depth, pos=pos)
78947924 */
78957925 /*else*/ {
7896 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_destroy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 489, __pyx_L1_error)
7926 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_destroy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 500, __pyx_L1_error)
78977927 __Pyx_GOTREF(__pyx_t_2);
78987928 __pyx_t_8 = NULL;
78997929 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
79077937 }
79087938 __pyx_t_4 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
79097939 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
7910 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 489, __pyx_L1_error)
7940 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 500, __pyx_L1_error)
79117941 __Pyx_GOTREF(__pyx_t_4);
79127942 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
79137943 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
79147944 }
79157945
7916 /* "pygame_sdl2/display.pyx":482
7946 /* "pygame_sdl2/display.pyx":493
79177947 * RESIZE_FLAGS = SDL_WINDOW_OPENGL | SDL_WINDOW_FULLSCREEN_DESKTOP
79187948 *
79197949 * if main_window: # <<<<<<<<<<<<<<
79227952 */
79237953 }
79247954
7925 /* "pygame_sdl2/display.pyx":491
7955 /* "pygame_sdl2/display.pyx":502
79267956 * main_window.destroy()
79277957 *
79287958 * main_window = Window(default_title, resolution, flags, depth, pos=pos) # <<<<<<<<<<<<<<
79297959 *
79307960 * if default_icon is not None:
79317961 */
7932 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_default_title); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 491, __pyx_L1_error)
7962 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_default_title); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 502, __pyx_L1_error)
79337963 __Pyx_GOTREF(__pyx_t_4);
7934 __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 491, __pyx_L1_error)
7964 __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 502, __pyx_L1_error)
79357965 __Pyx_GOTREF(__pyx_t_2);
79367966 __Pyx_GIVEREF(__pyx_t_4);
79377967 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
79457975 __Pyx_GIVEREF(__pyx_v_depth);
79467976 PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_depth);
79477977 __pyx_t_4 = 0;
7948 __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 491, __pyx_L1_error)
7978 __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 502, __pyx_L1_error)
79497979 __Pyx_GOTREF(__pyx_t_4);
7950 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_pos, __pyx_v_pos) < 0) __PYX_ERR(0, 491, __pyx_L1_error)
7951 __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window), __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 491, __pyx_L1_error)
7980 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_pos, __pyx_v_pos) < 0) __PYX_ERR(0, 502, __pyx_L1_error)
7981 __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window), __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 502, __pyx_L1_error)
79527982 __Pyx_GOTREF(__pyx_t_8);
79537983 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
79547984 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
79577987 __Pyx_GIVEREF(__pyx_t_8);
79587988 __pyx_t_8 = 0;
79597989
7960 /* "pygame_sdl2/display.pyx":493
7990 /* "pygame_sdl2/display.pyx":504
79617991 * main_window = Window(default_title, resolution, flags, depth, pos=pos)
79627992 *
79637993 * if default_icon is not None: # <<<<<<<<<<<<<<
79647994 * main_window.set_icon(default_icon)
79657995 *
79667996 */
7967 __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_default_icon); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 493, __pyx_L1_error)
7997 __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_default_icon); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 504, __pyx_L1_error)
79687998 __Pyx_GOTREF(__pyx_t_8);
79697999 __pyx_t_1 = (__pyx_t_8 != Py_None);
79708000 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
79718001 __pyx_t_9 = (__pyx_t_1 != 0);
79728002 if (__pyx_t_9) {
79738003
7974 /* "pygame_sdl2/display.pyx":494
8004 /* "pygame_sdl2/display.pyx":505
79758005 *
79768006 * if default_icon is not None:
79778007 * main_window.set_icon(default_icon) # <<<<<<<<<<<<<<
79788008 *
79798009 * return main_window.surface
79808010 */
7981 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_set_icon); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 494, __pyx_L1_error)
8011 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_set_icon); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 505, __pyx_L1_error)
79828012 __Pyx_GOTREF(__pyx_t_4);
7983 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_default_icon); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 494, __pyx_L1_error)
8013 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_default_icon); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 505, __pyx_L1_error)
79848014 __Pyx_GOTREF(__pyx_t_2);
79858015 __pyx_t_6 = NULL;
79868016 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
79958025 __pyx_t_8 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2);
79968026 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
79978027 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7998 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 494, __pyx_L1_error)
8028 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 505, __pyx_L1_error)
79998029 __Pyx_GOTREF(__pyx_t_8);
80008030 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
80018031 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
80028032
8003 /* "pygame_sdl2/display.pyx":493
8033 /* "pygame_sdl2/display.pyx":504
80048034 * main_window = Window(default_title, resolution, flags, depth, pos=pos)
80058035 *
80068036 * if default_icon is not None: # <<<<<<<<<<<<<<
80098039 */
80108040 }
80118041
8012 /* "pygame_sdl2/display.pyx":496
8042 /* "pygame_sdl2/display.pyx":507
80138043 * main_window.set_icon(default_icon)
80148044 *
80158045 * return main_window.surface # <<<<<<<<<<<<<<
80168046 *
8017 * def get_surface():
8047 * def destroy():
80188048 */
80198049 __Pyx_XDECREF(__pyx_r);
80208050 __Pyx_INCREF(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window->surface));
80218051 __pyx_r = ((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window->surface);
80228052 goto __pyx_L0;
80238053
8024 /* "pygame_sdl2/display.pyx":477
8054 /* "pygame_sdl2/display.pyx":488
80258055 * default_swap_control = 1
80268056 *
80278057 * def set_mode(resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): # <<<<<<<<<<<<<<
80458075 return __pyx_r;
80468076 }
80478077
8048 /* "pygame_sdl2/display.pyx":498
8078 /* "pygame_sdl2/display.pyx":509
80498079 * return main_window.surface
8080 *
8081 * def destroy(): # <<<<<<<<<<<<<<
8082 * global main_window
8083 *
8084 */
8085
8086 /* Python wrapper */
8087 static PyObject *__pyx_pw_11pygame_sdl2_7display_15destroy(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
8088 static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_15destroy = {"destroy", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_15destroy, METH_NOARGS, 0};
8089 static PyObject *__pyx_pw_11pygame_sdl2_7display_15destroy(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
8090 PyObject *__pyx_r = 0;
8091 __Pyx_RefNannyDeclarations
8092 __Pyx_RefNannySetupContext("destroy (wrapper)", 0);
8093 __pyx_r = __pyx_pf_11pygame_sdl2_7display_14destroy(__pyx_self);
8094
8095 /* function exit code */
8096 __Pyx_RefNannyFinishContext();
8097 return __pyx_r;
8098 }
8099
8100 static PyObject *__pyx_pf_11pygame_sdl2_7display_14destroy(CYTHON_UNUSED PyObject *__pyx_self) {
8101 PyObject *__pyx_r = NULL;
8102 __Pyx_RefNannyDeclarations
8103 int __pyx_t_1;
8104 int __pyx_t_2;
8105 PyObject *__pyx_t_3 = NULL;
8106 PyObject *__pyx_t_4 = NULL;
8107 PyObject *__pyx_t_5 = NULL;
8108 int __pyx_lineno = 0;
8109 const char *__pyx_filename = NULL;
8110 int __pyx_clineno = 0;
8111 __Pyx_RefNannySetupContext("destroy", 0);
8112
8113 /* "pygame_sdl2/display.pyx":512
8114 * global main_window
8115 *
8116 * if main_window is not None: # <<<<<<<<<<<<<<
8117 * main_window.destroy()
8118 * main_window = None
8119 */
8120 __pyx_t_1 = (((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window) != Py_None);
8121 __pyx_t_2 = (__pyx_t_1 != 0);
8122 if (__pyx_t_2) {
8123
8124 /* "pygame_sdl2/display.pyx":513
8125 *
8126 * if main_window is not None:
8127 * main_window.destroy() # <<<<<<<<<<<<<<
8128 * main_window = None
8129 *
8130 */
8131 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_destroy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 513, __pyx_L1_error)
8132 __Pyx_GOTREF(__pyx_t_4);
8133 __pyx_t_5 = NULL;
8134 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
8135 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
8136 if (likely(__pyx_t_5)) {
8137 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
8138 __Pyx_INCREF(__pyx_t_5);
8139 __Pyx_INCREF(function);
8140 __Pyx_DECREF_SET(__pyx_t_4, function);
8141 }
8142 }
8143 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
8144 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
8145 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 513, __pyx_L1_error)
8146 __Pyx_GOTREF(__pyx_t_3);
8147 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8148 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8149
8150 /* "pygame_sdl2/display.pyx":514
8151 * if main_window is not None:
8152 * main_window.destroy()
8153 * main_window = None # <<<<<<<<<<<<<<
8154 *
8155 * def get_surface():
8156 */
8157 __Pyx_INCREF(Py_None);
8158 __Pyx_XGOTREF(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window));
8159 __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_7display_main_window, ((struct __pyx_obj_11pygame_sdl2_7display_Window *)Py_None));
8160 __Pyx_GIVEREF(Py_None);
8161
8162 /* "pygame_sdl2/display.pyx":512
8163 * global main_window
8164 *
8165 * if main_window is not None: # <<<<<<<<<<<<<<
8166 * main_window.destroy()
8167 * main_window = None
8168 */
8169 }
8170
8171 /* "pygame_sdl2/display.pyx":509
8172 * return main_window.surface
8173 *
8174 * def destroy(): # <<<<<<<<<<<<<<
8175 * global main_window
8176 *
8177 */
8178
8179 /* function exit code */
8180 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8181 goto __pyx_L0;
8182 __pyx_L1_error:;
8183 __Pyx_XDECREF(__pyx_t_3);
8184 __Pyx_XDECREF(__pyx_t_4);
8185 __Pyx_XDECREF(__pyx_t_5);
8186 __Pyx_AddTraceback("pygame_sdl2.display.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename);
8187 __pyx_r = NULL;
8188 __pyx_L0:;
8189 __Pyx_XGIVEREF(__pyx_r);
8190 __Pyx_RefNannyFinishContext();
8191 return __pyx_r;
8192 }
8193
8194 /* "pygame_sdl2/display.pyx":516
8195 * main_window = None
80508196 *
80518197 * def get_surface(): # <<<<<<<<<<<<<<
80528198 * if main_window is None:
80808226 int __pyx_clineno = 0;
80818227 __Pyx_RefNannySetupContext("get_surface", 0);
80828228
8083 /* "pygame_sdl2/display.pyx":499
8229 /* "pygame_sdl2/display.pyx":517
80848230 *
80858231 * def get_surface():
80868232 * if main_window is None: # <<<<<<<<<<<<<<
80918237 __pyx_t_2 = (__pyx_t_1 != 0);
80928238 if (__pyx_t_2) {
80938239
8094 /* "pygame_sdl2/display.pyx":500
8240 /* "pygame_sdl2/display.pyx":518
80958241 * def get_surface():
80968242 * if main_window is None:
80978243 * return None # <<<<<<<<<<<<<<
81028248 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
81038249 goto __pyx_L0;
81048250
8105 /* "pygame_sdl2/display.pyx":499
8251 /* "pygame_sdl2/display.pyx":517
81068252 *
81078253 * def get_surface():
81088254 * if main_window is None: # <<<<<<<<<<<<<<
81118257 */
81128258 }
81138259
8114 /* "pygame_sdl2/display.pyx":502
8260 /* "pygame_sdl2/display.pyx":520
81158261 * return None
81168262 *
81178263 * return main_window.get_surface() # <<<<<<<<<<<<<<
81198265 * def get_window():
81208266 */
81218267 __Pyx_XDECREF(__pyx_r);
8122 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_get_surface); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 502, __pyx_L1_error)
8268 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_get_surface); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error)
81238269 __Pyx_GOTREF(__pyx_t_4);
81248270 __pyx_t_5 = NULL;
81258271 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
81338279 }
81348280 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
81358281 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
8136 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 502, __pyx_L1_error)
8282 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 520, __pyx_L1_error)
81378283 __Pyx_GOTREF(__pyx_t_3);
81388284 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
81398285 __pyx_r = __pyx_t_3;
81408286 __pyx_t_3 = 0;
81418287 goto __pyx_L0;
81428288
8143 /* "pygame_sdl2/display.pyx":498
8144 * return main_window.surface
8289 /* "pygame_sdl2/display.pyx":516
8290 * main_window = None
81458291 *
81468292 * def get_surface(): # <<<<<<<<<<<<<<
81478293 * if main_window is None:
81618307 return __pyx_r;
81628308 }
81638309
8164 /* "pygame_sdl2/display.pyx":504
8310 /* "pygame_sdl2/display.pyx":522
81658311 * return main_window.get_surface()
81668312 *
81678313 * def get_window(): # <<<<<<<<<<<<<<
81898335 __Pyx_RefNannyDeclarations
81908336 __Pyx_RefNannySetupContext("get_window", 0);
81918337
8192 /* "pygame_sdl2/display.pyx":510
8338 /* "pygame_sdl2/display.pyx":528
81938339 * """
81948340 *
81958341 * return main_window # <<<<<<<<<<<<<<
82018347 __pyx_r = ((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window);
82028348 goto __pyx_L0;
82038349
8204 /* "pygame_sdl2/display.pyx":504
8350 /* "pygame_sdl2/display.pyx":522
82058351 * return main_window.get_surface()
82068352 *
82078353 * def get_window(): # <<<<<<<<<<<<<<
82168362 return __pyx_r;
82178363 }
82188364
8219 /* "pygame_sdl2/display.pyx":512
8365 /* "pygame_sdl2/display.pyx":530
82208366 * return main_window
82218367 *
82228368 * def flip(): # <<<<<<<<<<<<<<
82508396 int __pyx_clineno = 0;
82518397 __Pyx_RefNannySetupContext("flip", 0);
82528398
8253 /* "pygame_sdl2/display.pyx":513
8399 /* "pygame_sdl2/display.pyx":531
82548400 *
82558401 * def flip():
82568402 * if main_window: # <<<<<<<<<<<<<<
82578403 * main_window.flip()
82588404 *
82598405 */
8260 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 513, __pyx_L1_error)
8406 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 531, __pyx_L1_error)
82618407 if (__pyx_t_1) {
82628408
8263 /* "pygame_sdl2/display.pyx":514
8409 /* "pygame_sdl2/display.pyx":532
82648410 * def flip():
82658411 * if main_window:
82668412 * main_window.flip() # <<<<<<<<<<<<<<
82678413 *
82688414 * def update(rectangles=None):
82698415 */
8270 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_flip); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 514, __pyx_L1_error)
8416 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_flip); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 532, __pyx_L1_error)
82718417 __Pyx_GOTREF(__pyx_t_3);
82728418 __pyx_t_4 = NULL;
82738419 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
82818427 }
82828428 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
82838429 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8284 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error)
8430 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 532, __pyx_L1_error)
82858431 __Pyx_GOTREF(__pyx_t_2);
82868432 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
82878433 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
82888434
8289 /* "pygame_sdl2/display.pyx":513
8435 /* "pygame_sdl2/display.pyx":531
82908436 *
82918437 * def flip():
82928438 * if main_window: # <<<<<<<<<<<<<<
82958441 */
82968442 }
82978443
8298 /* "pygame_sdl2/display.pyx":512
8444 /* "pygame_sdl2/display.pyx":530
82998445 * return main_window
83008446 *
83018447 * def flip(): # <<<<<<<<<<<<<<
83188464 return __pyx_r;
83198465 }
83208466
8321 /* "pygame_sdl2/display.pyx":516
8467 /* "pygame_sdl2/display.pyx":534
83228468 * main_window.flip()
83238469 *
83248470 * def update(rectangles=None): # <<<<<<<<<<<<<<
83598505 }
83608506 }
83618507 if (unlikely(kw_args > 0)) {
8362 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "update") < 0)) __PYX_ERR(0, 516, __pyx_L3_error)
8508 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "update") < 0)) __PYX_ERR(0, 534, __pyx_L3_error)
83638509 }
83648510 } else {
83658511 switch (PyTuple_GET_SIZE(__pyx_args)) {
83738519 }
83748520 goto __pyx_L4_argument_unpacking_done;
83758521 __pyx_L5_argtuple_error:;
8376 __Pyx_RaiseArgtupleInvalid("update", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 516, __pyx_L3_error)
8522 __Pyx_RaiseArgtupleInvalid("update", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 534, __pyx_L3_error)
83778523 __pyx_L3_error:;
83788524 __Pyx_AddTraceback("pygame_sdl2.display.update", __pyx_clineno, __pyx_lineno, __pyx_filename);
83798525 __Pyx_RefNannyFinishContext();
83988544 int __pyx_clineno = 0;
83998545 __Pyx_RefNannySetupContext("update", 0);
84008546
8401 /* "pygame_sdl2/display.pyx":517
8547 /* "pygame_sdl2/display.pyx":535
84028548 *
84038549 * def update(rectangles=None):
84048550 * if main_window: # <<<<<<<<<<<<<<
84058551 * main_window.update(rectangles)
84068552 *
84078553 */
8408 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 517, __pyx_L1_error)
8554 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 535, __pyx_L1_error)
84098555 if (__pyx_t_1) {
84108556
8411 /* "pygame_sdl2/display.pyx":518
8557 /* "pygame_sdl2/display.pyx":536
84128558 * def update(rectangles=None):
84138559 * if main_window:
84148560 * main_window.update(rectangles) # <<<<<<<<<<<<<<
84158561 *
84168562 * def get_driver():
84178563 */
8418 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_update); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 518, __pyx_L1_error)
8564 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_update); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 536, __pyx_L1_error)
84198565 __Pyx_GOTREF(__pyx_t_3);
84208566 __pyx_t_4 = NULL;
84218567 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
84298575 }
84308576 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_rectangles) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_rectangles);
84318577 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8432 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 518, __pyx_L1_error)
8578 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 536, __pyx_L1_error)
84338579 __Pyx_GOTREF(__pyx_t_2);
84348580 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
84358581 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
84368582
8437 /* "pygame_sdl2/display.pyx":517
8583 /* "pygame_sdl2/display.pyx":535
84388584 *
84398585 * def update(rectangles=None):
84408586 * if main_window: # <<<<<<<<<<<<<<
84438589 */
84448590 }
84458591
8446 /* "pygame_sdl2/display.pyx":516
8592 /* "pygame_sdl2/display.pyx":534
84478593 * main_window.flip()
84488594 *
84498595 * def update(rectangles=None): # <<<<<<<<<<<<<<
84668612 return __pyx_r;
84678613 }
84688614
8469 /* "pygame_sdl2/display.pyx":520
8615 /* "pygame_sdl2/display.pyx":538
84708616 * main_window.update(rectangles)
84718617 *
84728618 * def get_driver(): # <<<<<<<<<<<<<<
85018647 int __pyx_clineno = 0;
85028648 __Pyx_RefNannySetupContext("get_driver", 0);
85038649
8504 /* "pygame_sdl2/display.pyx":521
8650 /* "pygame_sdl2/display.pyx":539
85058651 *
85068652 * def get_driver():
85078653 * cdef const char *driver = SDL_GetCurrentVideoDriver() # <<<<<<<<<<<<<<
85108656 */
85118657 __pyx_v_driver = SDL_GetCurrentVideoDriver();
85128658
8513 /* "pygame_sdl2/display.pyx":523
8659 /* "pygame_sdl2/display.pyx":541
85148660 * cdef const char *driver = SDL_GetCurrentVideoDriver()
85158661 *
85168662 * if driver == NULL: # <<<<<<<<<<<<<<
85208666 __pyx_t_1 = ((__pyx_v_driver == NULL) != 0);
85218667 if (unlikely(__pyx_t_1)) {
85228668
8523 /* "pygame_sdl2/display.pyx":524
8669 /* "pygame_sdl2/display.pyx":542
85248670 *
85258671 * if driver == NULL:
85268672 * raise error() # <<<<<<<<<<<<<<
85278673 *
85288674 * return driver
85298675 */
8530 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 524, __pyx_L1_error)
8676 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 542, __pyx_L1_error)
85318677 __Pyx_GOTREF(__pyx_t_3);
85328678 __pyx_t_4 = NULL;
85338679 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
85418687 }
85428688 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
85438689 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8544 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 524, __pyx_L1_error)
8690 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 542, __pyx_L1_error)
85458691 __Pyx_GOTREF(__pyx_t_2);
85468692 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
85478693 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
85488694 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8549 __PYX_ERR(0, 524, __pyx_L1_error)
8550
8551 /* "pygame_sdl2/display.pyx":523
8695 __PYX_ERR(0, 542, __pyx_L1_error)
8696
8697 /* "pygame_sdl2/display.pyx":541
85528698 * cdef const char *driver = SDL_GetCurrentVideoDriver()
85538699 *
85548700 * if driver == NULL: # <<<<<<<<<<<<<<
85578703 */
85588704 }
85598705
8560 /* "pygame_sdl2/display.pyx":526
8706 /* "pygame_sdl2/display.pyx":544
85618707 * raise error()
85628708 *
85638709 * return driver # <<<<<<<<<<<<<<
85658711 * class Info(object):
85668712 */
85678713 __Pyx_XDECREF(__pyx_r);
8568 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_driver); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 526, __pyx_L1_error)
8714 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_driver); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 544, __pyx_L1_error)
85698715 __Pyx_GOTREF(__pyx_t_2);
85708716 __pyx_r = __pyx_t_2;
85718717 __pyx_t_2 = 0;
85728718 goto __pyx_L0;
85738719
8574 /* "pygame_sdl2/display.pyx":520
8720 /* "pygame_sdl2/display.pyx":538
85758721 * main_window.update(rectangles)
85768722 *
85778723 * def get_driver(): # <<<<<<<<<<<<<<
85928738 return __pyx_r;
85938739 }
85948740
8595 /* "pygame_sdl2/display.pyx":530
8741 /* "pygame_sdl2/display.pyx":548
85968742 * class Info(object):
85978743 *
85988744 * def __init__(self): # <<<<<<<<<<<<<<
86318777 int __pyx_clineno = 0;
86328778 __Pyx_RefNannySetupContext("__init__", 0);
86338779
8634 /* "pygame_sdl2/display.pyx":534
8780 /* "pygame_sdl2/display.pyx":552
86358781 * cdef SDL_PixelFormat *format
86368782 *
86378783 * if SDL_GetCurrentDisplayMode(0, &dm): # <<<<<<<<<<<<<<
86418787 __pyx_t_1 = (SDL_GetCurrentDisplayMode(0, (&__pyx_v_dm)) != 0);
86428788 if (unlikely(__pyx_t_1)) {
86438789
8644 /* "pygame_sdl2/display.pyx":535
8790 /* "pygame_sdl2/display.pyx":553
86458791 *
86468792 * if SDL_GetCurrentDisplayMode(0, &dm):
86478793 * raise error() # <<<<<<<<<<<<<<
86488794 *
86498795 * format = SDL_AllocFormat(dm.format)
86508796 */
8651 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 535, __pyx_L1_error)
8797 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 553, __pyx_L1_error)
86528798 __Pyx_GOTREF(__pyx_t_3);
86538799 __pyx_t_4 = NULL;
86548800 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
86628808 }
86638809 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
86648810 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8665 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 535, __pyx_L1_error)
8811 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 553, __pyx_L1_error)
86668812 __Pyx_GOTREF(__pyx_t_2);
86678813 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
86688814 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
86698815 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8670 __PYX_ERR(0, 535, __pyx_L1_error)
8671
8672 /* "pygame_sdl2/display.pyx":534
8816 __PYX_ERR(0, 553, __pyx_L1_error)
8817
8818 /* "pygame_sdl2/display.pyx":552
86738819 * cdef SDL_PixelFormat *format
86748820 *
86758821 * if SDL_GetCurrentDisplayMode(0, &dm): # <<<<<<<<<<<<<<
86788824 */
86798825 }
86808826
8681 /* "pygame_sdl2/display.pyx":537
8827 /* "pygame_sdl2/display.pyx":555
86828828 * raise error()
86838829 *
86848830 * format = SDL_AllocFormat(dm.format) # <<<<<<<<<<<<<<
86878833 */
86888834 __pyx_v_format = SDL_AllocFormat(__pyx_v_dm.format);
86898835
8690 /* "pygame_sdl2/display.pyx":538
8836 /* "pygame_sdl2/display.pyx":556
86918837 *
86928838 * format = SDL_AllocFormat(dm.format)
86938839 * if format == NULL: # <<<<<<<<<<<<<<
86978843 __pyx_t_1 = ((__pyx_v_format == NULL) != 0);
86988844 if (unlikely(__pyx_t_1)) {
86998845
8700 /* "pygame_sdl2/display.pyx":539
8846 /* "pygame_sdl2/display.pyx":557
87018847 * format = SDL_AllocFormat(dm.format)
87028848 * if format == NULL:
87038849 * raise error() # <<<<<<<<<<<<<<
87048850 *
87058851 * self.bitsize = format.BitsPerPixel
87068852 */
8707 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 539, __pyx_L1_error)
8853 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 557, __pyx_L1_error)
87088854 __Pyx_GOTREF(__pyx_t_3);
87098855 __pyx_t_4 = NULL;
87108856 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
87188864 }
87198865 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
87208866 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8721 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 539, __pyx_L1_error)
8867 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 557, __pyx_L1_error)
87228868 __Pyx_GOTREF(__pyx_t_2);
87238869 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
87248870 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
87258871 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8726 __PYX_ERR(0, 539, __pyx_L1_error)
8727
8728 /* "pygame_sdl2/display.pyx":538
8872 __PYX_ERR(0, 557, __pyx_L1_error)
8873
8874 /* "pygame_sdl2/display.pyx":556
87298875 *
87308876 * format = SDL_AllocFormat(dm.format)
87318877 * if format == NULL: # <<<<<<<<<<<<<<
87348880 */
87358881 }
87368882
8737 /* "pygame_sdl2/display.pyx":541
8883 /* "pygame_sdl2/display.pyx":559
87388884 * raise error()
87398885 *
87408886 * self.bitsize = format.BitsPerPixel # <<<<<<<<<<<<<<
87418887 * self.bytesize = format.BytesPerPixel
87428888 *
87438889 */
8744 __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->BitsPerPixel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 541, __pyx_L1_error)
8890 __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->BitsPerPixel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 559, __pyx_L1_error)
87458891 __Pyx_GOTREF(__pyx_t_2);
8746 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_bitsize, __pyx_t_2) < 0) __PYX_ERR(0, 541, __pyx_L1_error)
8892 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_bitsize, __pyx_t_2) < 0) __PYX_ERR(0, 559, __pyx_L1_error)
87478893 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
87488894
8749 /* "pygame_sdl2/display.pyx":542
8895 /* "pygame_sdl2/display.pyx":560
87508896 *
87518897 * self.bitsize = format.BitsPerPixel
87528898 * self.bytesize = format.BytesPerPixel # <<<<<<<<<<<<<<
87538899 *
87548900 * self.masks = (
87558901 */
8756 __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->BytesPerPixel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 542, __pyx_L1_error)
8902 __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->BytesPerPixel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 560, __pyx_L1_error)
87578903 __Pyx_GOTREF(__pyx_t_2);
8758 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_bytesize, __pyx_t_2) < 0) __PYX_ERR(0, 542, __pyx_L1_error)
8904 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_bytesize, __pyx_t_2) < 0) __PYX_ERR(0, 560, __pyx_L1_error)
87598905 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
87608906
8761 /* "pygame_sdl2/display.pyx":545
8907 /* "pygame_sdl2/display.pyx":563
87628908 *
87638909 * self.masks = (
87648910 * format.Rmask, # <<<<<<<<<<<<<<
87658911 * format.Gmask,
87668912 * format.Bmask,
87678913 */
8768 __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_format->Rmask); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 545, __pyx_L1_error)
8914 __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_format->Rmask); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 563, __pyx_L1_error)
87698915 __Pyx_GOTREF(__pyx_t_2);
87708916
8771 /* "pygame_sdl2/display.pyx":546
8917 /* "pygame_sdl2/display.pyx":564
87728918 * self.masks = (
87738919 * format.Rmask,
87748920 * format.Gmask, # <<<<<<<<<<<<<<
87758921 * format.Bmask,
87768922 * format.Amask,
87778923 */
8778 __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_format->Gmask); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 546, __pyx_L1_error)
8924 __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_format->Gmask); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 564, __pyx_L1_error)
87798925 __Pyx_GOTREF(__pyx_t_3);
87808926
8781 /* "pygame_sdl2/display.pyx":547
8927 /* "pygame_sdl2/display.pyx":565
87828928 * format.Rmask,
87838929 * format.Gmask,
87848930 * format.Bmask, # <<<<<<<<<<<<<<
87858931 * format.Amask,
87868932 * )
87878933 */
8788 __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_format->Bmask); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 547, __pyx_L1_error)
8934 __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_format->Bmask); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 565, __pyx_L1_error)
87898935 __Pyx_GOTREF(__pyx_t_4);
87908936
8791 /* "pygame_sdl2/display.pyx":548
8937 /* "pygame_sdl2/display.pyx":566
87928938 * format.Gmask,
87938939 * format.Bmask,
87948940 * format.Amask, # <<<<<<<<<<<<<<
87958941 * )
87968942 *
87978943 */
8798 __pyx_t_5 = __Pyx_PyInt_From_uint32_t(__pyx_v_format->Amask); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 548, __pyx_L1_error)
8944 __pyx_t_5 = __Pyx_PyInt_From_uint32_t(__pyx_v_format->Amask); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 566, __pyx_L1_error)
87998945 __Pyx_GOTREF(__pyx_t_5);
88008946
8801 /* "pygame_sdl2/display.pyx":545
8947 /* "pygame_sdl2/display.pyx":563
88028948 *
88038949 * self.masks = (
88048950 * format.Rmask, # <<<<<<<<<<<<<<
88058951 * format.Gmask,
88068952 * format.Bmask,
88078953 */
8808 __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 545, __pyx_L1_error)
8954 __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 563, __pyx_L1_error)
88098955 __Pyx_GOTREF(__pyx_t_6);
88108956 __Pyx_GIVEREF(__pyx_t_2);
88118957 PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
88208966 __pyx_t_4 = 0;
88218967 __pyx_t_5 = 0;
88228968
8823 /* "pygame_sdl2/display.pyx":544
8969 /* "pygame_sdl2/display.pyx":562
88248970 * self.bytesize = format.BytesPerPixel
88258971 *
88268972 * self.masks = ( # <<<<<<<<<<<<<<
88278973 * format.Rmask,
88288974 * format.Gmask,
88298975 */
8830 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_masks, __pyx_t_6) < 0) __PYX_ERR(0, 544, __pyx_L1_error)
8976 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_masks, __pyx_t_6) < 0) __PYX_ERR(0, 562, __pyx_L1_error)
88318977 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
88328978
8833 /* "pygame_sdl2/display.pyx":552
8979 /* "pygame_sdl2/display.pyx":570
88348980 *
88358981 * self.shifts = (
88368982 * format.Rshift, # <<<<<<<<<<<<<<
88378983 * format.Gshift,
88388984 * format.Bshift,
88398985 */
8840 __pyx_t_6 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Rshift); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 552, __pyx_L1_error)
8986 __pyx_t_6 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Rshift); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 570, __pyx_L1_error)
88418987 __Pyx_GOTREF(__pyx_t_6);
88428988
8843 /* "pygame_sdl2/display.pyx":553
8989 /* "pygame_sdl2/display.pyx":571
88448990 * self.shifts = (
88458991 * format.Rshift,
88468992 * format.Gshift, # <<<<<<<<<<<<<<
88478993 * format.Bshift,
88488994 * format.Ashift,
88498995 */
8850 __pyx_t_5 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Gshift); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 553, __pyx_L1_error)
8996 __pyx_t_5 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Gshift); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 571, __pyx_L1_error)
88518997 __Pyx_GOTREF(__pyx_t_5);
88528998
8853 /* "pygame_sdl2/display.pyx":554
8999 /* "pygame_sdl2/display.pyx":572
88549000 * format.Rshift,
88559001 * format.Gshift,
88569002 * format.Bshift, # <<<<<<<<<<<<<<
88579003 * format.Ashift,
88589004 * )
88599005 */
8860 __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Bshift); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 554, __pyx_L1_error)
9006 __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Bshift); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 572, __pyx_L1_error)
88619007 __Pyx_GOTREF(__pyx_t_4);
88629008
8863 /* "pygame_sdl2/display.pyx":555
9009 /* "pygame_sdl2/display.pyx":573
88649010 * format.Gshift,
88659011 * format.Bshift,
88669012 * format.Ashift, # <<<<<<<<<<<<<<
88679013 * )
88689014 *
88699015 */
8870 __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Ashift); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 555, __pyx_L1_error)
9016 __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Ashift); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 573, __pyx_L1_error)
88719017 __Pyx_GOTREF(__pyx_t_3);
88729018
8873 /* "pygame_sdl2/display.pyx":552
9019 /* "pygame_sdl2/display.pyx":570
88749020 *
88759021 * self.shifts = (
88769022 * format.Rshift, # <<<<<<<<<<<<<<
88779023 * format.Gshift,
88789024 * format.Bshift,
88799025 */
8880 __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 552, __pyx_L1_error)
9026 __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 570, __pyx_L1_error)
88819027 __Pyx_GOTREF(__pyx_t_2);
88829028 __Pyx_GIVEREF(__pyx_t_6);
88839029 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6);
88929038 __pyx_t_4 = 0;
88939039 __pyx_t_3 = 0;
88949040
8895 /* "pygame_sdl2/display.pyx":551
9041 /* "pygame_sdl2/display.pyx":569
88969042 * )
88979043 *
88989044 * self.shifts = ( # <<<<<<<<<<<<<<
88999045 * format.Rshift,
89009046 * format.Gshift,
89019047 */
8902 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_shifts, __pyx_t_2) < 0) __PYX_ERR(0, 551, __pyx_L1_error)
9048 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_shifts, __pyx_t_2) < 0) __PYX_ERR(0, 569, __pyx_L1_error)
89039049 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
89049050
8905 /* "pygame_sdl2/display.pyx":559
9051 /* "pygame_sdl2/display.pyx":577
89069052 *
89079053 * self.losses = (
89089054 * format.Rloss, # <<<<<<<<<<<<<<
89099055 * format.Gloss,
89109056 * format.Bloss,
89119057 */
8912 __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Rloss); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 559, __pyx_L1_error)
9058 __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Rloss); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 577, __pyx_L1_error)
89139059 __Pyx_GOTREF(__pyx_t_2);
89149060
8915 /* "pygame_sdl2/display.pyx":560
9061 /* "pygame_sdl2/display.pyx":578
89169062 * self.losses = (
89179063 * format.Rloss,
89189064 * format.Gloss, # <<<<<<<<<<<<<<
89199065 * format.Bloss,
89209066 * format.Aloss,
89219067 */
8922 __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Gloss); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 560, __pyx_L1_error)
9068 __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Gloss); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 578, __pyx_L1_error)
89239069 __Pyx_GOTREF(__pyx_t_3);
89249070
8925 /* "pygame_sdl2/display.pyx":561
9071 /* "pygame_sdl2/display.pyx":579
89269072 * format.Rloss,
89279073 * format.Gloss,
89289074 * format.Bloss, # <<<<<<<<<<<<<<
89299075 * format.Aloss,
89309076 * )
89319077 */
8932 __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Bloss); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 561, __pyx_L1_error)
9078 __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Bloss); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 579, __pyx_L1_error)
89339079 __Pyx_GOTREF(__pyx_t_4);
89349080
8935 /* "pygame_sdl2/display.pyx":562
9081 /* "pygame_sdl2/display.pyx":580
89369082 * format.Gloss,
89379083 * format.Bloss,
89389084 * format.Aloss, # <<<<<<<<<<<<<<
89399085 * )
89409086 *
89419087 */
8942 __pyx_t_5 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Aloss); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 562, __pyx_L1_error)
9088 __pyx_t_5 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Aloss); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 580, __pyx_L1_error)
89439089 __Pyx_GOTREF(__pyx_t_5);
89449090
8945 /* "pygame_sdl2/display.pyx":559
9091 /* "pygame_sdl2/display.pyx":577
89469092 *
89479093 * self.losses = (
89489094 * format.Rloss, # <<<<<<<<<<<<<<
89499095 * format.Gloss,
89509096 * format.Bloss,
89519097 */
8952 __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 559, __pyx_L1_error)
9098 __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 577, __pyx_L1_error)
89539099 __Pyx_GOTREF(__pyx_t_6);
89549100 __Pyx_GIVEREF(__pyx_t_2);
89559101 PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
89649110 __pyx_t_4 = 0;
89659111 __pyx_t_5 = 0;
89669112
8967 /* "pygame_sdl2/display.pyx":558
9113 /* "pygame_sdl2/display.pyx":576
89689114 * )
89699115 *
89709116 * self.losses = ( # <<<<<<<<<<<<<<
89719117 * format.Rloss,
89729118 * format.Gloss,
89739119 */
8974 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_losses, __pyx_t_6) < 0) __PYX_ERR(0, 558, __pyx_L1_error)
9120 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_losses, __pyx_t_6) < 0) __PYX_ERR(0, 576, __pyx_L1_error)
89759121 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
89769122
8977 /* "pygame_sdl2/display.pyx":565
9123 /* "pygame_sdl2/display.pyx":583
89789124 * )
89799125 *
89809126 * SDL_FreeFormat(format) # <<<<<<<<<<<<<<
89839129 */
89849130 SDL_FreeFormat(__pyx_v_format);
89859131
8986 /* "pygame_sdl2/display.pyx":567
9132 /* "pygame_sdl2/display.pyx":585
89879133 * SDL_FreeFormat(format)
89889134 *
89899135 * if main_window: # <<<<<<<<<<<<<<
89909136 * self.current_w, self.current_h = main_window.surface.get_size()
89919137 * else:
89929138 */
8993 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 567, __pyx_L1_error)
9139 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 585, __pyx_L1_error)
89949140 if (__pyx_t_1) {
89959141
8996 /* "pygame_sdl2/display.pyx":568
9142 /* "pygame_sdl2/display.pyx":586
89979143 *
89989144 * if main_window:
89999145 * self.current_w, self.current_h = main_window.surface.get_size() # <<<<<<<<<<<<<<
90009146 * else:
90019147 *
90029148 */
9003 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window->surface), __pyx_n_s_get_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 568, __pyx_L1_error)
9149 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window->surface), __pyx_n_s_get_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 586, __pyx_L1_error)
90049150 __Pyx_GOTREF(__pyx_t_5);
90059151 __pyx_t_4 = NULL;
90069152 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
90149160 }
90159161 __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
90169162 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
9017 if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 568, __pyx_L1_error)
9163 if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 586, __pyx_L1_error)
90189164 __Pyx_GOTREF(__pyx_t_6);
90199165 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
90209166 if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
90239169 if (unlikely(size != 2)) {
90249170 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
90259171 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
9026 __PYX_ERR(0, 568, __pyx_L1_error)
9172 __PYX_ERR(0, 586, __pyx_L1_error)
90279173 }
90289174 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
90299175 if (likely(PyTuple_CheckExact(sequence))) {
90369182 __Pyx_INCREF(__pyx_t_5);
90379183 __Pyx_INCREF(__pyx_t_4);
90389184 #else
9039 __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 568, __pyx_L1_error)
9185 __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 586, __pyx_L1_error)
90409186 __Pyx_GOTREF(__pyx_t_5);
9041 __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 568, __pyx_L1_error)
9187 __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 586, __pyx_L1_error)
90429188 __Pyx_GOTREF(__pyx_t_4);
90439189 #endif
90449190 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
90459191 } else {
90469192 Py_ssize_t index = -1;
9047 __pyx_t_3 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 568, __pyx_L1_error)
9193 __pyx_t_3 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 586, __pyx_L1_error)
90489194 __Pyx_GOTREF(__pyx_t_3);
90499195 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
90509196 __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext;
90529198 __Pyx_GOTREF(__pyx_t_5);
90539199 index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed;
90549200 __Pyx_GOTREF(__pyx_t_4);
9055 if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_3), 2) < 0) __PYX_ERR(0, 568, __pyx_L1_error)
9201 if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_3), 2) < 0) __PYX_ERR(0, 586, __pyx_L1_error)
90569202 __pyx_t_7 = NULL;
90579203 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
90589204 goto __pyx_L7_unpacking_done;
90609206 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
90619207 __pyx_t_7 = NULL;
90629208 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
9063 __PYX_ERR(0, 568, __pyx_L1_error)
9209 __PYX_ERR(0, 586, __pyx_L1_error)
90649210 __pyx_L7_unpacking_done:;
90659211 }
9066 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_current_w, __pyx_t_5) < 0) __PYX_ERR(0, 568, __pyx_L1_error)
9212 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_current_w, __pyx_t_5) < 0) __PYX_ERR(0, 586, __pyx_L1_error)
90679213 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9068 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_current_h, __pyx_t_4) < 0) __PYX_ERR(0, 568, __pyx_L1_error)
9214 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_current_h, __pyx_t_4) < 0) __PYX_ERR(0, 586, __pyx_L1_error)
90699215 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
90709216
9071 /* "pygame_sdl2/display.pyx":567
9217 /* "pygame_sdl2/display.pyx":585
90729218 * SDL_FreeFormat(format)
90739219 *
90749220 * if main_window: # <<<<<<<<<<<<<<
90789224 goto __pyx_L5;
90799225 }
90809226
9081 /* "pygame_sdl2/display.pyx":571
9227 /* "pygame_sdl2/display.pyx":589
90829228 * else:
90839229 *
90849230 * self.current_w = dm.w # <<<<<<<<<<<<<<
90869232 *
90879233 */
90889234 /*else*/ {
9089 __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_dm.w); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 571, __pyx_L1_error)
9235 __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_dm.w); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 589, __pyx_L1_error)
90909236 __Pyx_GOTREF(__pyx_t_6);
9091 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_current_w, __pyx_t_6) < 0) __PYX_ERR(0, 571, __pyx_L1_error)
9237 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_current_w, __pyx_t_6) < 0) __PYX_ERR(0, 589, __pyx_L1_error)
90929238 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
90939239
9094 /* "pygame_sdl2/display.pyx":572
9240 /* "pygame_sdl2/display.pyx":590
90959241 *
90969242 * self.current_w = dm.w
90979243 * self.current_h = dm.h # <<<<<<<<<<<<<<
90989244 *
90999245 * self.refresh_rate = dm.refresh_rate
91009246 */
9101 __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_dm.h); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 572, __pyx_L1_error)
9247 __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_dm.h); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 590, __pyx_L1_error)
91029248 __Pyx_GOTREF(__pyx_t_6);
9103 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_current_h, __pyx_t_6) < 0) __PYX_ERR(0, 572, __pyx_L1_error)
9249 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_current_h, __pyx_t_6) < 0) __PYX_ERR(0, 590, __pyx_L1_error)
91049250 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
91059251 }
91069252 __pyx_L5:;
91079253
9108 /* "pygame_sdl2/display.pyx":574
9254 /* "pygame_sdl2/display.pyx":592
91099255 * self.current_h = dm.h
91109256 *
91119257 * self.refresh_rate = dm.refresh_rate # <<<<<<<<<<<<<<
91129258 *
91139259 * # The rest of these are just guesses.
91149260 */
9115 __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_dm.refresh_rate); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 574, __pyx_L1_error)
9261 __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_dm.refresh_rate); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 592, __pyx_L1_error)
91169262 __Pyx_GOTREF(__pyx_t_6);
9117 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_refresh_rate, __pyx_t_6) < 0) __PYX_ERR(0, 574, __pyx_L1_error)
9263 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_refresh_rate, __pyx_t_6) < 0) __PYX_ERR(0, 592, __pyx_L1_error)
91189264 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
91199265
9120 /* "pygame_sdl2/display.pyx":577
9266 /* "pygame_sdl2/display.pyx":595
91219267 *
91229268 * # The rest of these are just guesses.
91239269 * self.hw = False # <<<<<<<<<<<<<<
91249270 * self.wm = True
91259271 * self.video_mem = 256 * 1024 * 1024
91269272 */
9127 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_hw, Py_False) < 0) __PYX_ERR(0, 577, __pyx_L1_error)
9128
9129 /* "pygame_sdl2/display.pyx":578
9273 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_hw, Py_False) < 0) __PYX_ERR(0, 595, __pyx_L1_error)
9274
9275 /* "pygame_sdl2/display.pyx":596
91309276 * # The rest of these are just guesses.
91319277 * self.hw = False
91329278 * self.wm = True # <<<<<<<<<<<<<<
91339279 * self.video_mem = 256 * 1024 * 1024
91349280 *
91359281 */
9136 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_wm, Py_True) < 0) __PYX_ERR(0, 578, __pyx_L1_error)
9137
9138 /* "pygame_sdl2/display.pyx":579
9282 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_wm, Py_True) < 0) __PYX_ERR(0, 596, __pyx_L1_error)
9283
9284 /* "pygame_sdl2/display.pyx":597
91399285 * self.hw = False
91409286 * self.wm = True
91419287 * self.video_mem = 256 * 1024 * 1024 # <<<<<<<<<<<<<<
91429288 *
91439289 * self.blit_hw = False
91449290 */
9145 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_video_mem, __pyx_int_268435456) < 0) __PYX_ERR(0, 579, __pyx_L1_error)
9146
9147 /* "pygame_sdl2/display.pyx":581
9291 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_video_mem, __pyx_int_268435456) < 0) __PYX_ERR(0, 597, __pyx_L1_error)
9292
9293 /* "pygame_sdl2/display.pyx":599
91489294 * self.video_mem = 256 * 1024 * 1024
91499295 *
91509296 * self.blit_hw = False # <<<<<<<<<<<<<<
91519297 * self.blit_hw_CC = False
91529298 * self.blit_hw_A = False
91539299 */
9154 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_hw, Py_False) < 0) __PYX_ERR(0, 581, __pyx_L1_error)
9155
9156 /* "pygame_sdl2/display.pyx":582
9300 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_hw, Py_False) < 0) __PYX_ERR(0, 599, __pyx_L1_error)
9301
9302 /* "pygame_sdl2/display.pyx":600
91579303 *
91589304 * self.blit_hw = False
91599305 * self.blit_hw_CC = False # <<<<<<<<<<<<<<
91609306 * self.blit_hw_A = False
91619307 *
91629308 */
9163 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_hw_CC, Py_False) < 0) __PYX_ERR(0, 582, __pyx_L1_error)
9164
9165 /* "pygame_sdl2/display.pyx":583
9309 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_hw_CC, Py_False) < 0) __PYX_ERR(0, 600, __pyx_L1_error)
9310
9311 /* "pygame_sdl2/display.pyx":601
91669312 * self.blit_hw = False
91679313 * self.blit_hw_CC = False
91689314 * self.blit_hw_A = False # <<<<<<<<<<<<<<
91699315 *
91709316 * self.blit_sw = False
91719317 */
9172 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_hw_A, Py_False) < 0) __PYX_ERR(0, 583, __pyx_L1_error)
9173
9174 /* "pygame_sdl2/display.pyx":585
9318 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_hw_A, Py_False) < 0) __PYX_ERR(0, 601, __pyx_L1_error)
9319
9320 /* "pygame_sdl2/display.pyx":603
91759321 * self.blit_hw_A = False
91769322 *
91779323 * self.blit_sw = False # <<<<<<<<<<<<<<
91789324 * self.blit_sw_CC = False
91799325 * self.blit_sw_A = False
91809326 */
9181 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_sw, Py_False) < 0) __PYX_ERR(0, 585, __pyx_L1_error)
9182
9183 /* "pygame_sdl2/display.pyx":586
9327 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_sw, Py_False) < 0) __PYX_ERR(0, 603, __pyx_L1_error)
9328
9329 /* "pygame_sdl2/display.pyx":604
91849330 *
91859331 * self.blit_sw = False
91869332 * self.blit_sw_CC = False # <<<<<<<<<<<<<<
91879333 * self.blit_sw_A = False
91889334 *
91899335 */
9190 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_sw_CC, Py_False) < 0) __PYX_ERR(0, 586, __pyx_L1_error)
9191
9192 /* "pygame_sdl2/display.pyx":587
9336 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_sw_CC, Py_False) < 0) __PYX_ERR(0, 604, __pyx_L1_error)
9337
9338 /* "pygame_sdl2/display.pyx":605
91939339 * self.blit_sw = False
91949340 * self.blit_sw_CC = False
91959341 * self.blit_sw_A = False # <<<<<<<<<<<<<<
91969342 *
91979343 * def __repr__(self):
91989344 */
9199 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_sw_A, Py_False) < 0) __PYX_ERR(0, 587, __pyx_L1_error)
9200
9201 /* "pygame_sdl2/display.pyx":530
9345 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_sw_A, Py_False) < 0) __PYX_ERR(0, 605, __pyx_L1_error)
9346
9347 /* "pygame_sdl2/display.pyx":548
92029348 * class Info(object):
92039349 *
92049350 * def __init__(self): # <<<<<<<<<<<<<<
92239369 return __pyx_r;
92249370 }
92259371
9226 /* "pygame_sdl2/display.pyx":589
9372 /* "pygame_sdl2/display.pyx":607
92279373 * self.blit_sw_A = False
92289374 *
92299375 * def __repr__(self): # <<<<<<<<<<<<<<
92579403 int __pyx_clineno = 0;
92589404 __Pyx_RefNannySetupContext("__repr__", 0);
92599405
9260 /* "pygame_sdl2/display.pyx":590
9406 /* "pygame_sdl2/display.pyx":608
92619407 *
92629408 * def __repr__(self):
92639409 * return "<Info({!r})>".format(self.__dict__) # <<<<<<<<<<<<<<
92659411 *
92669412 */
92679413 __Pyx_XDECREF(__pyx_r);
9268 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Info_r, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 590, __pyx_L1_error)
9414 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Info_r, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 608, __pyx_L1_error)
92699415 __Pyx_GOTREF(__pyx_t_2);
9270 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 590, __pyx_L1_error)
9416 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 608, __pyx_L1_error)
92719417 __Pyx_GOTREF(__pyx_t_3);
92729418 __pyx_t_4 = NULL;
92739419 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
92829428 __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
92839429 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
92849430 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9285 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 590, __pyx_L1_error)
9431 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 608, __pyx_L1_error)
92869432 __Pyx_GOTREF(__pyx_t_1);
92879433 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
92889434 __pyx_r = __pyx_t_1;
92899435 __pyx_t_1 = 0;
92909436 goto __pyx_L0;
92919437
9292 /* "pygame_sdl2/display.pyx":589
9438 /* "pygame_sdl2/display.pyx":607
92939439 * self.blit_sw_A = False
92949440 *
92959441 * def __repr__(self): # <<<<<<<<<<<<<<
93119457 return __pyx_r;
93129458 }
93139459
9314 /* "pygame_sdl2/display.pyx":593
9460 /* "pygame_sdl2/display.pyx":611
93159461 *
93169462 *
93179463 * def get_wm_info(): # <<<<<<<<<<<<<<
93459491 int __pyx_clineno = 0;
93469492 __Pyx_RefNannySetupContext("get_wm_info", 0);
93479493
9348 /* "pygame_sdl2/display.pyx":594
9494 /* "pygame_sdl2/display.pyx":612
93499495 *
93509496 * def get_wm_info():
93519497 * if main_window: # <<<<<<<<<<<<<<
93529498 * return main_window.get_wm_info()
93539499 *
93549500 */
9355 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 594, __pyx_L1_error)
9501 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 612, __pyx_L1_error)
93569502 if (__pyx_t_1) {
93579503
9358 /* "pygame_sdl2/display.pyx":595
9504 /* "pygame_sdl2/display.pyx":613
93599505 * def get_wm_info():
93609506 * if main_window:
93619507 * return main_window.get_wm_info() # <<<<<<<<<<<<<<
93639509 * return {}
93649510 */
93659511 __Pyx_XDECREF(__pyx_r);
9366 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_get_wm_info); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 595, __pyx_L1_error)
9512 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_get_wm_info); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 613, __pyx_L1_error)
93679513 __Pyx_GOTREF(__pyx_t_3);
93689514 __pyx_t_4 = NULL;
93699515 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
93779523 }
93789524 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
93799525 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
9380 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 595, __pyx_L1_error)
9526 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 613, __pyx_L1_error)
93819527 __Pyx_GOTREF(__pyx_t_2);
93829528 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
93839529 __pyx_r = __pyx_t_2;
93849530 __pyx_t_2 = 0;
93859531 goto __pyx_L0;
93869532
9387 /* "pygame_sdl2/display.pyx":594
9533 /* "pygame_sdl2/display.pyx":612
93889534 *
93899535 * def get_wm_info():
93909536 * if main_window: # <<<<<<<<<<<<<<
93939539 */
93949540 }
93959541
9396 /* "pygame_sdl2/display.pyx":597
9542 /* "pygame_sdl2/display.pyx":615
93979543 * return main_window.get_wm_info()
93989544 *
93999545 * return {} # <<<<<<<<<<<<<<
94019547 *
94029548 */
94039549 __Pyx_XDECREF(__pyx_r);
9404 __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 597, __pyx_L1_error)
9550 __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 615, __pyx_L1_error)
94059551 __Pyx_GOTREF(__pyx_t_2);
94069552 __pyx_r = __pyx_t_2;
94079553 __pyx_t_2 = 0;
94089554 goto __pyx_L0;
94099555
9410 /* "pygame_sdl2/display.pyx":593
9556 /* "pygame_sdl2/display.pyx":611
94119557 *
94129558 *
94139559 * def get_wm_info(): # <<<<<<<<<<<<<<
94289574 return __pyx_r;
94299575 }
94309576
9431 /* "pygame_sdl2/display.pyx":600
9577 /* "pygame_sdl2/display.pyx":618
94329578 *
94339579 *
94349580 * def get_num_video_displays(): # <<<<<<<<<<<<<<
94649610 int __pyx_clineno = 0;
94659611 __Pyx_RefNannySetupContext("get_num_video_displays", 0);
94669612
9467 /* "pygame_sdl2/display.pyx":605
9613 /* "pygame_sdl2/display.pyx":623
94689614 * """
94699615 *
94709616 * rv = SDL_GetNumVideoDisplays() # <<<<<<<<<<<<<<
94739619 */
94749620 __pyx_v_rv = SDL_GetNumVideoDisplays();
94759621
9476 /* "pygame_sdl2/display.pyx":607
9622 /* "pygame_sdl2/display.pyx":625
94779623 * rv = SDL_GetNumVideoDisplays()
94789624 *
94799625 * if rv < 0: # <<<<<<<<<<<<<<
94839629 __pyx_t_1 = ((__pyx_v_rv < 0) != 0);
94849630 if (unlikely(__pyx_t_1)) {
94859631
9486 /* "pygame_sdl2/display.pyx":608
9632 /* "pygame_sdl2/display.pyx":626
94879633 *
94889634 * if rv < 0:
94899635 * raise error() # <<<<<<<<<<<<<<
94909636 *
94919637 * return rv
94929638 */
9493 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 608, __pyx_L1_error)
9639 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 626, __pyx_L1_error)
94949640 __Pyx_GOTREF(__pyx_t_3);
94959641 __pyx_t_4 = NULL;
94969642 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
95049650 }
95059651 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
95069652 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
9507 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 608, __pyx_L1_error)
9653 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 626, __pyx_L1_error)
95089654 __Pyx_GOTREF(__pyx_t_2);
95099655 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
95109656 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
95119657 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9512 __PYX_ERR(0, 608, __pyx_L1_error)
9513
9514 /* "pygame_sdl2/display.pyx":607
9658 __PYX_ERR(0, 626, __pyx_L1_error)
9659
9660 /* "pygame_sdl2/display.pyx":625
95159661 * rv = SDL_GetNumVideoDisplays()
95169662 *
95179663 * if rv < 0: # <<<<<<<<<<<<<<
95209666 */
95219667 }
95229668
9523 /* "pygame_sdl2/display.pyx":610
9669 /* "pygame_sdl2/display.pyx":628
95249670 * raise error()
95259671 *
95269672 * return rv # <<<<<<<<<<<<<<
95289674 *
95299675 */
95309676 __Pyx_XDECREF(__pyx_r);
9531 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 610, __pyx_L1_error)
9677 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 628, __pyx_L1_error)
95329678 __Pyx_GOTREF(__pyx_t_2);
95339679 __pyx_r = __pyx_t_2;
95349680 __pyx_t_2 = 0;
95359681 goto __pyx_L0;
95369682
9537 /* "pygame_sdl2/display.pyx":600
9683 /* "pygame_sdl2/display.pyx":618
95389684 *
95399685 *
95409686 * def get_num_video_displays(): # <<<<<<<<<<<<<<
95559701 return __pyx_r;
95569702 }
95579703
9558 /* "pygame_sdl2/display.pyx":613
9704 /* "pygame_sdl2/display.pyx":631
95599705 *
95609706 *
95619707 * def list_modes(depth=0, flags=0, display=0): # <<<<<<<<<<<<<<
96179763 }
96189764 }
96199765 if (unlikely(kw_args > 0)) {
9620 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "list_modes") < 0)) __PYX_ERR(0, 613, __pyx_L3_error)
9766 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "list_modes") < 0)) __PYX_ERR(0, 631, __pyx_L3_error)
96219767 }
96229768 } else {
96239769 switch (PyTuple_GET_SIZE(__pyx_args)) {
96379783 }
96389784 goto __pyx_L4_argument_unpacking_done;
96399785 __pyx_L5_argtuple_error:;
9640 __Pyx_RaiseArgtupleInvalid("list_modes", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 613, __pyx_L3_error)
9786 __Pyx_RaiseArgtupleInvalid("list_modes", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 631, __pyx_L3_error)
96419787 __pyx_L3_error:;
96429788 __Pyx_AddTraceback("pygame_sdl2.display.list_modes", __pyx_clineno, __pyx_lineno, __pyx_filename);
96439789 __Pyx_RefNannyFinishContext();
96719817 int __pyx_clineno = 0;
96729818 __Pyx_RefNannySetupContext("list_modes", 0);
96739819
9674 /* "pygame_sdl2/display.pyx":623
9820 /* "pygame_sdl2/display.pyx":641
96759821 * cdef SDL_DisplayMode mode
96769822 *
96779823 * rv = [ ] # <<<<<<<<<<<<<<
96789824 *
96799825 * num_modes = SDL_GetNumDisplayModes(display)
96809826 */
9681 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L1_error)
9827 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 641, __pyx_L1_error)
96829828 __Pyx_GOTREF(__pyx_t_1);
96839829 __pyx_v_rv = ((PyObject*)__pyx_t_1);
96849830 __pyx_t_1 = 0;
96859831
9686 /* "pygame_sdl2/display.pyx":625
9832 /* "pygame_sdl2/display.pyx":643
96879833 * rv = [ ]
96889834 *
96899835 * num_modes = SDL_GetNumDisplayModes(display) # <<<<<<<<<<<<<<
96909836 * if num_modes < 0:
96919837 * raise error()
96929838 */
9693 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_display); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 625, __pyx_L1_error)
9839 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_display); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 643, __pyx_L1_error)
96949840 __pyx_v_num_modes = SDL_GetNumDisplayModes(__pyx_t_2);
96959841
9696 /* "pygame_sdl2/display.pyx":626
9842 /* "pygame_sdl2/display.pyx":644
96979843 *
96989844 * num_modes = SDL_GetNumDisplayModes(display)
96999845 * if num_modes < 0: # <<<<<<<<<<<<<<
97039849 __pyx_t_3 = ((__pyx_v_num_modes < 0) != 0);
97049850 if (unlikely(__pyx_t_3)) {
97059851
9706 /* "pygame_sdl2/display.pyx":627
9852 /* "pygame_sdl2/display.pyx":645
97079853 * num_modes = SDL_GetNumDisplayModes(display)
97089854 * if num_modes < 0:
97099855 * raise error() # <<<<<<<<<<<<<<
97109856 *
97119857 * for 0 <= i < num_modes:
97129858 */
9713 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 627, __pyx_L1_error)
9859 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 645, __pyx_L1_error)
97149860 __Pyx_GOTREF(__pyx_t_4);
97159861 __pyx_t_5 = NULL;
97169862 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
97249870 }
97259871 __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
97269872 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9727 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 627, __pyx_L1_error)
9873 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 645, __pyx_L1_error)
97289874 __Pyx_GOTREF(__pyx_t_1);
97299875 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
97309876 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
97319877 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9732 __PYX_ERR(0, 627, __pyx_L1_error)
9733
9734 /* "pygame_sdl2/display.pyx":626
9878 __PYX_ERR(0, 645, __pyx_L1_error)
9879
9880 /* "pygame_sdl2/display.pyx":644
97359881 *
97369882 * num_modes = SDL_GetNumDisplayModes(display)
97379883 * if num_modes < 0: # <<<<<<<<<<<<<<
97409886 */
97419887 }
97429888
9743 /* "pygame_sdl2/display.pyx":629
9889 /* "pygame_sdl2/display.pyx":647
97449890 * raise error()
97459891 *
97469892 * for 0 <= i < num_modes: # <<<<<<<<<<<<<<
97509896 __pyx_t_2 = __pyx_v_num_modes;
97519897 for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {
97529898
9753 /* "pygame_sdl2/display.pyx":630
9899 /* "pygame_sdl2/display.pyx":648
97549900 *
97559901 * for 0 <= i < num_modes:
97569902 * if SDL_GetDisplayMode(display, i, &mode) == 0: # <<<<<<<<<<<<<<
97579903 * t = (mode.w, mode.h)
97589904 * if t not in rv:
97599905 */
9760 __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_display); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 630, __pyx_L1_error)
9906 __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_display); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 648, __pyx_L1_error)
97619907 __pyx_t_3 = ((SDL_GetDisplayMode(__pyx_t_6, __pyx_v_i, (&__pyx_v_mode)) == 0) != 0);
97629908 if (__pyx_t_3) {
97639909
9764 /* "pygame_sdl2/display.pyx":631
9910 /* "pygame_sdl2/display.pyx":649
97659911 * for 0 <= i < num_modes:
97669912 * if SDL_GetDisplayMode(display, i, &mode) == 0:
97679913 * t = (mode.w, mode.h) # <<<<<<<<<<<<<<
97689914 * if t not in rv:
97699915 * rv.append(t)
97709916 */
9771 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_mode.w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 631, __pyx_L1_error)
9917 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_mode.w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 649, __pyx_L1_error)
97729918 __Pyx_GOTREF(__pyx_t_1);
9773 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_mode.h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 631, __pyx_L1_error)
9919 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_mode.h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 649, __pyx_L1_error)
97749920 __Pyx_GOTREF(__pyx_t_4);
9775 __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 631, __pyx_L1_error)
9921 __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 649, __pyx_L1_error)
97769922 __Pyx_GOTREF(__pyx_t_5);
97779923 __Pyx_GIVEREF(__pyx_t_1);
97789924 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
97839929 __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_5);
97849930 __pyx_t_5 = 0;
97859931
9786 /* "pygame_sdl2/display.pyx":632
9932 /* "pygame_sdl2/display.pyx":650
97879933 * if SDL_GetDisplayMode(display, i, &mode) == 0:
97889934 * t = (mode.w, mode.h)
97899935 * if t not in rv: # <<<<<<<<<<<<<<
97909936 * rv.append(t)
97919937 *
97929938 */
9793 __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_t, __pyx_v_rv, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 632, __pyx_L1_error)
9939 __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_t, __pyx_v_rv, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 650, __pyx_L1_error)
97949940 __pyx_t_7 = (__pyx_t_3 != 0);
97959941 if (__pyx_t_7) {
97969942
9797 /* "pygame_sdl2/display.pyx":633
9943 /* "pygame_sdl2/display.pyx":651
97989944 * t = (mode.w, mode.h)
97999945 * if t not in rv:
98009946 * rv.append(t) # <<<<<<<<<<<<<<
98019947 *
98029948 * return rv
98039949 */
9804 __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_rv, __pyx_v_t); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 633, __pyx_L1_error)
9805
9806 /* "pygame_sdl2/display.pyx":632
9950 __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_rv, __pyx_v_t); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 651, __pyx_L1_error)
9951
9952 /* "pygame_sdl2/display.pyx":650
98079953 * if SDL_GetDisplayMode(display, i, &mode) == 0:
98089954 * t = (mode.w, mode.h)
98099955 * if t not in rv: # <<<<<<<<<<<<<<
98129958 */
98139959 }
98149960
9815 /* "pygame_sdl2/display.pyx":630
9961 /* "pygame_sdl2/display.pyx":648
98169962 *
98179963 * for 0 <= i < num_modes:
98189964 * if SDL_GetDisplayMode(display, i, &mode) == 0: # <<<<<<<<<<<<<<
98229968 }
98239969 }
98249970
9825 /* "pygame_sdl2/display.pyx":635
9971 /* "pygame_sdl2/display.pyx":653
98269972 * rv.append(t)
98279973 *
98289974 * return rv # <<<<<<<<<<<<<<
98349980 __pyx_r = __pyx_v_rv;
98359981 goto __pyx_L0;
98369982
9837 /* "pygame_sdl2/display.pyx":613
9983 /* "pygame_sdl2/display.pyx":631
98389984 *
98399985 *
98409986 * def list_modes(depth=0, flags=0, display=0): # <<<<<<<<<<<<<<
985710003 return __pyx_r;
985810004 }
985910005
9860 /* "pygame_sdl2/display.pyx":638
10006 /* "pygame_sdl2/display.pyx":656
986110007 *
986210008 *
986310009 * def mode_ok(size, flags=0, depth=0): # <<<<<<<<<<<<<<
991610062 }
991710063 }
991810064 if (unlikely(kw_args > 0)) {
9919 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mode_ok") < 0)) __PYX_ERR(0, 638, __pyx_L3_error)
10065 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mode_ok") < 0)) __PYX_ERR(0, 656, __pyx_L3_error)
992010066 }
992110067 } else {
992210068 switch (PyTuple_GET_SIZE(__pyx_args)) {
993510081 }
993610082 goto __pyx_L4_argument_unpacking_done;
993710083 __pyx_L5_argtuple_error:;
9938 __Pyx_RaiseArgtupleInvalid("mode_ok", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 638, __pyx_L3_error)
10084 __Pyx_RaiseArgtupleInvalid("mode_ok", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 656, __pyx_L3_error)
993910085 __pyx_L3_error:;
994010086 __Pyx_AddTraceback("pygame_sdl2.display.mode_ok", __pyx_clineno, __pyx_lineno, __pyx_filename);
994110087 __Pyx_RefNannyFinishContext();
996110107 int __pyx_clineno = 0;
996210108 __Pyx_RefNannySetupContext("mode_ok", 0);
996310109
9964 /* "pygame_sdl2/display.pyx":643
10110 /* "pygame_sdl2/display.pyx":661
996510111 * """
996610112 *
996710113 * return tuple(size) in list_modes() # <<<<<<<<<<<<<<
996910115 * def gl_reset_attributes():
997010116 */
997110117 __Pyx_XDECREF(__pyx_r);
9972 __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 643, __pyx_L1_error)
10118 __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 661, __pyx_L1_error)
997310119 __Pyx_GOTREF(__pyx_t_1);
9974 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_list_modes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 643, __pyx_L1_error)
10120 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_list_modes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 661, __pyx_L1_error)
997510121 __Pyx_GOTREF(__pyx_t_3);
997610122 __pyx_t_4 = NULL;
997710123 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
998510131 }
998610132 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
998710133 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
9988 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 643, __pyx_L1_error)
10134 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 661, __pyx_L1_error)
998910135 __Pyx_GOTREF(__pyx_t_2);
999010136 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9991 __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 643, __pyx_L1_error)
10137 __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 661, __pyx_L1_error)
999210138 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
999310139 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9994 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 643, __pyx_L1_error)
10140 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 661, __pyx_L1_error)
999510141 __Pyx_GOTREF(__pyx_t_2);
999610142 __pyx_r = __pyx_t_2;
999710143 __pyx_t_2 = 0;
999810144 goto __pyx_L0;
999910145
10000 /* "pygame_sdl2/display.pyx":638
10146 /* "pygame_sdl2/display.pyx":656
1000110147 *
1000210148 *
1000310149 * def mode_ok(size, flags=0, depth=0): # <<<<<<<<<<<<<<
1001910165 return __pyx_r;
1002010166 }
1002110167
10022 /* "pygame_sdl2/display.pyx":645
10168 /* "pygame_sdl2/display.pyx":663
1002310169 * return tuple(size) in list_modes()
1002410170 *
1002510171 * def gl_reset_attributes(): # <<<<<<<<<<<<<<
1004610192 __Pyx_RefNannyDeclarations
1004710193 __Pyx_RefNannySetupContext("gl_reset_attributes", 0);
1004810194
10049 /* "pygame_sdl2/display.pyx":646
10195 /* "pygame_sdl2/display.pyx":664
1005010196 *
1005110197 * def gl_reset_attributes():
1005210198 * SDL_GL_ResetAttributes() # <<<<<<<<<<<<<<
1005510201 */
1005610202 SDL_GL_ResetAttributes();
1005710203
10058 /* "pygame_sdl2/display.pyx":645
10204 /* "pygame_sdl2/display.pyx":663
1005910205 * return tuple(size) in list_modes()
1006010206 *
1006110207 * def gl_reset_attributes(): # <<<<<<<<<<<<<<
1007010216 return __pyx_r;
1007110217 }
1007210218
10073 /* "pygame_sdl2/display.pyx":648
10219 /* "pygame_sdl2/display.pyx":666
1007410220 * SDL_GL_ResetAttributes()
1007510221 *
1007610222 * def gl_set_attribute(flag, value): # <<<<<<<<<<<<<<
1011310259 case 1:
1011410260 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
1011510261 else {
10116 __Pyx_RaiseArgtupleInvalid("gl_set_attribute", 1, 2, 2, 1); __PYX_ERR(0, 648, __pyx_L3_error)
10262 __Pyx_RaiseArgtupleInvalid("gl_set_attribute", 1, 2, 2, 1); __PYX_ERR(0, 666, __pyx_L3_error)
1011710263 }
1011810264 }
1011910265 if (unlikely(kw_args > 0)) {
10120 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gl_set_attribute") < 0)) __PYX_ERR(0, 648, __pyx_L3_error)
10266 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gl_set_attribute") < 0)) __PYX_ERR(0, 666, __pyx_L3_error)
1012110267 }
1012210268 } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
1012310269 goto __pyx_L5_argtuple_error;
1013010276 }
1013110277 goto __pyx_L4_argument_unpacking_done;
1013210278 __pyx_L5_argtuple_error:;
10133 __Pyx_RaiseArgtupleInvalid("gl_set_attribute", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 648, __pyx_L3_error)
10279 __Pyx_RaiseArgtupleInvalid("gl_set_attribute", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 666, __pyx_L3_error)
1013410280 __pyx_L3_error:;
1013510281 __Pyx_AddTraceback("pygame_sdl2.display.gl_set_attribute", __pyx_clineno, __pyx_lineno, __pyx_filename);
1013610282 __Pyx_RefNannyFinishContext();
1015710303 int __pyx_clineno = 0;
1015810304 __Pyx_RefNannySetupContext("gl_set_attribute", 0);
1015910305
10160 /* "pygame_sdl2/display.pyx":650
10306 /* "pygame_sdl2/display.pyx":668
1016110307 * def gl_set_attribute(flag, value):
1016210308 *
1016310309 * if flag == GL_SWAP_CONTROL: # <<<<<<<<<<<<<<
1016410310 * if ios:
1016510311 * return
1016610312 */
10167 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_GL_SWAP_CONTROL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 650, __pyx_L1_error)
10313 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_GL_SWAP_CONTROL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error)
1016810314 __Pyx_GOTREF(__pyx_t_1);
10169 __pyx_t_2 = PyObject_RichCompare(__pyx_v_flag, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 650, __pyx_L1_error)
10315 __pyx_t_2 = PyObject_RichCompare(__pyx_v_flag, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 668, __pyx_L1_error)
1017010316 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10171 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 650, __pyx_L1_error)
10317 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 668, __pyx_L1_error)
1017210318 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1017310319 if (__pyx_t_3) {
1017410320
10175 /* "pygame_sdl2/display.pyx":651
10321 /* "pygame_sdl2/display.pyx":669
1017610322 *
1017710323 * if flag == GL_SWAP_CONTROL:
1017810324 * if ios: # <<<<<<<<<<<<<<
1017910325 * return
1018010326 *
1018110327 */
10182 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ios); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 651, __pyx_L1_error)
10328 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ios); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 669, __pyx_L1_error)
1018310329 __Pyx_GOTREF(__pyx_t_2);
10184 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 651, __pyx_L1_error)
10330 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 669, __pyx_L1_error)
1018510331 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1018610332 if (__pyx_t_3) {
1018710333
10188 /* "pygame_sdl2/display.pyx":652
10334 /* "pygame_sdl2/display.pyx":670
1018910335 * if flag == GL_SWAP_CONTROL:
1019010336 * if ios:
1019110337 * return # <<<<<<<<<<<<<<
1019610342 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
1019710343 goto __pyx_L0;
1019810344
10199 /* "pygame_sdl2/display.pyx":651
10345 /* "pygame_sdl2/display.pyx":669
1020010346 *
1020110347 * if flag == GL_SWAP_CONTROL:
1020210348 * if ios: # <<<<<<<<<<<<<<
1020510351 */
1020610352 }
1020710353
10208 /* "pygame_sdl2/display.pyx":659
10354 /* "pygame_sdl2/display.pyx":677
1020910355 * # to deal with the case where the negative interval isn't
1021010356 * # supported. Then give up and carry on.
1021110357 * if SDL_GL_SetSwapInterval(value): # <<<<<<<<<<<<<<
1021210358 * SDL_GL_SetSwapInterval(-value)
1021310359 *
1021410360 */
10215 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 659, __pyx_L1_error)
10361 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 677, __pyx_L1_error)
1021610362 __pyx_t_3 = (SDL_GL_SetSwapInterval(__pyx_t_4) != 0);
1021710363 if (__pyx_t_3) {
1021810364
10219 /* "pygame_sdl2/display.pyx":660
10365 /* "pygame_sdl2/display.pyx":678
1022010366 * # supported. Then give up and carry on.
1022110367 * if SDL_GL_SetSwapInterval(value):
1022210368 * SDL_GL_SetSwapInterval(-value) # <<<<<<<<<<<<<<
1022310369 *
1022410370 * default_swap_control = value
1022510371 */
10226 __pyx_t_2 = PyNumber_Negative(__pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 660, __pyx_L1_error)
10372 __pyx_t_2 = PyNumber_Negative(__pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 678, __pyx_L1_error)
1022710373 __Pyx_GOTREF(__pyx_t_2);
10228 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 660, __pyx_L1_error)
10374 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 678, __pyx_L1_error)
1022910375 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1023010376 (void)(SDL_GL_SetSwapInterval(__pyx_t_4));
1023110377
10232 /* "pygame_sdl2/display.pyx":659
10378 /* "pygame_sdl2/display.pyx":677
1023310379 * # to deal with the case where the negative interval isn't
1023410380 * # supported. Then give up and carry on.
1023510381 * if SDL_GL_SetSwapInterval(value): # <<<<<<<<<<<<<<
1023810384 */
1023910385 }
1024010386
10241 /* "pygame_sdl2/display.pyx":662
10387 /* "pygame_sdl2/display.pyx":680
1024210388 * SDL_GL_SetSwapInterval(-value)
1024310389 *
1024410390 * default_swap_control = value # <<<<<<<<<<<<<<
1024510391 * return
1024610392 *
1024710393 */
10248 if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_swap_control, __pyx_v_value) < 0) __PYX_ERR(0, 662, __pyx_L1_error)
10249
10250 /* "pygame_sdl2/display.pyx":663
10394 if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_swap_control, __pyx_v_value) < 0) __PYX_ERR(0, 680, __pyx_L1_error)
10395
10396 /* "pygame_sdl2/display.pyx":681
1025110397 *
1025210398 * default_swap_control = value
1025310399 * return # <<<<<<<<<<<<<<
1025810404 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
1025910405 goto __pyx_L0;
1026010406
10261 /* "pygame_sdl2/display.pyx":650
10407 /* "pygame_sdl2/display.pyx":668
1026210408 * def gl_set_attribute(flag, value):
1026310409 *
1026410410 * if flag == GL_SWAP_CONTROL: # <<<<<<<<<<<<<<
1026710413 */
1026810414 }
1026910415
10270 /* "pygame_sdl2/display.pyx":665
10416 /* "pygame_sdl2/display.pyx":683
1027110417 * return
1027210418 *
1027310419 * if SDL_GL_SetAttribute(flag, value): # <<<<<<<<<<<<<<
1027410420 * raise error()
1027510421 *
1027610422 */
10277 __pyx_t_5 = ((SDL_GLattr)__Pyx_PyInt_As_SDL_GLattr(__pyx_v_flag)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 665, __pyx_L1_error)
10278 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 665, __pyx_L1_error)
10423 __pyx_t_5 = ((SDL_GLattr)__Pyx_PyInt_As_SDL_GLattr(__pyx_v_flag)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 683, __pyx_L1_error)
10424 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 683, __pyx_L1_error)
1027910425 __pyx_t_3 = (SDL_GL_SetAttribute(__pyx_t_5, __pyx_t_4) != 0);
1028010426 if (unlikely(__pyx_t_3)) {
1028110427
10282 /* "pygame_sdl2/display.pyx":666
10428 /* "pygame_sdl2/display.pyx":684
1028310429 *
1028410430 * if SDL_GL_SetAttribute(flag, value):
1028510431 * raise error() # <<<<<<<<<<<<<<
1028610432 *
1028710433 * def gl_get_attribute(flag):
1028810434 */
10289 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 666, __pyx_L1_error)
10435 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 684, __pyx_L1_error)
1029010436 __Pyx_GOTREF(__pyx_t_1);
1029110437 __pyx_t_6 = NULL;
1029210438 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
1030010446 }
1030110447 __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
1030210448 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
10303 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 666, __pyx_L1_error)
10449 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 684, __pyx_L1_error)
1030410450 __Pyx_GOTREF(__pyx_t_2);
1030510451 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1030610452 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
1030710453 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10308 __PYX_ERR(0, 666, __pyx_L1_error)
10309
10310 /* "pygame_sdl2/display.pyx":665
10454 __PYX_ERR(0, 684, __pyx_L1_error)
10455
10456 /* "pygame_sdl2/display.pyx":683
1031110457 * return
1031210458 *
1031310459 * if SDL_GL_SetAttribute(flag, value): # <<<<<<<<<<<<<<
1031610462 */
1031710463 }
1031810464
10319 /* "pygame_sdl2/display.pyx":648
10465 /* "pygame_sdl2/display.pyx":666
1032010466 * SDL_GL_ResetAttributes()
1032110467 *
1032210468 * def gl_set_attribute(flag, value): # <<<<<<<<<<<<<<
1033910485 return __pyx_r;
1034010486 }
1034110487
10342 /* "pygame_sdl2/display.pyx":668
10488 /* "pygame_sdl2/display.pyx":686
1034310489 * raise error()
1034410490 *
1034510491 * def gl_get_attribute(flag): # <<<<<<<<<<<<<<
1037510521 int __pyx_clineno = 0;
1037610522 __Pyx_RefNannySetupContext("gl_get_attribute", 0);
1037710523
10378 /* "pygame_sdl2/display.pyx":671
10524 /* "pygame_sdl2/display.pyx":689
1037910525 * cdef int rv
1038010526 *
1038110527 * if flag == GL_SWAP_CONTROL: # <<<<<<<<<<<<<<
1038210528 * return SDL_GL_GetSwapInterval()
1038310529 *
1038410530 */
10385 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_GL_SWAP_CONTROL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 671, __pyx_L1_error)
10531 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_GL_SWAP_CONTROL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 689, __pyx_L1_error)
1038610532 __Pyx_GOTREF(__pyx_t_1);
10387 __pyx_t_2 = PyObject_RichCompare(__pyx_v_flag, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 671, __pyx_L1_error)
10533 __pyx_t_2 = PyObject_RichCompare(__pyx_v_flag, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 689, __pyx_L1_error)
1038810534 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10389 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 671, __pyx_L1_error)
10535 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 689, __pyx_L1_error)
1039010536 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1039110537 if (__pyx_t_3) {
1039210538
10393 /* "pygame_sdl2/display.pyx":672
10539 /* "pygame_sdl2/display.pyx":690
1039410540 *
1039510541 * if flag == GL_SWAP_CONTROL:
1039610542 * return SDL_GL_GetSwapInterval() # <<<<<<<<<<<<<<
1039810544 * if SDL_GL_GetAttribute(flag, &rv):
1039910545 */
1040010546 __Pyx_XDECREF(__pyx_r);
10401 __pyx_t_2 = __Pyx_PyInt_From_int(SDL_GL_GetSwapInterval()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 672, __pyx_L1_error)
10547 __pyx_t_2 = __Pyx_PyInt_From_int(SDL_GL_GetSwapInterval()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 690, __pyx_L1_error)
1040210548 __Pyx_GOTREF(__pyx_t_2);
1040310549 __pyx_r = __pyx_t_2;
1040410550 __pyx_t_2 = 0;
1040510551 goto __pyx_L0;
1040610552
10407 /* "pygame_sdl2/display.pyx":671
10553 /* "pygame_sdl2/display.pyx":689
1040810554 * cdef int rv
1040910555 *
1041010556 * if flag == GL_SWAP_CONTROL: # <<<<<<<<<<<<<<
1041310559 */
1041410560 }
1041510561
10416 /* "pygame_sdl2/display.pyx":674
10562 /* "pygame_sdl2/display.pyx":692
1041710563 * return SDL_GL_GetSwapInterval()
1041810564 *
1041910565 * if SDL_GL_GetAttribute(flag, &rv): # <<<<<<<<<<<<<<
1042010566 * raise error()
1042110567 *
1042210568 */
10423 __pyx_t_4 = ((SDL_GLattr)__Pyx_PyInt_As_SDL_GLattr(__pyx_v_flag)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 674, __pyx_L1_error)
10569 __pyx_t_4 = ((SDL_GLattr)__Pyx_PyInt_As_SDL_GLattr(__pyx_v_flag)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 692, __pyx_L1_error)
1042410570 __pyx_t_3 = (SDL_GL_GetAttribute(__pyx_t_4, (&__pyx_v_rv)) != 0);
1042510571 if (unlikely(__pyx_t_3)) {
1042610572
10427 /* "pygame_sdl2/display.pyx":675
10573 /* "pygame_sdl2/display.pyx":693
1042810574 *
1042910575 * if SDL_GL_GetAttribute(flag, &rv):
1043010576 * raise error() # <<<<<<<<<<<<<<
1043110577 *
1043210578 * return rv
1043310579 */
10434 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 675, __pyx_L1_error)
10580 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 693, __pyx_L1_error)
1043510581 __Pyx_GOTREF(__pyx_t_1);
1043610582 __pyx_t_5 = NULL;
1043710583 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
1044510591 }
1044610592 __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
1044710593 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10448 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 675, __pyx_L1_error)
10594 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 693, __pyx_L1_error)
1044910595 __Pyx_GOTREF(__pyx_t_2);
1045010596 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1045110597 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
1045210598 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10453 __PYX_ERR(0, 675, __pyx_L1_error)
10454
10455 /* "pygame_sdl2/display.pyx":674
10599 __PYX_ERR(0, 693, __pyx_L1_error)
10600
10601 /* "pygame_sdl2/display.pyx":692
1045610602 * return SDL_GL_GetSwapInterval()
1045710603 *
1045810604 * if SDL_GL_GetAttribute(flag, &rv): # <<<<<<<<<<<<<<
1046110607 */
1046210608 }
1046310609
10464 /* "pygame_sdl2/display.pyx":677
10610 /* "pygame_sdl2/display.pyx":695
1046510611 * raise error()
1046610612 *
1046710613 * return rv # <<<<<<<<<<<<<<
1046910615 * def gl_load_library(path):
1047010616 */
1047110617 __Pyx_XDECREF(__pyx_r);
10472 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 677, __pyx_L1_error)
10618 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 695, __pyx_L1_error)
1047310619 __Pyx_GOTREF(__pyx_t_2);
1047410620 __pyx_r = __pyx_t_2;
1047510621 __pyx_t_2 = 0;
1047610622 goto __pyx_L0;
1047710623
10478 /* "pygame_sdl2/display.pyx":668
10624 /* "pygame_sdl2/display.pyx":686
1047910625 * raise error()
1048010626 *
1048110627 * def gl_get_attribute(flag): # <<<<<<<<<<<<<<
1049610642 return __pyx_r;
1049710643 }
1049810644
10499 /* "pygame_sdl2/display.pyx":679
10645 /* "pygame_sdl2/display.pyx":697
1050010646 * return rv
1050110647 *
1050210648 * def gl_load_library(path): # <<<<<<<<<<<<<<
1053210678 int __pyx_clineno = 0;
1053310679 __Pyx_RefNannySetupContext("gl_load_library", 0);
1053410680
10535 /* "pygame_sdl2/display.pyx":680
10681 /* "pygame_sdl2/display.pyx":698
1053610682 *
1053710683 * def gl_load_library(path):
1053810684 * if path is None: # <<<<<<<<<<<<<<
1054310689 __pyx_t_2 = (__pyx_t_1 != 0);
1054410690 if (__pyx_t_2) {
1054510691
10546 /* "pygame_sdl2/display.pyx":681
10692 /* "pygame_sdl2/display.pyx":699
1054710693 * def gl_load_library(path):
1054810694 * if path is None:
1054910695 * if SDL_GL_LoadLibrary(NULL): # <<<<<<<<<<<<<<
1055310699 __pyx_t_2 = (SDL_GL_LoadLibrary(NULL) != 0);
1055410700 if (unlikely(__pyx_t_2)) {
1055510701
10556 /* "pygame_sdl2/display.pyx":682
10702 /* "pygame_sdl2/display.pyx":700
1055710703 * if path is None:
1055810704 * if SDL_GL_LoadLibrary(NULL):
1055910705 * raise error() # <<<<<<<<<<<<<<
1056010706 * else:
1056110707 * if SDL_GL_LoadLibrary(path):
1056210708 */
10563 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 682, __pyx_L1_error)
10709 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 700, __pyx_L1_error)
1056410710 __Pyx_GOTREF(__pyx_t_4);
1056510711 __pyx_t_5 = NULL;
1056610712 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
1057410720 }
1057510721 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
1057610722 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10577 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 682, __pyx_L1_error)
10723 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 700, __pyx_L1_error)
1057810724 __Pyx_GOTREF(__pyx_t_3);
1057910725 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1058010726 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
1058110727 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10582 __PYX_ERR(0, 682, __pyx_L1_error)
10583
10584 /* "pygame_sdl2/display.pyx":681
10728 __PYX_ERR(0, 700, __pyx_L1_error)
10729
10730 /* "pygame_sdl2/display.pyx":699
1058510731 * def gl_load_library(path):
1058610732 * if path is None:
1058710733 * if SDL_GL_LoadLibrary(NULL): # <<<<<<<<<<<<<<
1059010736 */
1059110737 }
1059210738
10593 /* "pygame_sdl2/display.pyx":680
10739 /* "pygame_sdl2/display.pyx":698
1059410740 *
1059510741 * def gl_load_library(path):
1059610742 * if path is None: # <<<<<<<<<<<<<<
1060010746 goto __pyx_L3;
1060110747 }
1060210748
10603 /* "pygame_sdl2/display.pyx":684
10749 /* "pygame_sdl2/display.pyx":702
1060410750 * raise error()
1060510751 * else:
1060610752 * if SDL_GL_LoadLibrary(path): # <<<<<<<<<<<<<<
1060810754 *
1060910755 */
1061010756 /*else*/ {
10611 __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_path); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 684, __pyx_L1_error)
10757 __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_path); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 702, __pyx_L1_error)
1061210758 __pyx_t_2 = (SDL_GL_LoadLibrary(__pyx_t_6) != 0);
1061310759 if (unlikely(__pyx_t_2)) {
1061410760
10615 /* "pygame_sdl2/display.pyx":685
10761 /* "pygame_sdl2/display.pyx":703
1061610762 * else:
1061710763 * if SDL_GL_LoadLibrary(path):
1061810764 * raise error() # <<<<<<<<<<<<<<
1061910765 *
1062010766 * def gl_unload_library():
1062110767 */
10622 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 685, __pyx_L1_error)
10768 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 703, __pyx_L1_error)
1062310769 __Pyx_GOTREF(__pyx_t_4);
1062410770 __pyx_t_5 = NULL;
1062510771 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
1063310779 }
1063410780 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
1063510781 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10636 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 685, __pyx_L1_error)
10782 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 703, __pyx_L1_error)
1063710783 __Pyx_GOTREF(__pyx_t_3);
1063810784 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1063910785 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
1064010786 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10641 __PYX_ERR(0, 685, __pyx_L1_error)
10642
10643 /* "pygame_sdl2/display.pyx":684
10787 __PYX_ERR(0, 703, __pyx_L1_error)
10788
10789 /* "pygame_sdl2/display.pyx":702
1064410790 * raise error()
1064510791 * else:
1064610792 * if SDL_GL_LoadLibrary(path): # <<<<<<<<<<<<<<
1065110797 }
1065210798 __pyx_L3:;
1065310799
10654 /* "pygame_sdl2/display.pyx":679
10800 /* "pygame_sdl2/display.pyx":697
1065510801 * return rv
1065610802 *
1065710803 * def gl_load_library(path): # <<<<<<<<<<<<<<
1067410820 return __pyx_r;
1067510821 }
1067610822
10677 /* "pygame_sdl2/display.pyx":687
10823 /* "pygame_sdl2/display.pyx":705
1067810824 * raise error()
1067910825 *
1068010826 * def gl_unload_library(): # <<<<<<<<<<<<<<
1070110847 __Pyx_RefNannyDeclarations
1070210848 __Pyx_RefNannySetupContext("gl_unload_library", 0);
1070310849
10704 /* "pygame_sdl2/display.pyx":688
10850 /* "pygame_sdl2/display.pyx":706
1070510851 *
1070610852 * def gl_unload_library():
1070710853 * SDL_GL_UnloadLibrary() # <<<<<<<<<<<<<<
1071010856 */
1071110857 SDL_GL_UnloadLibrary();
1071210858
10713 /* "pygame_sdl2/display.pyx":687
10859 /* "pygame_sdl2/display.pyx":705
1071410860 * raise error()
1071510861 *
1071610862 * def gl_unload_library(): # <<<<<<<<<<<<<<
1072510871 return __pyx_r;
1072610872 }
1072710873
10728 /* "pygame_sdl2/display.pyx":690
10874 /* "pygame_sdl2/display.pyx":708
1072910875 * SDL_GL_UnloadLibrary()
1073010876 *
1073110877 * def get_active(): # <<<<<<<<<<<<<<
1075910905 int __pyx_clineno = 0;
1076010906 __Pyx_RefNannySetupContext("get_active", 0);
1076110907
10762 /* "pygame_sdl2/display.pyx":691
10908 /* "pygame_sdl2/display.pyx":709
1076310909 *
1076410910 * def get_active():
1076510911 * if main_window: # <<<<<<<<<<<<<<
1076610912 * return main_window.get_active()
1076710913 * return False
1076810914 */
10769 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 691, __pyx_L1_error)
10915 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 709, __pyx_L1_error)
1077010916 if (__pyx_t_1) {
1077110917
10772 /* "pygame_sdl2/display.pyx":692
10918 /* "pygame_sdl2/display.pyx":710
1077310919 * def get_active():
1077410920 * if main_window:
1077510921 * return main_window.get_active() # <<<<<<<<<<<<<<
1077710923 *
1077810924 */
1077910925 __Pyx_XDECREF(__pyx_r);
10780 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_get_active); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 692, __pyx_L1_error)
10926 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_get_active); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 710, __pyx_L1_error)
1078110927 __Pyx_GOTREF(__pyx_t_3);
1078210928 __pyx_t_4 = NULL;
1078310929 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
1079110937 }
1079210938 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
1079310939 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
10794 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __pyx_L1_error)
10940 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 710, __pyx_L1_error)
1079510941 __Pyx_GOTREF(__pyx_t_2);
1079610942 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1079710943 __pyx_r = __pyx_t_2;
1079810944 __pyx_t_2 = 0;
1079910945 goto __pyx_L0;
1080010946
10801 /* "pygame_sdl2/display.pyx":691
10947 /* "pygame_sdl2/display.pyx":709
1080210948 *
1080310949 * def get_active():
1080410950 * if main_window: # <<<<<<<<<<<<<<
1080710953 */
1080810954 }
1080910955
10810 /* "pygame_sdl2/display.pyx":693
10956 /* "pygame_sdl2/display.pyx":711
1081110957 * if main_window:
1081210958 * return main_window.get_active()
1081310959 * return False # <<<<<<<<<<<<<<
1081910965 __pyx_r = Py_False;
1082010966 goto __pyx_L0;
1082110967
10822 /* "pygame_sdl2/display.pyx":690
10968 /* "pygame_sdl2/display.pyx":708
1082310969 * SDL_GL_UnloadLibrary()
1082410970 *
1082510971 * def get_active(): # <<<<<<<<<<<<<<
1084010986 return __pyx_r;
1084110987 }
1084210988
10843 /* "pygame_sdl2/display.pyx":695
10989 /* "pygame_sdl2/display.pyx":713
1084410990 * return False
1084510991 *
1084610992 * def iconify(): # <<<<<<<<<<<<<<
1087411020 int __pyx_clineno = 0;
1087511021 __Pyx_RefNannySetupContext("iconify", 0);
1087611022
10877 /* "pygame_sdl2/display.pyx":696
11023 /* "pygame_sdl2/display.pyx":714
1087811024 *
1087911025 * def iconify():
1088011026 * if main_window: # <<<<<<<<<<<<<<
1088111027 * return main_window.iconify()
1088211028 *
1088311029 */
10884 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 696, __pyx_L1_error)
11030 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 714, __pyx_L1_error)
1088511031 if (__pyx_t_1) {
1088611032
10887 /* "pygame_sdl2/display.pyx":697
11033 /* "pygame_sdl2/display.pyx":715
1088811034 * def iconify():
1088911035 * if main_window:
1089011036 * return main_window.iconify() # <<<<<<<<<<<<<<
1089211038 * return False
1089311039 */
1089411040 __Pyx_XDECREF(__pyx_r);
10895 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_iconify); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 697, __pyx_L1_error)
11041 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_iconify); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 715, __pyx_L1_error)
1089611042 __Pyx_GOTREF(__pyx_t_3);
1089711043 __pyx_t_4 = NULL;
1089811044 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
1090611052 }
1090711053 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
1090811054 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
10909 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 697, __pyx_L1_error)
11055 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 715, __pyx_L1_error)
1091011056 __Pyx_GOTREF(__pyx_t_2);
1091111057 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1091211058 __pyx_r = __pyx_t_2;
1091311059 __pyx_t_2 = 0;
1091411060 goto __pyx_L0;
1091511061
10916 /* "pygame_sdl2/display.pyx":696
11062 /* "pygame_sdl2/display.pyx":714
1091711063 *
1091811064 * def iconify():
1091911065 * if main_window: # <<<<<<<<<<<<<<
1092211068 */
1092311069 }
1092411070
10925 /* "pygame_sdl2/display.pyx":699
11071 /* "pygame_sdl2/display.pyx":717
1092611072 * return main_window.iconify()
1092711073 *
1092811074 * return False # <<<<<<<<<<<<<<
1093411080 __pyx_r = Py_False;
1093511081 goto __pyx_L0;
1093611082
10937 /* "pygame_sdl2/display.pyx":695
11083 /* "pygame_sdl2/display.pyx":713
1093811084 * return False
1093911085 *
1094011086 * def iconify(): # <<<<<<<<<<<<<<
1095511101 return __pyx_r;
1095611102 }
1095711103
10958 /* "pygame_sdl2/display.pyx":701
11104 /* "pygame_sdl2/display.pyx":719
1095911105 * return False
1096011106 *
1096111107 * def toggle_fullscreen(): # <<<<<<<<<<<<<<
1098911135 int __pyx_clineno = 0;
1099011136 __Pyx_RefNannySetupContext("toggle_fullscreen", 0);
1099111137
10992 /* "pygame_sdl2/display.pyx":702
11138 /* "pygame_sdl2/display.pyx":720
1099311139 *
1099411140 * def toggle_fullscreen():
1099511141 * if main_window: # <<<<<<<<<<<<<<
1099611142 * return main_window.toggle_fullscreen()
1099711143 *
1099811144 */
10999 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 702, __pyx_L1_error)
11145 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 720, __pyx_L1_error)
1100011146 if (__pyx_t_1) {
1100111147
11002 /* "pygame_sdl2/display.pyx":703
11148 /* "pygame_sdl2/display.pyx":721
1100311149 * def toggle_fullscreen():
1100411150 * if main_window:
1100511151 * return main_window.toggle_fullscreen() # <<<<<<<<<<<<<<
1100711153 * return True
1100811154 */
1100911155 __Pyx_XDECREF(__pyx_r);
11010 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_toggle_fullscreen); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 703, __pyx_L1_error)
11156 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_toggle_fullscreen); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 721, __pyx_L1_error)
1101111157 __Pyx_GOTREF(__pyx_t_3);
1101211158 __pyx_t_4 = NULL;
1101311159 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
1102111167 }
1102211168 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
1102311169 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11024 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 703, __pyx_L1_error)
11170 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 721, __pyx_L1_error)
1102511171 __Pyx_GOTREF(__pyx_t_2);
1102611172 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1102711173 __pyx_r = __pyx_t_2;
1102811174 __pyx_t_2 = 0;
1102911175 goto __pyx_L0;
1103011176
11031 /* "pygame_sdl2/display.pyx":702
11177 /* "pygame_sdl2/display.pyx":720
1103211178 *
1103311179 * def toggle_fullscreen():
1103411180 * if main_window: # <<<<<<<<<<<<<<
1103711183 */
1103811184 }
1103911185
11040 /* "pygame_sdl2/display.pyx":705
11186 /* "pygame_sdl2/display.pyx":723
1104111187 * return main_window.toggle_fullscreen()
1104211188 *
1104311189 * return True # <<<<<<<<<<<<<<
1104911195 __pyx_r = Py_True;
1105011196 goto __pyx_L0;
1105111197
11052 /* "pygame_sdl2/display.pyx":701
11198 /* "pygame_sdl2/display.pyx":719
1105311199 * return False
1105411200 *
1105511201 * def toggle_fullscreen(): # <<<<<<<<<<<<<<
1107011216 return __pyx_r;
1107111217 }
1107211218
11073 /* "pygame_sdl2/display.pyx":707
11219 /* "pygame_sdl2/display.pyx":725
1107411220 * return True
1107511221 *
1107611222 * def set_gamma(red, green=None, blue=None): # <<<<<<<<<<<<<<
1112811274 }
1112911275 }
1113011276 if (unlikely(kw_args > 0)) {
11131 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_gamma") < 0)) __PYX_ERR(0, 707, __pyx_L3_error)
11277 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_gamma") < 0)) __PYX_ERR(0, 725, __pyx_L3_error)
1113211278 }
1113311279 } else {
1113411280 switch (PyTuple_GET_SIZE(__pyx_args)) {
1114711293 }
1114811294 goto __pyx_L4_argument_unpacking_done;
1114911295 __pyx_L5_argtuple_error:;
11150 __Pyx_RaiseArgtupleInvalid("set_gamma", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 707, __pyx_L3_error)
11296 __Pyx_RaiseArgtupleInvalid("set_gamma", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 725, __pyx_L3_error)
1115111297 __pyx_L3_error:;
1115211298 __Pyx_AddTraceback("pygame_sdl2.display.set_gamma", __pyx_clineno, __pyx_lineno, __pyx_filename);
1115311299 __Pyx_RefNannyFinishContext();
1117411320 int __pyx_clineno = 0;
1117511321 __Pyx_RefNannySetupContext("set_gamma", 0);
1117611322
11177 /* "pygame_sdl2/display.pyx":708
11323 /* "pygame_sdl2/display.pyx":726
1117811324 *
1117911325 * def set_gamma(red, green=None, blue=None):
1118011326 * if main_window: # <<<<<<<<<<<<<<
1118111327 * return main_window.set_gamma(red, green, blue)
1118211328 * return False
1118311329 */
11184 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 708, __pyx_L1_error)
11330 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 726, __pyx_L1_error)
1118511331 if (__pyx_t_1) {
1118611332
11187 /* "pygame_sdl2/display.pyx":709
11333 /* "pygame_sdl2/display.pyx":727
1118811334 * def set_gamma(red, green=None, blue=None):
1118911335 * if main_window:
1119011336 * return main_window.set_gamma(red, green, blue) # <<<<<<<<<<<<<<
1119211338 *
1119311339 */
1119411340 __Pyx_XDECREF(__pyx_r);
11195 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_set_gamma); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 709, __pyx_L1_error)
11341 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_set_gamma); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 727, __pyx_L1_error)
1119611342 __Pyx_GOTREF(__pyx_t_3);
1119711343 __pyx_t_4 = NULL;
1119811344 __pyx_t_5 = 0;
1120911355 #if CYTHON_FAST_PYCALL
1121011356 if (PyFunction_Check(__pyx_t_3)) {
1121111357 PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_red, __pyx_v_green, __pyx_v_blue};
11212 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 709, __pyx_L1_error)
11358 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 727, __pyx_L1_error)
1121311359 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
1121411360 __Pyx_GOTREF(__pyx_t_2);
1121511361 } else
1121711363 #if CYTHON_FAST_PYCCALL
1121811364 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
1121911365 PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_red, __pyx_v_green, __pyx_v_blue};
11220 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 709, __pyx_L1_error)
11366 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 727, __pyx_L1_error)
1122111367 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
1122211368 __Pyx_GOTREF(__pyx_t_2);
1122311369 } else
1122411370 #endif
1122511371 {
11226 __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 709, __pyx_L1_error)
11372 __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 727, __pyx_L1_error)
1122711373 __Pyx_GOTREF(__pyx_t_6);
1122811374 if (__pyx_t_4) {
1122911375 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
1123711383 __Pyx_INCREF(__pyx_v_blue);
1123811384 __Pyx_GIVEREF(__pyx_v_blue);
1123911385 PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_blue);
11240 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 709, __pyx_L1_error)
11386 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 727, __pyx_L1_error)
1124111387 __Pyx_GOTREF(__pyx_t_2);
1124211388 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
1124311389 }
1124611392 __pyx_t_2 = 0;
1124711393 goto __pyx_L0;
1124811394
11249 /* "pygame_sdl2/display.pyx":708
11395 /* "pygame_sdl2/display.pyx":726
1125011396 *
1125111397 * def set_gamma(red, green=None, blue=None):
1125211398 * if main_window: # <<<<<<<<<<<<<<
1125511401 */
1125611402 }
1125711403
11258 /* "pygame_sdl2/display.pyx":710
11404 /* "pygame_sdl2/display.pyx":728
1125911405 * if main_window:
1126011406 * return main_window.set_gamma(red, green, blue)
1126111407 * return False # <<<<<<<<<<<<<<
1126711413 __pyx_r = Py_False;
1126811414 goto __pyx_L0;
1126911415
11270 /* "pygame_sdl2/display.pyx":707
11416 /* "pygame_sdl2/display.pyx":725
1127111417 * return True
1127211418 *
1127311419 * def set_gamma(red, green=None, blue=None): # <<<<<<<<<<<<<<
1128911435 return __pyx_r;
1129011436 }
1129111437
11292 /* "pygame_sdl2/display.pyx":712
11438 /* "pygame_sdl2/display.pyx":730
1129311439 * return False
1129411440 *
1129511441 * def set_gamma_ramp(red, green, blue): # <<<<<<<<<<<<<<
1133511481 case 1:
1133611482 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_green)) != 0)) kw_args--;
1133711483 else {
11338 __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, 1); __PYX_ERR(0, 712, __pyx_L3_error)
11484 __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, 1); __PYX_ERR(0, 730, __pyx_L3_error)
1133911485 }
1134011486 CYTHON_FALLTHROUGH;
1134111487 case 2:
1134211488 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_blue)) != 0)) kw_args--;
1134311489 else {
11344 __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, 2); __PYX_ERR(0, 712, __pyx_L3_error)
11490 __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, 2); __PYX_ERR(0, 730, __pyx_L3_error)
1134511491 }
1134611492 }
1134711493 if (unlikely(kw_args > 0)) {
11348 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_gamma_ramp") < 0)) __PYX_ERR(0, 712, __pyx_L3_error)
11494 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_gamma_ramp") < 0)) __PYX_ERR(0, 730, __pyx_L3_error)
1134911495 }
1135011496 } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
1135111497 goto __pyx_L5_argtuple_error;
1136011506 }
1136111507 goto __pyx_L4_argument_unpacking_done;
1136211508 __pyx_L5_argtuple_error:;
11363 __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 712, __pyx_L3_error)
11509 __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 730, __pyx_L3_error)
1136411510 __pyx_L3_error:;
1136511511 __Pyx_AddTraceback("pygame_sdl2.display.set_gamma_ramp", __pyx_clineno, __pyx_lineno, __pyx_filename);
1136611512 __Pyx_RefNannyFinishContext();
1138711533 int __pyx_clineno = 0;
1138811534 __Pyx_RefNannySetupContext("set_gamma_ramp", 0);
1138911535
11390 /* "pygame_sdl2/display.pyx":713
11536 /* "pygame_sdl2/display.pyx":731
1139111537 *
1139211538 * def set_gamma_ramp(red, green, blue):
1139311539 * if main_window: # <<<<<<<<<<<<<<
1139411540 * return main_window.set_gamma_ramp(red, green, blue)
1139511541 * return False
1139611542 */
11397 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 713, __pyx_L1_error)
11543 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 731, __pyx_L1_error)
1139811544 if (__pyx_t_1) {
1139911545
11400 /* "pygame_sdl2/display.pyx":714
11546 /* "pygame_sdl2/display.pyx":732
1140111547 * def set_gamma_ramp(red, green, blue):
1140211548 * if main_window:
1140311549 * return main_window.set_gamma_ramp(red, green, blue) # <<<<<<<<<<<<<<
1140511551 *
1140611552 */
1140711553 __Pyx_XDECREF(__pyx_r);
11408 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_set_gamma_ramp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 714, __pyx_L1_error)
11554 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_set_gamma_ramp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 732, __pyx_L1_error)
1140911555 __Pyx_GOTREF(__pyx_t_3);
1141011556 __pyx_t_4 = NULL;
1141111557 __pyx_t_5 = 0;
1142211568 #if CYTHON_FAST_PYCALL
1142311569 if (PyFunction_Check(__pyx_t_3)) {
1142411570 PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_red, __pyx_v_green, __pyx_v_blue};
11425 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 714, __pyx_L1_error)
11571 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 732, __pyx_L1_error)
1142611572 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
1142711573 __Pyx_GOTREF(__pyx_t_2);
1142811574 } else
1143011576 #if CYTHON_FAST_PYCCALL
1143111577 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
1143211578 PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_red, __pyx_v_green, __pyx_v_blue};
11433 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 714, __pyx_L1_error)
11579 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 732, __pyx_L1_error)
1143411580 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
1143511581 __Pyx_GOTREF(__pyx_t_2);
1143611582 } else
1143711583 #endif
1143811584 {
11439 __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 714, __pyx_L1_error)
11585 __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 732, __pyx_L1_error)
1144011586 __Pyx_GOTREF(__pyx_t_6);
1144111587 if (__pyx_t_4) {
1144211588 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
1145011596 __Pyx_INCREF(__pyx_v_blue);
1145111597 __Pyx_GIVEREF(__pyx_v_blue);
1145211598 PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_blue);
11453 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 714, __pyx_L1_error)
11599 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 732, __pyx_L1_error)
1145411600 __Pyx_GOTREF(__pyx_t_2);
1145511601 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
1145611602 }
1145911605 __pyx_t_2 = 0;
1146011606 goto __pyx_L0;
1146111607
11462 /* "pygame_sdl2/display.pyx":713
11608 /* "pygame_sdl2/display.pyx":731
1146311609 *
1146411610 * def set_gamma_ramp(red, green, blue):
1146511611 * if main_window: # <<<<<<<<<<<<<<
1146811614 */
1146911615 }
1147011616
11471 /* "pygame_sdl2/display.pyx":715
11617 /* "pygame_sdl2/display.pyx":733
1147211618 * if main_window:
1147311619 * return main_window.set_gamma_ramp(red, green, blue)
1147411620 * return False # <<<<<<<<<<<<<<
1148011626 __pyx_r = Py_False;
1148111627 goto __pyx_L0;
1148211628
11483 /* "pygame_sdl2/display.pyx":712
11629 /* "pygame_sdl2/display.pyx":730
1148411630 * return False
1148511631 *
1148611632 * def set_gamma_ramp(red, green, blue): # <<<<<<<<<<<<<<
1150211648 return __pyx_r;
1150311649 }
1150411650
11505 /* "pygame_sdl2/display.pyx":717
11651 /* "pygame_sdl2/display.pyx":735
1150611652 * return False
1150711653 *
1150811654 * def set_icon(surface): # <<<<<<<<<<<<<<
1153811684 int __pyx_clineno = 0;
1153911685 __Pyx_RefNannySetupContext("set_icon", 0);
1154011686
11541 /* "pygame_sdl2/display.pyx":720
11687 /* "pygame_sdl2/display.pyx":738
1154211688 * global default_icon
1154311689 *
1154411690 * default_icon = surface.copy() # <<<<<<<<<<<<<<
1154511691 *
1154611692 * if main_window is not None:
1154711693 */
11548 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_surface, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 720, __pyx_L1_error)
11694 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_surface, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 738, __pyx_L1_error)
1154911695 __Pyx_GOTREF(__pyx_t_2);
1155011696 __pyx_t_3 = NULL;
1155111697 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
1155911705 }
1156011706 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
1156111707 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11562 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 720, __pyx_L1_error)
11708 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 738, __pyx_L1_error)
1156311709 __Pyx_GOTREF(__pyx_t_1);
1156411710 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11565 if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_icon, __pyx_t_1) < 0) __PYX_ERR(0, 720, __pyx_L1_error)
11711 if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_icon, __pyx_t_1) < 0) __PYX_ERR(0, 738, __pyx_L1_error)
1156611712 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1156711713
11568 /* "pygame_sdl2/display.pyx":722
11714 /* "pygame_sdl2/display.pyx":740
1156911715 * default_icon = surface.copy()
1157011716 *
1157111717 * if main_window is not None: # <<<<<<<<<<<<<<
1157611722 __pyx_t_5 = (__pyx_t_4 != 0);
1157711723 if (__pyx_t_5) {
1157811724
11579 /* "pygame_sdl2/display.pyx":723
11725 /* "pygame_sdl2/display.pyx":741
1158011726 *
1158111727 * if main_window is not None:
1158211728 * main_window.set_icon(default_icon) # <<<<<<<<<<<<<<
1158311729 *
1158411730 * def set_caption(title, icontitle = None):
1158511731 */
11586 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_set_icon); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 723, __pyx_L1_error)
11732 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_set_icon); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 741, __pyx_L1_error)
1158711733 __Pyx_GOTREF(__pyx_t_2);
11588 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_default_icon); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 723, __pyx_L1_error)
11734 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_default_icon); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 741, __pyx_L1_error)
1158911735 __Pyx_GOTREF(__pyx_t_3);
1159011736 __pyx_t_6 = NULL;
1159111737 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
1160011746 __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
1160111747 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
1160211748 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11603 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 723, __pyx_L1_error)
11749 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 741, __pyx_L1_error)
1160411750 __Pyx_GOTREF(__pyx_t_1);
1160511751 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1160611752 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1160711753
11608 /* "pygame_sdl2/display.pyx":722
11754 /* "pygame_sdl2/display.pyx":740
1160911755 * default_icon = surface.copy()
1161011756 *
1161111757 * if main_window is not None: # <<<<<<<<<<<<<<
1161411760 */
1161511761 }
1161611762
11617 /* "pygame_sdl2/display.pyx":717
11763 /* "pygame_sdl2/display.pyx":735
1161811764 * return False
1161911765 *
1162011766 * def set_icon(surface): # <<<<<<<<<<<<<<
1163811784 return __pyx_r;
1163911785 }
1164011786
11641 /* "pygame_sdl2/display.pyx":725
11787 /* "pygame_sdl2/display.pyx":743
1164211788 * main_window.set_icon(default_icon)
1164311789 *
1164411790 * def set_caption(title, icontitle = None): # <<<<<<<<<<<<<<
1168611832 }
1168711833 }
1168811834 if (unlikely(kw_args > 0)) {
11689 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_caption") < 0)) __PYX_ERR(0, 725, __pyx_L3_error)
11835 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_caption") < 0)) __PYX_ERR(0, 743, __pyx_L3_error)
1169011836 }
1169111837 } else {
1169211838 switch (PyTuple_GET_SIZE(__pyx_args)) {
1170211848 }
1170311849 goto __pyx_L4_argument_unpacking_done;
1170411850 __pyx_L5_argtuple_error:;
11705 __Pyx_RaiseArgtupleInvalid("set_caption", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 725, __pyx_L3_error)
11851 __Pyx_RaiseArgtupleInvalid("set_caption", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 743, __pyx_L3_error)
1170611852 __pyx_L3_error:;
1170711853 __Pyx_AddTraceback("pygame_sdl2.display.set_caption", __pyx_clineno, __pyx_lineno, __pyx_filename);
1170811854 __Pyx_RefNannyFinishContext();
1172811874 int __pyx_clineno = 0;
1172911875 __Pyx_RefNannySetupContext("set_caption", 0);
1173011876
11731 /* "pygame_sdl2/display.pyx":728
11877 /* "pygame_sdl2/display.pyx":746
1173211878 * global default_title
1173311879 *
1173411880 * default_title = title # <<<<<<<<<<<<<<
1173511881 *
1173611882 * if main_window:
1173711883 */
11738 if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_title, __pyx_v_title) < 0) __PYX_ERR(0, 728, __pyx_L1_error)
11739
11740 /* "pygame_sdl2/display.pyx":730
11884 if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_title, __pyx_v_title) < 0) __PYX_ERR(0, 746, __pyx_L1_error)
11885
11886 /* "pygame_sdl2/display.pyx":748
1174111887 * default_title = title
1174211888 *
1174311889 * if main_window: # <<<<<<<<<<<<<<
1174411890 * main_window.set_caption(default_title)
1174511891 *
1174611892 */
11747 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 730, __pyx_L1_error)
11893 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 748, __pyx_L1_error)
1174811894 if (__pyx_t_1) {
1174911895
11750 /* "pygame_sdl2/display.pyx":731
11896 /* "pygame_sdl2/display.pyx":749
1175111897 *
1175211898 * if main_window:
1175311899 * main_window.set_caption(default_title) # <<<<<<<<<<<<<<
1175411900 *
1175511901 * def get_caption():
1175611902 */
11757 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_set_caption); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 731, __pyx_L1_error)
11903 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_set_caption); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 749, __pyx_L1_error)
1175811904 __Pyx_GOTREF(__pyx_t_3);
11759 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_default_title); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 731, __pyx_L1_error)
11905 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_default_title); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 749, __pyx_L1_error)
1176011906 __Pyx_GOTREF(__pyx_t_4);
1176111907 __pyx_t_5 = NULL;
1176211908 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
1177111917 __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
1177211918 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
1177311919 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11774 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 731, __pyx_L1_error)
11920 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 749, __pyx_L1_error)
1177511921 __Pyx_GOTREF(__pyx_t_2);
1177611922 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1177711923 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1177811924
11779 /* "pygame_sdl2/display.pyx":730
11925 /* "pygame_sdl2/display.pyx":748
1178011926 * default_title = title
1178111927 *
1178211928 * if main_window: # <<<<<<<<<<<<<<
1178511931 */
1178611932 }
1178711933
11788 /* "pygame_sdl2/display.pyx":725
11934 /* "pygame_sdl2/display.pyx":743
1178911935 * main_window.set_icon(default_icon)
1179011936 *
1179111937 * def set_caption(title, icontitle = None): # <<<<<<<<<<<<<<
1180911955 return __pyx_r;
1181011956 }
1181111957
11812 /* "pygame_sdl2/display.pyx":733
11958 /* "pygame_sdl2/display.pyx":751
1181311959 * main_window.set_caption(default_title)
1181411960 *
1181511961 * def get_caption(): # <<<<<<<<<<<<<<
1184011986 int __pyx_clineno = 0;
1184111987 __Pyx_RefNannySetupContext("get_caption", 0);
1184211988
11843 /* "pygame_sdl2/display.pyx":734
11989 /* "pygame_sdl2/display.pyx":752
1184411990 *
1184511991 * def get_caption():
1184611992 * return default_title # <<<<<<<<<<<<<<
1184811994 * def get_drawable_size():
1184911995 */
1185011996 __Pyx_XDECREF(__pyx_r);
11851 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_default_title); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 734, __pyx_L1_error)
11997 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_default_title); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 752, __pyx_L1_error)
1185211998 __Pyx_GOTREF(__pyx_t_1);
1185311999 __pyx_r = __pyx_t_1;
1185412000 __pyx_t_1 = 0;
1185512001 goto __pyx_L0;
1185612002
11857 /* "pygame_sdl2/display.pyx":733
12003 /* "pygame_sdl2/display.pyx":751
1185812004 * main_window.set_caption(default_title)
1185912005 *
1186012006 * def get_caption(): # <<<<<<<<<<<<<<
1187312019 return __pyx_r;
1187412020 }
1187512021
11876 /* "pygame_sdl2/display.pyx":736
12022 /* "pygame_sdl2/display.pyx":754
1187712023 * return default_title
1187812024 *
1187912025 * def get_drawable_size(): # <<<<<<<<<<<<<<
1190712053 int __pyx_clineno = 0;
1190812054 __Pyx_RefNannySetupContext("get_drawable_size", 0);
1190912055
11910 /* "pygame_sdl2/display.pyx":737
12056 /* "pygame_sdl2/display.pyx":755
1191112057 *
1191212058 * def get_drawable_size():
1191312059 * if main_window: # <<<<<<<<<<<<<<
1191412060 * return main_window.get_drawable_size()
1191512061 * return None
1191612062 */
11917 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 737, __pyx_L1_error)
12063 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 755, __pyx_L1_error)
1191812064 if (__pyx_t_1) {
1191912065
11920 /* "pygame_sdl2/display.pyx":738
12066 /* "pygame_sdl2/display.pyx":756
1192112067 * def get_drawable_size():
1192212068 * if main_window:
1192312069 * return main_window.get_drawable_size() # <<<<<<<<<<<<<<
1192512071 *
1192612072 */
1192712073 __Pyx_XDECREF(__pyx_r);
11928 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_get_drawable_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 738, __pyx_L1_error)
12074 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_get_drawable_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 756, __pyx_L1_error)
1192912075 __Pyx_GOTREF(__pyx_t_3);
1193012076 __pyx_t_4 = NULL;
1193112077 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
1193912085 }
1194012086 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
1194112087 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11942 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 738, __pyx_L1_error)
12088 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 756, __pyx_L1_error)
1194312089 __Pyx_GOTREF(__pyx_t_2);
1194412090 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1194512091 __pyx_r = __pyx_t_2;
1194612092 __pyx_t_2 = 0;
1194712093 goto __pyx_L0;
1194812094
11949 /* "pygame_sdl2/display.pyx":737
12095 /* "pygame_sdl2/display.pyx":755
1195012096 *
1195112097 * def get_drawable_size():
1195212098 * if main_window: # <<<<<<<<<<<<<<
1195512101 */
1195612102 }
1195712103
11958 /* "pygame_sdl2/display.pyx":739
12104 /* "pygame_sdl2/display.pyx":757
1195912105 * if main_window:
1196012106 * return main_window.get_drawable_size()
1196112107 * return None # <<<<<<<<<<<<<<
1196612112 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
1196712113 goto __pyx_L0;
1196812114
11969 /* "pygame_sdl2/display.pyx":736
12115 /* "pygame_sdl2/display.pyx":754
1197012116 * return default_title
1197112117 *
1197212118 * def get_drawable_size(): # <<<<<<<<<<<<<<
1198712133 return __pyx_r;
1198812134 }
1198912135
11990 /* "pygame_sdl2/display.pyx":741
12136 /* "pygame_sdl2/display.pyx":759
1199112137 * return None
1199212138 *
1199312139 * def get_size(): # <<<<<<<<<<<<<<
1202112167 int __pyx_clineno = 0;
1202212168 __Pyx_RefNannySetupContext("get_size", 0);
1202312169
12024 /* "pygame_sdl2/display.pyx":742
12170 /* "pygame_sdl2/display.pyx":760
1202512171 *
1202612172 * def get_size():
1202712173 * if main_window: # <<<<<<<<<<<<<<
1202812174 * return main_window.get_size()
1202912175 * return None
1203012176 */
12031 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 742, __pyx_L1_error)
12177 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 760, __pyx_L1_error)
1203212178 if (__pyx_t_1) {
1203312179
12034 /* "pygame_sdl2/display.pyx":743
12180 /* "pygame_sdl2/display.pyx":761
1203512181 * def get_size():
1203612182 * if main_window:
1203712183 * return main_window.get_size() # <<<<<<<<<<<<<<
1203912185 *
1204012186 */
1204112187 __Pyx_XDECREF(__pyx_r);
12042 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_get_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 743, __pyx_L1_error)
12188 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_get_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 761, __pyx_L1_error)
1204312189 __Pyx_GOTREF(__pyx_t_3);
1204412190 __pyx_t_4 = NULL;
1204512191 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
1205312199 }
1205412200 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
1205512201 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
12056 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 743, __pyx_L1_error)
12202 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 761, __pyx_L1_error)
1205712203 __Pyx_GOTREF(__pyx_t_2);
1205812204 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1205912205 __pyx_r = __pyx_t_2;
1206012206 __pyx_t_2 = 0;
1206112207 goto __pyx_L0;
1206212208
12063 /* "pygame_sdl2/display.pyx":742
12209 /* "pygame_sdl2/display.pyx":760
1206412210 *
1206512211 * def get_size():
1206612212 * if main_window: # <<<<<<<<<<<<<<
1206912215 */
1207012216 }
1207112217
12072 /* "pygame_sdl2/display.pyx":744
12218 /* "pygame_sdl2/display.pyx":762
1207312219 * if main_window:
1207412220 * return main_window.get_size()
1207512221 * return None # <<<<<<<<<<<<<<
1208012226 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
1208112227 goto __pyx_L0;
1208212228
12083 /* "pygame_sdl2/display.pyx":741
12229 /* "pygame_sdl2/display.pyx":759
1208412230 * return None
1208512231 *
1208612232 * def get_size(): # <<<<<<<<<<<<<<
1210112247 return __pyx_r;
1210212248 }
1210312249
12104 /* "pygame_sdl2/display.pyx":746
12250 /* "pygame_sdl2/display.pyx":764
1210512251 * return None
1210612252 *
1210712253 * def get_num_video_displays(): # <<<<<<<<<<<<<<
1213612282 int __pyx_clineno = 0;
1213712283 __Pyx_RefNannySetupContext("get_num_video_displays", 0);
1213812284
12139 /* "pygame_sdl2/display.pyx":747
12285 /* "pygame_sdl2/display.pyx":765
1214012286 *
1214112287 * def get_num_video_displays():
1214212288 * rv = SDL_GetNumVideoDisplays() # <<<<<<<<<<<<<<
1214512291 */
1214612292 __pyx_v_rv = SDL_GetNumVideoDisplays();
1214712293
12148 /* "pygame_sdl2/display.pyx":748
12294 /* "pygame_sdl2/display.pyx":766
1214912295 * def get_num_video_displays():
1215012296 * rv = SDL_GetNumVideoDisplays()
1215112297 * if rv < 0: # <<<<<<<<<<<<<<
1215512301 __pyx_t_1 = ((__pyx_v_rv < 0) != 0);
1215612302 if (unlikely(__pyx_t_1)) {
1215712303
12158 /* "pygame_sdl2/display.pyx":749
12304 /* "pygame_sdl2/display.pyx":767
1215912305 * rv = SDL_GetNumVideoDisplays()
1216012306 * if rv < 0:
1216112307 * raise error() # <<<<<<<<<<<<<<
1216212308 *
1216312309 * return rv
1216412310 */
12165 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 749, __pyx_L1_error)
12311 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 767, __pyx_L1_error)
1216612312 __Pyx_GOTREF(__pyx_t_3);
1216712313 __pyx_t_4 = NULL;
1216812314 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
1217612322 }
1217712323 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
1217812324 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
12179 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 749, __pyx_L1_error)
12325 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 767, __pyx_L1_error)
1218012326 __Pyx_GOTREF(__pyx_t_2);
1218112327 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1218212328 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
1218312329 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12184 __PYX_ERR(0, 749, __pyx_L1_error)
12185
12186 /* "pygame_sdl2/display.pyx":748
12330 __PYX_ERR(0, 767, __pyx_L1_error)
12331
12332 /* "pygame_sdl2/display.pyx":766
1218712333 * def get_num_video_displays():
1218812334 * rv = SDL_GetNumVideoDisplays()
1218912335 * if rv < 0: # <<<<<<<<<<<<<<
1219212338 */
1219312339 }
1219412340
12195 /* "pygame_sdl2/display.pyx":751
12341 /* "pygame_sdl2/display.pyx":769
1219612342 * raise error()
1219712343 *
1219812344 * return rv # <<<<<<<<<<<<<<
1220012346 * def get_display_bounds(index):
1220112347 */
1220212348 __Pyx_XDECREF(__pyx_r);
12203 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 751, __pyx_L1_error)
12349 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 769, __pyx_L1_error)
1220412350 __Pyx_GOTREF(__pyx_t_2);
1220512351 __pyx_r = __pyx_t_2;
1220612352 __pyx_t_2 = 0;
1220712353 goto __pyx_L0;
1220812354
12209 /* "pygame_sdl2/display.pyx":746
12355 /* "pygame_sdl2/display.pyx":764
1221012356 * return None
1221112357 *
1221212358 * def get_num_video_displays(): # <<<<<<<<<<<<<<
1222712373 return __pyx_r;
1222812374 }
1222912375
12230 /* "pygame_sdl2/display.pyx":753
12376 /* "pygame_sdl2/display.pyx":771
1223112377 * return rv
1223212378 *
1223312379 * def get_display_bounds(index): # <<<<<<<<<<<<<<
1226512411 int __pyx_clineno = 0;
1226612412 __Pyx_RefNannySetupContext("get_display_bounds", 0);
1226712413
12268 /* "pygame_sdl2/display.pyx":755
12414 /* "pygame_sdl2/display.pyx":773
1226912415 * def get_display_bounds(index):
1227012416 * cdef SDL_Rect rect
1227112417 * rv = SDL_GetDisplayBounds(index, &rect) # <<<<<<<<<<<<<<
1227212418 *
1227312419 * return (rect.x, rect.y, rect.w, rect.h)
1227412420 */
12275 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_index); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 755, __pyx_L1_error)
12421 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_index); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 773, __pyx_L1_error)
1227612422 __pyx_v_rv = SDL_GetDisplayBounds(__pyx_t_1, (&__pyx_v_rect));
1227712423
12278 /* "pygame_sdl2/display.pyx":757
12424 /* "pygame_sdl2/display.pyx":775
1227912425 * rv = SDL_GetDisplayBounds(index, &rect)
1228012426 *
1228112427 * return (rect.x, rect.y, rect.w, rect.h) # <<<<<<<<<<<<<<
1228312429 * def set_screensaver(state):
1228412430 */
1228512431 __Pyx_XDECREF(__pyx_r);
12286 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rect.x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 757, __pyx_L1_error)
12432 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rect.x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 775, __pyx_L1_error)
1228712433 __Pyx_GOTREF(__pyx_t_2);
12288 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rect.y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 757, __pyx_L1_error)
12434 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rect.y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 775, __pyx_L1_error)
1228912435 __Pyx_GOTREF(__pyx_t_3);
12290 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_rect.w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 757, __pyx_L1_error)
12436 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_rect.w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 775, __pyx_L1_error)
1229112437 __Pyx_GOTREF(__pyx_t_4);
12292 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_rect.h); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 757, __pyx_L1_error)
12438 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_rect.h); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 775, __pyx_L1_error)
1229312439 __Pyx_GOTREF(__pyx_t_5);
12294 __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 757, __pyx_L1_error)
12440 __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 775, __pyx_L1_error)
1229512441 __Pyx_GOTREF(__pyx_t_6);
1229612442 __Pyx_GIVEREF(__pyx_t_2);
1229712443 PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
1230912455 __pyx_t_6 = 0;
1231012456 goto __pyx_L0;
1231112457
12312 /* "pygame_sdl2/display.pyx":753
12458 /* "pygame_sdl2/display.pyx":771
1231312459 * return rv
1231412460 *
1231512461 * def get_display_bounds(index): # <<<<<<<<<<<<<<
1233212478 return __pyx_r;
1233312479 }
1233412480
12335 /* "pygame_sdl2/display.pyx":759
12481 /* "pygame_sdl2/display.pyx":777
1233612482 * return (rect.x, rect.y, rect.w, rect.h)
1233712483 *
1233812484 * def set_screensaver(state): # <<<<<<<<<<<<<<
1236412510 int __pyx_clineno = 0;
1236512511 __Pyx_RefNannySetupContext("set_screensaver", 0);
1236612512
12367 /* "pygame_sdl2/display.pyx":764
12513 /* "pygame_sdl2/display.pyx":782
1236812514 * """
1236912515 *
1237012516 * if state: # <<<<<<<<<<<<<<
1237112517 * SDL_EnableScreenSaver()
1237212518 * else:
1237312519 */
12374 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_state); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 764, __pyx_L1_error)
12520 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_state); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 782, __pyx_L1_error)
1237512521 if (__pyx_t_1) {
1237612522
12377 /* "pygame_sdl2/display.pyx":765
12523 /* "pygame_sdl2/display.pyx":783
1237812524 *
1237912525 * if state:
1238012526 * SDL_EnableScreenSaver() # <<<<<<<<<<<<<<
1238312529 */
1238412530 SDL_EnableScreenSaver();
1238512531
12386 /* "pygame_sdl2/display.pyx":764
12532 /* "pygame_sdl2/display.pyx":782
1238712533 * """
1238812534 *
1238912535 * if state: # <<<<<<<<<<<<<<
1239312539 goto __pyx_L3;
1239412540 }
1239512541
12396 /* "pygame_sdl2/display.pyx":767
12542 /* "pygame_sdl2/display.pyx":785
1239712543 * SDL_EnableScreenSaver()
1239812544 * else:
1239912545 * SDL_DisableScreenSaver() # <<<<<<<<<<<<<<
1240512551 }
1240612552 __pyx_L3:;
1240712553
12408 /* "pygame_sdl2/display.pyx":759
12554 /* "pygame_sdl2/display.pyx":777
1240912555 * return (rect.x, rect.y, rect.w, rect.h)
1241012556 *
1241112557 * def set_screensaver(state): # <<<<<<<<<<<<<<
1242512571 return __pyx_r;
1242612572 }
1242712573
12428 /* "pygame_sdl2/display.pyx":769
12574 /* "pygame_sdl2/display.pyx":787
1242912575 * SDL_DisableScreenSaver()
1243012576 *
1243112577 * def get_platform(): # <<<<<<<<<<<<<<
1245612602 int __pyx_clineno = 0;
1245712603 __Pyx_RefNannySetupContext("get_platform", 0);
1245812604
12459 /* "pygame_sdl2/display.pyx":770
12605 /* "pygame_sdl2/display.pyx":788
1246012606 *
1246112607 * def get_platform():
1246212608 * return SDL_GetPlatform() # <<<<<<<<<<<<<<
1246412610 * cdef api SDL_Window *PyWindow_AsWindow(window):
1246512611 */
1246612612 __Pyx_XDECREF(__pyx_r);
12467 __pyx_t_1 = __Pyx_PyBytes_FromString(SDL_GetPlatform()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 770, __pyx_L1_error)
12613 __pyx_t_1 = __Pyx_PyBytes_FromString(SDL_GetPlatform()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 788, __pyx_L1_error)
1246812614 __Pyx_GOTREF(__pyx_t_1);
1246912615 __pyx_r = __pyx_t_1;
1247012616 __pyx_t_1 = 0;
1247112617 goto __pyx_L0;
1247212618
12473 /* "pygame_sdl2/display.pyx":769
12619 /* "pygame_sdl2/display.pyx":787
1247412620 * SDL_DisableScreenSaver()
1247512621 *
1247612622 * def get_platform(): # <<<<<<<<<<<<<<
1248912635 return __pyx_r;
1249012636 }
1249112637
12492 /* "pygame_sdl2/display.pyx":772
12638 /* "pygame_sdl2/display.pyx":790
1249312639 * return SDL_GetPlatform()
1249412640 *
1249512641 * cdef api SDL_Window *PyWindow_AsWindow(window): # <<<<<<<<<<<<<<
1250512651 __Pyx_RefNannySetupContext("PyWindow_AsWindow", 0);
1250612652 __Pyx_INCREF(__pyx_v_window);
1250712653
12508 /* "pygame_sdl2/display.pyx":779
12654 /* "pygame_sdl2/display.pyx":797
1250912655 * """
1251012656 *
1251112657 * if window is None: # <<<<<<<<<<<<<<
1251612662 __pyx_t_2 = (__pyx_t_1 != 0);
1251712663 if (__pyx_t_2) {
1251812664
12519 /* "pygame_sdl2/display.pyx":780
12665 /* "pygame_sdl2/display.pyx":798
1252012666 *
1252112667 * if window is None:
1252212668 * window = main_window # <<<<<<<<<<<<<<
1252612672 __Pyx_INCREF(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window));
1252712673 __Pyx_DECREF_SET(__pyx_v_window, ((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window));
1252812674
12529 /* "pygame_sdl2/display.pyx":779
12675 /* "pygame_sdl2/display.pyx":797
1253012676 * """
1253112677 *
1253212678 * if window is None: # <<<<<<<<<<<<<<
1253512681 */
1253612682 }
1253712683
12538 /* "pygame_sdl2/display.pyx":782
12684 /* "pygame_sdl2/display.pyx":800
1253912685 * window = main_window
1254012686 *
1254112687 * if window is None: # <<<<<<<<<<<<<<
1254612692 __pyx_t_1 = (__pyx_t_2 != 0);
1254712693 if (__pyx_t_1) {
1254812694
12549 /* "pygame_sdl2/display.pyx":783
12695 /* "pygame_sdl2/display.pyx":801
1255012696 *
1255112697 * if window is None:
1255212698 * return NULL # <<<<<<<<<<<<<<
1255612702 __pyx_r = NULL;
1255712703 goto __pyx_L0;
1255812704
12559 /* "pygame_sdl2/display.pyx":782
12705 /* "pygame_sdl2/display.pyx":800
1256012706 * window = main_window
1256112707 *
1256212708 * if window is None: # <<<<<<<<<<<<<<
1256512711 */
1256612712 }
1256712713
12568 /* "pygame_sdl2/display.pyx":785
12714 /* "pygame_sdl2/display.pyx":803
1256912715 * return NULL
1257012716 *
1257112717 * return (<Window> window).window # <<<<<<<<<<<<<<
1257312719 __pyx_r = ((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_window)->window;
1257412720 goto __pyx_L0;
1257512721
12576 /* "pygame_sdl2/display.pyx":772
12722 /* "pygame_sdl2/display.pyx":790
1257712723 * return SDL_GetPlatform()
1257812724 *
1257912725 * cdef api SDL_Window *PyWindow_AsWindow(window): # <<<<<<<<<<<<<<
1266912815 {"restore", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_41restore, METH_NOARGS, 0},
1267012816 {"maximize", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_43maximize, METH_NOARGS, 0},
1267112817 {"minimize", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_45minimize, METH_NOARGS, 0},
12672 {"__reduce_cython__", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_47__reduce_cython__, METH_NOARGS, 0},
12673 {"__setstate_cython__", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_49__setstate_cython__, METH_O, 0},
12818 {"get_sdl_window_pointer", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_47get_sdl_window_pointer, METH_NOARGS, __pyx_doc_11pygame_sdl2_7display_6Window_46get_sdl_window_pointer},
12819 {"__reduce_cython__", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_49__reduce_cython__, METH_NOARGS, 0},
12820 {"__setstate_cython__", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_51__setstate_cython__, METH_O, 0},
1267412821 {0, 0, 0, 0}
1267512822 };
1267612823
1281212959 {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
1281312960 {&__pyx_n_s_Window, __pyx_k_Window, sizeof(__pyx_k_Window), 0, 0, 1, 1},
1281412961 {&__pyx_n_s_androidembed, __pyx_k_androidembed, sizeof(__pyx_k_androidembed), 0, 0, 1, 1},
12815 {&__pyx_n_s_before_first_window, __pyx_k_before_first_window, sizeof(__pyx_k_before_first_window), 0, 0, 1, 1},
1281612962 {&__pyx_n_s_bitsize, __pyx_k_bitsize, sizeof(__pyx_k_bitsize), 0, 0, 1, 1},
1281712963 {&__pyx_n_s_blit_hw, __pyx_k_blit_hw, sizeof(__pyx_k_blit_hw), 0, 0, 1, 1},
1281812964 {&__pyx_n_s_blit_hw_A, __pyx_k_blit_hw_A, sizeof(__pyx_k_blit_hw_A), 0, 0, 1, 1},
1282212968 {&__pyx_n_s_blit_sw_CC, __pyx_k_blit_sw_CC, sizeof(__pyx_k_blit_sw_CC), 0, 0, 1, 1},
1282312969 {&__pyx_n_s_blue, __pyx_k_blue, sizeof(__pyx_k_blue), 0, 0, 1, 1},
1282412970 {&__pyx_n_s_bytesize, __pyx_k_bytesize, sizeof(__pyx_k_bytesize), 0, 0, 1, 1},
12971 {&__pyx_n_s_c_void_p, __pyx_k_c_void_p, sizeof(__pyx_k_c_void_p), 0, 0, 1, 1},
1282512972 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
12826 {&__pyx_n_s_close_window, __pyx_k_close_window, sizeof(__pyx_k_close_window), 0, 0, 1, 1},
1282712973 {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
1282812974 {&__pyx_n_s_create_surface, __pyx_k_create_surface, sizeof(__pyx_k_create_surface), 0, 0, 1, 1},
12975 {&__pyx_n_s_ctypes, __pyx_k_ctypes, sizeof(__pyx_k_ctypes), 0, 0, 1, 1},
1282912976 {&__pyx_n_s_current_h, __pyx_k_current_h, sizeof(__pyx_k_current_h), 0, 0, 1, 1},
1283012977 {&__pyx_n_s_current_w, __pyx_k_current_w, sizeof(__pyx_k_current_w), 0, 0, 1, 1},
1283112978 {&__pyx_n_s_default, __pyx_k_default, sizeof(__pyx_k_default), 0, 0, 1, 1},
1293613083 {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
1293713084 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
1293813085 {&__pyx_n_s_shifts, __pyx_k_shifts, sizeof(__pyx_k_shifts), 0, 0, 1, 1},
12939 {&__pyx_n_s_shown_first_window, __pyx_k_shown_first_window, sizeof(__pyx_k_shown_first_window), 0, 0, 1, 1},
1294013086 {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
1294113087 {&__pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_k_src_pygame_sdl2_display_pyx, sizeof(__pyx_k_src_pygame_sdl2_display_pyx), 0, 0, 1, 0},
1294213088 {&__pyx_n_s_startswith, __pyx_k_startswith, sizeof(__pyx_k_startswith), 0, 0, 1, 1},
1295513101 {0, 0, 0, 0, 0, 0, 0}
1295613102 };
1295713103 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
12958 __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 528, __pyx_L1_error)
12959 __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(0, 139, __pyx_L1_error)
12960 __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 361, __pyx_L1_error)
12961 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 425, __pyx_L1_error)
13104 __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(0, 125, __pyx_L1_error)
13105 __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 546, __pyx_L1_error)
13106 __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 362, __pyx_L1_error)
13107 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 426, __pyx_L1_error)
1296213108 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
1296313109 return 0;
1296413110 __pyx_L1_error:;
1298013126 __Pyx_GOTREF(__pyx_tuple_);
1298113127 __Pyx_GIVEREF(__pyx_tuple_);
1298213128
12983 /* "pygame_sdl2/display.pyx":145
13129 /* "pygame_sdl2/display.pyx":130
1298413130 *
1298513131 * cdef class Window:
1298613132 * def __init__(self, title, resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): # <<<<<<<<<<<<<<
1298713133 *
1298813134 * if not isinstance(title, bytes):
1298913135 */
12990 __pyx_tuple__2 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 145, __pyx_L1_error)
13136 __pyx_tuple__2 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 130, __pyx_L1_error)
1299113137 __Pyx_GOTREF(__pyx_tuple__2);
1299213138 __Pyx_GIVEREF(__pyx_tuple__2);
1299313139
12994 /* "pygame_sdl2/display.pyx":156
13140 /* "pygame_sdl2/display.pyx":139
1299513141 * # If we do not get the AVOID_GL hint, we always create a GL-compatible
1299613142 * # window. This lets us change the OPENGL flag later on.
1299713143 * if int(_get_hint("PYGAME_SDL2_AVOID_GL", "0")): # <<<<<<<<<<<<<<
1299813144 * gl_flag = 0
1299913145 * else:
1300013146 */
13001 __pyx_tuple__4 = PyTuple_Pack(2, __pyx_n_s_PYGAME_SDL2_AVOID_GL, __pyx_kp_s_0); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 156, __pyx_L1_error)
13147 __pyx_tuple__4 = PyTuple_Pack(2, __pyx_n_s_PYGAME_SDL2_AVOID_GL, __pyx_kp_s_0); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 139, __pyx_L1_error)
1300213148 __Pyx_GOTREF(__pyx_tuple__4);
1300313149 __Pyx_GIVEREF(__pyx_tuple__4);
1300413150
13005 /* "pygame_sdl2/display.pyx":218
13151 /* "pygame_sdl2/display.pyx":219
1300613152 * if self.window_surface.format.BitsPerPixel == 32:
1300713153 *
1300813154 * self.surface = Surface(()) # <<<<<<<<<<<<<<
1300913155 * self.surface.surface = self.window_surface
1301013156 * self.surface.owns_surface = False
1301113157 */
13012 __pyx_tuple__5 = PyTuple_Pack(1, __pyx_empty_tuple); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 218, __pyx_L1_error)
13158 __pyx_tuple__5 = PyTuple_Pack(1, __pyx_empty_tuple); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 219, __pyx_L1_error)
1301313159 __Pyx_GOTREF(__pyx_tuple__5);
1301413160 __Pyx_GIVEREF(__pyx_tuple__5);
1301513161
13016 /* "pygame_sdl2/display.pyx":361
13162 /* "pygame_sdl2/display.pyx":362
1301713163 * rects = <SDL_Rect *> calloc(len(rectangles), sizeof(SDL_Rect))
1301813164 * if rects == NULL:
1301913165 * raise MemoryError("Couldn't allocate rectangles.") # <<<<<<<<<<<<<<
1302013166 *
1302113167 * try:
1302213168 */
13023 __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_Couldn_t_allocate_rectangles); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 361, __pyx_L1_error)
13169 __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_Couldn_t_allocate_rectangles); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 362, __pyx_L1_error)
1302413170 __Pyx_GOTREF(__pyx_tuple__6);
1302513171 __Pyx_GIVEREF(__pyx_tuple__6);
1302613172
1310313249 */
1310413250 __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_init, 116, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 116, __pyx_L1_error)
1310513251
13106 /* "pygame_sdl2/display.pyx":126
13107 * _shown_first_window = False
13108 *
13109 * def _before_first_window(): # <<<<<<<<<<<<<<
13110 * global _shown_first_window
13111 *
13112 */
13113 __pyx_tuple__18 = PyTuple_Pack(1, __pyx_n_s_androidembed); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 126, __pyx_L1_error)
13252 /* "pygame_sdl2/display.pyx":488
13253 * default_swap_control = 1
13254 *
13255 * def set_mode(resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): # <<<<<<<<<<<<<<
13256 * global main_window
13257 *
13258 */
13259 __pyx_tuple__18 = PyTuple_Pack(5, __pyx_n_s_resolution, __pyx_n_s_flags, __pyx_n_s_depth, __pyx_n_s_pos, __pyx_n_s_RESIZE_FLAGS); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 488, __pyx_L1_error)
1311413260 __Pyx_GOTREF(__pyx_tuple__18);
1311513261 __Pyx_GIVEREF(__pyx_tuple__18);
13116 __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_before_first_window, 126, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 126, __pyx_L1_error)
13117
13118 /* "pygame_sdl2/display.pyx":477
13119 * default_swap_control = 1
13120 *
13121 * def set_mode(resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): # <<<<<<<<<<<<<<
13262 __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_mode, 488, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 488, __pyx_L1_error)
13263
13264 /* "pygame_sdl2/display.pyx":509
13265 * return main_window.surface
13266 *
13267 * def destroy(): # <<<<<<<<<<<<<<
1312213268 * global main_window
1312313269 *
1312413270 */
13125 __pyx_tuple__20 = PyTuple_Pack(5, __pyx_n_s_resolution, __pyx_n_s_flags, __pyx_n_s_depth, __pyx_n_s_pos, __pyx_n_s_RESIZE_FLAGS); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 477, __pyx_L1_error)
13126 __Pyx_GOTREF(__pyx_tuple__20);
13127 __Pyx_GIVEREF(__pyx_tuple__20);
13128 __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_mode, 477, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 477, __pyx_L1_error)
13129
13130 /* "pygame_sdl2/display.pyx":498
13131 * return main_window.surface
13271 __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_destroy, 509, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 509, __pyx_L1_error)
13272
13273 /* "pygame_sdl2/display.pyx":516
13274 * main_window = None
1313213275 *
1313313276 * def get_surface(): # <<<<<<<<<<<<<<
1313413277 * if main_window is None:
1313513278 * return None
1313613279 */
13137 __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_surface, 498, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 498, __pyx_L1_error)
13138
13139 /* "pygame_sdl2/display.pyx":504
13280 __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_surface, 516, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 516, __pyx_L1_error)
13281
13282 /* "pygame_sdl2/display.pyx":522
1314013283 * return main_window.get_surface()
1314113284 *
1314213285 * def get_window(): # <<<<<<<<<<<<<<
1314313286 * """
1314413287 * Returns the Window created by set_mode, or None if no such window
1314513288 */
13146 __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_window, 504, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 504, __pyx_L1_error)
13147
13148 /* "pygame_sdl2/display.pyx":512
13289 __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_window, 522, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 522, __pyx_L1_error)
13290
13291 /* "pygame_sdl2/display.pyx":530
1314913292 * return main_window
1315013293 *
1315113294 * def flip(): # <<<<<<<<<<<<<<
1315213295 * if main_window:
1315313296 * main_window.flip()
1315413297 */
13155 __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_flip, 512, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 512, __pyx_L1_error)
13156
13157 /* "pygame_sdl2/display.pyx":516
13298 __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_flip, 530, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 530, __pyx_L1_error)
13299
13300 /* "pygame_sdl2/display.pyx":534
1315813301 * main_window.flip()
1315913302 *
1316013303 * def update(rectangles=None): # <<<<<<<<<<<<<<
1316113304 * if main_window:
1316213305 * main_window.update(rectangles)
1316313306 */
13164 __pyx_tuple__25 = PyTuple_Pack(1, __pyx_n_s_rectangles); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 516, __pyx_L1_error)
13165 __Pyx_GOTREF(__pyx_tuple__25);
13166 __Pyx_GIVEREF(__pyx_tuple__25);
13167 __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_update, 516, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 516, __pyx_L1_error)
13168
13169 /* "pygame_sdl2/display.pyx":520
13307 __pyx_tuple__24 = PyTuple_Pack(1, __pyx_n_s_rectangles); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 534, __pyx_L1_error)
13308 __Pyx_GOTREF(__pyx_tuple__24);
13309 __Pyx_GIVEREF(__pyx_tuple__24);
13310 __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_update, 534, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 534, __pyx_L1_error)
13311
13312 /* "pygame_sdl2/display.pyx":538
1317013313 * main_window.update(rectangles)
1317113314 *
1317213315 * def get_driver(): # <<<<<<<<<<<<<<
1317313316 * cdef const char *driver = SDL_GetCurrentVideoDriver()
1317413317 *
1317513318 */
13176 __pyx_tuple__27 = PyTuple_Pack(1, __pyx_n_s_driver); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 520, __pyx_L1_error)
13177 __Pyx_GOTREF(__pyx_tuple__27);
13178 __Pyx_GIVEREF(__pyx_tuple__27);
13179 __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_driver, 520, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 520, __pyx_L1_error)
13180
13181 /* "pygame_sdl2/display.pyx":528
13319 __pyx_tuple__26 = PyTuple_Pack(1, __pyx_n_s_driver); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 538, __pyx_L1_error)
13320 __Pyx_GOTREF(__pyx_tuple__26);
13321 __Pyx_GIVEREF(__pyx_tuple__26);
13322 __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_driver, 538, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 538, __pyx_L1_error)
13323
13324 /* "pygame_sdl2/display.pyx":546
1318213325 * return driver
1318313326 *
1318413327 * class Info(object): # <<<<<<<<<<<<<<
1318513328 *
1318613329 * def __init__(self):
1318713330 */
13188 __pyx_tuple__29 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 528, __pyx_L1_error)
13189 __Pyx_GOTREF(__pyx_tuple__29);
13190 __Pyx_GIVEREF(__pyx_tuple__29);
13191
13192 /* "pygame_sdl2/display.pyx":530
13331 __pyx_tuple__28 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 546, __pyx_L1_error)
13332 __Pyx_GOTREF(__pyx_tuple__28);
13333 __Pyx_GIVEREF(__pyx_tuple__28);
13334
13335 /* "pygame_sdl2/display.pyx":548
1319313336 * class Info(object):
1319413337 *
1319513338 * def __init__(self): # <<<<<<<<<<<<<<
1319613339 * cdef SDL_DisplayMode dm
1319713340 * cdef SDL_PixelFormat *format
1319813341 */
13199 __pyx_tuple__30 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_dm, __pyx_n_s_format); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 530, __pyx_L1_error)
13200 __Pyx_GOTREF(__pyx_tuple__30);
13201 __Pyx_GIVEREF(__pyx_tuple__30);
13202 __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_init_2, 530, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 530, __pyx_L1_error)
13203
13204 /* "pygame_sdl2/display.pyx":589
13342 __pyx_tuple__29 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_dm, __pyx_n_s_format); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 548, __pyx_L1_error)
13343 __Pyx_GOTREF(__pyx_tuple__29);
13344 __Pyx_GIVEREF(__pyx_tuple__29);
13345 __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_init_2, 548, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 548, __pyx_L1_error)
13346
13347 /* "pygame_sdl2/display.pyx":607
1320513348 * self.blit_sw_A = False
1320613349 *
1320713350 * def __repr__(self): # <<<<<<<<<<<<<<
1320813351 * return "<Info({!r})>".format(self.__dict__)
1320913352 *
1321013353 */
13211 __pyx_tuple__32 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 589, __pyx_L1_error)
13212 __Pyx_GOTREF(__pyx_tuple__32);
13213 __Pyx_GIVEREF(__pyx_tuple__32);
13214 __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_repr, 589, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 589, __pyx_L1_error)
13215
13216 /* "pygame_sdl2/display.pyx":593
13354 __pyx_tuple__31 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 607, __pyx_L1_error)
13355 __Pyx_GOTREF(__pyx_tuple__31);
13356 __Pyx_GIVEREF(__pyx_tuple__31);
13357 __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_repr, 607, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 607, __pyx_L1_error)
13358
13359 /* "pygame_sdl2/display.pyx":611
1321713360 *
1321813361 *
1321913362 * def get_wm_info(): # <<<<<<<<<<<<<<
1322013363 * if main_window:
1322113364 * return main_window.get_wm_info()
1322213365 */
13223 __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_wm_info, 593, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 593, __pyx_L1_error)
13224
13225 /* "pygame_sdl2/display.pyx":600
13366 __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_wm_info, 611, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 611, __pyx_L1_error)
13367
13368 /* "pygame_sdl2/display.pyx":618
1322613369 *
1322713370 *
1322813371 * def get_num_video_displays(): # <<<<<<<<<<<<<<
1322913372 * """
1323013373 * Returns the number of video displays connected to the system.
1323113374 */
13232 __pyx_tuple__35 = PyTuple_Pack(1, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 600, __pyx_L1_error)
13233 __Pyx_GOTREF(__pyx_tuple__35);
13234 __Pyx_GIVEREF(__pyx_tuple__35);
13235 __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_num_video_displays, 600, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 600, __pyx_L1_error)
13236
13237 /* "pygame_sdl2/display.pyx":613
13375 __pyx_tuple__34 = PyTuple_Pack(1, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 618, __pyx_L1_error)
13376 __Pyx_GOTREF(__pyx_tuple__34);
13377 __Pyx_GIVEREF(__pyx_tuple__34);
13378 __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_num_video_displays, 618, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 618, __pyx_L1_error)
13379
13380 /* "pygame_sdl2/display.pyx":631
1323813381 *
1323913382 *
1324013383 * def list_modes(depth=0, flags=0, display=0): # <<<<<<<<<<<<<<
1324113384 * """
1324213385 * Returns a list of possible display modes for the display `display`.
1324313386 */
13244 __pyx_tuple__37 = PyTuple_Pack(8, __pyx_n_s_depth, __pyx_n_s_flags, __pyx_n_s_display, __pyx_n_s_num_modes, __pyx_n_s_i, __pyx_n_s_mode, __pyx_n_s_rv, __pyx_n_s_t); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 613, __pyx_L1_error)
13245 __Pyx_GOTREF(__pyx_tuple__37);
13246 __Pyx_GIVEREF(__pyx_tuple__37);
13247 __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_list_modes, 613, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 613, __pyx_L1_error)
13248
13249 /* "pygame_sdl2/display.pyx":638
13387 __pyx_tuple__36 = PyTuple_Pack(8, __pyx_n_s_depth, __pyx_n_s_flags, __pyx_n_s_display, __pyx_n_s_num_modes, __pyx_n_s_i, __pyx_n_s_mode, __pyx_n_s_rv, __pyx_n_s_t); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 631, __pyx_L1_error)
13388 __Pyx_GOTREF(__pyx_tuple__36);
13389 __Pyx_GIVEREF(__pyx_tuple__36);
13390 __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_list_modes, 631, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 631, __pyx_L1_error)
13391
13392 /* "pygame_sdl2/display.pyx":656
1325013393 *
1325113394 *
1325213395 * def mode_ok(size, flags=0, depth=0): # <<<<<<<<<<<<<<
1325313396 * """
1325413397 * Returns true if size is in the result of list_modes().
1325513398 */
13256 __pyx_tuple__39 = PyTuple_Pack(3, __pyx_n_s_size, __pyx_n_s_flags, __pyx_n_s_depth); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 638, __pyx_L1_error)
13257 __Pyx_GOTREF(__pyx_tuple__39);
13258 __Pyx_GIVEREF(__pyx_tuple__39);
13259 __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_mode_ok, 638, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 638, __pyx_L1_error)
13260
13261 /* "pygame_sdl2/display.pyx":645
13399 __pyx_tuple__38 = PyTuple_Pack(3, __pyx_n_s_size, __pyx_n_s_flags, __pyx_n_s_depth); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 656, __pyx_L1_error)
13400 __Pyx_GOTREF(__pyx_tuple__38);
13401 __Pyx_GIVEREF(__pyx_tuple__38);
13402 __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_mode_ok, 656, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 656, __pyx_L1_error)
13403
13404 /* "pygame_sdl2/display.pyx":663
1326213405 * return tuple(size) in list_modes()
1326313406 *
1326413407 * def gl_reset_attributes(): # <<<<<<<<<<<<<<
1326513408 * SDL_GL_ResetAttributes()
1326613409 *
1326713410 */
13268 __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_gl_reset_attributes, 645, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 645, __pyx_L1_error)
13269
13270 /* "pygame_sdl2/display.pyx":648
13411 __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_gl_reset_attributes, 663, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 663, __pyx_L1_error)
13412
13413 /* "pygame_sdl2/display.pyx":666
1327113414 * SDL_GL_ResetAttributes()
1327213415 *
1327313416 * def gl_set_attribute(flag, value): # <<<<<<<<<<<<<<
1327413417 *
1327513418 * if flag == GL_SWAP_CONTROL:
1327613419 */
13277 __pyx_tuple__42 = PyTuple_Pack(2, __pyx_n_s_flag, __pyx_n_s_value); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 648, __pyx_L1_error)
13278 __Pyx_GOTREF(__pyx_tuple__42);
13279 __Pyx_GIVEREF(__pyx_tuple__42);
13280 __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_gl_set_attribute, 648, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 648, __pyx_L1_error)
13281
13282 /* "pygame_sdl2/display.pyx":668
13420 __pyx_tuple__41 = PyTuple_Pack(2, __pyx_n_s_flag, __pyx_n_s_value); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 666, __pyx_L1_error)
13421 __Pyx_GOTREF(__pyx_tuple__41);
13422 __Pyx_GIVEREF(__pyx_tuple__41);
13423 __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_gl_set_attribute, 666, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 666, __pyx_L1_error)
13424
13425 /* "pygame_sdl2/display.pyx":686
1328313426 * raise error()
1328413427 *
1328513428 * def gl_get_attribute(flag): # <<<<<<<<<<<<<<
1328613429 * cdef int rv
1328713430 *
1328813431 */
13289 __pyx_tuple__44 = PyTuple_Pack(2, __pyx_n_s_flag, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 668, __pyx_L1_error)
13290 __Pyx_GOTREF(__pyx_tuple__44);
13291 __Pyx_GIVEREF(__pyx_tuple__44);
13292 __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_gl_get_attribute, 668, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(0, 668, __pyx_L1_error)
13293
13294 /* "pygame_sdl2/display.pyx":679
13432 __pyx_tuple__43 = PyTuple_Pack(2, __pyx_n_s_flag, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 686, __pyx_L1_error)
13433 __Pyx_GOTREF(__pyx_tuple__43);
13434 __Pyx_GIVEREF(__pyx_tuple__43);
13435 __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_gl_get_attribute, 686, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 686, __pyx_L1_error)
13436
13437 /* "pygame_sdl2/display.pyx":697
1329513438 * return rv
1329613439 *
1329713440 * def gl_load_library(path): # <<<<<<<<<<<<<<
1329813441 * if path is None:
1329913442 * if SDL_GL_LoadLibrary(NULL):
1330013443 */
13301 __pyx_tuple__46 = PyTuple_Pack(1, __pyx_n_s_path); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 679, __pyx_L1_error)
13302 __Pyx_GOTREF(__pyx_tuple__46);
13303 __Pyx_GIVEREF(__pyx_tuple__46);
13304 __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_gl_load_library, 679, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 679, __pyx_L1_error)
13305
13306 /* "pygame_sdl2/display.pyx":687
13444 __pyx_tuple__45 = PyTuple_Pack(1, __pyx_n_s_path); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 697, __pyx_L1_error)
13445 __Pyx_GOTREF(__pyx_tuple__45);
13446 __Pyx_GIVEREF(__pyx_tuple__45);
13447 __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_gl_load_library, 697, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 697, __pyx_L1_error)
13448
13449 /* "pygame_sdl2/display.pyx":705
1330713450 * raise error()
1330813451 *
1330913452 * def gl_unload_library(): # <<<<<<<<<<<<<<
1331013453 * SDL_GL_UnloadLibrary()
1331113454 *
1331213455 */
13313 __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_gl_unload_library, 687, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 687, __pyx_L1_error)
13314
13315 /* "pygame_sdl2/display.pyx":690
13456 __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_gl_unload_library, 705, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 705, __pyx_L1_error)
13457
13458 /* "pygame_sdl2/display.pyx":708
1331613459 * SDL_GL_UnloadLibrary()
1331713460 *
1331813461 * def get_active(): # <<<<<<<<<<<<<<
1331913462 * if main_window:
1332013463 * return main_window.get_active()
1332113464 */
13322 __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_active, 690, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 690, __pyx_L1_error)
13323
13324 /* "pygame_sdl2/display.pyx":695
13465 __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_active, 708, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 708, __pyx_L1_error)
13466
13467 /* "pygame_sdl2/display.pyx":713
1332513468 * return False
1332613469 *
1332713470 * def iconify(): # <<<<<<<<<<<<<<
1332813471 * if main_window:
1332913472 * return main_window.iconify()
1333013473 */
13331 __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_iconify, 695, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 695, __pyx_L1_error)
13332
13333 /* "pygame_sdl2/display.pyx":701
13474 __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_iconify, 713, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 713, __pyx_L1_error)
13475
13476 /* "pygame_sdl2/display.pyx":719
1333413477 * return False
1333513478 *
1333613479 * def toggle_fullscreen(): # <<<<<<<<<<<<<<
1333713480 * if main_window:
1333813481 * return main_window.toggle_fullscreen()
1333913482 */
13340 __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_toggle_fullscreen, 701, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 701, __pyx_L1_error)
13341
13342 /* "pygame_sdl2/display.pyx":707
13483 __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_toggle_fullscreen, 719, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 719, __pyx_L1_error)
13484
13485 /* "pygame_sdl2/display.pyx":725
1334313486 * return True
1334413487 *
1334513488 * def set_gamma(red, green=None, blue=None): # <<<<<<<<<<<<<<
1334613489 * if main_window:
1334713490 * return main_window.set_gamma(red, green, blue)
1334813491 */
13349 __pyx_tuple__52 = PyTuple_Pack(3, __pyx_n_s_red, __pyx_n_s_green, __pyx_n_s_blue); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 707, __pyx_L1_error)
13350 __Pyx_GOTREF(__pyx_tuple__52);
13351 __Pyx_GIVEREF(__pyx_tuple__52);
13352 __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_gamma, 707, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 707, __pyx_L1_error)
13353
13354 /* "pygame_sdl2/display.pyx":712
13492 __pyx_tuple__51 = PyTuple_Pack(3, __pyx_n_s_red, __pyx_n_s_green, __pyx_n_s_blue); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 725, __pyx_L1_error)
13493 __Pyx_GOTREF(__pyx_tuple__51);
13494 __Pyx_GIVEREF(__pyx_tuple__51);
13495 __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_gamma, 725, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 725, __pyx_L1_error)
13496
13497 /* "pygame_sdl2/display.pyx":730
1335513498 * return False
1335613499 *
1335713500 * def set_gamma_ramp(red, green, blue): # <<<<<<<<<<<<<<
1335813501 * if main_window:
1335913502 * return main_window.set_gamma_ramp(red, green, blue)
1336013503 */
13361 __pyx_tuple__54 = PyTuple_Pack(3, __pyx_n_s_red, __pyx_n_s_green, __pyx_n_s_blue); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 712, __pyx_L1_error)
13362 __Pyx_GOTREF(__pyx_tuple__54);
13363 __Pyx_GIVEREF(__pyx_tuple__54);
13364 __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_gamma_ramp, 712, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 712, __pyx_L1_error)
13365
13366 /* "pygame_sdl2/display.pyx":717
13504 __pyx_tuple__53 = PyTuple_Pack(3, __pyx_n_s_red, __pyx_n_s_green, __pyx_n_s_blue); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 730, __pyx_L1_error)
13505 __Pyx_GOTREF(__pyx_tuple__53);
13506 __Pyx_GIVEREF(__pyx_tuple__53);
13507 __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_gamma_ramp, 730, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 730, __pyx_L1_error)
13508
13509 /* "pygame_sdl2/display.pyx":735
1336713510 * return False
1336813511 *
1336913512 * def set_icon(surface): # <<<<<<<<<<<<<<
1337013513 * global default_icon
1337113514 *
1337213515 */
13373 __pyx_tuple__56 = PyTuple_Pack(1, __pyx_n_s_surface); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 717, __pyx_L1_error)
13374 __Pyx_GOTREF(__pyx_tuple__56);
13375 __Pyx_GIVEREF(__pyx_tuple__56);
13376 __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_icon, 717, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(0, 717, __pyx_L1_error)
13377
13378 /* "pygame_sdl2/display.pyx":725
13516 __pyx_tuple__55 = PyTuple_Pack(1, __pyx_n_s_surface); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 735, __pyx_L1_error)
13517 __Pyx_GOTREF(__pyx_tuple__55);
13518 __Pyx_GIVEREF(__pyx_tuple__55);
13519 __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_icon, 735, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(0, 735, __pyx_L1_error)
13520
13521 /* "pygame_sdl2/display.pyx":743
1337913522 * main_window.set_icon(default_icon)
1338013523 *
1338113524 * def set_caption(title, icontitle = None): # <<<<<<<<<<<<<<
1338213525 * global default_title
1338313526 *
1338413527 */
13385 __pyx_tuple__58 = PyTuple_Pack(2, __pyx_n_s_title, __pyx_n_s_icontitle); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 725, __pyx_L1_error)
13386 __Pyx_GOTREF(__pyx_tuple__58);
13387 __Pyx_GIVEREF(__pyx_tuple__58);
13388 __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_caption, 725, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 725, __pyx_L1_error)
13389
13390 /* "pygame_sdl2/display.pyx":733
13528 __pyx_tuple__57 = PyTuple_Pack(2, __pyx_n_s_title, __pyx_n_s_icontitle); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 743, __pyx_L1_error)
13529 __Pyx_GOTREF(__pyx_tuple__57);
13530 __Pyx_GIVEREF(__pyx_tuple__57);
13531 __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_caption, 743, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 743, __pyx_L1_error)
13532
13533 /* "pygame_sdl2/display.pyx":751
1339113534 * main_window.set_caption(default_title)
1339213535 *
1339313536 * def get_caption(): # <<<<<<<<<<<<<<
1339413537 * return default_title
1339513538 *
1339613539 */
13397 __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_caption, 733, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 733, __pyx_L1_error)
13398
13399 /* "pygame_sdl2/display.pyx":736
13540 __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_caption, 751, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 751, __pyx_L1_error)
13541
13542 /* "pygame_sdl2/display.pyx":754
1340013543 * return default_title
1340113544 *
1340213545 * def get_drawable_size(): # <<<<<<<<<<<<<<
1340313546 * if main_window:
1340413547 * return main_window.get_drawable_size()
1340513548 */
13406 __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_drawable_size, 736, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(0, 736, __pyx_L1_error)
13407
13408 /* "pygame_sdl2/display.pyx":741
13549 __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_drawable_size, 754, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 754, __pyx_L1_error)
13550
13551 /* "pygame_sdl2/display.pyx":759
1340913552 * return None
1341013553 *
1341113554 * def get_size(): # <<<<<<<<<<<<<<
1341213555 * if main_window:
1341313556 * return main_window.get_size()
1341413557 */
13415 __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_size, 741, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(0, 741, __pyx_L1_error)
13416
13417 /* "pygame_sdl2/display.pyx":746
13558 __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_size, 759, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(0, 759, __pyx_L1_error)
13559
13560 /* "pygame_sdl2/display.pyx":764
1341813561 * return None
1341913562 *
1342013563 * def get_num_video_displays(): # <<<<<<<<<<<<<<
1342113564 * rv = SDL_GetNumVideoDisplays()
1342213565 * if rv < 0:
1342313566 */
13424 __pyx_tuple__63 = PyTuple_Pack(1, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 746, __pyx_L1_error)
13425 __Pyx_GOTREF(__pyx_tuple__63);
13426 __Pyx_GIVEREF(__pyx_tuple__63);
13427 __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_num_video_displays, 746, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(0, 746, __pyx_L1_error)
13428
13429 /* "pygame_sdl2/display.pyx":753
13567 __pyx_tuple__62 = PyTuple_Pack(1, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 764, __pyx_L1_error)
13568 __Pyx_GOTREF(__pyx_tuple__62);
13569 __Pyx_GIVEREF(__pyx_tuple__62);
13570 __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__62, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_num_video_displays, 764, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(0, 764, __pyx_L1_error)
13571
13572 /* "pygame_sdl2/display.pyx":771
1343013573 * return rv
1343113574 *
1343213575 * def get_display_bounds(index): # <<<<<<<<<<<<<<
1343313576 * cdef SDL_Rect rect
1343413577 * rv = SDL_GetDisplayBounds(index, &rect)
1343513578 */
13436 __pyx_tuple__65 = PyTuple_Pack(3, __pyx_n_s_index, __pyx_n_s_rect, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 753, __pyx_L1_error)
13437 __Pyx_GOTREF(__pyx_tuple__65);
13438 __Pyx_GIVEREF(__pyx_tuple__65);
13439 __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_display_bounds, 753, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(0, 753, __pyx_L1_error)
13440
13441 /* "pygame_sdl2/display.pyx":759
13579 __pyx_tuple__64 = PyTuple_Pack(3, __pyx_n_s_index, __pyx_n_s_rect, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 771, __pyx_L1_error)
13580 __Pyx_GOTREF(__pyx_tuple__64);
13581 __Pyx_GIVEREF(__pyx_tuple__64);
13582 __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_display_bounds, 771, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 771, __pyx_L1_error)
13583
13584 /* "pygame_sdl2/display.pyx":777
1344213585 * return (rect.x, rect.y, rect.w, rect.h)
1344313586 *
1344413587 * def set_screensaver(state): # <<<<<<<<<<<<<<
1344513588 * """
1344613589 * Sets the screenslaver to `state`.
1344713590 */
13448 __pyx_tuple__67 = PyTuple_Pack(1, __pyx_n_s_state); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 759, __pyx_L1_error)
13449 __Pyx_GOTREF(__pyx_tuple__67);
13450 __Pyx_GIVEREF(__pyx_tuple__67);
13451 __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_screensaver, 759, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(0, 759, __pyx_L1_error)
13452
13453 /* "pygame_sdl2/display.pyx":769
13591 __pyx_tuple__66 = PyTuple_Pack(1, __pyx_n_s_state); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 777, __pyx_L1_error)
13592 __Pyx_GOTREF(__pyx_tuple__66);
13593 __Pyx_GIVEREF(__pyx_tuple__66);
13594 __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_screensaver, 777, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(0, 777, __pyx_L1_error)
13595
13596 /* "pygame_sdl2/display.pyx":787
1345413597 * SDL_DisableScreenSaver()
1345513598 *
1345613599 * def get_platform(): # <<<<<<<<<<<<<<
1345713600 * return SDL_GetPlatform()
1345813601 *
1345913602 */
13460 __pyx_codeobj__69 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_platform, 769, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__69)) __PYX_ERR(0, 769, __pyx_L1_error)
13603 __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_platform, 787, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(0, 787, __pyx_L1_error)
1346113604 __Pyx_RefNannyFinishContext();
1346213605 return 0;
1346313606 __pyx_L1_error:;
1353013673 int __pyx_clineno = 0;
1353113674 __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
1353213675 /*--- Type init code ---*/
13533 if (PyType_Ready(&__pyx_type_11pygame_sdl2_7display_Window) < 0) __PYX_ERR(0, 144, __pyx_L1_error)
13676 if (PyType_Ready(&__pyx_type_11pygame_sdl2_7display_Window) < 0) __PYX_ERR(0, 129, __pyx_L1_error)
1353413677 #if PY_VERSION_HEX < 0x030800B1
1353513678 __pyx_type_11pygame_sdl2_7display_Window.tp_print = 0;
1353613679 #endif
1353713680 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11pygame_sdl2_7display_Window.tp_dictoffset && __pyx_type_11pygame_sdl2_7display_Window.tp_getattro == PyObject_GenericGetAttr)) {
1353813681 __pyx_type_11pygame_sdl2_7display_Window.tp_getattro = __Pyx_PyObject_GenericGetAttr;
1353913682 }
13540 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Window, (PyObject *)&__pyx_type_11pygame_sdl2_7display_Window) < 0) __PYX_ERR(0, 144, __pyx_L1_error)
13683 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Window, (PyObject *)&__pyx_type_11pygame_sdl2_7display_Window) < 0) __PYX_ERR(0, 129, __pyx_L1_error)
1354113684 if (__pyx_type_11pygame_sdl2_7display_Window.tp_weaklistoffset == 0) __pyx_type_11pygame_sdl2_7display_Window.tp_weaklistoffset = offsetof(struct __pyx_obj_11pygame_sdl2_7display_Window, __weakref__);
13542 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_11pygame_sdl2_7display_Window) < 0) __PYX_ERR(0, 144, __pyx_L1_error)
13685 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_11pygame_sdl2_7display_Window) < 0) __PYX_ERR(0, 129, __pyx_L1_error)
1354313686 __pyx_ptype_11pygame_sdl2_7display_Window = &__pyx_type_11pygame_sdl2_7display_Window;
1354413687 __Pyx_RefNannyFinishContext();
1354513688 return 0;
1370013843 PyObject *__pyx_t_2 = NULL;
1370113844 int __pyx_t_3;
1370213845 PyObject *__pyx_t_4 = NULL;
13846 PyObject *__pyx_t_5 = NULL;
13847 PyObject *__pyx_t_6 = NULL;
13848 PyObject *__pyx_t_7 = NULL;
13849 int __pyx_t_8;
1370313850 int __pyx_lineno = 0;
1370413851 const char *__pyx_filename = NULL;
1370513852 int __pyx_clineno = 0;
1406814215 * # The window that is used by the various module globals.
1406914216 * main_window = None # <<<<<<<<<<<<<<
1407014217 *
14071 * # Have we shown the first window?
14218 * try:
1407214219 */
1407314220 __Pyx_INCREF(Py_None);
1407414221 __Pyx_XGOTREF(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window));
1407514222 __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_7display_main_window, ((struct __pyx_obj_11pygame_sdl2_7display_Window *)Py_None));
1407614223 __Pyx_GIVEREF(Py_None);
1407714224
14078 /* "pygame_sdl2/display.pyx":124
14079 *
14080 * # Have we shown the first window?
14081 * _shown_first_window = False # <<<<<<<<<<<<<<
14082 *
14083 * def _before_first_window():
14084 */
14085 if (PyDict_SetItem(__pyx_d, __pyx_n_s_shown_first_window, Py_False) < 0) __PYX_ERR(0, 124, __pyx_L1_error)
14086
14087 /* "pygame_sdl2/display.pyx":126
14088 * _shown_first_window = False
14089 *
14090 * def _before_first_window(): # <<<<<<<<<<<<<<
14091 * global _shown_first_window
14092 *
14093 */
14094 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_13_before_first_window, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error)
14095 __Pyx_GOTREF(__pyx_t_1);
14096 if (PyDict_SetItem(__pyx_d, __pyx_n_s_before_first_window, __pyx_t_1) < 0) __PYX_ERR(0, 126, __pyx_L1_error)
14097 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14098
14099 /* "pygame_sdl2/display.pyx":145
14225 /* "pygame_sdl2/display.pyx":123
14226 * main_window = None
14227 *
14228 * try: # <<<<<<<<<<<<<<
14229 * import androidembed
14230 * except ImportError:
14231 */
14232 {
14233 __Pyx_PyThreadState_declare
14234 __Pyx_PyThreadState_assign
14235 __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
14236 __Pyx_XGOTREF(__pyx_t_5);
14237 __Pyx_XGOTREF(__pyx_t_6);
14238 __Pyx_XGOTREF(__pyx_t_7);
14239 /*try:*/ {
14240
14241 /* "pygame_sdl2/display.pyx":124
14242 *
14243 * try:
14244 * import androidembed # <<<<<<<<<<<<<<
14245 * except ImportError:
14246 * androidembed = None
14247 */
14248 __pyx_t_1 = __Pyx_Import(__pyx_n_s_androidembed, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L2_error)
14249 __Pyx_GOTREF(__pyx_t_1);
14250 if (PyDict_SetItem(__pyx_d, __pyx_n_s_androidembed, __pyx_t_1) < 0) __PYX_ERR(0, 124, __pyx_L2_error)
14251 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14252
14253 /* "pygame_sdl2/display.pyx":123
14254 * main_window = None
14255 *
14256 * try: # <<<<<<<<<<<<<<
14257 * import androidembed
14258 * except ImportError:
14259 */
14260 }
14261 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14262 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
14263 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
14264 goto __pyx_L7_try_end;
14265 __pyx_L2_error:;
14266 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
14267 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
14268 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
14269
14270 /* "pygame_sdl2/display.pyx":125
14271 * try:
14272 * import androidembed
14273 * except ImportError: # <<<<<<<<<<<<<<
14274 * androidembed = None
14275 *
14276 */
14277 __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
14278 if (__pyx_t_8) {
14279 __Pyx_AddTraceback("pygame_sdl2.display", __pyx_clineno, __pyx_lineno, __pyx_filename);
14280 if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_4, &__pyx_t_2) < 0) __PYX_ERR(0, 125, __pyx_L4_except_error)
14281 __Pyx_GOTREF(__pyx_t_1);
14282 __Pyx_GOTREF(__pyx_t_4);
14283 __Pyx_GOTREF(__pyx_t_2);
14284
14285 /* "pygame_sdl2/display.pyx":126
14286 * import androidembed
14287 * except ImportError:
14288 * androidembed = None # <<<<<<<<<<<<<<
14289 *
14290 *
14291 */
14292 if (PyDict_SetItem(__pyx_d, __pyx_n_s_androidembed, Py_None) < 0) __PYX_ERR(0, 126, __pyx_L4_except_error)
14293 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
14294 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
14295 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
14296 goto __pyx_L3_exception_handled;
14297 }
14298 goto __pyx_L4_except_error;
14299 __pyx_L4_except_error:;
14300
14301 /* "pygame_sdl2/display.pyx":123
14302 * main_window = None
14303 *
14304 * try: # <<<<<<<<<<<<<<
14305 * import androidembed
14306 * except ImportError:
14307 */
14308 __Pyx_XGIVEREF(__pyx_t_5);
14309 __Pyx_XGIVEREF(__pyx_t_6);
14310 __Pyx_XGIVEREF(__pyx_t_7);
14311 __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
14312 goto __pyx_L1_error;
14313 __pyx_L3_exception_handled:;
14314 __Pyx_XGIVEREF(__pyx_t_5);
14315 __Pyx_XGIVEREF(__pyx_t_6);
14316 __Pyx_XGIVEREF(__pyx_t_7);
14317 __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
14318 __pyx_L7_try_end:;
14319 }
14320
14321 /* "pygame_sdl2/display.pyx":130
1410014322 *
1410114323 * cdef class Window:
1410214324 * def __init__(self, title, resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): # <<<<<<<<<<<<<<
1410314325 *
1410414326 * if not isinstance(title, bytes):
1410514327 */
14106 __pyx_t_1 = __Pyx_PyInt_From_int(SDL_WINDOWPOS_UNDEFINED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error)
14328 __pyx_t_2 = __Pyx_PyInt_From_int(SDL_WINDOWPOS_UNDEFINED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 130, __pyx_L1_error)
14329 __Pyx_GOTREF(__pyx_t_2);
14330 __pyx_t_4 = __Pyx_PyInt_From_int(SDL_WINDOWPOS_UNDEFINED); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 130, __pyx_L1_error)
14331 __Pyx_GOTREF(__pyx_t_4);
14332 __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 130, __pyx_L1_error)
1410714333 __Pyx_GOTREF(__pyx_t_1);
14108 __pyx_t_4 = __Pyx_PyInt_From_int(SDL_WINDOWPOS_UNDEFINED); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 145, __pyx_L1_error)
14334 __Pyx_GIVEREF(__pyx_t_2);
14335 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
14336 __Pyx_GIVEREF(__pyx_t_4);
14337 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
14338 __pyx_t_2 = 0;
14339 __pyx_t_4 = 0;
14340 __pyx_k__3 = __pyx_t_1;
14341 __Pyx_GIVEREF(__pyx_t_1);
14342 __pyx_t_1 = 0;
14343
14344 /* "pygame_sdl2/display.pyx":480
14345 *
14346 * # The icon that's used for new windows.
14347 * default_icon = None # <<<<<<<<<<<<<<
14348 *
14349 * # The title that's used for new windows.
14350 */
14351 if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_icon, Py_None) < 0) __PYX_ERR(0, 480, __pyx_L1_error)
14352
14353 /* "pygame_sdl2/display.pyx":483
14354 *
14355 * # The title that's used for new windows.
14356 * default_title = "pygame window" # <<<<<<<<<<<<<<
14357 *
14358 * # The default gl_swap_control
14359 */
14360 if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_title, __pyx_kp_s_pygame_window) < 0) __PYX_ERR(0, 483, __pyx_L1_error)
14361
14362 /* "pygame_sdl2/display.pyx":486
14363 *
14364 * # The default gl_swap_control
14365 * default_swap_control = 1 # <<<<<<<<<<<<<<
14366 *
14367 * def set_mode(resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)):
14368 */
14369 if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_swap_control, __pyx_int_1) < 0) __PYX_ERR(0, 486, __pyx_L1_error)
14370
14371 /* "pygame_sdl2/display.pyx":488
14372 * default_swap_control = 1
14373 *
14374 * def set_mode(resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): # <<<<<<<<<<<<<<
14375 * global main_window
14376 *
14377 */
14378 __pyx_t_1 = __Pyx_PyInt_From_int(SDL_WINDOWPOS_UNDEFINED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 488, __pyx_L1_error)
14379 __Pyx_GOTREF(__pyx_t_1);
14380 __pyx_t_4 = __Pyx_PyInt_From_int(SDL_WINDOWPOS_UNDEFINED); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 488, __pyx_L1_error)
1410914381 __Pyx_GOTREF(__pyx_t_4);
14110 __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error)
14382 __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 488, __pyx_L1_error)
1411114383 __Pyx_GOTREF(__pyx_t_2);
1411214384 __Pyx_GIVEREF(__pyx_t_1);
1411314385 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
1411514387 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
1411614388 __pyx_t_1 = 0;
1411714389 __pyx_t_4 = 0;
14118 __pyx_k__3 = __pyx_t_2;
14390 __pyx_k__9 = __pyx_t_2;
1411914391 __Pyx_GIVEREF(__pyx_t_2);
1412014392 __pyx_t_2 = 0;
14121
14122 /* "pygame_sdl2/display.pyx":469
14123 *
14124 * # The icon that's used for new windows.
14125 * default_icon = None # <<<<<<<<<<<<<<
14126 *
14127 * # The title that's used for new windows.
14128 */
14129 if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_icon, Py_None) < 0) __PYX_ERR(0, 469, __pyx_L1_error)
14130
14131 /* "pygame_sdl2/display.pyx":472
14132 *
14133 * # The title that's used for new windows.
14134 * default_title = "pygame window" # <<<<<<<<<<<<<<
14135 *
14136 * # The default gl_swap_control
14137 */
14138 if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_title, __pyx_kp_s_pygame_window) < 0) __PYX_ERR(0, 472, __pyx_L1_error)
14139
14140 /* "pygame_sdl2/display.pyx":475
14141 *
14142 * # The default gl_swap_control
14143 * default_swap_control = 1 # <<<<<<<<<<<<<<
14144 *
14145 * def set_mode(resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)):
14146 */
14147 if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_swap_control, __pyx_int_1) < 0) __PYX_ERR(0, 475, __pyx_L1_error)
14148
14149 /* "pygame_sdl2/display.pyx":477
14150 * default_swap_control = 1
14151 *
14152 * def set_mode(resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): # <<<<<<<<<<<<<<
14393 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_13set_mode, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 488, __pyx_L1_error)
14394 __Pyx_GOTREF(__pyx_t_2);
14395 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_mode, __pyx_t_2) < 0) __PYX_ERR(0, 488, __pyx_L1_error)
14396 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14397
14398 /* "pygame_sdl2/display.pyx":509
14399 * return main_window.surface
14400 *
14401 * def destroy(): # <<<<<<<<<<<<<<
1415314402 * global main_window
1415414403 *
1415514404 */
14156 __pyx_t_2 = __Pyx_PyInt_From_int(SDL_WINDOWPOS_UNDEFINED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 477, __pyx_L1_error)
14405 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_15destroy, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 509, __pyx_L1_error)
1415714406 __Pyx_GOTREF(__pyx_t_2);
14158 __pyx_t_4 = __Pyx_PyInt_From_int(SDL_WINDOWPOS_UNDEFINED); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 477, __pyx_L1_error)
14159 __Pyx_GOTREF(__pyx_t_4);
14160 __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 477, __pyx_L1_error)
14161 __Pyx_GOTREF(__pyx_t_1);
14162 __Pyx_GIVEREF(__pyx_t_2);
14163 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
14164 __Pyx_GIVEREF(__pyx_t_4);
14165 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
14166 __pyx_t_2 = 0;
14167 __pyx_t_4 = 0;
14168 __pyx_k__9 = __pyx_t_1;
14169 __Pyx_GIVEREF(__pyx_t_1);
14170 __pyx_t_1 = 0;
14171 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_15set_mode, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 477, __pyx_L1_error)
14172 __Pyx_GOTREF(__pyx_t_1);
14173 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_mode, __pyx_t_1) < 0) __PYX_ERR(0, 477, __pyx_L1_error)
14174 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14175
14176 /* "pygame_sdl2/display.pyx":498
14177 * return main_window.surface
14407 if (PyDict_SetItem(__pyx_d, __pyx_n_s_destroy, __pyx_t_2) < 0) __PYX_ERR(0, 509, __pyx_L1_error)
14408 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14409
14410 /* "pygame_sdl2/display.pyx":516
14411 * main_window = None
1417814412 *
1417914413 * def get_surface(): # <<<<<<<<<<<<<<
1418014414 * if main_window is None:
1418114415 * return None
1418214416 */
14183 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_17get_surface, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 498, __pyx_L1_error)
14184 __Pyx_GOTREF(__pyx_t_1);
14185 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_surface, __pyx_t_1) < 0) __PYX_ERR(0, 498, __pyx_L1_error)
14186 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14187
14188 /* "pygame_sdl2/display.pyx":504
14417 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_17get_surface, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 516, __pyx_L1_error)
14418 __Pyx_GOTREF(__pyx_t_2);
14419 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_surface, __pyx_t_2) < 0) __PYX_ERR(0, 516, __pyx_L1_error)
14420 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14421
14422 /* "pygame_sdl2/display.pyx":522
1418914423 * return main_window.get_surface()
1419014424 *
1419114425 * def get_window(): # <<<<<<<<<<<<<<
1419214426 * """
1419314427 * Returns the Window created by set_mode, or None if no such window
1419414428 */
14195 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_19get_window, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error)
14196 __Pyx_GOTREF(__pyx_t_1);
14197 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_window, __pyx_t_1) < 0) __PYX_ERR(0, 504, __pyx_L1_error)
14198 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14199
14200 /* "pygame_sdl2/display.pyx":512
14429 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_19get_window, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 522, __pyx_L1_error)
14430 __Pyx_GOTREF(__pyx_t_2);
14431 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_window, __pyx_t_2) < 0) __PYX_ERR(0, 522, __pyx_L1_error)
14432 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14433
14434 /* "pygame_sdl2/display.pyx":530
1420114435 * return main_window
1420214436 *
1420314437 * def flip(): # <<<<<<<<<<<<<<
1420414438 * if main_window:
1420514439 * main_window.flip()
1420614440 */
14207 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_21flip, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error)
14208 __Pyx_GOTREF(__pyx_t_1);
14209 if (PyDict_SetItem(__pyx_d, __pyx_n_s_flip, __pyx_t_1) < 0) __PYX_ERR(0, 512, __pyx_L1_error)
14210 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14211
14212 /* "pygame_sdl2/display.pyx":516
14441 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_21flip, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 530, __pyx_L1_error)
14442 __Pyx_GOTREF(__pyx_t_2);
14443 if (PyDict_SetItem(__pyx_d, __pyx_n_s_flip, __pyx_t_2) < 0) __PYX_ERR(0, 530, __pyx_L1_error)
14444 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14445
14446 /* "pygame_sdl2/display.pyx":534
1421314447 * main_window.flip()
1421414448 *
1421514449 * def update(rectangles=None): # <<<<<<<<<<<<<<
1421614450 * if main_window:
1421714451 * main_window.update(rectangles)
1421814452 */
14219 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_23update, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error)
14220 __Pyx_GOTREF(__pyx_t_1);
14221 if (PyDict_SetItem(__pyx_d, __pyx_n_s_update, __pyx_t_1) < 0) __PYX_ERR(0, 516, __pyx_L1_error)
14222 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14223
14224 /* "pygame_sdl2/display.pyx":520
14453 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_23update, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 534, __pyx_L1_error)
14454 __Pyx_GOTREF(__pyx_t_2);
14455 if (PyDict_SetItem(__pyx_d, __pyx_n_s_update, __pyx_t_2) < 0) __PYX_ERR(0, 534, __pyx_L1_error)
14456 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14457
14458 /* "pygame_sdl2/display.pyx":538
1422514459 * main_window.update(rectangles)
1422614460 *
1422714461 * def get_driver(): # <<<<<<<<<<<<<<
1422814462 * cdef const char *driver = SDL_GetCurrentVideoDriver()
1422914463 *
1423014464 */
14231 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_25get_driver, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error)
14232 __Pyx_GOTREF(__pyx_t_1);
14233 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_driver, __pyx_t_1) < 0) __PYX_ERR(0, 520, __pyx_L1_error)
14234 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14235
14236 /* "pygame_sdl2/display.pyx":528
14465 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_25get_driver, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 538, __pyx_L1_error)
14466 __Pyx_GOTREF(__pyx_t_2);
14467 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_driver, __pyx_t_2) < 0) __PYX_ERR(0, 538, __pyx_L1_error)
14468 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14469
14470 /* "pygame_sdl2/display.pyx":546
1423714471 * return driver
1423814472 *
1423914473 * class Info(object): # <<<<<<<<<<<<<<
1424014474 *
1424114475 * def __init__(self):
1424214476 */
14243 __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__29); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 528, __pyx_L1_error)
14244 __Pyx_GOTREF(__pyx_t_1);
14245 __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_tuple__29, __pyx_n_s_Info, __pyx_n_s_Info, (PyObject *) NULL, __pyx_n_s_pygame_sdl2_display, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 528, __pyx_L1_error)
14477 __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__28); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 546, __pyx_L1_error)
14478 __Pyx_GOTREF(__pyx_t_2);
14479 __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_tuple__28, __pyx_n_s_Info, __pyx_n_s_Info, (PyObject *) NULL, __pyx_n_s_pygame_sdl2_display, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 546, __pyx_L1_error)
1424614480 __Pyx_GOTREF(__pyx_t_4);
1424714481
14248 /* "pygame_sdl2/display.pyx":530
14482 /* "pygame_sdl2/display.pyx":548
1424914483 * class Info(object):
1425014484 *
1425114485 * def __init__(self): # <<<<<<<<<<<<<<
1425214486 * cdef SDL_DisplayMode dm
1425314487 * cdef SDL_PixelFormat *format
1425414488 */
14255 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_4Info_1__init__, 0, __pyx_n_s_Info___init, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 530, __pyx_L1_error)
14256 __Pyx_GOTREF(__pyx_t_2);
14257 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_init_2, __pyx_t_2) < 0) __PYX_ERR(0, 530, __pyx_L1_error)
14258 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14259
14260 /* "pygame_sdl2/display.pyx":589
14489 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_4Info_1__init__, 0, __pyx_n_s_Info___init, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 548, __pyx_L1_error)
14490 __Pyx_GOTREF(__pyx_t_1);
14491 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_init_2, __pyx_t_1) < 0) __PYX_ERR(0, 548, __pyx_L1_error)
14492 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14493
14494 /* "pygame_sdl2/display.pyx":607
1426114495 * self.blit_sw_A = False
1426214496 *
1426314497 * def __repr__(self): # <<<<<<<<<<<<<<
1426414498 * return "<Info({!r})>".format(self.__dict__)
1426514499 *
1426614500 */
14267 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_4Info_3__repr__, 0, __pyx_n_s_Info___repr, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 589, __pyx_L1_error)
14268 __Pyx_GOTREF(__pyx_t_2);
14269 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_repr, __pyx_t_2) < 0) __PYX_ERR(0, 589, __pyx_L1_error)
14501 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_4Info_3__repr__, 0, __pyx_n_s_Info___repr, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 607, __pyx_L1_error)
14502 __Pyx_GOTREF(__pyx_t_1);
14503 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_repr, __pyx_t_1) < 0) __PYX_ERR(0, 607, __pyx_L1_error)
14504 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14505
14506 /* "pygame_sdl2/display.pyx":546
14507 * return driver
14508 *
14509 * class Info(object): # <<<<<<<<<<<<<<
14510 *
14511 * def __init__(self):
14512 */
14513 __pyx_t_1 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Info, __pyx_tuple__28, __pyx_t_4, NULL, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 546, __pyx_L1_error)
14514 __Pyx_GOTREF(__pyx_t_1);
14515 if (PyDict_SetItem(__pyx_d, __pyx_n_s_Info, __pyx_t_1) < 0) __PYX_ERR(0, 546, __pyx_L1_error)
14516 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14517 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1427014518 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1427114519
14272 /* "pygame_sdl2/display.pyx":528
14273 * return driver
14274 *
14275 * class Info(object): # <<<<<<<<<<<<<<
14276 *
14277 * def __init__(self):
14278 */
14279 __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Info, __pyx_tuple__29, __pyx_t_4, NULL, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 528, __pyx_L1_error)
14280 __Pyx_GOTREF(__pyx_t_2);
14281 if (PyDict_SetItem(__pyx_d, __pyx_n_s_Info, __pyx_t_2) < 0) __PYX_ERR(0, 528, __pyx_L1_error)
14282 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14283 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14284 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14285
14286 /* "pygame_sdl2/display.pyx":593
14520 /* "pygame_sdl2/display.pyx":611
1428714521 *
1428814522 *
1428914523 * def get_wm_info(): # <<<<<<<<<<<<<<
1429014524 * if main_window:
1429114525 * return main_window.get_wm_info()
1429214526 */
14293 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_27get_wm_info, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 593, __pyx_L1_error)
14294 __Pyx_GOTREF(__pyx_t_1);
14295 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_wm_info, __pyx_t_1) < 0) __PYX_ERR(0, 593, __pyx_L1_error)
14296 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14297
14298 /* "pygame_sdl2/display.pyx":600
14527 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_27get_wm_info, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 611, __pyx_L1_error)
14528 __Pyx_GOTREF(__pyx_t_2);
14529 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_wm_info, __pyx_t_2) < 0) __PYX_ERR(0, 611, __pyx_L1_error)
14530 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14531
14532 /* "pygame_sdl2/display.pyx":618
1429914533 *
1430014534 *
1430114535 * def get_num_video_displays(): # <<<<<<<<<<<<<<
1430214536 * """
1430314537 * Returns the number of video displays connected to the system.
1430414538 */
14305 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_29get_num_video_displays, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 600, __pyx_L1_error)
14306 __Pyx_GOTREF(__pyx_t_1);
14307 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_num_video_displays, __pyx_t_1) < 0) __PYX_ERR(0, 600, __pyx_L1_error)
14308 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14309
14310 /* "pygame_sdl2/display.pyx":613
14539 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_29get_num_video_displays, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 618, __pyx_L1_error)
14540 __Pyx_GOTREF(__pyx_t_2);
14541 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_num_video_displays, __pyx_t_2) < 0) __PYX_ERR(0, 618, __pyx_L1_error)
14542 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14543
14544 /* "pygame_sdl2/display.pyx":631
1431114545 *
1431214546 *
1431314547 * def list_modes(depth=0, flags=0, display=0): # <<<<<<<<<<<<<<
1431414548 * """
1431514549 * Returns a list of possible display modes for the display `display`.
1431614550 */
14317 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_31list_modes, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 613, __pyx_L1_error)
14318 __Pyx_GOTREF(__pyx_t_1);
14319 if (PyDict_SetItem(__pyx_d, __pyx_n_s_list_modes, __pyx_t_1) < 0) __PYX_ERR(0, 613, __pyx_L1_error)
14320 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14321
14322 /* "pygame_sdl2/display.pyx":638
14551 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_31list_modes, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 631, __pyx_L1_error)
14552 __Pyx_GOTREF(__pyx_t_2);
14553 if (PyDict_SetItem(__pyx_d, __pyx_n_s_list_modes, __pyx_t_2) < 0) __PYX_ERR(0, 631, __pyx_L1_error)
14554 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14555
14556 /* "pygame_sdl2/display.pyx":656
1432314557 *
1432414558 *
1432514559 * def mode_ok(size, flags=0, depth=0): # <<<<<<<<<<<<<<
1432614560 * """
1432714561 * Returns true if size is in the result of list_modes().
1432814562 */
14329 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_33mode_ok, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 638, __pyx_L1_error)
14330 __Pyx_GOTREF(__pyx_t_1);
14331 if (PyDict_SetItem(__pyx_d, __pyx_n_s_mode_ok, __pyx_t_1) < 0) __PYX_ERR(0, 638, __pyx_L1_error)
14332 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14333
14334 /* "pygame_sdl2/display.pyx":645
14563 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_33mode_ok, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 656, __pyx_L1_error)
14564 __Pyx_GOTREF(__pyx_t_2);
14565 if (PyDict_SetItem(__pyx_d, __pyx_n_s_mode_ok, __pyx_t_2) < 0) __PYX_ERR(0, 656, __pyx_L1_error)
14566 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14567
14568 /* "pygame_sdl2/display.pyx":663
1433514569 * return tuple(size) in list_modes()
1433614570 *
1433714571 * def gl_reset_attributes(): # <<<<<<<<<<<<<<
1433814572 * SDL_GL_ResetAttributes()
1433914573 *
1434014574 */
14341 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_35gl_reset_attributes, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 645, __pyx_L1_error)
14342 __Pyx_GOTREF(__pyx_t_1);
14343 if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_reset_attributes, __pyx_t_1) < 0) __PYX_ERR(0, 645, __pyx_L1_error)
14344 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14345
14346 /* "pygame_sdl2/display.pyx":648
14575 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_35gl_reset_attributes, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error)
14576 __Pyx_GOTREF(__pyx_t_2);
14577 if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_reset_attributes, __pyx_t_2) < 0) __PYX_ERR(0, 663, __pyx_L1_error)
14578 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14579
14580 /* "pygame_sdl2/display.pyx":666
1434714581 * SDL_GL_ResetAttributes()
1434814582 *
1434914583 * def gl_set_attribute(flag, value): # <<<<<<<<<<<<<<
1435014584 *
1435114585 * if flag == GL_SWAP_CONTROL:
1435214586 */
14353 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_37gl_set_attribute, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 648, __pyx_L1_error)
14354 __Pyx_GOTREF(__pyx_t_1);
14355 if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_set_attribute, __pyx_t_1) < 0) __PYX_ERR(0, 648, __pyx_L1_error)
14356 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14357
14358 /* "pygame_sdl2/display.pyx":668
14587 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_37gl_set_attribute, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 666, __pyx_L1_error)
14588 __Pyx_GOTREF(__pyx_t_2);
14589 if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_set_attribute, __pyx_t_2) < 0) __PYX_ERR(0, 666, __pyx_L1_error)
14590 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14591
14592 /* "pygame_sdl2/display.pyx":686
1435914593 * raise error()
1436014594 *
1436114595 * def gl_get_attribute(flag): # <<<<<<<<<<<<<<
1436214596 * cdef int rv
1436314597 *
1436414598 */
14365 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_39gl_get_attribute, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error)
14366 __Pyx_GOTREF(__pyx_t_1);
14367 if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_get_attribute, __pyx_t_1) < 0) __PYX_ERR(0, 668, __pyx_L1_error)
14368 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14369
14370 /* "pygame_sdl2/display.pyx":679
14599 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_39gl_get_attribute, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 686, __pyx_L1_error)
14600 __Pyx_GOTREF(__pyx_t_2);
14601 if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_get_attribute, __pyx_t_2) < 0) __PYX_ERR(0, 686, __pyx_L1_error)
14602 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14603
14604 /* "pygame_sdl2/display.pyx":697
1437114605 * return rv
1437214606 *
1437314607 * def gl_load_library(path): # <<<<<<<<<<<<<<
1437414608 * if path is None:
1437514609 * if SDL_GL_LoadLibrary(NULL):
1437614610 */
14377 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_41gl_load_library, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 679, __pyx_L1_error)
14378 __Pyx_GOTREF(__pyx_t_1);
14379 if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_load_library, __pyx_t_1) < 0) __PYX_ERR(0, 679, __pyx_L1_error)
14380 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14381
14382 /* "pygame_sdl2/display.pyx":687
14611 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_41gl_load_library, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 697, __pyx_L1_error)
14612 __Pyx_GOTREF(__pyx_t_2);
14613 if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_load_library, __pyx_t_2) < 0) __PYX_ERR(0, 697, __pyx_L1_error)
14614 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14615
14616 /* "pygame_sdl2/display.pyx":705
1438314617 * raise error()
1438414618 *
1438514619 * def gl_unload_library(): # <<<<<<<<<<<<<<
1438614620 * SDL_GL_UnloadLibrary()
1438714621 *
1438814622 */
14389 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_43gl_unload_library, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 687, __pyx_L1_error)
14390 __Pyx_GOTREF(__pyx_t_1);
14391 if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_unload_library, __pyx_t_1) < 0) __PYX_ERR(0, 687, __pyx_L1_error)
14392 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14393
14394 /* "pygame_sdl2/display.pyx":690
14623 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_43gl_unload_library, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 705, __pyx_L1_error)
14624 __Pyx_GOTREF(__pyx_t_2);
14625 if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_unload_library, __pyx_t_2) < 0) __PYX_ERR(0, 705, __pyx_L1_error)
14626 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14627
14628 /* "pygame_sdl2/display.pyx":708
1439514629 * SDL_GL_UnloadLibrary()
1439614630 *
1439714631 * def get_active(): # <<<<<<<<<<<<<<
1439814632 * if main_window:
1439914633 * return main_window.get_active()
1440014634 */
14401 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_45get_active, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 690, __pyx_L1_error)
14402 __Pyx_GOTREF(__pyx_t_1);
14403 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_active, __pyx_t_1) < 0) __PYX_ERR(0, 690, __pyx_L1_error)
14404 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14405
14406 /* "pygame_sdl2/display.pyx":695
14635 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_45get_active, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 708, __pyx_L1_error)
14636 __Pyx_GOTREF(__pyx_t_2);
14637 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_active, __pyx_t_2) < 0) __PYX_ERR(0, 708, __pyx_L1_error)
14638 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14639
14640 /* "pygame_sdl2/display.pyx":713
1440714641 * return False
1440814642 *
1440914643 * def iconify(): # <<<<<<<<<<<<<<
1441014644 * if main_window:
1441114645 * return main_window.iconify()
1441214646 */
14413 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_47iconify, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 695, __pyx_L1_error)
14414 __Pyx_GOTREF(__pyx_t_1);
14415 if (PyDict_SetItem(__pyx_d, __pyx_n_s_iconify, __pyx_t_1) < 0) __PYX_ERR(0, 695, __pyx_L1_error)
14416 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14417
14418 /* "pygame_sdl2/display.pyx":701
14647 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_47iconify, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 713, __pyx_L1_error)
14648 __Pyx_GOTREF(__pyx_t_2);
14649 if (PyDict_SetItem(__pyx_d, __pyx_n_s_iconify, __pyx_t_2) < 0) __PYX_ERR(0, 713, __pyx_L1_error)
14650 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14651
14652 /* "pygame_sdl2/display.pyx":719
1441914653 * return False
1442014654 *
1442114655 * def toggle_fullscreen(): # <<<<<<<<<<<<<<
1442214656 * if main_window:
1442314657 * return main_window.toggle_fullscreen()
1442414658 */
14425 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_49toggle_fullscreen, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 701, __pyx_L1_error)
14426 __Pyx_GOTREF(__pyx_t_1);
14427 if (PyDict_SetItem(__pyx_d, __pyx_n_s_toggle_fullscreen, __pyx_t_1) < 0) __PYX_ERR(0, 701, __pyx_L1_error)
14428 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14429
14430 /* "pygame_sdl2/display.pyx":707
14659 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_49toggle_fullscreen, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 719, __pyx_L1_error)
14660 __Pyx_GOTREF(__pyx_t_2);
14661 if (PyDict_SetItem(__pyx_d, __pyx_n_s_toggle_fullscreen, __pyx_t_2) < 0) __PYX_ERR(0, 719, __pyx_L1_error)
14662 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14663
14664 /* "pygame_sdl2/display.pyx":725
1443114665 * return True
1443214666 *
1443314667 * def set_gamma(red, green=None, blue=None): # <<<<<<<<<<<<<<
1443414668 * if main_window:
1443514669 * return main_window.set_gamma(red, green, blue)
1443614670 */
14437 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_51set_gamma, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 707, __pyx_L1_error)
14438 __Pyx_GOTREF(__pyx_t_1);
14439 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_gamma, __pyx_t_1) < 0) __PYX_ERR(0, 707, __pyx_L1_error)
14440 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14441
14442 /* "pygame_sdl2/display.pyx":712
14671 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_51set_gamma, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 725, __pyx_L1_error)
14672 __Pyx_GOTREF(__pyx_t_2);
14673 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_gamma, __pyx_t_2) < 0) __PYX_ERR(0, 725, __pyx_L1_error)
14674 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14675
14676 /* "pygame_sdl2/display.pyx":730
1444314677 * return False
1444414678 *
1444514679 * def set_gamma_ramp(red, green, blue): # <<<<<<<<<<<<<<
1444614680 * if main_window:
1444714681 * return main_window.set_gamma_ramp(red, green, blue)
1444814682 */
14449 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_53set_gamma_ramp, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 712, __pyx_L1_error)
14450 __Pyx_GOTREF(__pyx_t_1);
14451 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_gamma_ramp, __pyx_t_1) < 0) __PYX_ERR(0, 712, __pyx_L1_error)
14452 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14453
14454 /* "pygame_sdl2/display.pyx":717
14683 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_53set_gamma_ramp, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L1_error)
14684 __Pyx_GOTREF(__pyx_t_2);
14685 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_gamma_ramp, __pyx_t_2) < 0) __PYX_ERR(0, 730, __pyx_L1_error)
14686 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14687
14688 /* "pygame_sdl2/display.pyx":735
1445514689 * return False
1445614690 *
1445714691 * def set_icon(surface): # <<<<<<<<<<<<<<
1445814692 * global default_icon
1445914693 *
1446014694 */
14461 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_55set_icon, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 717, __pyx_L1_error)
14462 __Pyx_GOTREF(__pyx_t_1);
14463 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_icon, __pyx_t_1) < 0) __PYX_ERR(0, 717, __pyx_L1_error)
14464 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14465
14466 /* "pygame_sdl2/display.pyx":725
14695 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_55set_icon, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 735, __pyx_L1_error)
14696 __Pyx_GOTREF(__pyx_t_2);
14697 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_icon, __pyx_t_2) < 0) __PYX_ERR(0, 735, __pyx_L1_error)
14698 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14699
14700 /* "pygame_sdl2/display.pyx":743
1446714701 * main_window.set_icon(default_icon)
1446814702 *
1446914703 * def set_caption(title, icontitle = None): # <<<<<<<<<<<<<<
1447014704 * global default_title
1447114705 *
1447214706 */
14473 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_57set_caption, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 725, __pyx_L1_error)
14474 __Pyx_GOTREF(__pyx_t_1);
14475 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_caption, __pyx_t_1) < 0) __PYX_ERR(0, 725, __pyx_L1_error)
14476 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14477
14478 /* "pygame_sdl2/display.pyx":733
14707 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_57set_caption, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 743, __pyx_L1_error)
14708 __Pyx_GOTREF(__pyx_t_2);
14709 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_caption, __pyx_t_2) < 0) __PYX_ERR(0, 743, __pyx_L1_error)
14710 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14711
14712 /* "pygame_sdl2/display.pyx":751
1447914713 * main_window.set_caption(default_title)
1448014714 *
1448114715 * def get_caption(): # <<<<<<<<<<<<<<
1448214716 * return default_title
1448314717 *
1448414718 */
14485 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_59get_caption, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 733, __pyx_L1_error)
14486 __Pyx_GOTREF(__pyx_t_1);
14487 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_caption, __pyx_t_1) < 0) __PYX_ERR(0, 733, __pyx_L1_error)
14488 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14489
14490 /* "pygame_sdl2/display.pyx":736
14719 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_59get_caption, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 751, __pyx_L1_error)
14720 __Pyx_GOTREF(__pyx_t_2);
14721 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_caption, __pyx_t_2) < 0) __PYX_ERR(0, 751, __pyx_L1_error)
14722 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14723
14724 /* "pygame_sdl2/display.pyx":754
1449114725 * return default_title
1449214726 *
1449314727 * def get_drawable_size(): # <<<<<<<<<<<<<<
1449414728 * if main_window:
1449514729 * return main_window.get_drawable_size()
1449614730 */
14497 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_61get_drawable_size, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 736, __pyx_L1_error)
14498 __Pyx_GOTREF(__pyx_t_1);
14499 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_drawable_size, __pyx_t_1) < 0) __PYX_ERR(0, 736, __pyx_L1_error)
14500 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14501
14502 /* "pygame_sdl2/display.pyx":741
14731 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_61get_drawable_size, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 754, __pyx_L1_error)
14732 __Pyx_GOTREF(__pyx_t_2);
14733 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_drawable_size, __pyx_t_2) < 0) __PYX_ERR(0, 754, __pyx_L1_error)
14734 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14735
14736 /* "pygame_sdl2/display.pyx":759
1450314737 * return None
1450414738 *
1450514739 * def get_size(): # <<<<<<<<<<<<<<
1450614740 * if main_window:
1450714741 * return main_window.get_size()
1450814742 */
14509 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_63get_size, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 741, __pyx_L1_error)
14510 __Pyx_GOTREF(__pyx_t_1);
14511 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_size, __pyx_t_1) < 0) __PYX_ERR(0, 741, __pyx_L1_error)
14512 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14513
14514 /* "pygame_sdl2/display.pyx":746
14743 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_63get_size, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 759, __pyx_L1_error)
14744 __Pyx_GOTREF(__pyx_t_2);
14745 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_size, __pyx_t_2) < 0) __PYX_ERR(0, 759, __pyx_L1_error)
14746 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14747
14748 /* "pygame_sdl2/display.pyx":764
1451514749 * return None
1451614750 *
1451714751 * def get_num_video_displays(): # <<<<<<<<<<<<<<
1451814752 * rv = SDL_GetNumVideoDisplays()
1451914753 * if rv < 0:
1452014754 */
14521 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_65get_num_video_displays, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 746, __pyx_L1_error)
14522 __Pyx_GOTREF(__pyx_t_1);
14523 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_num_video_displays, __pyx_t_1) < 0) __PYX_ERR(0, 746, __pyx_L1_error)
14524 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14525
14526 /* "pygame_sdl2/display.pyx":753
14755 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_65get_num_video_displays, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 764, __pyx_L1_error)
14756 __Pyx_GOTREF(__pyx_t_2);
14757 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_num_video_displays, __pyx_t_2) < 0) __PYX_ERR(0, 764, __pyx_L1_error)
14758 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14759
14760 /* "pygame_sdl2/display.pyx":771
1452714761 * return rv
1452814762 *
1452914763 * def get_display_bounds(index): # <<<<<<<<<<<<<<
1453014764 * cdef SDL_Rect rect
1453114765 * rv = SDL_GetDisplayBounds(index, &rect)
1453214766 */
14533 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_67get_display_bounds, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 753, __pyx_L1_error)
14534 __Pyx_GOTREF(__pyx_t_1);
14535 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_display_bounds, __pyx_t_1) < 0) __PYX_ERR(0, 753, __pyx_L1_error)
14536 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14537
14538 /* "pygame_sdl2/display.pyx":759
14767 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_67get_display_bounds, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 771, __pyx_L1_error)
14768 __Pyx_GOTREF(__pyx_t_2);
14769 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_display_bounds, __pyx_t_2) < 0) __PYX_ERR(0, 771, __pyx_L1_error)
14770 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14771
14772 /* "pygame_sdl2/display.pyx":777
1453914773 * return (rect.x, rect.y, rect.w, rect.h)
1454014774 *
1454114775 * def set_screensaver(state): # <<<<<<<<<<<<<<
1454214776 * """
1454314777 * Sets the screenslaver to `state`.
1454414778 */
14545 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_69set_screensaver, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 759, __pyx_L1_error)
14546 __Pyx_GOTREF(__pyx_t_1);
14547 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_screensaver, __pyx_t_1) < 0) __PYX_ERR(0, 759, __pyx_L1_error)
14548 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14549
14550 /* "pygame_sdl2/display.pyx":769
14779 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_69set_screensaver, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 777, __pyx_L1_error)
14780 __Pyx_GOTREF(__pyx_t_2);
14781 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_screensaver, __pyx_t_2) < 0) __PYX_ERR(0, 777, __pyx_L1_error)
14782 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14783
14784 /* "pygame_sdl2/display.pyx":787
1455114785 * SDL_DisableScreenSaver()
1455214786 *
1455314787 * def get_platform(): # <<<<<<<<<<<<<<
1455414788 * return SDL_GetPlatform()
1455514789 *
1455614790 */
14557 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_71get_platform, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 769, __pyx_L1_error)
14558 __Pyx_GOTREF(__pyx_t_1);
14559 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_platform, __pyx_t_1) < 0) __PYX_ERR(0, 769, __pyx_L1_error)
14560 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14791 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_71get_platform, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 787, __pyx_L1_error)
14792 __Pyx_GOTREF(__pyx_t_2);
14793 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_platform, __pyx_t_2) < 0) __PYX_ERR(0, 787, __pyx_L1_error)
14794 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1456114795
1456214796 /* "pygame_sdl2/display.pyx":1
1456314797 * # Copyright 2014 Patrick Dawson <pat@dw.is> # <<<<<<<<<<<<<<
1456414798 * # Copyright 2014 Tom Rothamel <tom@rothamel.us>
1456514799 * #
1456614800 */
14567 __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
14568 __Pyx_GOTREF(__pyx_t_1);
14569 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
14570 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14801 __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
14802 __Pyx_GOTREF(__pyx_t_2);
14803 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
14804 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1457114805
1457214806 /*--- Wrapped vars code ---*/
1457314807
1541615650 }
1541715651 #endif
1541815652
15653 /* GetTopmostException */
15654 #if CYTHON_USE_EXC_INFO_STACK
15655 static _PyErr_StackItem *
15656 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
15657 {
15658 _PyErr_StackItem *exc_info = tstate->exc_info;
15659 while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
15660 exc_info->previous_item != NULL)
15661 {
15662 exc_info = exc_info->previous_item;
15663 }
15664 return exc_info;
15665 }
15666 #endif
15667
15668 /* SaveResetException */
15669 #if CYTHON_FAST_THREAD_STATE
15670 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
15671 #if CYTHON_USE_EXC_INFO_STACK
15672 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
15673 *type = exc_info->exc_type;
15674 *value = exc_info->exc_value;
15675 *tb = exc_info->exc_traceback;
15676 #else
15677 *type = tstate->exc_type;
15678 *value = tstate->exc_value;
15679 *tb = tstate->exc_traceback;
15680 #endif
15681 Py_XINCREF(*type);
15682 Py_XINCREF(*value);
15683 Py_XINCREF(*tb);
15684 }
15685 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
15686 PyObject *tmp_type, *tmp_value, *tmp_tb;
15687 #if CYTHON_USE_EXC_INFO_STACK
15688 _PyErr_StackItem *exc_info = tstate->exc_info;
15689 tmp_type = exc_info->exc_type;
15690 tmp_value = exc_info->exc_value;
15691 tmp_tb = exc_info->exc_traceback;
15692 exc_info->exc_type = type;
15693 exc_info->exc_value = value;
15694 exc_info->exc_traceback = tb;
15695 #else
15696 tmp_type = tstate->exc_type;
15697 tmp_value = tstate->exc_value;
15698 tmp_tb = tstate->exc_traceback;
15699 tstate->exc_type = type;
15700 tstate->exc_value = value;
15701 tstate->exc_traceback = tb;
15702 #endif
15703 Py_XDECREF(tmp_type);
15704 Py_XDECREF(tmp_value);
15705 Py_XDECREF(tmp_tb);
15706 }
15707 #endif
15708
15709 /* GetException */
15710 #if CYTHON_FAST_THREAD_STATE
15711 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
15712 #else
15713 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
15714 #endif
15715 {
15716 PyObject *local_type, *local_value, *local_tb;
15717 #if CYTHON_FAST_THREAD_STATE
15718 PyObject *tmp_type, *tmp_value, *tmp_tb;
15719 local_type = tstate->curexc_type;
15720 local_value = tstate->curexc_value;
15721 local_tb = tstate->curexc_traceback;
15722 tstate->curexc_type = 0;
15723 tstate->curexc_value = 0;
15724 tstate->curexc_traceback = 0;
15725 #else
15726 PyErr_Fetch(&local_type, &local_value, &local_tb);
15727 #endif
15728 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
15729 #if CYTHON_FAST_THREAD_STATE
15730 if (unlikely(tstate->curexc_type))
15731 #else
15732 if (unlikely(PyErr_Occurred()))
15733 #endif
15734 goto bad;
15735 #if PY_MAJOR_VERSION >= 3
15736 if (local_tb) {
15737 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
15738 goto bad;
15739 }
15740 #endif
15741 Py_XINCREF(local_tb);
15742 Py_XINCREF(local_type);
15743 Py_XINCREF(local_value);
15744 *type = local_type;
15745 *value = local_value;
15746 *tb = local_tb;
15747 #if CYTHON_FAST_THREAD_STATE
15748 #if CYTHON_USE_EXC_INFO_STACK
15749 {
15750 _PyErr_StackItem *exc_info = tstate->exc_info;
15751 tmp_type = exc_info->exc_type;
15752 tmp_value = exc_info->exc_value;
15753 tmp_tb = exc_info->exc_traceback;
15754 exc_info->exc_type = local_type;
15755 exc_info->exc_value = local_value;
15756 exc_info->exc_traceback = local_tb;
15757 }
15758 #else
15759 tmp_type = tstate->exc_type;
15760 tmp_value = tstate->exc_value;
15761 tmp_tb = tstate->exc_traceback;
15762 tstate->exc_type = local_type;
15763 tstate->exc_value = local_value;
15764 tstate->exc_traceback = local_tb;
15765 #endif
15766 Py_XDECREF(tmp_type);
15767 Py_XDECREF(tmp_value);
15768 Py_XDECREF(tmp_tb);
15769 #else
15770 PyErr_SetExcInfo(local_type, local_value, local_tb);
15771 #endif
15772 return 0;
15773 bad:
15774 *type = 0;
15775 *value = 0;
15776 *tb = 0;
15777 Py_XDECREF(local_type);
15778 Py_XDECREF(local_value);
15779 Py_XDECREF(local_tb);
15780 return -1;
15781 }
15782
15783 /* RaiseTooManyValuesToUnpack */
15784 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
15785 PyErr_Format(PyExc_ValueError,
15786 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
15787 }
15788
15789 /* RaiseNeedMoreValuesToUnpack */
15790 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
15791 PyErr_Format(PyExc_ValueError,
15792 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
15793 index, (index == 1) ? "" : "s");
15794 }
15795
15796 /* IterFinish */
15797 static CYTHON_INLINE int __Pyx_IterFinish(void) {
15798 #if CYTHON_FAST_THREAD_STATE
15799 PyThreadState *tstate = __Pyx_PyThreadState_Current;
15800 PyObject* exc_type = tstate->curexc_type;
15801 if (unlikely(exc_type)) {
15802 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
15803 PyObject *exc_value, *exc_tb;
15804 exc_value = tstate->curexc_value;
15805 exc_tb = tstate->curexc_traceback;
15806 tstate->curexc_type = 0;
15807 tstate->curexc_value = 0;
15808 tstate->curexc_traceback = 0;
15809 Py_DECREF(exc_type);
15810 Py_XDECREF(exc_value);
15811 Py_XDECREF(exc_tb);
15812 return 0;
15813 } else {
15814 return -1;
15815 }
15816 }
15817 return 0;
15818 #else
15819 if (unlikely(PyErr_Occurred())) {
15820 if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
15821 PyErr_Clear();
15822 return 0;
15823 } else {
15824 return -1;
15825 }
15826 }
15827 return 0;
15828 #endif
15829 }
15830
15831 /* UnpackItemEndCheck */
15832 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
15833 if (unlikely(retval)) {
15834 Py_DECREF(retval);
15835 __Pyx_RaiseTooManyValuesError(expected);
15836 return -1;
15837 } else {
15838 return __Pyx_IterFinish();
15839 }
15840 return 0;
15841 }
15842
15843 /* SwapException */
15844 #if CYTHON_FAST_THREAD_STATE
15845 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
15846 PyObject *tmp_type, *tmp_value, *tmp_tb;
15847 #if CYTHON_USE_EXC_INFO_STACK
15848 _PyErr_StackItem *exc_info = tstate->exc_info;
15849 tmp_type = exc_info->exc_type;
15850 tmp_value = exc_info->exc_value;
15851 tmp_tb = exc_info->exc_traceback;
15852 exc_info->exc_type = *type;
15853 exc_info->exc_value = *value;
15854 exc_info->exc_traceback = *tb;
15855 #else
15856 tmp_type = tstate->exc_type;
15857 tmp_value = tstate->exc_value;
15858 tmp_tb = tstate->exc_traceback;
15859 tstate->exc_type = *type;
15860 tstate->exc_value = *value;
15861 tstate->exc_traceback = *tb;
15862 #endif
15863 *type = tmp_type;
15864 *value = tmp_value;
15865 *tb = tmp_tb;
15866 }
15867 #else
15868 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
15869 PyObject *tmp_type, *tmp_value, *tmp_tb;
15870 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
15871 PyErr_SetExcInfo(*type, *value, *tb);
15872 *type = tmp_type;
15873 *value = tmp_value;
15874 *tb = tmp_tb;
15875 }
15876 #endif
15877
15878 /* ArgTypeTest */
15879 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
15880 {
15881 if (unlikely(!type)) {
15882 PyErr_SetString(PyExc_SystemError, "Missing type object");
15883 return 0;
15884 }
15885 else if (exact) {
15886 #if PY_MAJOR_VERSION == 2
15887 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
15888 #endif
15889 }
15890 else {
15891 if (likely(__Pyx_TypeCheck(obj, type))) return 1;
15892 }
15893 PyErr_Format(PyExc_TypeError,
15894 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
15895 name, type->tp_name, Py_TYPE(obj)->tp_name);
15896 return 0;
15897 }
15898
1541915899 /* Import */
1542015900 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
1542115901 PyObject *empty_list = 0;
1548115961 return module;
1548215962 }
1548315963
15484 /* GetTopmostException */
15485 #if CYTHON_USE_EXC_INFO_STACK
15486 static _PyErr_StackItem *
15487 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
15488 {
15489 _PyErr_StackItem *exc_info = tstate->exc_info;
15490 while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
15491 exc_info->previous_item != NULL)
15492 {
15493 exc_info = exc_info->previous_item;
15494 }
15495 return exc_info;
15496 }
15497 #endif
15498
15499 /* SaveResetException */
15500 #if CYTHON_FAST_THREAD_STATE
15501 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
15502 #if CYTHON_USE_EXC_INFO_STACK
15503 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
15504 *type = exc_info->exc_type;
15505 *value = exc_info->exc_value;
15506 *tb = exc_info->exc_traceback;
15507 #else
15508 *type = tstate->exc_type;
15509 *value = tstate->exc_value;
15510 *tb = tstate->exc_traceback;
15511 #endif
15512 Py_XINCREF(*type);
15513 Py_XINCREF(*value);
15514 Py_XINCREF(*tb);
15515 }
15516 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
15517 PyObject *tmp_type, *tmp_value, *tmp_tb;
15518 #if CYTHON_USE_EXC_INFO_STACK
15519 _PyErr_StackItem *exc_info = tstate->exc_info;
15520 tmp_type = exc_info->exc_type;
15521 tmp_value = exc_info->exc_value;
15522 tmp_tb = exc_info->exc_traceback;
15523 exc_info->exc_type = type;
15524 exc_info->exc_value = value;
15525 exc_info->exc_traceback = tb;
15526 #else
15527 tmp_type = tstate->exc_type;
15528 tmp_value = tstate->exc_value;
15529 tmp_tb = tstate->exc_traceback;
15530 tstate->exc_type = type;
15531 tstate->exc_value = value;
15532 tstate->exc_traceback = tb;
15533 #endif
15534 Py_XDECREF(tmp_type);
15535 Py_XDECREF(tmp_value);
15536 Py_XDECREF(tmp_tb);
15537 }
15538 #endif
15539
15540 /* PyErrExceptionMatches */
15541 #if CYTHON_FAST_THREAD_STATE
15542 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
15543 Py_ssize_t i, n;
15544 n = PyTuple_GET_SIZE(tuple);
15545 #if PY_MAJOR_VERSION >= 3
15546 for (i=0; i<n; i++) {
15547 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
15548 }
15549 #endif
15550 for (i=0; i<n; i++) {
15551 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
15552 }
15553 return 0;
15554 }
15555 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
15556 PyObject *exc_type = tstate->curexc_type;
15557 if (exc_type == err) return 1;
15558 if (unlikely(!exc_type)) return 0;
15559 if (unlikely(PyTuple_Check(err)))
15560 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
15561 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
15562 }
15563 #endif
15564
15565 /* GetException */
15566 #if CYTHON_FAST_THREAD_STATE
15567 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
15568 #else
15569 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
15570 #endif
15571 {
15572 PyObject *local_type, *local_value, *local_tb;
15573 #if CYTHON_FAST_THREAD_STATE
15574 PyObject *tmp_type, *tmp_value, *tmp_tb;
15575 local_type = tstate->curexc_type;
15576 local_value = tstate->curexc_value;
15577 local_tb = tstate->curexc_traceback;
15578 tstate->curexc_type = 0;
15579 tstate->curexc_value = 0;
15580 tstate->curexc_traceback = 0;
15581 #else
15582 PyErr_Fetch(&local_type, &local_value, &local_tb);
15583 #endif
15584 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
15585 #if CYTHON_FAST_THREAD_STATE
15586 if (unlikely(tstate->curexc_type))
15587 #else
15588 if (unlikely(PyErr_Occurred()))
15589 #endif
15590 goto bad;
15591 #if PY_MAJOR_VERSION >= 3
15592 if (local_tb) {
15593 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
15594 goto bad;
15595 }
15596 #endif
15597 Py_XINCREF(local_tb);
15598 Py_XINCREF(local_type);
15599 Py_XINCREF(local_value);
15600 *type = local_type;
15601 *value = local_value;
15602 *tb = local_tb;
15603 #if CYTHON_FAST_THREAD_STATE
15604 #if CYTHON_USE_EXC_INFO_STACK
15605 {
15606 _PyErr_StackItem *exc_info = tstate->exc_info;
15607 tmp_type = exc_info->exc_type;
15608 tmp_value = exc_info->exc_value;
15609 tmp_tb = exc_info->exc_traceback;
15610 exc_info->exc_type = local_type;
15611 exc_info->exc_value = local_value;
15612 exc_info->exc_traceback = local_tb;
15613 }
15614 #else
15615 tmp_type = tstate->exc_type;
15616 tmp_value = tstate->exc_value;
15617 tmp_tb = tstate->exc_traceback;
15618 tstate->exc_type = local_type;
15619 tstate->exc_value = local_value;
15620 tstate->exc_traceback = local_tb;
15621 #endif
15622 Py_XDECREF(tmp_type);
15623 Py_XDECREF(tmp_value);
15624 Py_XDECREF(tmp_tb);
15625 #else
15626 PyErr_SetExcInfo(local_type, local_value, local_tb);
15627 #endif
15628 return 0;
15629 bad:
15630 *type = 0;
15631 *value = 0;
15632 *tb = 0;
15633 Py_XDECREF(local_type);
15634 Py_XDECREF(local_value);
15635 Py_XDECREF(local_tb);
15636 return -1;
15637 }
15638
15639 /* RaiseTooManyValuesToUnpack */
15640 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
15641 PyErr_Format(PyExc_ValueError,
15642 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
15643 }
15644
15645 /* RaiseNeedMoreValuesToUnpack */
15646 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
15647 PyErr_Format(PyExc_ValueError,
15648 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
15649 index, (index == 1) ? "" : "s");
15650 }
15651
15652 /* IterFinish */
15653 static CYTHON_INLINE int __Pyx_IterFinish(void) {
15654 #if CYTHON_FAST_THREAD_STATE
15655 PyThreadState *tstate = __Pyx_PyThreadState_Current;
15656 PyObject* exc_type = tstate->curexc_type;
15657 if (unlikely(exc_type)) {
15658 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
15659 PyObject *exc_value, *exc_tb;
15660 exc_value = tstate->curexc_value;
15661 exc_tb = tstate->curexc_traceback;
15662 tstate->curexc_type = 0;
15663 tstate->curexc_value = 0;
15664 tstate->curexc_traceback = 0;
15665 Py_DECREF(exc_type);
15666 Py_XDECREF(exc_value);
15667 Py_XDECREF(exc_tb);
15668 return 0;
15669 } else {
15670 return -1;
15671 }
15672 }
15673 return 0;
15674 #else
15675 if (unlikely(PyErr_Occurred())) {
15676 if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
15677 PyErr_Clear();
15678 return 0;
15679 } else {
15680 return -1;
15681 }
15682 }
15683 return 0;
15684 #endif
15685 }
15686
15687 /* UnpackItemEndCheck */
15688 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
15689 if (unlikely(retval)) {
15690 Py_DECREF(retval);
15691 __Pyx_RaiseTooManyValuesError(expected);
15692 return -1;
15693 } else {
15694 return __Pyx_IterFinish();
15695 }
15696 return 0;
15697 }
15698
15699 /* SwapException */
15700 #if CYTHON_FAST_THREAD_STATE
15701 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
15702 PyObject *tmp_type, *tmp_value, *tmp_tb;
15703 #if CYTHON_USE_EXC_INFO_STACK
15704 _PyErr_StackItem *exc_info = tstate->exc_info;
15705 tmp_type = exc_info->exc_type;
15706 tmp_value = exc_info->exc_value;
15707 tmp_tb = exc_info->exc_traceback;
15708 exc_info->exc_type = *type;
15709 exc_info->exc_value = *value;
15710 exc_info->exc_traceback = *tb;
15711 #else
15712 tmp_type = tstate->exc_type;
15713 tmp_value = tstate->exc_value;
15714 tmp_tb = tstate->exc_traceback;
15715 tstate->exc_type = *type;
15716 tstate->exc_value = *value;
15717 tstate->exc_traceback = *tb;
15718 #endif
15719 *type = tmp_type;
15720 *value = tmp_value;
15721 *tb = tmp_tb;
15722 }
15723 #else
15724 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
15725 PyObject *tmp_type, *tmp_value, *tmp_tb;
15726 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
15727 PyErr_SetExcInfo(*type, *value, *tb);
15728 *type = tmp_type;
15729 *value = tmp_value;
15730 *tb = tmp_tb;
15731 }
15732 #endif
15733
15734 /* ArgTypeTest */
15735 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
15736 {
15737 if (unlikely(!type)) {
15738 PyErr_SetString(PyExc_SystemError, "Missing type object");
15739 return 0;
15740 }
15741 else if (exact) {
15742 #if PY_MAJOR_VERSION == 2
15743 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
15744 #endif
15745 }
15746 else {
15747 if (likely(__Pyx_TypeCheck(obj, type))) return 1;
15748 }
15749 PyErr_Format(PyExc_TypeError,
15750 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
15751 name, type->tp_name, Py_TYPE(obj)->tp_name);
15752 return 0;
15753 }
15754
1575515964 /* ExtTypeTest */
1575615965 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
1575715966 if (unlikely(!type)) {
1582616035 return PyObject_GenericGetAttr(obj, attr_name);
1582716036 }
1582816037 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
16038 }
16039 #endif
16040
16041 /* PyErrExceptionMatches */
16042 #if CYTHON_FAST_THREAD_STATE
16043 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
16044 Py_ssize_t i, n;
16045 n = PyTuple_GET_SIZE(tuple);
16046 #if PY_MAJOR_VERSION >= 3
16047 for (i=0; i<n; i++) {
16048 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
16049 }
16050 #endif
16051 for (i=0; i<n; i++) {
16052 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
16053 }
16054 return 0;
16055 }
16056 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
16057 PyObject *exc_type = tstate->curexc_type;
16058 if (exc_type == err) return 1;
16059 if (unlikely(!exc_type)) return 0;
16060 if (unlikely(PyTuple_Check(err)))
16061 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
16062 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
1582916063 }
1583016064 #endif
1583116065
1713917373 int one = 1; int little = (int)*(unsigned char *)&one;
1714017374 unsigned char *bytes = (unsigned char *)&value;
1714117375 return _PyLong_FromByteArray(bytes, sizeof(uint32_t),
17376 little, !is_unsigned);
17377 }
17378 }
17379
17380 /* CIntToPy */
17381 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_long(unsigned long value) {
17382 const unsigned long neg_one = (unsigned long) ((unsigned long) 0 - (unsigned long) 1), const_zero = (unsigned long) 0;
17383 const int is_unsigned = neg_one > const_zero;
17384 if (is_unsigned) {
17385 if (sizeof(unsigned long) < sizeof(long)) {
17386 return PyInt_FromLong((long) value);
17387 } else if (sizeof(unsigned long) <= sizeof(unsigned long)) {
17388 return PyLong_FromUnsignedLong((unsigned long) value);
17389 #ifdef HAVE_LONG_LONG
17390 } else if (sizeof(unsigned long) <= sizeof(unsigned PY_LONG_LONG)) {
17391 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
17392 #endif
17393 }
17394 } else {
17395 if (sizeof(unsigned long) <= sizeof(long)) {
17396 return PyInt_FromLong((long) value);
17397 #ifdef HAVE_LONG_LONG
17398 } else if (sizeof(unsigned long) <= sizeof(PY_LONG_LONG)) {
17399 return PyLong_FromLongLong((PY_LONG_LONG) value);
17400 #endif
17401 }
17402 }
17403 {
17404 int one = 1; int little = (int)*(unsigned char *)&one;
17405 unsigned char *bytes = (unsigned char *)&value;
17406 return _PyLong_FromByteArray(bytes, sizeof(unsigned long),
1714217407 little, !is_unsigned);
1714317408 }
1714417409 }
11881188 /* RaiseException.proto */
11891189 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
11901190
1191 /* Import.proto */
1192 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1193
11941191 /* GetTopmostException.proto */
11951192 #if CYTHON_USE_EXC_INFO_STACK
11961193 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
12071204 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
12081205 #endif
12091206
1210 /* PyErrExceptionMatches.proto */
1211 #if CYTHON_FAST_THREAD_STATE
1212 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1213 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1214 #else
1215 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1216 #endif
1217
12181207 /* GetException.proto */
12191208 #if CYTHON_FAST_THREAD_STATE
12201209 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
12481237 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
12491238 __Pyx__ArgTypeTest(obj, type, name, exact))
12501239 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
1240
1241 /* Import.proto */
1242 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
12511243
12521244 /* ExtTypeTest.proto */
12531245 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
12901282 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
12911283 #else
12921284 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
1285 #endif
1286
1287 /* PyErrExceptionMatches.proto */
1288 #if CYTHON_FAST_THREAD_STATE
1289 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1290 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1291 #else
1292 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
12931293 #endif
12941294
12951295 /* PyObjectGetAttrStrNoError.proto */
14371437 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value);
14381438
14391439 /* CIntToPy.proto */
1440 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_long(unsigned long value);
1441
1442 /* CIntToPy.proto */
14401443 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value);
14411444
14421445 /* CIntFromPy.proto */
15141517 int __pyx_module_is_main_pygame_sdl2__display = 0;
15151518
15161519 /* Implementation of 'pygame_sdl2.display' */
1520 static PyObject *__pyx_builtin_ImportError;
15171521 static PyObject *__pyx_builtin_object;
1518 static PyObject *__pyx_builtin_ImportError;
15191522 static PyObject *__pyx_builtin_MemoryError;
15201523 static PyObject *__pyx_builtin_range;
15211524 static PyObject *__pyx_builtin_TypeError;
15631566 static const char __pyx_k_value[] = "value";
15641567 static const char __pyx_k_Info_r[] = "<Info({!r})>";
15651568 static const char __pyx_k_Window[] = "Window";
1569 static const char __pyx_k_ctypes[] = "ctypes";
15661570 static const char __pyx_k_driver[] = "driver";
15671571 static const char __pyx_k_encode[] = "encode";
15681572 static const char __pyx_k_format[] = "format";
15891593 static const char __pyx_k_surface[] = "surface";
15901594 static const char __pyx_k_SRCALPHA[] = "SRCALPHA";
15911595 static const char __pyx_k_bytesize[] = "bytesize";
1596 static const char __pyx_k_c_void_p[] = "c_void_p";
15921597 static const char __pyx_k_get_hint[] = "_get_hint";
15931598 static const char __pyx_k_get_init[] = "get_init";
15941599 static const char __pyx_k_get_size[] = "get_size";
16371642 static const char __pyx_k_set_caption[] = "set_caption";
16381643 static const char __pyx_k_RESIZE_FLAGS[] = "RESIZE_FLAGS";
16391644 static const char __pyx_k_androidembed[] = "androidembed";
1640 static const char __pyx_k_close_window[] = "close_window";
16411645 static const char __pyx_k_default_icon[] = "default_icon";
16421646 static const char __pyx_k_get_platform[] = "get_platform";
16431647 static const char __pyx_k_pygame_hints[] = "_pygame_hints";
16641668 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
16651669 static const char __pyx_k_get_display_bounds[] = "get_display_bounds";
16661670 static const char __pyx_k_pygame_sdl2_locals[] = "pygame_sdl2.locals";
1667 static const char __pyx_k_shown_first_window[] = "_shown_first_window";
1668 static const char __pyx_k_before_first_window[] = "_before_first_window";
16691671 static const char __pyx_k_gl_reset_attributes[] = "gl_reset_attributes";
16701672 static const char __pyx_k_pygame_sdl2_display[] = "pygame_sdl2.display";
16711673 static const char __pyx_k_PYGAME_SDL2_AVOID_GL[] = "PYGAME_SDL2_AVOID_GL";
16941696 static PyObject *__pyx_n_s_TypeError;
16951697 static PyObject *__pyx_n_s_Window;
16961698 static PyObject *__pyx_n_s_androidembed;
1697 static PyObject *__pyx_n_s_before_first_window;
16981699 static PyObject *__pyx_n_s_bitsize;
16991700 static PyObject *__pyx_n_s_blit_hw;
17001701 static PyObject *__pyx_n_s_blit_hw_A;
17041705 static PyObject *__pyx_n_s_blit_sw_CC;
17051706 static PyObject *__pyx_n_s_blue;
17061707 static PyObject *__pyx_n_s_bytesize;
1708 static PyObject *__pyx_n_s_c_void_p;
17071709 static PyObject *__pyx_n_s_cline_in_traceback;
1708 static PyObject *__pyx_n_s_close_window;
17091710 static PyObject *__pyx_n_s_copy;
17101711 static PyObject *__pyx_n_s_create_surface;
1712 static PyObject *__pyx_n_s_ctypes;
17111713 static PyObject *__pyx_n_s_current_h;
17121714 static PyObject *__pyx_n_s_current_w;
17131715 static PyObject *__pyx_n_s_default;
18181820 static PyObject *__pyx_n_s_setstate;
18191821 static PyObject *__pyx_n_s_setstate_cython;
18201822 static PyObject *__pyx_n_s_shifts;
1821 static PyObject *__pyx_n_s_shown_first_window;
18221823 static PyObject *__pyx_n_s_size;
18231824 static PyObject *__pyx_kp_s_src_pygame_sdl2_display_pyx;
18241825 static PyObject *__pyx_n_s_state;
18391840 static PyObject *__pyx_pf_11pygame_sdl2_7display_6init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
18401841 static PyObject *__pyx_pf_11pygame_sdl2_7display_8quit(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
18411842 static PyObject *__pyx_pf_11pygame_sdl2_7display_10get_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
1842 static PyObject *__pyx_pf_11pygame_sdl2_7display_12_before_first_window(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
18431843 static int __pyx_pf_11pygame_sdl2_7display_6Window___init__(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_title, PyObject *__pyx_v_resolution, PyObject *__pyx_v_flags, CYTHON_UNUSED PyObject *__pyx_v_depth, PyObject *__pyx_v_pos); /* proto */
18441844 static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_2create_surface(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */
18451845 static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_4destroy(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */
18631863 static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_40restore(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */
18641864 static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_42maximize(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */
18651865 static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_44minimize(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */
1866 static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_46get_sdl_window_pointer(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */
18661867 static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_7surface___get__(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */
18671868 static int __pyx_pf_11pygame_sdl2_7display_6Window_7surface_2__set__(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
18681869 static int __pyx_pf_11pygame_sdl2_7display_6Window_7surface_4__del__(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */
1869 static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_46__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */
1870 static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_48__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
1871 static PyObject *__pyx_pf_11pygame_sdl2_7display_14set_mode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_resolution, PyObject *__pyx_v_flags, PyObject *__pyx_v_depth, PyObject *__pyx_v_pos); /* proto */
1870 static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_48__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */
1871 static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_50__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
1872 static PyObject *__pyx_pf_11pygame_sdl2_7display_12set_mode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_resolution, PyObject *__pyx_v_flags, PyObject *__pyx_v_depth, PyObject *__pyx_v_pos); /* proto */
1873 static PyObject *__pyx_pf_11pygame_sdl2_7display_14destroy(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
18721874 static PyObject *__pyx_pf_11pygame_sdl2_7display_16get_surface(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
18731875 static PyObject *__pyx_pf_11pygame_sdl2_7display_18get_window(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
18741876 static PyObject *__pyx_pf_11pygame_sdl2_7display_20flip(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
19161918 static PyObject *__pyx_tuple__10;
19171919 static PyObject *__pyx_tuple__12;
19181920 static PyObject *__pyx_tuple__18;
1919 static PyObject *__pyx_tuple__20;
1920 static PyObject *__pyx_tuple__25;
1921 static PyObject *__pyx_tuple__27;
1921 static PyObject *__pyx_tuple__24;
1922 static PyObject *__pyx_tuple__26;
1923 static PyObject *__pyx_tuple__28;
19221924 static PyObject *__pyx_tuple__29;
1923 static PyObject *__pyx_tuple__30;
1924 static PyObject *__pyx_tuple__32;
1925 static PyObject *__pyx_tuple__35;
1926 static PyObject *__pyx_tuple__37;
1927 static PyObject *__pyx_tuple__39;
1928 static PyObject *__pyx_tuple__42;
1929 static PyObject *__pyx_tuple__44;
1930 static PyObject *__pyx_tuple__46;
1931 static PyObject *__pyx_tuple__52;
1932 static PyObject *__pyx_tuple__54;
1933 static PyObject *__pyx_tuple__56;
1934 static PyObject *__pyx_tuple__58;
1935 static PyObject *__pyx_tuple__63;
1936 static PyObject *__pyx_tuple__65;
1937 static PyObject *__pyx_tuple__67;
1925 static PyObject *__pyx_tuple__31;
1926 static PyObject *__pyx_tuple__34;
1927 static PyObject *__pyx_tuple__36;
1928 static PyObject *__pyx_tuple__38;
1929 static PyObject *__pyx_tuple__41;
1930 static PyObject *__pyx_tuple__43;
1931 static PyObject *__pyx_tuple__45;
1932 static PyObject *__pyx_tuple__51;
1933 static PyObject *__pyx_tuple__53;
1934 static PyObject *__pyx_tuple__55;
1935 static PyObject *__pyx_tuple__57;
1936 static PyObject *__pyx_tuple__62;
1937 static PyObject *__pyx_tuple__64;
1938 static PyObject *__pyx_tuple__66;
19381939 static PyObject *__pyx_codeobj__11;
19391940 static PyObject *__pyx_codeobj__13;
19401941 static PyObject *__pyx_codeobj__14;
19421943 static PyObject *__pyx_codeobj__16;
19431944 static PyObject *__pyx_codeobj__17;
19441945 static PyObject *__pyx_codeobj__19;
1946 static PyObject *__pyx_codeobj__20;
19451947 static PyObject *__pyx_codeobj__21;
19461948 static PyObject *__pyx_codeobj__22;
19471949 static PyObject *__pyx_codeobj__23;
1948 static PyObject *__pyx_codeobj__24;
1949 static PyObject *__pyx_codeobj__26;
1950 static PyObject *__pyx_codeobj__28;
1951 static PyObject *__pyx_codeobj__31;
1950 static PyObject *__pyx_codeobj__25;
1951 static PyObject *__pyx_codeobj__27;
1952 static PyObject *__pyx_codeobj__30;
1953 static PyObject *__pyx_codeobj__32;
19521954 static PyObject *__pyx_codeobj__33;
1953 static PyObject *__pyx_codeobj__34;
1954 static PyObject *__pyx_codeobj__36;
1955 static PyObject *__pyx_codeobj__38;
1955 static PyObject *__pyx_codeobj__35;
1956 static PyObject *__pyx_codeobj__37;
1957 static PyObject *__pyx_codeobj__39;
19561958 static PyObject *__pyx_codeobj__40;
1957 static PyObject *__pyx_codeobj__41;
1958 static PyObject *__pyx_codeobj__43;
1959 static PyObject *__pyx_codeobj__45;
1959 static PyObject *__pyx_codeobj__42;
1960 static PyObject *__pyx_codeobj__44;
1961 static PyObject *__pyx_codeobj__46;
19601962 static PyObject *__pyx_codeobj__47;
19611963 static PyObject *__pyx_codeobj__48;
19621964 static PyObject *__pyx_codeobj__49;
19631965 static PyObject *__pyx_codeobj__50;
1964 static PyObject *__pyx_codeobj__51;
1965 static PyObject *__pyx_codeobj__53;
1966 static PyObject *__pyx_codeobj__55;
1967 static PyObject *__pyx_codeobj__57;
1966 static PyObject *__pyx_codeobj__52;
1967 static PyObject *__pyx_codeobj__54;
1968 static PyObject *__pyx_codeobj__56;
1969 static PyObject *__pyx_codeobj__58;
19681970 static PyObject *__pyx_codeobj__59;
19691971 static PyObject *__pyx_codeobj__60;
19701972 static PyObject *__pyx_codeobj__61;
1971 static PyObject *__pyx_codeobj__62;
1972 static PyObject *__pyx_codeobj__64;
1973 static PyObject *__pyx_codeobj__66;
1973 static PyObject *__pyx_codeobj__63;
1974 static PyObject *__pyx_codeobj__65;
1975 static PyObject *__pyx_codeobj__67;
19741976 static PyObject *__pyx_codeobj__68;
1975 static PyObject *__pyx_codeobj__69;
19761977 /* Late includes */
19771978
19781979 /* "pygame_sdl2/display.pyx":40
30403041 return __pyx_r;
30413042 }
30423043
3043 /* "pygame_sdl2/display.pyx":126
3044 * _shown_first_window = False
3045 *
3046 * def _before_first_window(): # <<<<<<<<<<<<<<
3047 * global _shown_first_window
3048 *
3049 */
3050
3051 /* Python wrapper */
3052 static PyObject *__pyx_pw_11pygame_sdl2_7display_13_before_first_window(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
3053 static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_13_before_first_window = {"_before_first_window", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_13_before_first_window, METH_NOARGS, 0};
3054 static PyObject *__pyx_pw_11pygame_sdl2_7display_13_before_first_window(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
3055 PyObject *__pyx_r = 0;
3056 __Pyx_RefNannyDeclarations
3057 __Pyx_RefNannySetupContext("_before_first_window (wrapper)", 0);
3058 __pyx_r = __pyx_pf_11pygame_sdl2_7display_12_before_first_window(__pyx_self);
3059
3060 /* function exit code */
3061 __Pyx_RefNannyFinishContext();
3062 return __pyx_r;
3063 }
3064
3065 static PyObject *__pyx_pf_11pygame_sdl2_7display_12_before_first_window(CYTHON_UNUSED PyObject *__pyx_self) {
3066 PyObject *__pyx_v_androidembed = NULL;
3067 PyObject *__pyx_r = NULL;
3068 __Pyx_RefNannyDeclarations
3069 PyObject *__pyx_t_1 = NULL;
3070 int __pyx_t_2;
3071 PyObject *__pyx_t_3 = NULL;
3072 PyObject *__pyx_t_4 = NULL;
3073 PyObject *__pyx_t_5 = NULL;
3074 PyObject *__pyx_t_6 = NULL;
3075 PyObject *__pyx_t_7 = NULL;
3076 int __pyx_t_8;
3077 int __pyx_lineno = 0;
3078 const char *__pyx_filename = NULL;
3079 int __pyx_clineno = 0;
3080 __Pyx_RefNannySetupContext("_before_first_window", 0);
3081
3082 /* "pygame_sdl2/display.pyx":129
3083 * global _shown_first_window
3084 *
3085 * if _shown_first_window: # <<<<<<<<<<<<<<
3086 * return
3087 *
3088 */
3089 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_shown_first_window); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __pyx_L1_error)
3090 __Pyx_GOTREF(__pyx_t_1);
3091 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 129, __pyx_L1_error)
3092 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3093 if (__pyx_t_2) {
3094
3095 /* "pygame_sdl2/display.pyx":130
3096 *
3097 * if _shown_first_window:
3098 * return # <<<<<<<<<<<<<<
3099 *
3100 * _shown_first_window = True
3101 */
3102 __Pyx_XDECREF(__pyx_r);
3103 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3104 goto __pyx_L0;
3105
3106 /* "pygame_sdl2/display.pyx":129
3107 * global _shown_first_window
3108 *
3109 * if _shown_first_window: # <<<<<<<<<<<<<<
3110 * return
3111 *
3112 */
3113 }
3114
3115 /* "pygame_sdl2/display.pyx":132
3116 * return
3117 *
3118 * _shown_first_window = True # <<<<<<<<<<<<<<
3119 *
3120 * # If we're on android, we have to close the splash window before opening
3121 */
3122 if (PyDict_SetItem(__pyx_d, __pyx_n_s_shown_first_window, Py_True) < 0) __PYX_ERR(0, 132, __pyx_L1_error)
3123
3124 /* "pygame_sdl2/display.pyx":136
3125 * # If we're on android, we have to close the splash window before opening
3126 * # our window.
3127 * try: # <<<<<<<<<<<<<<
3128 * import androidembed
3129 * androidembed.close_window()
3130 */
3131 {
3132 __Pyx_PyThreadState_declare
3133 __Pyx_PyThreadState_assign
3134 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
3135 __Pyx_XGOTREF(__pyx_t_3);
3136 __Pyx_XGOTREF(__pyx_t_4);
3137 __Pyx_XGOTREF(__pyx_t_5);
3138 /*try:*/ {
3139
3140 /* "pygame_sdl2/display.pyx":137
3141 * # our window.
3142 * try:
3143 * import androidembed # <<<<<<<<<<<<<<
3144 * androidembed.close_window()
3145 * except ImportError:
3146 */
3147 __pyx_t_1 = __Pyx_Import(__pyx_n_s_androidembed, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L4_error)
3148 __Pyx_GOTREF(__pyx_t_1);
3149 __pyx_v_androidembed = __pyx_t_1;
3150 __pyx_t_1 = 0;
3151
3152 /* "pygame_sdl2/display.pyx":138
3153 * try:
3154 * import androidembed
3155 * androidembed.close_window() # <<<<<<<<<<<<<<
3156 * except ImportError:
3157 * pass
3158 */
3159 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_androidembed, __pyx_n_s_close_window); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 138, __pyx_L4_error)
3160 __Pyx_GOTREF(__pyx_t_6);
3161 __pyx_t_7 = NULL;
3162 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
3163 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
3164 if (likely(__pyx_t_7)) {
3165 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
3166 __Pyx_INCREF(__pyx_t_7);
3167 __Pyx_INCREF(function);
3168 __Pyx_DECREF_SET(__pyx_t_6, function);
3169 }
3170 }
3171 __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
3172 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
3173 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 138, __pyx_L4_error)
3174 __Pyx_GOTREF(__pyx_t_1);
3175 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3176 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3177
3178 /* "pygame_sdl2/display.pyx":136
3179 * # If we're on android, we have to close the splash window before opening
3180 * # our window.
3181 * try: # <<<<<<<<<<<<<<
3182 * import androidembed
3183 * androidembed.close_window()
3184 */
3185 }
3186 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
3187 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3188 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3189 goto __pyx_L9_try_end;
3190 __pyx_L4_error:;
3191 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
3192 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
3193 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
3194
3195 /* "pygame_sdl2/display.pyx":139
3196 * import androidembed
3197 * androidembed.close_window()
3198 * except ImportError: # <<<<<<<<<<<<<<
3199 * pass
3200 *
3201 */
3202 __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
3203 if (__pyx_t_8) {
3204 __Pyx_ErrRestore(0,0,0);
3205 goto __pyx_L5_exception_handled;
3206 }
3207 goto __pyx_L6_except_error;
3208 __pyx_L6_except_error:;
3209
3210 /* "pygame_sdl2/display.pyx":136
3211 * # If we're on android, we have to close the splash window before opening
3212 * # our window.
3213 * try: # <<<<<<<<<<<<<<
3214 * import androidembed
3215 * androidembed.close_window()
3216 */
3217 __Pyx_XGIVEREF(__pyx_t_3);
3218 __Pyx_XGIVEREF(__pyx_t_4);
3219 __Pyx_XGIVEREF(__pyx_t_5);
3220 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
3221 goto __pyx_L1_error;
3222 __pyx_L5_exception_handled:;
3223 __Pyx_XGIVEREF(__pyx_t_3);
3224 __Pyx_XGIVEREF(__pyx_t_4);
3225 __Pyx_XGIVEREF(__pyx_t_5);
3226 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
3227 __pyx_L9_try_end:;
3228 }
3229
3230 /* "pygame_sdl2/display.pyx":126
3231 * _shown_first_window = False
3232 *
3233 * def _before_first_window(): # <<<<<<<<<<<<<<
3234 * global _shown_first_window
3235 *
3236 */
3237
3238 /* function exit code */
3239 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3240 goto __pyx_L0;
3241 __pyx_L1_error:;
3242 __Pyx_XDECREF(__pyx_t_1);
3243 __Pyx_XDECREF(__pyx_t_6);
3244 __Pyx_XDECREF(__pyx_t_7);
3245 __Pyx_AddTraceback("pygame_sdl2.display._before_first_window", __pyx_clineno, __pyx_lineno, __pyx_filename);
3246 __pyx_r = NULL;
3247 __pyx_L0:;
3248 __Pyx_XDECREF(__pyx_v_androidembed);
3249 __Pyx_XGIVEREF(__pyx_r);
3250 __Pyx_RefNannyFinishContext();
3251 return __pyx_r;
3252 }
3253
3254 /* "pygame_sdl2/display.pyx":145
3044 /* "pygame_sdl2/display.pyx":130
32553045 *
32563046 * cdef class Window:
32573047 * def __init__(self, title, resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): # <<<<<<<<<<<<<<
33283118 }
33293119 }
33303120 if (unlikely(kw_args > 0)) {
3331 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 145, __pyx_L3_error)
3121 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 130, __pyx_L3_error)
33323122 }
33333123 } else {
33343124 switch (PyTuple_GET_SIZE(__pyx_args)) {
33533143 }
33543144 goto __pyx_L4_argument_unpacking_done;
33553145 __pyx_L5_argtuple_error:;
3356 __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 145, __pyx_L3_error)
3146 __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 130, __pyx_L3_error)
33573147 __pyx_L3_error:;
33583148 __Pyx_AddTraceback("pygame_sdl2.display.Window.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
33593149 __Pyx_RefNannyFinishContext();
33773167 PyObject *__pyx_t_5 = NULL;
33783168 Uint32 __pyx_t_6;
33793169 char const *__pyx_t_7;
3380 int __pyx_t_8;
3170 char const *__pyx_t_8;
33813171 int __pyx_t_9;
33823172 int __pyx_t_10;
33833173 int __pyx_t_11;
3384 PyObject *__pyx_t_12 = NULL;
3174 int __pyx_t_12;
33853175 PyObject *__pyx_t_13 = NULL;
33863176 PyObject *__pyx_t_14 = NULL;
33873177 PyObject *__pyx_t_15 = NULL;
33883178 PyObject *__pyx_t_16 = NULL;
33893179 PyObject *__pyx_t_17 = NULL;
3180 PyObject *__pyx_t_18 = NULL;
33903181 int __pyx_lineno = 0;
33913182 const char *__pyx_filename = NULL;
33923183 int __pyx_clineno = 0;
33933184 __Pyx_RefNannySetupContext("__init__", 0);
33943185 __Pyx_INCREF(__pyx_v_title);
33953186
3396 /* "pygame_sdl2/display.pyx":147
3187 /* "pygame_sdl2/display.pyx":132
33973188 * def __init__(self, title, resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)):
33983189 *
33993190 * if not isinstance(title, bytes): # <<<<<<<<<<<<<<
34043195 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
34053196 if (__pyx_t_2) {
34063197
3407 /* "pygame_sdl2/display.pyx":148
3198 /* "pygame_sdl2/display.pyx":133
34083199 *
34093200 * if not isinstance(title, bytes):
34103201 * title = title.encode("utf-8") # <<<<<<<<<<<<<<
34113202 *
3412 * _before_first_window()
3413 */
3414 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_title, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 148, __pyx_L1_error)
3203 * self.create_flags = flags
3204 */
3205 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_title, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 133, __pyx_L1_error)
34153206 __Pyx_GOTREF(__pyx_t_4);
34163207 __pyx_t_5 = NULL;
34173208 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
34253216 }
34263217 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_u_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_utf_8);
34273218 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3428 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 148, __pyx_L1_error)
3219 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 133, __pyx_L1_error)
34293220 __Pyx_GOTREF(__pyx_t_3);
34303221 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
34313222 __Pyx_DECREF_SET(__pyx_v_title, __pyx_t_3);
34323223 __pyx_t_3 = 0;
34333224
3434 /* "pygame_sdl2/display.pyx":147
3225 /* "pygame_sdl2/display.pyx":132
34353226 * def __init__(self, title, resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)):
34363227 *
34373228 * if not isinstance(title, bytes): # <<<<<<<<<<<<<<
34403231 */
34413232 }
34423233
3443 /* "pygame_sdl2/display.pyx":150
3234 /* "pygame_sdl2/display.pyx":135
34443235 * title = title.encode("utf-8")
34453236 *
3446 * _before_first_window() # <<<<<<<<<<<<<<
3447 *
3448 * self.create_flags = flags
3449 */
3450 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_before_first_window); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 150, __pyx_L1_error)
3451 __Pyx_GOTREF(__pyx_t_4);
3452 __pyx_t_5 = NULL;
3453 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
3454 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
3455 if (likely(__pyx_t_5)) {
3456 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
3457 __Pyx_INCREF(__pyx_t_5);
3458 __Pyx_INCREF(function);
3459 __Pyx_DECREF_SET(__pyx_t_4, function);
3460 }
3461 }
3462 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
3463 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3464 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 150, __pyx_L1_error)
3465 __Pyx_GOTREF(__pyx_t_3);
3466 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3467 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3468
3469 /* "pygame_sdl2/display.pyx":152
3470 * _before_first_window()
3471 *
34723237 * self.create_flags = flags # <<<<<<<<<<<<<<
34733238 *
34743239 * # If we do not get the AVOID_GL hint, we always create a GL-compatible
34753240 */
3476 __pyx_t_6 = __Pyx_PyInt_As_uint32_t(__pyx_v_flags); if (unlikely((__pyx_t_6 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 152, __pyx_L1_error)
3241 __pyx_t_6 = __Pyx_PyInt_As_uint32_t(__pyx_v_flags); if (unlikely((__pyx_t_6 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 135, __pyx_L1_error)
34773242 __pyx_v_self->create_flags = __pyx_t_6;
34783243
3479 /* "pygame_sdl2/display.pyx":156
3244 /* "pygame_sdl2/display.pyx":139
34803245 * # If we do not get the AVOID_GL hint, we always create a GL-compatible
34813246 * # window. This lets us change the OPENGL flag later on.
34823247 * if int(_get_hint("PYGAME_SDL2_AVOID_GL", "0")): # <<<<<<<<<<<<<<
34833248 * gl_flag = 0
34843249 * else:
34853250 */
3486 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_get_hint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 156, __pyx_L1_error)
3251 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_get_hint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error)
34873252 __Pyx_GOTREF(__pyx_t_3);
3488 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 156, __pyx_L1_error)
3253 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 139, __pyx_L1_error)
34893254 __Pyx_GOTREF(__pyx_t_4);
34903255 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3491 __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 156, __pyx_L1_error)
3256 __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error)
34923257 __Pyx_GOTREF(__pyx_t_3);
34933258 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3494 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 156, __pyx_L1_error)
3259 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 139, __pyx_L1_error)
34953260 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
34963261 if (__pyx_t_2) {
34973262
3498 /* "pygame_sdl2/display.pyx":157
3263 /* "pygame_sdl2/display.pyx":140
34993264 * # window. This lets us change the OPENGL flag later on.
35003265 * if int(_get_hint("PYGAME_SDL2_AVOID_GL", "0")):
35013266 * gl_flag = 0 # <<<<<<<<<<<<<<
35043269 */
35053270 __pyx_v_gl_flag = 0;
35063271
3507 /* "pygame_sdl2/display.pyx":156
3272 /* "pygame_sdl2/display.pyx":139
35083273 * # If we do not get the AVOID_GL hint, we always create a GL-compatible
35093274 * # window. This lets us change the OPENGL flag later on.
35103275 * if int(_get_hint("PYGAME_SDL2_AVOID_GL", "0")): # <<<<<<<<<<<<<<
35143279 goto __pyx_L4;
35153280 }
35163281
3517 /* "pygame_sdl2/display.pyx":159
3282 /* "pygame_sdl2/display.pyx":142
35183283 * gl_flag = 0
35193284 * else:
35203285 * gl_flag = SDL_WINDOW_OPENGL # <<<<<<<<<<<<<<
35213286 *
3522 * self.window = SDL_CreateWindow(
3287 * self.window = NULL
35233288 */
35243289 /*else*/ {
35253290 __pyx_v_gl_flag = SDL_WINDOW_OPENGL;
35263291 }
35273292 __pyx_L4:;
35283293
3529 /* "pygame_sdl2/display.pyx":162
3530 *
3531 * self.window = SDL_CreateWindow(
3532 * title, # <<<<<<<<<<<<<<
3533 * pos[0], pos[1],
3534 * resolution[0], resolution[1], flags | gl_flag)
3535 */
3536 __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_title); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 162, __pyx_L1_error)
3537
3538 /* "pygame_sdl2/display.pyx":163
3539 * self.window = SDL_CreateWindow(
3540 * title,
3541 * pos[0], pos[1], # <<<<<<<<<<<<<<
3542 * resolution[0], resolution[1], flags | gl_flag)
3543 *
3544 */
3545 __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pos, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error)
3294 /* "pygame_sdl2/display.pyx":144
3295 * gl_flag = SDL_WINDOW_OPENGL
3296 *
3297 * self.window = NULL # <<<<<<<<<<<<<<
3298 *
3299 * if androidembed is not None:
3300 */
3301 __pyx_v_self->window = NULL;
3302
3303 /* "pygame_sdl2/display.pyx":146
3304 * self.window = NULL
3305 *
3306 * if androidembed is not None: # <<<<<<<<<<<<<<
3307 * self.window = SDL_GL_GetCurrentWindow()
3308 *
3309 */
3310 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_androidembed); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 146, __pyx_L1_error)
35463311 __Pyx_GOTREF(__pyx_t_3);
3547 __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 163, __pyx_L1_error)
3312 __pyx_t_2 = (__pyx_t_3 != Py_None);
35483313 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3549 __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pos, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error)
3550 __Pyx_GOTREF(__pyx_t_3);
3551 __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 163, __pyx_L1_error)
3552 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3553
3554 /* "pygame_sdl2/display.pyx":164
3555 * title,
3556 * pos[0], pos[1],
3557 * resolution[0], resolution[1], flags | gl_flag) # <<<<<<<<<<<<<<
3314 __pyx_t_1 = (__pyx_t_2 != 0);
3315 if (__pyx_t_1) {
3316
3317 /* "pygame_sdl2/display.pyx":147
3318 *
3319 * if androidembed is not None:
3320 * self.window = SDL_GL_GetCurrentWindow() # <<<<<<<<<<<<<<
3321 *
3322 * if self.window:
3323 */
3324 __pyx_v_self->window = SDL_GL_GetCurrentWindow();
3325
3326 /* "pygame_sdl2/display.pyx":149
3327 * self.window = SDL_GL_GetCurrentWindow()
3328 *
3329 * if self.window: # <<<<<<<<<<<<<<
3330 *
3331 * # Android bug - a RGB_565 format is likely to mean the window
3332 */
3333 __pyx_t_1 = (__pyx_v_self->window != 0);
3334 if (__pyx_t_1) {
3335
3336 /* "pygame_sdl2/display.pyx":153
3337 * # Android bug - a RGB_565 format is likely to mean the window
3338 * # wasn't created properly, so re-make it.
3339 * if SDL_GetWindowPixelFormat(self.window) == SDL_PIXELFORMAT_RGB565: # <<<<<<<<<<<<<<
3340 * SDL_DestroyWindow(self.window)
3341 * self.window = NULL
3342 */
3343 __pyx_t_1 = ((SDL_GetWindowPixelFormat(__pyx_v_self->window) == SDL_PIXELFORMAT_RGB565) != 0);
3344 if (__pyx_t_1) {
3345
3346 /* "pygame_sdl2/display.pyx":154
3347 * # wasn't created properly, so re-make it.
3348 * if SDL_GetWindowPixelFormat(self.window) == SDL_PIXELFORMAT_RGB565:
3349 * SDL_DestroyWindow(self.window) # <<<<<<<<<<<<<<
3350 * self.window = NULL
3351 * else:
3352 */
3353 SDL_DestroyWindow(__pyx_v_self->window);
3354
3355 /* "pygame_sdl2/display.pyx":155
3356 * if SDL_GetWindowPixelFormat(self.window) == SDL_PIXELFORMAT_RGB565:
3357 * SDL_DestroyWindow(self.window)
3358 * self.window = NULL # <<<<<<<<<<<<<<
3359 * else:
3360 * SDL_SetWindowTitle(self.window, title)
3361 */
3362 __pyx_v_self->window = NULL;
3363
3364 /* "pygame_sdl2/display.pyx":153
3365 * # Android bug - a RGB_565 format is likely to mean the window
3366 * # wasn't created properly, so re-make it.
3367 * if SDL_GetWindowPixelFormat(self.window) == SDL_PIXELFORMAT_RGB565: # <<<<<<<<<<<<<<
3368 * SDL_DestroyWindow(self.window)
3369 * self.window = NULL
3370 */
3371 goto __pyx_L7;
3372 }
3373
3374 /* "pygame_sdl2/display.pyx":157
3375 * self.window = NULL
3376 * else:
3377 * SDL_SetWindowTitle(self.window, title) # <<<<<<<<<<<<<<
35583378 *
35593379 * if not self.window:
35603380 */
3561 __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_resolution, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 164, __pyx_L1_error)
3562 __Pyx_GOTREF(__pyx_t_3);
3563 __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 164, __pyx_L1_error)
3564 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3565 __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_resolution, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 164, __pyx_L1_error)
3566 __Pyx_GOTREF(__pyx_t_3);
3567 __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 164, __pyx_L1_error)
3568 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3569 __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_gl_flag); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 164, __pyx_L1_error)
3570 __Pyx_GOTREF(__pyx_t_3);
3571 __pyx_t_4 = PyNumber_Or(__pyx_v_flags, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 164, __pyx_L1_error)
3572 __Pyx_GOTREF(__pyx_t_4);
3573 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3574 __pyx_t_6 = __Pyx_PyInt_As_uint32_t(__pyx_t_4); if (unlikely((__pyx_t_6 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 164, __pyx_L1_error)
3575 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3576
3577 /* "pygame_sdl2/display.pyx":161
3578 * gl_flag = SDL_WINDOW_OPENGL
3579 *
3580 * self.window = SDL_CreateWindow( # <<<<<<<<<<<<<<
3581 * title,
3582 * pos[0], pos[1],
3583 */
3584 __pyx_v_self->window = SDL_CreateWindow(__pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_t_11, __pyx_t_6);
3585
3586 /* "pygame_sdl2/display.pyx":166
3587 * resolution[0], resolution[1], flags | gl_flag)
3381 /*else*/ {
3382 __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_title); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 157, __pyx_L1_error)
3383 SDL_SetWindowTitle(__pyx_v_self->window, __pyx_t_7);
3384 }
3385 __pyx_L7:;
3386
3387 /* "pygame_sdl2/display.pyx":149
3388 * self.window = SDL_GL_GetCurrentWindow()
3389 *
3390 * if self.window: # <<<<<<<<<<<<<<
3391 *
3392 * # Android bug - a RGB_565 format is likely to mean the window
3393 */
3394 }
3395
3396 /* "pygame_sdl2/display.pyx":146
3397 * self.window = NULL
3398 *
3399 * if androidembed is not None: # <<<<<<<<<<<<<<
3400 * self.window = SDL_GL_GetCurrentWindow()
3401 *
3402 */
3403 }
3404
3405 /* "pygame_sdl2/display.pyx":159
3406 * SDL_SetWindowTitle(self.window, title)
3407 *
3408 * if not self.window: # <<<<<<<<<<<<<<
3409 * self.window = SDL_CreateWindow(
3410 * title,
3411 */
3412 __pyx_t_1 = ((!(__pyx_v_self->window != 0)) != 0);
3413 if (__pyx_t_1) {
3414
3415 /* "pygame_sdl2/display.pyx":161
3416 * if not self.window:
3417 * self.window = SDL_CreateWindow(
3418 * title, # <<<<<<<<<<<<<<
3419 * pos[0], pos[1],
3420 * resolution[0], resolution[1], flags | gl_flag)
3421 */
3422 __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_v_title); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 161, __pyx_L1_error)
3423
3424 /* "pygame_sdl2/display.pyx":162
3425 * self.window = SDL_CreateWindow(
3426 * title,
3427 * pos[0], pos[1], # <<<<<<<<<<<<<<
3428 * resolution[0], resolution[1], flags | gl_flag)
3429 *
3430 */
3431 __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pos, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 162, __pyx_L1_error)
3432 __Pyx_GOTREF(__pyx_t_3);
3433 __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 162, __pyx_L1_error)
3434 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3435 __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pos, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 162, __pyx_L1_error)
3436 __Pyx_GOTREF(__pyx_t_3);
3437 __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 162, __pyx_L1_error)
3438 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3439
3440 /* "pygame_sdl2/display.pyx":163
3441 * title,
3442 * pos[0], pos[1],
3443 * resolution[0], resolution[1], flags | gl_flag) # <<<<<<<<<<<<<<
3444 *
3445 * if not self.window:
3446 */
3447 __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_resolution, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error)
3448 __Pyx_GOTREF(__pyx_t_3);
3449 __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 163, __pyx_L1_error)
3450 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3451 __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_resolution, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error)
3452 __Pyx_GOTREF(__pyx_t_3);
3453 __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 163, __pyx_L1_error)
3454 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3455 __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_gl_flag); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error)
3456 __Pyx_GOTREF(__pyx_t_3);
3457 __pyx_t_4 = PyNumber_Or(__pyx_v_flags, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error)
3458 __Pyx_GOTREF(__pyx_t_4);
3459 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3460 __pyx_t_6 = __Pyx_PyInt_As_uint32_t(__pyx_t_4); if (unlikely((__pyx_t_6 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 163, __pyx_L1_error)
3461 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3462
3463 /* "pygame_sdl2/display.pyx":160
3464 *
3465 * if not self.window:
3466 * self.window = SDL_CreateWindow( # <<<<<<<<<<<<<<
3467 * title,
3468 * pos[0], pos[1],
3469 */
3470 __pyx_v_self->window = SDL_CreateWindow(__pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_t_11, __pyx_t_12, __pyx_t_6);
3471
3472 /* "pygame_sdl2/display.pyx":159
3473 * SDL_SetWindowTitle(self.window, title)
3474 *
3475 * if not self.window: # <<<<<<<<<<<<<<
3476 * self.window = SDL_CreateWindow(
3477 * title,
3478 */
3479 }
3480
3481 /* "pygame_sdl2/display.pyx":165
3482 * resolution[0], resolution[1], flags | gl_flag)
35883483 *
35893484 * if not self.window: # <<<<<<<<<<<<<<
35903485 * raise error()
35913486 *
35923487 */
3593 __pyx_t_2 = ((!(__pyx_v_self->window != 0)) != 0);
3594 if (unlikely(__pyx_t_2)) {
3595
3596 /* "pygame_sdl2/display.pyx":167
3488 __pyx_t_1 = ((!(__pyx_v_self->window != 0)) != 0);
3489 if (unlikely(__pyx_t_1)) {
3490
3491 /* "pygame_sdl2/display.pyx":166
35973492 *
35983493 * if not self.window:
35993494 * raise error() # <<<<<<<<<<<<<<
36003495 *
36013496 * # From here on, the window exists. So we have to call self.destroy if
36023497 */
3603 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 167, __pyx_L1_error)
3498 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 166, __pyx_L1_error)
36043499 __Pyx_GOTREF(__pyx_t_3);
36053500 __pyx_t_5 = NULL;
36063501 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
36143509 }
36153510 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
36163511 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3617 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L1_error)
3512 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 166, __pyx_L1_error)
36183513 __Pyx_GOTREF(__pyx_t_4);
36193514 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
36203515 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
36213516 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3622 __PYX_ERR(0, 167, __pyx_L1_error)
3623
3624 /* "pygame_sdl2/display.pyx":166
3625 * resolution[0], resolution[1], flags | gl_flag)
3517 __PYX_ERR(0, 166, __pyx_L1_error)
3518
3519 /* "pygame_sdl2/display.pyx":165
3520 * resolution[0], resolution[1], flags | gl_flag)
36263521 *
36273522 * if not self.window: # <<<<<<<<<<<<<<
36283523 * raise error()
36303525 */
36313526 }
36323527
3633 /* "pygame_sdl2/display.pyx":172
3528 /* "pygame_sdl2/display.pyx":171
36343529 * # an exception occurs.
36353530 *
36363531 * try: # <<<<<<<<<<<<<<
36403535 {
36413536 __Pyx_PyThreadState_declare
36423537 __Pyx_PyThreadState_assign
3643 __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
3644 __Pyx_XGOTREF(__pyx_t_12);
3538 __Pyx_ExceptionSave(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
36453539 __Pyx_XGOTREF(__pyx_t_13);
36463540 __Pyx_XGOTREF(__pyx_t_14);
3541 __Pyx_XGOTREF(__pyx_t_15);
36473542 /*try:*/ {
36483543
3649 /* "pygame_sdl2/display.pyx":174
3544 /* "pygame_sdl2/display.pyx":173
36503545 * try:
36513546 *
36523547 * if flags & SDL_WINDOW_OPENGL: # <<<<<<<<<<<<<<
36533548 *
36543549 * self.gl_context = SDL_GL_CreateContext(self.window)
36553550 */
3656 __pyx_t_4 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_OPENGL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 174, __pyx_L6_error)
3551 __pyx_t_4 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_OPENGL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 173, __pyx_L10_error)
36573552 __Pyx_GOTREF(__pyx_t_4);
3658 __pyx_t_3 = PyNumber_And(__pyx_v_flags, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 174, __pyx_L6_error)
3553 __pyx_t_3 = PyNumber_And(__pyx_v_flags, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 173, __pyx_L10_error)
36593554 __Pyx_GOTREF(__pyx_t_3);
36603555 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3661 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 174, __pyx_L6_error)
3556 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 173, __pyx_L10_error)
36623557 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3663 if (__pyx_t_2) {
3664
3665 /* "pygame_sdl2/display.pyx":176
3558 if (__pyx_t_1) {
3559
3560 /* "pygame_sdl2/display.pyx":175
36663561 * if flags & SDL_WINDOW_OPENGL:
36673562 *
36683563 * self.gl_context = SDL_GL_CreateContext(self.window) # <<<<<<<<<<<<<<
36713566 */
36723567 __pyx_v_self->gl_context = SDL_GL_CreateContext(__pyx_v_self->window);
36733568
3674 /* "pygame_sdl2/display.pyx":178
3569 /* "pygame_sdl2/display.pyx":177
36753570 * self.gl_context = SDL_GL_CreateContext(self.window)
36763571 *
36773572 * if self.gl_context == NULL: # <<<<<<<<<<<<<<
36783573 * raise error()
36793574 *
36803575 */
3681 __pyx_t_2 = ((__pyx_v_self->gl_context == NULL) != 0);
3682 if (unlikely(__pyx_t_2)) {
3683
3684 /* "pygame_sdl2/display.pyx":179
3576 __pyx_t_1 = ((__pyx_v_self->gl_context == NULL) != 0);
3577 if (unlikely(__pyx_t_1)) {
3578
3579 /* "pygame_sdl2/display.pyx":178
36853580 *
36863581 * if self.gl_context == NULL:
36873582 * raise error() # <<<<<<<<<<<<<<
36883583 *
3689 * if not ios:
3690 */
3691 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 179, __pyx_L6_error)
3584 * SDL_GL_MakeCurrent(self.window, self.gl_context)
3585 */
3586 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 178, __pyx_L10_error)
36923587 __Pyx_GOTREF(__pyx_t_4);
36933588 __pyx_t_5 = NULL;
36943589 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
37023597 }
37033598 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
37043599 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3705 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 179, __pyx_L6_error)
3600 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 178, __pyx_L10_error)
37063601 __Pyx_GOTREF(__pyx_t_3);
37073602 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37083603 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
37093604 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3710 __PYX_ERR(0, 179, __pyx_L6_error)
3711
3712 /* "pygame_sdl2/display.pyx":178
3605 __PYX_ERR(0, 178, __pyx_L10_error)
3606
3607 /* "pygame_sdl2/display.pyx":177
37133608 * self.gl_context = SDL_GL_CreateContext(self.window)
37143609 *
37153610 * if self.gl_context == NULL: # <<<<<<<<<<<<<<
37183613 */
37193614 }
37203615
3721 /* "pygame_sdl2/display.pyx":181
3616 /* "pygame_sdl2/display.pyx":180
37223617 * raise error()
3618 *
3619 * SDL_GL_MakeCurrent(self.window, self.gl_context) # <<<<<<<<<<<<<<
3620 *
3621 * if not ios:
3622 */
3623 (void)(SDL_GL_MakeCurrent(__pyx_v_self->window, __pyx_v_self->gl_context));
3624
3625 /* "pygame_sdl2/display.pyx":182
3626 * SDL_GL_MakeCurrent(self.window, self.gl_context)
37233627 *
37243628 * if not ios: # <<<<<<<<<<<<<<
37253629 * # Try setting the swap interval - first positive, then negated
37263630 * # to deal with the case where the negative interval isn't
37273631 */
3728 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ios); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 181, __pyx_L6_error)
3632 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ios); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 182, __pyx_L10_error)
37293633 __Pyx_GOTREF(__pyx_t_3);
3730 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 181, __pyx_L6_error)
3634 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 182, __pyx_L10_error)
37313635 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3732 __pyx_t_1 = ((!__pyx_t_2) != 0);
3733 if (__pyx_t_1) {
3734
3735 /* "pygame_sdl2/display.pyx":185
3636 __pyx_t_2 = ((!__pyx_t_1) != 0);
3637 if (__pyx_t_2) {
3638
3639 /* "pygame_sdl2/display.pyx":186
37363640 * # to deal with the case where the negative interval isn't
37373641 * # supported. Then give up and carry on.
37383642 * if SDL_GL_SetSwapInterval(default_swap_control): # <<<<<<<<<<<<<<
3739 * SDL_GL_SetSwapInterval(-default_swap_control)
3740 *
3741 */
3742 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_default_swap_control); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 185, __pyx_L6_error)
3643 * if default_swap_control < 0:
3644 * SDL_GL_SetSwapInterval(-default_swap_control)
3645 */
3646 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_default_swap_control); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 186, __pyx_L10_error)
37433647 __Pyx_GOTREF(__pyx_t_3);
3744 __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 185, __pyx_L6_error)
3648 __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 186, __pyx_L10_error)
37453649 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3746 __pyx_t_1 = (SDL_GL_SetSwapInterval(__pyx_t_11) != 0);
3747 if (__pyx_t_1) {
3748
3749 /* "pygame_sdl2/display.pyx":186
3650 __pyx_t_2 = (SDL_GL_SetSwapInterval(__pyx_t_12) != 0);
3651 if (__pyx_t_2) {
3652
3653 /* "pygame_sdl2/display.pyx":187
37503654 * # supported. Then give up and carry on.
37513655 * if SDL_GL_SetSwapInterval(default_swap_control):
3752 * SDL_GL_SetSwapInterval(-default_swap_control) # <<<<<<<<<<<<<<
3753 *
3754 *
3755 */
3756 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_default_swap_control); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 186, __pyx_L6_error)
3656 * if default_swap_control < 0: # <<<<<<<<<<<<<<
3657 * SDL_GL_SetSwapInterval(-default_swap_control)
3658 *
3659 */
3660 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_default_swap_control); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L10_error)
37573661 __Pyx_GOTREF(__pyx_t_3);
3758 __pyx_t_4 = PyNumber_Negative(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 186, __pyx_L6_error)
3759 __Pyx_GOTREF(__pyx_t_4);
3662 __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L10_error)
37603663 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3761 __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 186, __pyx_L6_error)
3664 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 187, __pyx_L10_error)
37623665 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3763 (void)(SDL_GL_SetSwapInterval(__pyx_t_11));
3764
3765 /* "pygame_sdl2/display.pyx":185
3666 if (__pyx_t_2) {
3667
3668 /* "pygame_sdl2/display.pyx":188
3669 * if SDL_GL_SetSwapInterval(default_swap_control):
3670 * if default_swap_control < 0:
3671 * SDL_GL_SetSwapInterval(-default_swap_control) # <<<<<<<<<<<<<<
3672 *
3673 * self.create_surface()
3674 */
3675 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_default_swap_control); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 188, __pyx_L10_error)
3676 __Pyx_GOTREF(__pyx_t_4);
3677 __pyx_t_3 = PyNumber_Negative(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 188, __pyx_L10_error)
3678 __Pyx_GOTREF(__pyx_t_3);
3679 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3680 __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 188, __pyx_L10_error)
3681 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3682 (void)(SDL_GL_SetSwapInterval(__pyx_t_12));
3683
3684 /* "pygame_sdl2/display.pyx":187
3685 * # supported. Then give up and carry on.
3686 * if SDL_GL_SetSwapInterval(default_swap_control):
3687 * if default_swap_control < 0: # <<<<<<<<<<<<<<
3688 * SDL_GL_SetSwapInterval(-default_swap_control)
3689 *
3690 */
3691 }
3692
3693 /* "pygame_sdl2/display.pyx":186
37663694 * # to deal with the case where the negative interval isn't
37673695 * # supported. Then give up and carry on.
37683696 * if SDL_GL_SetSwapInterval(default_swap_control): # <<<<<<<<<<<<<<
3769 * SDL_GL_SetSwapInterval(-default_swap_control)
3770 *
3697 * if default_swap_control < 0:
3698 * SDL_GL_SetSwapInterval(-default_swap_control)
37713699 */
37723700 }
37733701
3774 /* "pygame_sdl2/display.pyx":181
3775 * raise error()
3702 /* "pygame_sdl2/display.pyx":182
3703 * SDL_GL_MakeCurrent(self.window, self.gl_context)
37763704 *
37773705 * if not ios: # <<<<<<<<<<<<<<
37783706 * # Try setting the swap interval - first positive, then negated
37803708 */
37813709 }
37823710
3783 /* "pygame_sdl2/display.pyx":174
3711 /* "pygame_sdl2/display.pyx":173
37843712 * try:
37853713 *
37863714 * if flags & SDL_WINDOW_OPENGL: # <<<<<<<<<<<<<<
37893717 */
37903718 }
37913719
3792 /* "pygame_sdl2/display.pyx":189
3793 *
3720 /* "pygame_sdl2/display.pyx":190
3721 * SDL_GL_SetSwapInterval(-default_swap_control)
37943722 *
37953723 * self.create_surface() # <<<<<<<<<<<<<<
37963724 *
37973725 * except:
37983726 */
3799 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_create_surface); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 189, __pyx_L6_error)
3800 __Pyx_GOTREF(__pyx_t_3);
3727 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_create_surface); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 190, __pyx_L10_error)
3728 __Pyx_GOTREF(__pyx_t_4);
38013729 __pyx_t_5 = NULL;
3802 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3803 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3730 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
3731 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
38043732 if (likely(__pyx_t_5)) {
3805 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3733 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
38063734 __Pyx_INCREF(__pyx_t_5);
38073735 __Pyx_INCREF(function);
3808 __Pyx_DECREF_SET(__pyx_t_3, function);
3736 __Pyx_DECREF_SET(__pyx_t_4, function);
38093737 }
38103738 }
3811 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
3739 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
38123740 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3813 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 189, __pyx_L6_error)
3814 __Pyx_GOTREF(__pyx_t_4);
3741 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 190, __pyx_L10_error)
3742 __Pyx_GOTREF(__pyx_t_3);
3743 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
38153744 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3816 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3817
3818 /* "pygame_sdl2/display.pyx":172
3745
3746 /* "pygame_sdl2/display.pyx":171
38193747 * # an exception occurs.
38203748 *
38213749 * try: # <<<<<<<<<<<<<<
38233751 * if flags & SDL_WINDOW_OPENGL:
38243752 */
38253753 }
3826 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
38273754 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
38283755 __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
3829 goto __pyx_L11_try_end;
3830 __pyx_L6_error:;
3756 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
3757 goto __pyx_L15_try_end;
3758 __pyx_L10_error:;
38313759 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
38323760 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
38333761 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
38343762
3835 /* "pygame_sdl2/display.pyx":191
3763 /* "pygame_sdl2/display.pyx":192
38363764 * self.create_surface()
38373765 *
38383766 * except: # <<<<<<<<<<<<<<
38413769 */
38423770 /*except:*/ {
38433771 __Pyx_AddTraceback("pygame_sdl2.display.Window.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3844 if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_3, &__pyx_t_5) < 0) __PYX_ERR(0, 191, __pyx_L8_except_error)
3772 if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5) < 0) __PYX_ERR(0, 192, __pyx_L12_except_error)
3773 __Pyx_GOTREF(__pyx_t_3);
38453774 __Pyx_GOTREF(__pyx_t_4);
3846 __Pyx_GOTREF(__pyx_t_3);
38473775 __Pyx_GOTREF(__pyx_t_5);
38483776
3849 /* "pygame_sdl2/display.pyx":192
3777 /* "pygame_sdl2/display.pyx":193
38503778 *
38513779 * except:
38523780 * self.destroy() # <<<<<<<<<<<<<<
38533781 * raise
38543782 *
38553783 */
3856 __pyx_t_16 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_destroy); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 192, __pyx_L8_except_error)
3857 __Pyx_GOTREF(__pyx_t_16);
3858 __pyx_t_17 = NULL;
3859 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_16))) {
3860 __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_16);
3861 if (likely(__pyx_t_17)) {
3862 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16);
3863 __Pyx_INCREF(__pyx_t_17);
3784 __pyx_t_17 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_destroy); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 193, __pyx_L12_except_error)
3785 __Pyx_GOTREF(__pyx_t_17);
3786 __pyx_t_18 = NULL;
3787 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_17))) {
3788 __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_17);
3789 if (likely(__pyx_t_18)) {
3790 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
3791 __Pyx_INCREF(__pyx_t_18);
38643792 __Pyx_INCREF(function);
3865 __Pyx_DECREF_SET(__pyx_t_16, function);
3793 __Pyx_DECREF_SET(__pyx_t_17, function);
38663794 }
38673795 }
3868 __pyx_t_15 = (__pyx_t_17) ? __Pyx_PyObject_CallOneArg(__pyx_t_16, __pyx_t_17) : __Pyx_PyObject_CallNoArg(__pyx_t_16);
3869 __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
3870 if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 192, __pyx_L8_except_error)
3871 __Pyx_GOTREF(__pyx_t_15);
3796 __pyx_t_16 = (__pyx_t_18) ? __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_t_18) : __Pyx_PyObject_CallNoArg(__pyx_t_17);
3797 __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
3798 if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 193, __pyx_L12_except_error)
3799 __Pyx_GOTREF(__pyx_t_16);
3800 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
38723801 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
3873 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3874
3875 /* "pygame_sdl2/display.pyx":193
3802
3803 /* "pygame_sdl2/display.pyx":194
38763804 * except:
38773805 * self.destroy()
38783806 * raise # <<<<<<<<<<<<<<
38793807 *
38803808 * def create_surface(self):
38813809 */
3810 __Pyx_GIVEREF(__pyx_t_3);
38823811 __Pyx_GIVEREF(__pyx_t_4);
3883 __Pyx_GIVEREF(__pyx_t_3);
38843812 __Pyx_XGIVEREF(__pyx_t_5);
3885 __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_3, __pyx_t_5);
3886 __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_5 = 0;
3887 __PYX_ERR(0, 193, __pyx_L8_except_error)
3888 }
3889 __pyx_L8_except_error:;
3890
3891 /* "pygame_sdl2/display.pyx":172
3813 __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_4, __pyx_t_5);
3814 __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0;
3815 __PYX_ERR(0, 194, __pyx_L12_except_error)
3816 }
3817 __pyx_L12_except_error:;
3818
3819 /* "pygame_sdl2/display.pyx":171
38923820 * # an exception occurs.
38933821 *
38943822 * try: # <<<<<<<<<<<<<<
38953823 *
38963824 * if flags & SDL_WINDOW_OPENGL:
38973825 */
3898 __Pyx_XGIVEREF(__pyx_t_12);
38993826 __Pyx_XGIVEREF(__pyx_t_13);
39003827 __Pyx_XGIVEREF(__pyx_t_14);
3901 __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
3828 __Pyx_XGIVEREF(__pyx_t_15);
3829 __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15);
39023830 goto __pyx_L1_error;
3903 __pyx_L11_try_end:;
3831 __pyx_L15_try_end:;
39043832 }
39053833
3906 /* "pygame_sdl2/display.pyx":145
3834 /* "pygame_sdl2/display.pyx":130
39073835 *
39083836 * cdef class Window:
39093837 * def __init__(self, title, resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): # <<<<<<<<<<<<<<
39183846 __Pyx_XDECREF(__pyx_t_3);
39193847 __Pyx_XDECREF(__pyx_t_4);
39203848 __Pyx_XDECREF(__pyx_t_5);
3921 __Pyx_XDECREF(__pyx_t_15);
39223849 __Pyx_XDECREF(__pyx_t_16);
39233850 __Pyx_XDECREF(__pyx_t_17);
3851 __Pyx_XDECREF(__pyx_t_18);
39243852 __Pyx_AddTraceback("pygame_sdl2.display.Window.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
39253853 __pyx_r = -1;
39263854 __pyx_L0:;
39293857 return __pyx_r;
39303858 }
39313859
3932 /* "pygame_sdl2/display.pyx":195
3860 /* "pygame_sdl2/display.pyx":196
39333861 * raise
39343862 *
39353863 * def create_surface(self): # <<<<<<<<<<<<<<
39663894 int __pyx_clineno = 0;
39673895 __Pyx_RefNannySetupContext("create_surface", 0);
39683896
3969 /* "pygame_sdl2/display.pyx":201
3897 /* "pygame_sdl2/display.pyx":202
39703898 *
39713899 * cdef int w, h
39723900 * SDL_GetWindowSize(self.window, &w, &h) # <<<<<<<<<<<<<<
39753903 */
39763904 SDL_GetWindowSize(__pyx_v_self->window, (&__pyx_v_w), (&__pyx_v_h));
39773905
3978 /* "pygame_sdl2/display.pyx":203
3906 /* "pygame_sdl2/display.pyx":204
39793907 * SDL_GetWindowSize(self.window, &w, &h)
39803908 *
39813909 * if self.gl_context: # <<<<<<<<<<<<<<
39853913 __pyx_t_1 = (__pyx_v_self->gl_context != 0);
39863914 if (__pyx_t_1) {
39873915
3988 /* "pygame_sdl2/display.pyx":208
3916 /* "pygame_sdl2/display.pyx":209
39893917 * # TODO: Make this a bit less wasteful of memory, even if it means
39903918 * # we lie about the actual size of the pixel array.
39913919 * self.surface = Surface((w, h), SRCALPHA, 32) # <<<<<<<<<<<<<<
39923920 *
39933921 * else:
39943922 */
3995 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_w); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 208, __pyx_L1_error)
3923 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_w); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 209, __pyx_L1_error)
39963924 __Pyx_GOTREF(__pyx_t_2);
3997 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_h); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 208, __pyx_L1_error)
3925 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_h); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 209, __pyx_L1_error)
39983926 __Pyx_GOTREF(__pyx_t_3);
3999 __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 208, __pyx_L1_error)
3927 __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 209, __pyx_L1_error)
40003928 __Pyx_GOTREF(__pyx_t_4);
40013929 __Pyx_GIVEREF(__pyx_t_2);
40023930 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
40043932 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
40053933 __pyx_t_2 = 0;
40063934 __pyx_t_3 = 0;
4007 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SRCALPHA); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 208, __pyx_L1_error)
3935 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SRCALPHA); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 209, __pyx_L1_error)
40083936 __Pyx_GOTREF(__pyx_t_3);
4009 __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 208, __pyx_L1_error)
3937 __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 209, __pyx_L1_error)
40103938 __Pyx_GOTREF(__pyx_t_2);
40113939 __Pyx_GIVEREF(__pyx_t_4);
40123940 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
40173945 PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_int_32);
40183946 __pyx_t_4 = 0;
40193947 __pyx_t_3 = 0;
4020 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 208, __pyx_L1_error)
3948 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 209, __pyx_L1_error)
40213949 __Pyx_GOTREF(__pyx_t_3);
40223950 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
40233951 __Pyx_GIVEREF(__pyx_t_3);
40263954 __pyx_v_self->surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_3);
40273955 __pyx_t_3 = 0;
40283956
4029 /* "pygame_sdl2/display.pyx":203
3957 /* "pygame_sdl2/display.pyx":204
40303958 * SDL_GetWindowSize(self.window, &w, &h)
40313959 *
40323960 * if self.gl_context: # <<<<<<<<<<<<<<
40363964 goto __pyx_L3;
40373965 }
40383966
4039 /* "pygame_sdl2/display.pyx":212
3967 /* "pygame_sdl2/display.pyx":213
40403968 * else:
40413969 *
40423970 * self.window_surface = SDL_GetWindowSurface(self.window) # <<<<<<<<<<<<<<
40463974 /*else*/ {
40473975 __pyx_v_self->window_surface = SDL_GetWindowSurface(__pyx_v_self->window);
40483976
4049 /* "pygame_sdl2/display.pyx":216
3977 /* "pygame_sdl2/display.pyx":217
40503978 * # If the surface is 32-bit, we can use it directly. Otherwise,
40513979 * # we need to create a 32-bit proxy surface.
40523980 * if self.window_surface.format.BitsPerPixel == 32: # <<<<<<<<<<<<<<
40563984 __pyx_t_1 = ((__pyx_v_self->window_surface->format->BitsPerPixel == 32) != 0);
40573985 if (__pyx_t_1) {
40583986
4059 /* "pygame_sdl2/display.pyx":218
3987 /* "pygame_sdl2/display.pyx":219
40603988 * if self.window_surface.format.BitsPerPixel == 32:
40613989 *
40623990 * self.surface = Surface(()) # <<<<<<<<<<<<<<
40633991 * self.surface.surface = self.window_surface
40643992 * self.surface.owns_surface = False
40653993 */
4066 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 218, __pyx_L1_error)
3994 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 219, __pyx_L1_error)
40673995 __Pyx_GOTREF(__pyx_t_3);
40683996 __Pyx_GIVEREF(__pyx_t_3);
40693997 __Pyx_GOTREF(__pyx_v_self->surface);
40713999 __pyx_v_self->surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_3);
40724000 __pyx_t_3 = 0;
40734001
4074 /* "pygame_sdl2/display.pyx":219
4002 /* "pygame_sdl2/display.pyx":220
40754003 *
40764004 * self.surface = Surface(())
40774005 * self.surface.surface = self.window_surface # <<<<<<<<<<<<<<
40814009 __pyx_t_5 = __pyx_v_self->window_surface;
40824010 __pyx_v_self->surface->surface = __pyx_t_5;
40834011
4084 /* "pygame_sdl2/display.pyx":220
4012 /* "pygame_sdl2/display.pyx":221
40854013 * self.surface = Surface(())
40864014 * self.surface.surface = self.window_surface
40874015 * self.surface.owns_surface = False # <<<<<<<<<<<<<<
40904018 */
40914019 __pyx_v_self->surface->owns_surface = 0;
40924020
4093 /* "pygame_sdl2/display.pyx":221
4021 /* "pygame_sdl2/display.pyx":222
40944022 * self.surface.surface = self.window_surface
40954023 * self.surface.owns_surface = False
40964024 * self.surface.window_surface = True # <<<<<<<<<<<<<<
40994027 */
41004028 __pyx_v_self->surface->window_surface = 1;
41014029
4102 /* "pygame_sdl2/display.pyx":216
4030 /* "pygame_sdl2/display.pyx":217
41034031 * # If the surface is 32-bit, we can use it directly. Otherwise,
41044032 * # we need to create a 32-bit proxy surface.
41054033 * if self.window_surface.format.BitsPerPixel == 32: # <<<<<<<<<<<<<<
41094037 goto __pyx_L4;
41104038 }
41114039
4112 /* "pygame_sdl2/display.pyx":224
4040 /* "pygame_sdl2/display.pyx":225
41134041 *
41144042 * else:
41154043 * self.surface = Surface((w, h), 0, 32) # <<<<<<<<<<<<<<
41174045 * self.surface.get_window_flags = self.get_window_flags
41184046 */
41194047 /*else*/ {
4120 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 224, __pyx_L1_error)
4048 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 225, __pyx_L1_error)
41214049 __Pyx_GOTREF(__pyx_t_3);
4122 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error)
4050 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 225, __pyx_L1_error)
41234051 __Pyx_GOTREF(__pyx_t_2);
4124 __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 224, __pyx_L1_error)
4052 __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 225, __pyx_L1_error)
41254053 __Pyx_GOTREF(__pyx_t_4);
41264054 __Pyx_GIVEREF(__pyx_t_3);
41274055 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
41294057 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
41304058 __pyx_t_3 = 0;
41314059 __pyx_t_2 = 0;
4132 __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error)
4060 __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 225, __pyx_L1_error)
41334061 __Pyx_GOTREF(__pyx_t_2);
41344062 __Pyx_GIVEREF(__pyx_t_4);
41354063 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
41404068 __Pyx_GIVEREF(__pyx_int_32);
41414069 PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_int_32);
41424070 __pyx_t_4 = 0;
4143 __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 224, __pyx_L1_error)
4071 __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 225, __pyx_L1_error)
41444072 __Pyx_GOTREF(__pyx_t_4);
41454073 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
41464074 __Pyx_GIVEREF(__pyx_t_4);
41534081 }
41544082 __pyx_L3:;
41554083
4156 /* "pygame_sdl2/display.pyx":226
4084 /* "pygame_sdl2/display.pyx":227
41574085 * self.surface = Surface((w, h), 0, 32)
41584086 *
41594087 * self.surface.get_window_flags = self.get_window_flags # <<<<<<<<<<<<<<
41604088 *
41614089 *
41624090 */
4163 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_window_flags); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 226, __pyx_L1_error)
4091 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_window_flags); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 227, __pyx_L1_error)
41644092 __Pyx_GOTREF(__pyx_t_4);
41654093 __Pyx_GIVEREF(__pyx_t_4);
41664094 __Pyx_GOTREF(__pyx_v_self->surface->get_window_flags);
41684096 __pyx_v_self->surface->get_window_flags = __pyx_t_4;
41694097 __pyx_t_4 = 0;
41704098
4171 /* "pygame_sdl2/display.pyx":195
4099 /* "pygame_sdl2/display.pyx":196
41724100 * raise
41734101 *
41744102 * def create_surface(self): # <<<<<<<<<<<<<<
41914119 return __pyx_r;
41924120 }
41934121
4194 /* "pygame_sdl2/display.pyx":229
4122 /* "pygame_sdl2/display.pyx":230
41954123 *
41964124 *
41974125 * def destroy(self): # <<<<<<<<<<<<<<
42224150 int __pyx_clineno = 0;
42234151 __Pyx_RefNannySetupContext("destroy", 0);
42244152
4225 /* "pygame_sdl2/display.pyx":234
4153 /* "pygame_sdl2/display.pyx":235
42264154 * """
42274155 *
42284156 * if self.gl_context != NULL: # <<<<<<<<<<<<<<
42324160 __pyx_t_1 = ((__pyx_v_self->gl_context != NULL) != 0);
42334161 if (__pyx_t_1) {
42344162
4235 /* "pygame_sdl2/display.pyx":235
4163 /* "pygame_sdl2/display.pyx":236
42364164 *
42374165 * if self.gl_context != NULL:
42384166 * SDL_GL_DeleteContext(self.gl_context) # <<<<<<<<<<<<<<
42414169 */
42424170 SDL_GL_DeleteContext(__pyx_v_self->gl_context);
42434171
4244 /* "pygame_sdl2/display.pyx":234
4172 /* "pygame_sdl2/display.pyx":235
42454173 * """
42464174 *
42474175 * if self.gl_context != NULL: # <<<<<<<<<<<<<<
42504178 */
42514179 }
42524180
4253 /* "pygame_sdl2/display.pyx":237
4181 /* "pygame_sdl2/display.pyx":238
42544182 * SDL_GL_DeleteContext(self.gl_context)
42554183 *
42564184 * if self.surface: # <<<<<<<<<<<<<<
42574185 *
42584186 * # Break the cycle that prevents refcounting from collecting this
42594187 */
4260 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->surface)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 237, __pyx_L1_error)
4188 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->surface)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 238, __pyx_L1_error)
42614189 if (__pyx_t_1) {
42624190
4263 /* "pygame_sdl2/display.pyx":241
4191 /* "pygame_sdl2/display.pyx":242
42644192 * # Break the cycle that prevents refcounting from collecting this
42654193 * # object.
42664194 * self.surface.get_window_flags = None # <<<<<<<<<<<<<<
42734201 __Pyx_DECREF(__pyx_v_self->surface->get_window_flags);
42744202 __pyx_v_self->surface->get_window_flags = Py_None;
42754203
4276 /* "pygame_sdl2/display.pyx":244
4204 /* "pygame_sdl2/display.pyx":245
42774205 *
42784206 * # Necessary to collect the GL surface, doesn't hurt the window surface.
42794207 * self.surface = None # <<<<<<<<<<<<<<
42864214 __Pyx_DECREF(((PyObject *)__pyx_v_self->surface));
42874215 __pyx_v_self->surface = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)Py_None);
42884216
4289 /* "pygame_sdl2/display.pyx":237
4217 /* "pygame_sdl2/display.pyx":238
42904218 * SDL_GL_DeleteContext(self.gl_context)
42914219 *
42924220 * if self.surface: # <<<<<<<<<<<<<<
42954223 */
42964224 }
42974225
4298 /* "pygame_sdl2/display.pyx":246
4226 /* "pygame_sdl2/display.pyx":247
42994227 * self.surface = None
43004228 *
43014229 * SDL_DestroyWindow(self.window) # <<<<<<<<<<<<<<
43044232 */
43054233 SDL_DestroyWindow(__pyx_v_self->window);
43064234
4307 /* "pygame_sdl2/display.pyx":229
4235 /* "pygame_sdl2/display.pyx":230
43084236 *
43094237 *
43104238 * def destroy(self): # <<<<<<<<<<<<<<
43244252 return __pyx_r;
43254253 }
43264254
4327 /* "pygame_sdl2/display.pyx":248
4255 /* "pygame_sdl2/display.pyx":249
43284256 * SDL_DestroyWindow(self.window)
43294257 *
43304258 * def resize(self, size, opengl=False, fullscreen=None): # <<<<<<<<<<<<<<
43824310 }
43834311 }
43844312 if (unlikely(kw_args > 0)) {
4385 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "resize") < 0)) __PYX_ERR(0, 248, __pyx_L3_error)
4313 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "resize") < 0)) __PYX_ERR(0, 249, __pyx_L3_error)
43864314 }
43874315 } else {
43884316 switch (PyTuple_GET_SIZE(__pyx_args)) {
44014329 }
44024330 goto __pyx_L4_argument_unpacking_done;
44034331 __pyx_L5_argtuple_error:;
4404 __Pyx_RaiseArgtupleInvalid("resize", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 248, __pyx_L3_error)
4332 __Pyx_RaiseArgtupleInvalid("resize", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 249, __pyx_L3_error)
44054333 __pyx_L3_error:;
44064334 __Pyx_AddTraceback("pygame_sdl2.display.Window.resize", __pyx_clineno, __pyx_lineno, __pyx_filename);
44074335 __Pyx_RefNannyFinishContext();
44364364 __Pyx_RefNannySetupContext("resize", 0);
44374365 __Pyx_INCREF(__pyx_v_fullscreen);
44384366
4439 /* "pygame_sdl2/display.pyx":255
4367 /* "pygame_sdl2/display.pyx":256
44404368 * """
44414369 *
44424370 * if fullscreen is None: # <<<<<<<<<<<<<<
44474375 __pyx_t_2 = (__pyx_t_1 != 0);
44484376 if (__pyx_t_2) {
44494377
4450 /* "pygame_sdl2/display.pyx":256
4378 /* "pygame_sdl2/display.pyx":257
44514379 *
44524380 * if fullscreen is None:
44534381 * fullscreen = SDL_GetWindowFlags(self.window) & SDL_WINDOW_FULLSCREEN_DESKTOP # <<<<<<<<<<<<<<
44544382 *
44554383 * # Prevents a loop between the surface and this object.
44564384 */
4457 __pyx_t_3 = __Pyx_PyInt_From_uint32_t((SDL_GetWindowFlags(__pyx_v_self->window) & SDL_WINDOW_FULLSCREEN_DESKTOP)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 256, __pyx_L1_error)
4385 __pyx_t_3 = __Pyx_PyInt_From_uint32_t((SDL_GetWindowFlags(__pyx_v_self->window) & SDL_WINDOW_FULLSCREEN_DESKTOP)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 257, __pyx_L1_error)
44584386 __Pyx_GOTREF(__pyx_t_3);
44594387 __Pyx_DECREF_SET(__pyx_v_fullscreen, __pyx_t_3);
44604388 __pyx_t_3 = 0;
44614389
4462 /* "pygame_sdl2/display.pyx":255
4390 /* "pygame_sdl2/display.pyx":256
44634391 * """
44644392 *
44654393 * if fullscreen is None: # <<<<<<<<<<<<<<
44684396 */
44694397 }
44704398
4471 /* "pygame_sdl2/display.pyx":259
4399 /* "pygame_sdl2/display.pyx":260
44724400 *
44734401 * # Prevents a loop between the surface and this object.
44744402 * self.surface.get_window_flags = None # <<<<<<<<<<<<<<
44814409 __Pyx_DECREF(__pyx_v_self->surface->get_window_flags);
44824410 __pyx_v_self->surface->get_window_flags = Py_None;
44834411
4484 /* "pygame_sdl2/display.pyx":261
4412 /* "pygame_sdl2/display.pyx":262
44854413 * self.surface.get_window_flags = None
44864414 *
44874415 * if self.gl_context and not opengl: # <<<<<<<<<<<<<<
44944422 __pyx_t_2 = __pyx_t_1;
44954423 goto __pyx_L5_bool_binop_done;
44964424 }
4497 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_opengl); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 261, __pyx_L1_error)
4425 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_opengl); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 262, __pyx_L1_error)
44984426 __pyx_t_4 = ((!__pyx_t_1) != 0);
44994427 __pyx_t_2 = __pyx_t_4;
45004428 __pyx_L5_bool_binop_done:;
45014429 if (__pyx_t_2) {
45024430
4503 /* "pygame_sdl2/display.pyx":262
4431 /* "pygame_sdl2/display.pyx":263
45044432 *
45054433 * if self.gl_context and not opengl:
45064434 * SDL_GL_DeleteContext(self.gl_context) # <<<<<<<<<<<<<<
45094437 */
45104438 SDL_GL_DeleteContext(__pyx_v_self->gl_context);
45114439
4512 /* "pygame_sdl2/display.pyx":263
4440 /* "pygame_sdl2/display.pyx":264
45134441 * if self.gl_context and not opengl:
45144442 * SDL_GL_DeleteContext(self.gl_context)
45154443 * self.gl_context = NULL # <<<<<<<<<<<<<<
45184446 */
45194447 __pyx_v_self->gl_context = NULL;
45204448
4521 /* "pygame_sdl2/display.pyx":261
4449 /* "pygame_sdl2/display.pyx":262
45224450 * self.surface.get_window_flags = None
45234451 *
45244452 * if self.gl_context and not opengl: # <<<<<<<<<<<<<<
45274455 */
45284456 }
45294457
4530 /* "pygame_sdl2/display.pyx":265
4458 /* "pygame_sdl2/display.pyx":266
45314459 * self.gl_context = NULL
45324460 *
45334461 * cdef int cur_width = 0 # <<<<<<<<<<<<<<
45364464 */
45374465 __pyx_v_cur_width = 0;
45384466
4539 /* "pygame_sdl2/display.pyx":266
4467 /* "pygame_sdl2/display.pyx":267
45404468 *
45414469 * cdef int cur_width = 0
45424470 * cdef int cur_height = 0 # <<<<<<<<<<<<<<
45454473 */
45464474 __pyx_v_cur_height = 0;
45474475
4548 /* "pygame_sdl2/display.pyx":268
4476 /* "pygame_sdl2/display.pyx":269
45494477 * cdef int cur_height = 0
45504478 *
45514479 * if fullscreen: # <<<<<<<<<<<<<<
45524480 * if SDL_SetWindowFullscreen(self.window, SDL_WINDOW_FULLSCREEN_DESKTOP):
45534481 * fullscreen = False
45544482 */
4555 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_fullscreen); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 268, __pyx_L1_error)
4483 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_fullscreen); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 269, __pyx_L1_error)
45564484 if (__pyx_t_2) {
45574485
4558 /* "pygame_sdl2/display.pyx":269
4486 /* "pygame_sdl2/display.pyx":270
45594487 *
45604488 * if fullscreen:
45614489 * if SDL_SetWindowFullscreen(self.window, SDL_WINDOW_FULLSCREEN_DESKTOP): # <<<<<<<<<<<<<<
45654493 __pyx_t_2 = (SDL_SetWindowFullscreen(__pyx_v_self->window, SDL_WINDOW_FULLSCREEN_DESKTOP) != 0);
45664494 if (__pyx_t_2) {
45674495
4568 /* "pygame_sdl2/display.pyx":270
4496 /* "pygame_sdl2/display.pyx":271
45694497 * if fullscreen:
45704498 * if SDL_SetWindowFullscreen(self.window, SDL_WINDOW_FULLSCREEN_DESKTOP):
45714499 * fullscreen = False # <<<<<<<<<<<<<<
45754503 __Pyx_INCREF(Py_False);
45764504 __Pyx_DECREF_SET(__pyx_v_fullscreen, Py_False);
45774505
4578 /* "pygame_sdl2/display.pyx":269
4506 /* "pygame_sdl2/display.pyx":270
45794507 *
45804508 * if fullscreen:
45814509 * if SDL_SetWindowFullscreen(self.window, SDL_WINDOW_FULLSCREEN_DESKTOP): # <<<<<<<<<<<<<<
45844512 */
45854513 }
45864514
4587 /* "pygame_sdl2/display.pyx":268
4515 /* "pygame_sdl2/display.pyx":269
45884516 * cdef int cur_height = 0
45894517 *
45904518 * if fullscreen: # <<<<<<<<<<<<<<
45934521 */
45944522 }
45954523
4596 /* "pygame_sdl2/display.pyx":272
4524 /* "pygame_sdl2/display.pyx":273
45974525 * fullscreen = False
45984526 *
45994527 * if not fullscreen: # <<<<<<<<<<<<<<
46004528 * SDL_SetWindowFullscreen(self.window, 0)
46014529 *
46024530 */
4603 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_fullscreen); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 272, __pyx_L1_error)
4531 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_fullscreen); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 273, __pyx_L1_error)
46044532 __pyx_t_4 = ((!__pyx_t_2) != 0);
46054533 if (__pyx_t_4) {
46064534
4607 /* "pygame_sdl2/display.pyx":273
4535 /* "pygame_sdl2/display.pyx":274
46084536 *
46094537 * if not fullscreen:
46104538 * SDL_SetWindowFullscreen(self.window, 0) # <<<<<<<<<<<<<<
46134541 */
46144542 (void)(SDL_SetWindowFullscreen(__pyx_v_self->window, 0));
46154543
4616 /* "pygame_sdl2/display.pyx":275
4544 /* "pygame_sdl2/display.pyx":276
46174545 * SDL_SetWindowFullscreen(self.window, 0)
46184546 *
46194547 * width, height = size # <<<<<<<<<<<<<<
46264554 if (unlikely(size != 2)) {
46274555 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
46284556 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
4629 __PYX_ERR(0, 275, __pyx_L1_error)
4557 __PYX_ERR(0, 276, __pyx_L1_error)
46304558 }
46314559 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
46324560 if (likely(PyTuple_CheckExact(sequence))) {
46394567 __Pyx_INCREF(__pyx_t_3);
46404568 __Pyx_INCREF(__pyx_t_5);
46414569 #else
4642 __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 275, __pyx_L1_error)
4570 __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 276, __pyx_L1_error)
46434571 __Pyx_GOTREF(__pyx_t_3);
4644 __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 275, __pyx_L1_error)
4572 __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 276, __pyx_L1_error)
46454573 __Pyx_GOTREF(__pyx_t_5);
46464574 #endif
46474575 } else {
46484576 Py_ssize_t index = -1;
4649 __pyx_t_6 = PyObject_GetIter(__pyx_v_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 275, __pyx_L1_error)
4577 __pyx_t_6 = PyObject_GetIter(__pyx_v_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 276, __pyx_L1_error)
46504578 __Pyx_GOTREF(__pyx_t_6);
46514579 __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
46524580 index = 0; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L10_unpacking_failed;
46534581 __Pyx_GOTREF(__pyx_t_3);
46544582 index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L10_unpacking_failed;
46554583 __Pyx_GOTREF(__pyx_t_5);
4656 if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 275, __pyx_L1_error)
4584 if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 276, __pyx_L1_error)
46574585 __pyx_t_7 = NULL;
46584586 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
46594587 goto __pyx_L11_unpacking_done;
46614589 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
46624590 __pyx_t_7 = NULL;
46634591 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
4664 __PYX_ERR(0, 275, __pyx_L1_error)
4592 __PYX_ERR(0, 276, __pyx_L1_error)
46654593 __pyx_L11_unpacking_done:;
46664594 }
46674595 __pyx_v_width = __pyx_t_3;
46694597 __pyx_v_height = __pyx_t_5;
46704598 __pyx_t_5 = 0;
46714599
4672 /* "pygame_sdl2/display.pyx":277
4600 /* "pygame_sdl2/display.pyx":278
46734601 * width, height = size
46744602 *
46754603 * SDL_GetWindowSize(self.window, &cur_width, &cur_height) # <<<<<<<<<<<<<<
46784606 */
46794607 SDL_GetWindowSize(__pyx_v_self->window, (&__pyx_v_cur_width), (&__pyx_v_cur_height));
46804608
4681 /* "pygame_sdl2/display.pyx":279
4609 /* "pygame_sdl2/display.pyx":280
46824610 * SDL_GetWindowSize(self.window, &cur_width, &cur_height)
46834611 *
46844612 * if (cur_width != width) or (cur_height != height): # <<<<<<<<<<<<<<
46854613 * SDL_SetWindowSize(self.window, width, height)
46864614 *
46874615 */
4688 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_cur_width); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 279, __pyx_L1_error)
4616 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_cur_width); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 280, __pyx_L1_error)
46894617 __Pyx_GOTREF(__pyx_t_5);
4690 __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_width, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 279, __pyx_L1_error)
4618 __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_width, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 280, __pyx_L1_error)
46914619 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4692 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 279, __pyx_L1_error)
4620 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 280, __pyx_L1_error)
46934621 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
46944622 if (!__pyx_t_2) {
46954623 } else {
46964624 __pyx_t_4 = __pyx_t_2;
46974625 goto __pyx_L13_bool_binop_done;
46984626 }
4699 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_cur_height); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 279, __pyx_L1_error)
4627 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_cur_height); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 280, __pyx_L1_error)
47004628 __Pyx_GOTREF(__pyx_t_3);
4701 __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_v_height, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 279, __pyx_L1_error)
4629 __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_v_height, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 280, __pyx_L1_error)
47024630 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4703 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 279, __pyx_L1_error)
4631 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 280, __pyx_L1_error)
47044632 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
47054633 __pyx_t_4 = __pyx_t_2;
47064634 __pyx_L13_bool_binop_done:;
47074635 if (__pyx_t_4) {
47084636
4709 /* "pygame_sdl2/display.pyx":280
4637 /* "pygame_sdl2/display.pyx":281
47104638 *
47114639 * if (cur_width != width) or (cur_height != height):
47124640 * SDL_SetWindowSize(self.window, width, height) # <<<<<<<<<<<<<<
47134641 *
47144642 * # Create a missing GL context.
47154643 */
4716 __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_width); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 280, __pyx_L1_error)
4717 __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_height); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 280, __pyx_L1_error)
4644 __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_width); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 281, __pyx_L1_error)
4645 __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_height); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 281, __pyx_L1_error)
47184646 SDL_SetWindowSize(__pyx_v_self->window, __pyx_t_8, __pyx_t_9);
47194647
4720 /* "pygame_sdl2/display.pyx":279
4648 /* "pygame_sdl2/display.pyx":280
47214649 * SDL_GetWindowSize(self.window, &cur_width, &cur_height)
47224650 *
47234651 * if (cur_width != width) or (cur_height != height): # <<<<<<<<<<<<<<
47264654 */
47274655 }
47284656
4729 /* "pygame_sdl2/display.pyx":272
4657 /* "pygame_sdl2/display.pyx":273
47304658 * fullscreen = False
47314659 *
47324660 * if not fullscreen: # <<<<<<<<<<<<<<
47354663 */
47364664 }
47374665
4738 /* "pygame_sdl2/display.pyx":283
4666 /* "pygame_sdl2/display.pyx":284
47394667 *
47404668 * # Create a missing GL context.
47414669 * if opengl and not self.gl_context: # <<<<<<<<<<<<<<
47424670 * self.gl_context = SDL_GL_CreateContext(self.window)
47434671 *
47444672 */
4745 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_opengl); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 283, __pyx_L1_error)
4673 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_opengl); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 284, __pyx_L1_error)
47464674 if (__pyx_t_2) {
47474675 } else {
47484676 __pyx_t_4 = __pyx_t_2;
47534681 __pyx_L16_bool_binop_done:;
47544682 if (__pyx_t_4) {
47554683
4756 /* "pygame_sdl2/display.pyx":284
4684 /* "pygame_sdl2/display.pyx":285
47574685 * # Create a missing GL context.
47584686 * if opengl and not self.gl_context:
47594687 * self.gl_context = SDL_GL_CreateContext(self.window) # <<<<<<<<<<<<<<
47624690 */
47634691 __pyx_v_self->gl_context = SDL_GL_CreateContext(__pyx_v_self->window);
47644692
4765 /* "pygame_sdl2/display.pyx":286
4693 /* "pygame_sdl2/display.pyx":287
47664694 * self.gl_context = SDL_GL_CreateContext(self.window)
47674695 *
47684696 * if self.gl_context == NULL: # <<<<<<<<<<<<<<
47724700 __pyx_t_4 = ((__pyx_v_self->gl_context == NULL) != 0);
47734701 if (unlikely(__pyx_t_4)) {
47744702
4775 /* "pygame_sdl2/display.pyx":287
4703 /* "pygame_sdl2/display.pyx":288
47764704 *
47774705 * if self.gl_context == NULL:
47784706 * raise error() # <<<<<<<<<<<<<<
47794707 *
47804708 * self.create_surface()
47814709 */
4782 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 287, __pyx_L1_error)
4710 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 288, __pyx_L1_error)
47834711 __Pyx_GOTREF(__pyx_t_3);
47844712 __pyx_t_6 = NULL;
47854713 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
47934721 }
47944722 __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
47954723 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
4796 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 287, __pyx_L1_error)
4724 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 288, __pyx_L1_error)
47974725 __Pyx_GOTREF(__pyx_t_5);
47984726 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
47994727 __Pyx_Raise(__pyx_t_5, 0, 0, 0);
48004728 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4801 __PYX_ERR(0, 287, __pyx_L1_error)
4802
4803 /* "pygame_sdl2/display.pyx":286
4729 __PYX_ERR(0, 288, __pyx_L1_error)
4730
4731 /* "pygame_sdl2/display.pyx":287
48044732 * self.gl_context = SDL_GL_CreateContext(self.window)
48054733 *
48064734 * if self.gl_context == NULL: # <<<<<<<<<<<<<<
48094737 */
48104738 }
48114739
4812 /* "pygame_sdl2/display.pyx":283
4740 /* "pygame_sdl2/display.pyx":284
48134741 *
48144742 * # Create a missing GL context.
48154743 * if opengl and not self.gl_context: # <<<<<<<<<<<<<<
48184746 */
48194747 }
48204748
4821 /* "pygame_sdl2/display.pyx":289
4749 /* "pygame_sdl2/display.pyx":290
48224750 * raise error()
48234751 *
48244752 * self.create_surface() # <<<<<<<<<<<<<<
48254753 *
48264754 * def recreate_gl_context(self):
48274755 */
4828 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_create_surface); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 289, __pyx_L1_error)
4756 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_create_surface); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 290, __pyx_L1_error)
48294757 __Pyx_GOTREF(__pyx_t_3);
48304758 __pyx_t_6 = NULL;
48314759 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
48394767 }
48404768 __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
48414769 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
4842 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 289, __pyx_L1_error)
4770 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 290, __pyx_L1_error)
48434771 __Pyx_GOTREF(__pyx_t_5);
48444772 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
48454773 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
48464774
4847 /* "pygame_sdl2/display.pyx":248
4775 /* "pygame_sdl2/display.pyx":249
48484776 * SDL_DestroyWindow(self.window)
48494777 *
48504778 * def resize(self, size, opengl=False, fullscreen=None): # <<<<<<<<<<<<<<
48704798 return __pyx_r;
48714799 }
48724800
4873 /* "pygame_sdl2/display.pyx":291
4801 /* "pygame_sdl2/display.pyx":292
48744802 * self.create_surface()
48754803 *
48764804 * def recreate_gl_context(self): # <<<<<<<<<<<<<<
49044832 int __pyx_clineno = 0;
49054833 __Pyx_RefNannySetupContext("recreate_gl_context", 0);
49064834
4907 /* "pygame_sdl2/display.pyx":296
4835 /* "pygame_sdl2/display.pyx":297
49084836 * """
49094837 *
4910 * if <unsigned int> SDL_GL_GetCurrentContext(): # <<<<<<<<<<<<<<
4838 * if <unsigned long> SDL_GL_GetCurrentContext(): # <<<<<<<<<<<<<<
49114839 * return False
49124840 *
49134841 */
4914 __pyx_t_1 = (((unsigned int)SDL_GL_GetCurrentContext()) != 0);
4842 __pyx_t_1 = (((unsigned long)SDL_GL_GetCurrentContext()) != 0);
49154843 if (__pyx_t_1) {
49164844
4917 /* "pygame_sdl2/display.pyx":297
4918 *
4919 * if <unsigned int> SDL_GL_GetCurrentContext():
4845 /* "pygame_sdl2/display.pyx":298
4846 *
4847 * if <unsigned long> SDL_GL_GetCurrentContext():
49204848 * return False # <<<<<<<<<<<<<<
49214849 *
49224850 * self.gl_context = SDL_GL_CreateContext(self.window)
49264854 __pyx_r = Py_False;
49274855 goto __pyx_L0;
49284856
4929 /* "pygame_sdl2/display.pyx":296
4857 /* "pygame_sdl2/display.pyx":297
49304858 * """
49314859 *
4932 * if <unsigned int> SDL_GL_GetCurrentContext(): # <<<<<<<<<<<<<<
4860 * if <unsigned long> SDL_GL_GetCurrentContext(): # <<<<<<<<<<<<<<
49334861 * return False
49344862 *
49354863 */
49364864 }
49374865
4938 /* "pygame_sdl2/display.pyx":299
4866 /* "pygame_sdl2/display.pyx":300
49394867 * return False
49404868 *
49414869 * self.gl_context = SDL_GL_CreateContext(self.window) # <<<<<<<<<<<<<<
49444872 */
49454873 __pyx_v_self->gl_context = SDL_GL_CreateContext(__pyx_v_self->window);
49464874
4947 /* "pygame_sdl2/display.pyx":301
4875 /* "pygame_sdl2/display.pyx":302
49484876 * self.gl_context = SDL_GL_CreateContext(self.window)
49494877 *
49504878 * if self.gl_context == NULL: # <<<<<<<<<<<<<<
49544882 __pyx_t_1 = ((__pyx_v_self->gl_context == NULL) != 0);
49554883 if (unlikely(__pyx_t_1)) {
49564884
4957 /* "pygame_sdl2/display.pyx":302
4885 /* "pygame_sdl2/display.pyx":303
49584886 *
49594887 * if self.gl_context == NULL:
49604888 * raise error() # <<<<<<<<<<<<<<
49614889 *
49624890 * return True
49634891 */
4964 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 302, __pyx_L1_error)
4892 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 303, __pyx_L1_error)
49654893 __Pyx_GOTREF(__pyx_t_3);
49664894 __pyx_t_4 = NULL;
49674895 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
49754903 }
49764904 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
49774905 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
4978 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 302, __pyx_L1_error)
4906 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 303, __pyx_L1_error)
49794907 __Pyx_GOTREF(__pyx_t_2);
49804908 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
49814909 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
49824910 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4983 __PYX_ERR(0, 302, __pyx_L1_error)
4984
4985 /* "pygame_sdl2/display.pyx":301
4911 __PYX_ERR(0, 303, __pyx_L1_error)
4912
4913 /* "pygame_sdl2/display.pyx":302
49864914 * self.gl_context = SDL_GL_CreateContext(self.window)
49874915 *
49884916 * if self.gl_context == NULL: # <<<<<<<<<<<<<<
49914919 */
49924920 }
49934921
4994 /* "pygame_sdl2/display.pyx":304
4922 /* "pygame_sdl2/display.pyx":305
49954923 * raise error()
49964924 *
49974925 * return True # <<<<<<<<<<<<<<
50034931 __pyx_r = Py_True;
50044932 goto __pyx_L0;
50054933
5006 /* "pygame_sdl2/display.pyx":291
4934 /* "pygame_sdl2/display.pyx":292
50074935 * self.create_surface()
50084936 *
50094937 * def recreate_gl_context(self): # <<<<<<<<<<<<<<
50244952 return __pyx_r;
50254953 }
50264954
5027 /* "pygame_sdl2/display.pyx":306
4955 /* "pygame_sdl2/display.pyx":307
50284956 * return True
50294957 *
50304958 * def get_window_flags(self): # <<<<<<<<<<<<<<
50574985 int __pyx_clineno = 0;
50584986 __Pyx_RefNannySetupContext("get_window_flags", 0);
50594987
5060 /* "pygame_sdl2/display.pyx":307
4988 /* "pygame_sdl2/display.pyx":308
50614989 *
50624990 * def get_window_flags(self):
50634991 * rv = SDL_GetWindowFlags(self.window) # <<<<<<<<<<<<<<
50644992 *
50654993 * if self.gl_context:
50664994 */
5067 __pyx_t_1 = __Pyx_PyInt_From_uint32_t(SDL_GetWindowFlags(__pyx_v_self->window)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error)
4995 __pyx_t_1 = __Pyx_PyInt_From_uint32_t(SDL_GetWindowFlags(__pyx_v_self->window)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __pyx_L1_error)
50684996 __Pyx_GOTREF(__pyx_t_1);
50694997 __pyx_v_rv = __pyx_t_1;
50704998 __pyx_t_1 = 0;
50714999
5072 /* "pygame_sdl2/display.pyx":309
5000 /* "pygame_sdl2/display.pyx":310
50735001 * rv = SDL_GetWindowFlags(self.window)
50745002 *
50755003 * if self.gl_context: # <<<<<<<<<<<<<<
50795007 __pyx_t_2 = (__pyx_v_self->gl_context != 0);
50805008 if (__pyx_t_2) {
50815009
5082 /* "pygame_sdl2/display.pyx":310
5010 /* "pygame_sdl2/display.pyx":311
50835011 *
50845012 * if self.gl_context:
50855013 * rv |= SDL_WINDOW_OPENGL # <<<<<<<<<<<<<<
50865014 * else:
50875015 * rv &= ~SDL_WINDOW_OPENGL
50885016 */
5089 __pyx_t_1 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_OPENGL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error)
5017 __pyx_t_1 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_OPENGL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 311, __pyx_L1_error)
50905018 __Pyx_GOTREF(__pyx_t_1);
5091 __pyx_t_3 = PyNumber_InPlaceOr(__pyx_v_rv, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 310, __pyx_L1_error)
5019 __pyx_t_3 = PyNumber_InPlaceOr(__pyx_v_rv, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 311, __pyx_L1_error)
50925020 __Pyx_GOTREF(__pyx_t_3);
50935021 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
50945022 __Pyx_DECREF_SET(__pyx_v_rv, __pyx_t_3);
50955023 __pyx_t_3 = 0;
50965024
5097 /* "pygame_sdl2/display.pyx":309
5025 /* "pygame_sdl2/display.pyx":310
50985026 * rv = SDL_GetWindowFlags(self.window)
50995027 *
51005028 * if self.gl_context: # <<<<<<<<<<<<<<
51045032 goto __pyx_L3;
51055033 }
51065034
5107 /* "pygame_sdl2/display.pyx":312
5035 /* "pygame_sdl2/display.pyx":313
51085036 * rv |= SDL_WINDOW_OPENGL
51095037 * else:
51105038 * rv &= ~SDL_WINDOW_OPENGL # <<<<<<<<<<<<<<
51125040 * return rv
51135041 */
51145042 /*else*/ {
5115 __pyx_t_3 = __Pyx_PyInt_From_int((~SDL_WINDOW_OPENGL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 312, __pyx_L1_error)
5043 __pyx_t_3 = __Pyx_PyInt_From_int((~SDL_WINDOW_OPENGL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 313, __pyx_L1_error)
51165044 __Pyx_GOTREF(__pyx_t_3);
5117 __pyx_t_1 = PyNumber_InPlaceAnd(__pyx_v_rv, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 312, __pyx_L1_error)
5045 __pyx_t_1 = PyNumber_InPlaceAnd(__pyx_v_rv, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 313, __pyx_L1_error)
51185046 __Pyx_GOTREF(__pyx_t_1);
51195047 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
51205048 __Pyx_DECREF_SET(__pyx_v_rv, __pyx_t_1);
51225050 }
51235051 __pyx_L3:;
51245052
5125 /* "pygame_sdl2/display.pyx":314
5053 /* "pygame_sdl2/display.pyx":315
51265054 * rv &= ~SDL_WINDOW_OPENGL
51275055 *
51285056 * return rv # <<<<<<<<<<<<<<
51345062 __pyx_r = __pyx_v_rv;
51355063 goto __pyx_L0;
51365064
5137 /* "pygame_sdl2/display.pyx":306
5065 /* "pygame_sdl2/display.pyx":307
51385066 * return True
51395067 *
51405068 * def get_window_flags(self): # <<<<<<<<<<<<<<
51555083 return __pyx_r;
51565084 }
51575085
5158 /* "pygame_sdl2/display.pyx":316
5086 /* "pygame_sdl2/display.pyx":317
51595087 * return rv
51605088 *
51615089 * def proxy_window_surface(self): # <<<<<<<<<<<<<<
51815109 __Pyx_RefNannyDeclarations
51825110 __Pyx_RefNannySetupContext("proxy_window_surface", 0);
51835111
5184 /* "pygame_sdl2/display.pyx":317
5112 /* "pygame_sdl2/display.pyx":318
51855113 *
51865114 * def proxy_window_surface(self):
51875115 * SDL_UpperBlit(self.surface.surface, NULL, self.window_surface, NULL) # <<<<<<<<<<<<<<
51905118 */
51915119 (void)(SDL_UpperBlit(__pyx_v_self->surface->surface, NULL, __pyx_v_self->window_surface, NULL));
51925120
5193 /* "pygame_sdl2/display.pyx":316
5121 /* "pygame_sdl2/display.pyx":317
51945122 * return rv
51955123 *
51965124 * def proxy_window_surface(self): # <<<<<<<<<<<<<<
52055133 return __pyx_r;
52065134 }
52075135
5208 /* "pygame_sdl2/display.pyx":319
5136 /* "pygame_sdl2/display.pyx":320
52095137 * SDL_UpperBlit(self.surface.surface, NULL, self.window_surface, NULL)
52105138 *
52115139 * def flip(self): # <<<<<<<<<<<<<<
52405168 int __pyx_clineno = 0;
52415169 __Pyx_RefNannySetupContext("flip", 0);
52425170
5243 /* "pygame_sdl2/display.pyx":322
5171 /* "pygame_sdl2/display.pyx":323
52445172 * cdef const char *err
52455173 *
52465174 * if self.gl_context != NULL: # <<<<<<<<<<<<<<
52505178 __pyx_t_1 = ((__pyx_v_self->gl_context != NULL) != 0);
52515179 if (__pyx_t_1) {
52525180
5253 /* "pygame_sdl2/display.pyx":323
5181 /* "pygame_sdl2/display.pyx":324
52545182 *
52555183 * if self.gl_context != NULL:
52565184 * with nogil: # <<<<<<<<<<<<<<
52655193 #endif
52665194 /*try:*/ {
52675195
5268 /* "pygame_sdl2/display.pyx":324
5196 /* "pygame_sdl2/display.pyx":325
52695197 * if self.gl_context != NULL:
52705198 * with nogil:
52715199 * SDL_ClearError(); # <<<<<<<<<<<<<<
52745202 */
52755203 SDL_ClearError();
52765204
5277 /* "pygame_sdl2/display.pyx":326
5205 /* "pygame_sdl2/display.pyx":327
52785206 * SDL_ClearError();
52795207 *
52805208 * SDL_GL_SwapWindow(self.window) # <<<<<<<<<<<<<<
52835211 */
52845212 SDL_GL_SwapWindow(__pyx_v_self->window);
52855213
5286 /* "pygame_sdl2/display.pyx":328
5214 /* "pygame_sdl2/display.pyx":329
52875215 * SDL_GL_SwapWindow(self.window)
52885216 *
52895217 * err = SDL_GetError() # <<<<<<<<<<<<<<
52935221 __pyx_v_err = SDL_GetError();
52945222 }
52955223
5296 /* "pygame_sdl2/display.pyx":323
5224 /* "pygame_sdl2/display.pyx":324
52975225 *
52985226 * if self.gl_context != NULL:
52995227 * with nogil: # <<<<<<<<<<<<<<
53125240 }
53135241 }
53145242
5315 /* "pygame_sdl2/display.pyx":330
5243 /* "pygame_sdl2/display.pyx":331
53165244 * err = SDL_GetError()
53175245 *
53185246 * if err[0]: # <<<<<<<<<<<<<<
53225250 __pyx_t_1 = ((__pyx_v_err[0]) != 0);
53235251 if (unlikely(__pyx_t_1)) {
53245252
5325 /* "pygame_sdl2/display.pyx":331
5253 /* "pygame_sdl2/display.pyx":332
53265254 *
53275255 * if err[0]:
53285256 * raise error(err) # <<<<<<<<<<<<<<
53295257 *
53305258 * else:
53315259 */
5332 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 331, __pyx_L1_error)
5260 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 332, __pyx_L1_error)
53335261 __Pyx_GOTREF(__pyx_t_3);
5334 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_err); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 331, __pyx_L1_error)
5262 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_err); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 332, __pyx_L1_error)
53355263 __Pyx_GOTREF(__pyx_t_4);
53365264 __pyx_t_5 = NULL;
53375265 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
53465274 __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
53475275 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
53485276 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5349 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 331, __pyx_L1_error)
5277 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
53505278 __Pyx_GOTREF(__pyx_t_2);
53515279 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
53525280 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
53535281 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5354 __PYX_ERR(0, 331, __pyx_L1_error)
5355
5356 /* "pygame_sdl2/display.pyx":330
5282 __PYX_ERR(0, 332, __pyx_L1_error)
5283
5284 /* "pygame_sdl2/display.pyx":331
53575285 * err = SDL_GetError()
53585286 *
53595287 * if err[0]: # <<<<<<<<<<<<<<
53625290 */
53635291 }
53645292
5365 /* "pygame_sdl2/display.pyx":322
5293 /* "pygame_sdl2/display.pyx":323
53665294 * cdef const char *err
53675295 *
53685296 * if self.gl_context != NULL: # <<<<<<<<<<<<<<
53725300 goto __pyx_L3;
53735301 }
53745302
5375 /* "pygame_sdl2/display.pyx":335
5303 /* "pygame_sdl2/display.pyx":336
53765304 * else:
53775305 *
53785306 * if self.surface.surface != self.window_surface: # <<<<<<<<<<<<<<
53835311 __pyx_t_1 = ((__pyx_v_self->surface->surface != __pyx_v_self->window_surface) != 0);
53845312 if (__pyx_t_1) {
53855313
5386 /* "pygame_sdl2/display.pyx":336
5314 /* "pygame_sdl2/display.pyx":337
53875315 *
53885316 * if self.surface.surface != self.window_surface:
53895317 * self.proxy_window_surface() # <<<<<<<<<<<<<<
53905318 *
53915319 * with nogil:
53925320 */
5393 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_proxy_window_surface); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 336, __pyx_L1_error)
5321 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_proxy_window_surface); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 337, __pyx_L1_error)
53945322 __Pyx_GOTREF(__pyx_t_3);
53955323 __pyx_t_4 = NULL;
53965324 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
54045332 }
54055333 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
54065334 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
5407 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 336, __pyx_L1_error)
5335 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error)
54085336 __Pyx_GOTREF(__pyx_t_2);
54095337 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
54105338 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
54115339
5412 /* "pygame_sdl2/display.pyx":335
5340 /* "pygame_sdl2/display.pyx":336
54135341 * else:
54145342 *
54155343 * if self.surface.surface != self.window_surface: # <<<<<<<<<<<<<<
54185346 */
54195347 }
54205348
5421 /* "pygame_sdl2/display.pyx":338
5349 /* "pygame_sdl2/display.pyx":339
54225350 * self.proxy_window_surface()
54235351 *
54245352 * with nogil: # <<<<<<<<<<<<<<
54335361 #endif
54345362 /*try:*/ {
54355363
5436 /* "pygame_sdl2/display.pyx":339
5364 /* "pygame_sdl2/display.pyx":340
54375365 *
54385366 * with nogil:
54395367 * SDL_UpdateWindowSurface(self.window) # <<<<<<<<<<<<<<
54435371 (void)(SDL_UpdateWindowSurface(__pyx_v_self->window));
54445372 }
54455373
5446 /* "pygame_sdl2/display.pyx":338
5374 /* "pygame_sdl2/display.pyx":339
54475375 * self.proxy_window_surface()
54485376 *
54495377 * with nogil: # <<<<<<<<<<<<<<
54645392 }
54655393 __pyx_L3:;
54665394
5467 /* "pygame_sdl2/display.pyx":319
5395 /* "pygame_sdl2/display.pyx":320
54685396 * SDL_UpperBlit(self.surface.surface, NULL, self.window_surface, NULL)
54695397 *
54705398 * def flip(self): # <<<<<<<<<<<<<<
54885416 return __pyx_r;
54895417 }
54905418
5491 /* "pygame_sdl2/display.pyx":341
5419 /* "pygame_sdl2/display.pyx":342
54925420 * SDL_UpdateWindowSurface(self.window)
54935421 *
54945422 * def get_surface(self): # <<<<<<<<<<<<<<
55145442 __Pyx_RefNannyDeclarations
55155443 __Pyx_RefNannySetupContext("get_surface", 0);
55165444
5517 /* "pygame_sdl2/display.pyx":342
5445 /* "pygame_sdl2/display.pyx":343
55185446 *
55195447 * def get_surface(self):
55205448 * return self.surface # <<<<<<<<<<<<<<
55265454 __pyx_r = ((PyObject *)__pyx_v_self->surface);
55275455 goto __pyx_L0;
55285456
5529 /* "pygame_sdl2/display.pyx":341
5457 /* "pygame_sdl2/display.pyx":342
55305458 * SDL_UpdateWindowSurface(self.window)
55315459 *
55325460 * def get_surface(self): # <<<<<<<<<<<<<<
55415469 return __pyx_r;
55425470 }
55435471
5544 /* "pygame_sdl2/display.pyx":344
5472 /* "pygame_sdl2/display.pyx":345
55455473 * return self.surface
55465474 *
55475475 * def update(self, rectangles=None): # <<<<<<<<<<<<<<
55815509 }
55825510 }
55835511 if (unlikely(kw_args > 0)) {
5584 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "update") < 0)) __PYX_ERR(0, 344, __pyx_L3_error)
5512 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "update") < 0)) __PYX_ERR(0, 345, __pyx_L3_error)
55855513 }
55865514 } else {
55875515 switch (PyTuple_GET_SIZE(__pyx_args)) {
55955523 }
55965524 goto __pyx_L4_argument_unpacking_done;
55975525 __pyx_L5_argtuple_error:;
5598 __Pyx_RaiseArgtupleInvalid("update", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 344, __pyx_L3_error)
5526 __Pyx_RaiseArgtupleInvalid("update", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 345, __pyx_L3_error)
55995527 __pyx_L3_error:;
56005528 __Pyx_AddTraceback("pygame_sdl2.display.Window.update", __pyx_clineno, __pyx_lineno, __pyx_filename);
56015529 __Pyx_RefNannyFinishContext();
56365564 __Pyx_RefNannySetupContext("update", 0);
56375565 __Pyx_INCREF(__pyx_v_rectangles);
56385566
5639 /* "pygame_sdl2/display.pyx":347
5567 /* "pygame_sdl2/display.pyx":348
56405568 *
56415569 * cdef SDL_Rect *rects
56425570 * cdef int count = 0 # <<<<<<<<<<<<<<
56455573 */
56465574 __pyx_v_count = 0;
56475575
5648 /* "pygame_sdl2/display.pyx":349
5576 /* "pygame_sdl2/display.pyx":350
56495577 * cdef int count = 0
56505578 *
56515579 * if rectangles is None: # <<<<<<<<<<<<<<
56565584 __pyx_t_2 = (__pyx_t_1 != 0);
56575585 if (__pyx_t_2) {
56585586
5659 /* "pygame_sdl2/display.pyx":350
5587 /* "pygame_sdl2/display.pyx":351
56605588 *
56615589 * if rectangles is None:
56625590 * self.flip() # <<<<<<<<<<<<<<
56635591 * return
56645592 *
56655593 */
5666 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flip); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 350, __pyx_L1_error)
5594 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flip); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 351, __pyx_L1_error)
56675595 __Pyx_GOTREF(__pyx_t_4);
56685596 __pyx_t_5 = NULL;
56695597 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
56775605 }
56785606 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
56795607 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
5680 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 350, __pyx_L1_error)
5608 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 351, __pyx_L1_error)
56815609 __Pyx_GOTREF(__pyx_t_3);
56825610 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
56835611 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
56845612
5685 /* "pygame_sdl2/display.pyx":351
5613 /* "pygame_sdl2/display.pyx":352
56865614 * if rectangles is None:
56875615 * self.flip()
56885616 * return # <<<<<<<<<<<<<<
56935621 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
56945622 goto __pyx_L0;
56955623
5696 /* "pygame_sdl2/display.pyx":349
5624 /* "pygame_sdl2/display.pyx":350
56975625 * cdef int count = 0
56985626 *
56995627 * if rectangles is None: # <<<<<<<<<<<<<<
57025630 */
57035631 }
57045632
5705 /* "pygame_sdl2/display.pyx":353
5633 /* "pygame_sdl2/display.pyx":354
57065634 * return
57075635 *
57085636 * if self.surface.surface != self.window_surface: # <<<<<<<<<<<<<<
57125640 __pyx_t_2 = ((__pyx_v_self->surface->surface != __pyx_v_self->window_surface) != 0);
57135641 if (__pyx_t_2) {
57145642
5715 /* "pygame_sdl2/display.pyx":354
5643 /* "pygame_sdl2/display.pyx":355
57165644 *
57175645 * if self.surface.surface != self.window_surface:
57185646 * self.proxy_window_surface() # <<<<<<<<<<<<<<
57195647 *
57205648 * if not isinstance(rectangles, list):
57215649 */
5722 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_proxy_window_surface); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 354, __pyx_L1_error)
5650 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_proxy_window_surface); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 355, __pyx_L1_error)
57235651 __Pyx_GOTREF(__pyx_t_4);
57245652 __pyx_t_5 = NULL;
57255653 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
57335661 }
57345662 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
57355663 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
5736 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 354, __pyx_L1_error)
5664 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 355, __pyx_L1_error)
57375665 __Pyx_GOTREF(__pyx_t_3);
57385666 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
57395667 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
57405668
5741 /* "pygame_sdl2/display.pyx":353
5669 /* "pygame_sdl2/display.pyx":354
57425670 * return
57435671 *
57445672 * if self.surface.surface != self.window_surface: # <<<<<<<<<<<<<<
57475675 */
57485676 }
57495677
5750 /* "pygame_sdl2/display.pyx":356
5678 /* "pygame_sdl2/display.pyx":357
57515679 * self.proxy_window_surface()
57525680 *
57535681 * if not isinstance(rectangles, list): # <<<<<<<<<<<<<<
57585686 __pyx_t_1 = ((!(__pyx_t_2 != 0)) != 0);
57595687 if (__pyx_t_1) {
57605688
5761 /* "pygame_sdl2/display.pyx":357
5689 /* "pygame_sdl2/display.pyx":358
57625690 *
57635691 * if not isinstance(rectangles, list):
57645692 * rectangles = [ rectangles ] # <<<<<<<<<<<<<<
57655693 *
57665694 * rects = <SDL_Rect *> calloc(len(rectangles), sizeof(SDL_Rect))
57675695 */
5768 __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 357, __pyx_L1_error)
5696 __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 358, __pyx_L1_error)
57695697 __Pyx_GOTREF(__pyx_t_3);
57705698 __Pyx_INCREF(__pyx_v_rectangles);
57715699 __Pyx_GIVEREF(__pyx_v_rectangles);
57735701 __Pyx_DECREF_SET(__pyx_v_rectangles, __pyx_t_3);
57745702 __pyx_t_3 = 0;
57755703
5776 /* "pygame_sdl2/display.pyx":356
5704 /* "pygame_sdl2/display.pyx":357
57775705 * self.proxy_window_surface()
57785706 *
57795707 * if not isinstance(rectangles, list): # <<<<<<<<<<<<<<
57825710 */
57835711 }
57845712
5785 /* "pygame_sdl2/display.pyx":359
5713 /* "pygame_sdl2/display.pyx":360
57865714 * rectangles = [ rectangles ]
57875715 *
57885716 * rects = <SDL_Rect *> calloc(len(rectangles), sizeof(SDL_Rect)) # <<<<<<<<<<<<<<
57895717 * if rects == NULL:
57905718 * raise MemoryError("Couldn't allocate rectangles.")
57915719 */
5792 __pyx_t_6 = PyObject_Length(__pyx_v_rectangles); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 359, __pyx_L1_error)
5720 __pyx_t_6 = PyObject_Length(__pyx_v_rectangles); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 360, __pyx_L1_error)
57935721 __pyx_v_rects = ((SDL_Rect *)calloc(__pyx_t_6, (sizeof(SDL_Rect))));
57945722
5795 /* "pygame_sdl2/display.pyx":360
5723 /* "pygame_sdl2/display.pyx":361
57965724 *
57975725 * rects = <SDL_Rect *> calloc(len(rectangles), sizeof(SDL_Rect))
57985726 * if rects == NULL: # <<<<<<<<<<<<<<
58025730 __pyx_t_1 = ((__pyx_v_rects == NULL) != 0);
58035731 if (unlikely(__pyx_t_1)) {
58045732
5805 /* "pygame_sdl2/display.pyx":361
5733 /* "pygame_sdl2/display.pyx":362
58065734 * rects = <SDL_Rect *> calloc(len(rectangles), sizeof(SDL_Rect))
58075735 * if rects == NULL:
58085736 * raise MemoryError("Couldn't allocate rectangles.") # <<<<<<<<<<<<<<
58095737 *
58105738 * try:
58115739 */
5812 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 361, __pyx_L1_error)
5740 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 362, __pyx_L1_error)
58135741 __Pyx_GOTREF(__pyx_t_3);
58145742 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
58155743 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5816 __PYX_ERR(0, 361, __pyx_L1_error)
5817
5818 /* "pygame_sdl2/display.pyx":360
5744 __PYX_ERR(0, 362, __pyx_L1_error)
5745
5746 /* "pygame_sdl2/display.pyx":361
58195747 *
58205748 * rects = <SDL_Rect *> calloc(len(rectangles), sizeof(SDL_Rect))
58215749 * if rects == NULL: # <<<<<<<<<<<<<<
58245752 */
58255753 }
58265754
5827 /* "pygame_sdl2/display.pyx":363
5755 /* "pygame_sdl2/display.pyx":364
58285756 * raise MemoryError("Couldn't allocate rectangles.")
58295757 *
58305758 * try: # <<<<<<<<<<<<<<
58335761 */
58345762 /*try:*/ {
58355763
5836 /* "pygame_sdl2/display.pyx":365
5764 /* "pygame_sdl2/display.pyx":366
58375765 * try:
58385766 *
58395767 * for i in rectangles: # <<<<<<<<<<<<<<
58445772 __pyx_t_3 = __pyx_v_rectangles; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0;
58455773 __pyx_t_7 = NULL;
58465774 } else {
5847 __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_rectangles); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 365, __pyx_L8_error)
5775 __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_rectangles); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 366, __pyx_L8_error)
58485776 __Pyx_GOTREF(__pyx_t_3);
5849 __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 365, __pyx_L8_error)
5777 __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 366, __pyx_L8_error)
58505778 }
58515779 for (;;) {
58525780 if (likely(!__pyx_t_7)) {
58535781 if (likely(PyList_CheckExact(__pyx_t_3))) {
58545782 if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break;
58555783 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5856 __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 365, __pyx_L8_error)
5784 __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 366, __pyx_L8_error)
58575785 #else
5858 __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 365, __pyx_L8_error)
5786 __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 366, __pyx_L8_error)
58595787 __Pyx_GOTREF(__pyx_t_4);
58605788 #endif
58615789 } else {
58625790 if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
58635791 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5864 __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_ERR(0, 365, __pyx_L8_error)
5792 __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_ERR(0, 366, __pyx_L8_error)
58655793 #else
5866 __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 365, __pyx_L8_error)
5794 __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 366, __pyx_L8_error)
58675795 __Pyx_GOTREF(__pyx_t_4);
58685796 #endif
58695797 }
58735801 PyObject* exc_type = PyErr_Occurred();
58745802 if (exc_type) {
58755803 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
5876 else __PYX_ERR(0, 365, __pyx_L8_error)
5804 else __PYX_ERR(0, 366, __pyx_L8_error)
58775805 }
58785806 break;
58795807 }
58825810 __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4);
58835811 __pyx_t_4 = 0;
58845812
5885 /* "pygame_sdl2/display.pyx":366
5813 /* "pygame_sdl2/display.pyx":367
58865814 *
58875815 * for i in rectangles:
58885816 * if i is None: # <<<<<<<<<<<<<<
58935821 __pyx_t_2 = (__pyx_t_1 != 0);
58945822 if (__pyx_t_2) {
58955823
5896 /* "pygame_sdl2/display.pyx":367
5824 /* "pygame_sdl2/display.pyx":368
58975825 * for i in rectangles:
58985826 * if i is None:
58995827 * continue # <<<<<<<<<<<<<<
59025830 */
59035831 goto __pyx_L10_continue;
59045832
5905 /* "pygame_sdl2/display.pyx":366
5833 /* "pygame_sdl2/display.pyx":367
59065834 *
59075835 * for i in rectangles:
59085836 * if i is None: # <<<<<<<<<<<<<<
59115839 */
59125840 }
59135841
5914 /* "pygame_sdl2/display.pyx":369
5842 /* "pygame_sdl2/display.pyx":370
59155843 * continue
59165844 *
59175845 * to_sdl_rect(i, &rects[count]) # <<<<<<<<<<<<<<
59185846 * count += 1
59195847 *
59205848 */
5921 __pyx_t_8 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_i, (&(__pyx_v_rects[__pyx_v_count])), NULL); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 369, __pyx_L8_error)
5922
5923 /* "pygame_sdl2/display.pyx":370
5849 __pyx_t_8 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_i, (&(__pyx_v_rects[__pyx_v_count])), NULL); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 370, __pyx_L8_error)
5850
5851 /* "pygame_sdl2/display.pyx":371
59245852 *
59255853 * to_sdl_rect(i, &rects[count])
59265854 * count += 1 # <<<<<<<<<<<<<<
59295857 */
59305858 __pyx_v_count = (__pyx_v_count + 1);
59315859
5932 /* "pygame_sdl2/display.pyx":365
5860 /* "pygame_sdl2/display.pyx":366
59335861 * try:
59345862 *
59355863 * for i in rectangles: # <<<<<<<<<<<<<<
59405868 }
59415869 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
59425870
5943 /* "pygame_sdl2/display.pyx":372
5871 /* "pygame_sdl2/display.pyx":373
59445872 * count += 1
59455873 *
59465874 * SDL_UpdateWindowSurfaceRects(self.window, rects, count) # <<<<<<<<<<<<<<
59505878 (void)(SDL_UpdateWindowSurfaceRects(__pyx_v_self->window, __pyx_v_rects, __pyx_v_count));
59515879 }
59525880
5953 /* "pygame_sdl2/display.pyx":375
5881 /* "pygame_sdl2/display.pyx":376
59545882 *
59555883 * finally:
59565884 * free(rects) # <<<<<<<<<<<<<<
59995927 __pyx_L9:;
60005928 }
60015929
6002 /* "pygame_sdl2/display.pyx":344
5930 /* "pygame_sdl2/display.pyx":345
60035931 * return self.surface
60045932 *
60055933 * def update(self, rectangles=None): # <<<<<<<<<<<<<<
60245952 return __pyx_r;
60255953 }
60265954
6027 /* "pygame_sdl2/display.pyx":377
5955 /* "pygame_sdl2/display.pyx":378
60285956 * free(rects)
60295957 *
60305958 * def get_wm_info(self): # <<<<<<<<<<<<<<
60545982 int __pyx_clineno = 0;
60555983 __Pyx_RefNannySetupContext("get_wm_info", 0);
60565984
6057 /* "pygame_sdl2/display.pyx":378
5985 /* "pygame_sdl2/display.pyx":379
60585986 *
60595987 * def get_wm_info(self):
60605988 * return { } # <<<<<<<<<<<<<<
60625990 * def get_active(self):
60635991 */
60645992 __Pyx_XDECREF(__pyx_r);
6065 __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 378, __pyx_L1_error)
5993 __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 379, __pyx_L1_error)
60665994 __Pyx_GOTREF(__pyx_t_1);
60675995 __pyx_r = __pyx_t_1;
60685996 __pyx_t_1 = 0;
60695997 goto __pyx_L0;
60705998
6071 /* "pygame_sdl2/display.pyx":377
5999 /* "pygame_sdl2/display.pyx":378
60726000 * free(rects)
60736001 *
60746002 * def get_wm_info(self): # <<<<<<<<<<<<<<
60876015 return __pyx_r;
60886016 }
60896017
6090 /* "pygame_sdl2/display.pyx":380
6018 /* "pygame_sdl2/display.pyx":381
60916019 * return { }
60926020 *
60936021 * def get_active(self): # <<<<<<<<<<<<<<
61146042 int __pyx_t_1;
61156043 __Pyx_RefNannySetupContext("get_active", 0);
61166044
6117 /* "pygame_sdl2/display.pyx":381
6045 /* "pygame_sdl2/display.pyx":382
61186046 *
61196047 * def get_active(self):
61206048 * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_HIDDEN | SDL_WINDOW_MINIMIZED): # <<<<<<<<<<<<<<
61246052 __pyx_t_1 = ((SDL_GetWindowFlags(__pyx_v_self->window) & (SDL_WINDOW_HIDDEN | SDL_WINDOW_MINIMIZED)) != 0);
61256053 if (__pyx_t_1) {
61266054
6127 /* "pygame_sdl2/display.pyx":382
6055 /* "pygame_sdl2/display.pyx":383
61286056 * def get_active(self):
61296057 * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_HIDDEN | SDL_WINDOW_MINIMIZED):
61306058 * return False # <<<<<<<<<<<<<<
61366064 __pyx_r = Py_False;
61376065 goto __pyx_L0;
61386066
6139 /* "pygame_sdl2/display.pyx":381
6067 /* "pygame_sdl2/display.pyx":382
61406068 *
61416069 * def get_active(self):
61426070 * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_HIDDEN | SDL_WINDOW_MINIMIZED): # <<<<<<<<<<<<<<
61456073 */
61466074 }
61476075
6148 /* "pygame_sdl2/display.pyx":384
6076 /* "pygame_sdl2/display.pyx":385
61496077 * return False
61506078 * else:
61516079 * return True # <<<<<<<<<<<<<<
61596087 goto __pyx_L0;
61606088 }
61616089
6162 /* "pygame_sdl2/display.pyx":380
6090 /* "pygame_sdl2/display.pyx":381
61636091 * return { }
61646092 *
61656093 * def get_active(self): # <<<<<<<<<<<<<<
61746102 return __pyx_r;
61756103 }
61766104
6177 /* "pygame_sdl2/display.pyx":386
6105 /* "pygame_sdl2/display.pyx":387
61786106 * return True
61796107 *
61806108 * def iconify(self): # <<<<<<<<<<<<<<
62006128 __Pyx_RefNannyDeclarations
62016129 __Pyx_RefNannySetupContext("iconify", 0);
62026130
6203 /* "pygame_sdl2/display.pyx":387
6131 /* "pygame_sdl2/display.pyx":388
62046132 *
62056133 * def iconify(self):
62066134 * SDL_MinimizeWindow(self.window) # <<<<<<<<<<<<<<
62096137 */
62106138 SDL_MinimizeWindow(__pyx_v_self->window);
62116139
6212 /* "pygame_sdl2/display.pyx":388
6140 /* "pygame_sdl2/display.pyx":389
62136141 * def iconify(self):
62146142 * SDL_MinimizeWindow(self.window)
62156143 * return True # <<<<<<<<<<<<<<
62216149 __pyx_r = Py_True;
62226150 goto __pyx_L0;
62236151
6224 /* "pygame_sdl2/display.pyx":386
6152 /* "pygame_sdl2/display.pyx":387
62256153 * return True
62266154 *
62276155 * def iconify(self): # <<<<<<<<<<<<<<
62366164 return __pyx_r;
62376165 }
62386166
6239 /* "pygame_sdl2/display.pyx":390
6167 /* "pygame_sdl2/display.pyx":391
62406168 * return True
62416169 *
62426170 * def toggle_fullscreen(self): # <<<<<<<<<<<<<<
62696197 int __pyx_clineno = 0;
62706198 __Pyx_RefNannySetupContext("toggle_fullscreen", 0);
62716199
6272 /* "pygame_sdl2/display.pyx":391
6200 /* "pygame_sdl2/display.pyx":392
62736201 *
62746202 * def toggle_fullscreen(self):
62756203 * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_FULLSCREEN_DESKTOP): # <<<<<<<<<<<<<<
62796207 __pyx_t_1 = ((SDL_GetWindowFlags(__pyx_v_self->window) & SDL_WINDOW_FULLSCREEN_DESKTOP) != 0);
62806208 if (__pyx_t_1) {
62816209
6282 /* "pygame_sdl2/display.pyx":392
6210 /* "pygame_sdl2/display.pyx":393
62836211 * def toggle_fullscreen(self):
62846212 * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_FULLSCREEN_DESKTOP):
62856213 * if SDL_SetWindowFullscreen(self.window, 0): # <<<<<<<<<<<<<<
62896217 __pyx_t_1 = (SDL_SetWindowFullscreen(__pyx_v_self->window, 0) != 0);
62906218 if (unlikely(__pyx_t_1)) {
62916219
6292 /* "pygame_sdl2/display.pyx":393
6220 /* "pygame_sdl2/display.pyx":394
62936221 * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_FULLSCREEN_DESKTOP):
62946222 * if SDL_SetWindowFullscreen(self.window, 0):
62956223 * raise error() # <<<<<<<<<<<<<<
62966224 * else:
62976225 * if SDL_SetWindowFullscreen(self.window, SDL_WINDOW_FULLSCREEN_DESKTOP):
62986226 */
6299 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 393, __pyx_L1_error)
6227 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 394, __pyx_L1_error)
63006228 __Pyx_GOTREF(__pyx_t_3);
63016229 __pyx_t_4 = NULL;
63026230 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
63106238 }
63116239 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
63126240 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6313 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 393, __pyx_L1_error)
6241 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 394, __pyx_L1_error)
63146242 __Pyx_GOTREF(__pyx_t_2);
63156243 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
63166244 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
63176245 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6318 __PYX_ERR(0, 393, __pyx_L1_error)
6319
6320 /* "pygame_sdl2/display.pyx":392
6246 __PYX_ERR(0, 394, __pyx_L1_error)
6247
6248 /* "pygame_sdl2/display.pyx":393
63216249 * def toggle_fullscreen(self):
63226250 * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_FULLSCREEN_DESKTOP):
63236251 * if SDL_SetWindowFullscreen(self.window, 0): # <<<<<<<<<<<<<<
63266254 */
63276255 }
63286256
6329 /* "pygame_sdl2/display.pyx":391
6257 /* "pygame_sdl2/display.pyx":392
63306258 *
63316259 * def toggle_fullscreen(self):
63326260 * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_FULLSCREEN_DESKTOP): # <<<<<<<<<<<<<<
63366264 goto __pyx_L3;
63376265 }
63386266
6339 /* "pygame_sdl2/display.pyx":395
6267 /* "pygame_sdl2/display.pyx":396
63406268 * raise error()
63416269 * else:
63426270 * if SDL_SetWindowFullscreen(self.window, SDL_WINDOW_FULLSCREEN_DESKTOP): # <<<<<<<<<<<<<<
63476275 __pyx_t_1 = (SDL_SetWindowFullscreen(__pyx_v_self->window, SDL_WINDOW_FULLSCREEN_DESKTOP) != 0);
63486276 if (unlikely(__pyx_t_1)) {
63496277
6350 /* "pygame_sdl2/display.pyx":396
6278 /* "pygame_sdl2/display.pyx":397
63516279 * else:
63526280 * if SDL_SetWindowFullscreen(self.window, SDL_WINDOW_FULLSCREEN_DESKTOP):
63536281 * raise error() # <<<<<<<<<<<<<<
63546282 *
63556283 * return True
63566284 */
6357 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 396, __pyx_L1_error)
6285 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 397, __pyx_L1_error)
63586286 __Pyx_GOTREF(__pyx_t_3);
63596287 __pyx_t_4 = NULL;
63606288 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
63686296 }
63696297 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
63706298 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6371 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 396, __pyx_L1_error)
6299 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 397, __pyx_L1_error)
63726300 __Pyx_GOTREF(__pyx_t_2);
63736301 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
63746302 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
63756303 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6376 __PYX_ERR(0, 396, __pyx_L1_error)
6377
6378 /* "pygame_sdl2/display.pyx":395
6304 __PYX_ERR(0, 397, __pyx_L1_error)
6305
6306 /* "pygame_sdl2/display.pyx":396
63796307 * raise error()
63806308 * else:
63816309 * if SDL_SetWindowFullscreen(self.window, SDL_WINDOW_FULLSCREEN_DESKTOP): # <<<<<<<<<<<<<<
63866314 }
63876315 __pyx_L3:;
63886316
6389 /* "pygame_sdl2/display.pyx":398
6317 /* "pygame_sdl2/display.pyx":399
63906318 * raise error()
63916319 *
63926320 * return True # <<<<<<<<<<<<<<
63986326 __pyx_r = Py_True;
63996327 goto __pyx_L0;
64006328
6401 /* "pygame_sdl2/display.pyx":390
6329 /* "pygame_sdl2/display.pyx":391
64026330 * return True
64036331 *
64046332 * def toggle_fullscreen(self): # <<<<<<<<<<<<<<
64196347 return __pyx_r;
64206348 }
64216349
6422 /* "pygame_sdl2/display.pyx":400
6350 /* "pygame_sdl2/display.pyx":401
64236351 * return True
64246352 *
64256353 * def set_gamma(self, red, green=None, blue=None): # <<<<<<<<<<<<<<
64766404 }
64776405 }
64786406 if (unlikely(kw_args > 0)) {
6479 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_gamma") < 0)) __PYX_ERR(0, 400, __pyx_L3_error)
6407 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_gamma") < 0)) __PYX_ERR(0, 401, __pyx_L3_error)
64806408 }
64816409 } else {
64826410 switch (PyTuple_GET_SIZE(__pyx_args)) {
64956423 }
64966424 goto __pyx_L4_argument_unpacking_done;
64976425 __pyx_L5_argtuple_error:;
6498 __Pyx_RaiseArgtupleInvalid("set_gamma", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 400, __pyx_L3_error)
6426 __Pyx_RaiseArgtupleInvalid("set_gamma", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 401, __pyx_L3_error)
64996427 __pyx_L3_error:;
65006428 __Pyx_AddTraceback("pygame_sdl2.display.Window.set_gamma", __pyx_clineno, __pyx_lineno, __pyx_filename);
65016429 __Pyx_RefNannyFinishContext();
65246452 __Pyx_INCREF(__pyx_v_green);
65256453 __Pyx_INCREF(__pyx_v_blue);
65266454
6527 /* "pygame_sdl2/display.pyx":401
6455 /* "pygame_sdl2/display.pyx":402
65286456 *
65296457 * def set_gamma(self, red, green=None, blue=None):
65306458 * if green is None: # <<<<<<<<<<<<<<
65356463 __pyx_t_2 = (__pyx_t_1 != 0);
65366464 if (__pyx_t_2) {
65376465
6538 /* "pygame_sdl2/display.pyx":402
6466 /* "pygame_sdl2/display.pyx":403
65396467 * def set_gamma(self, red, green=None, blue=None):
65406468 * if green is None:
65416469 * green = red # <<<<<<<<<<<<<<
65456473 __Pyx_INCREF(__pyx_v_red);
65466474 __Pyx_DECREF_SET(__pyx_v_green, __pyx_v_red);
65476475
6548 /* "pygame_sdl2/display.pyx":401
6476 /* "pygame_sdl2/display.pyx":402
65496477 *
65506478 * def set_gamma(self, red, green=None, blue=None):
65516479 * if green is None: # <<<<<<<<<<<<<<
65546482 */
65556483 }
65566484
6557 /* "pygame_sdl2/display.pyx":403
6485 /* "pygame_sdl2/display.pyx":404
65586486 * if green is None:
65596487 * green = red
65606488 * if blue is None: # <<<<<<<<<<<<<<
65656493 __pyx_t_1 = (__pyx_t_2 != 0);
65666494 if (__pyx_t_1) {
65676495
6568 /* "pygame_sdl2/display.pyx":404
6496 /* "pygame_sdl2/display.pyx":405
65696497 * green = red
65706498 * if blue is None:
65716499 * blue = red # <<<<<<<<<<<<<<
65756503 __Pyx_INCREF(__pyx_v_red);
65766504 __Pyx_DECREF_SET(__pyx_v_blue, __pyx_v_red);
65776505
6578 /* "pygame_sdl2/display.pyx":403
6506 /* "pygame_sdl2/display.pyx":404
65796507 * if green is None:
65806508 * green = red
65816509 * if blue is None: # <<<<<<<<<<<<<<
65846512 */
65856513 }
65866514
6587 /* "pygame_sdl2/display.pyx":410
6515 /* "pygame_sdl2/display.pyx":411
65886516 * cdef Uint16 blue_gamma[256]
65896517 *
65906518 * SDL_CalculateGammaRamp(red, red_gamma) # <<<<<<<<<<<<<<
65916519 * SDL_CalculateGammaRamp(green, green_gamma)
65926520 * SDL_CalculateGammaRamp(blue, blue_gamma)
65936521 */
6594 __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_v_red); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 410, __pyx_L1_error)
6522 __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_v_red); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 411, __pyx_L1_error)
65956523 SDL_CalculateGammaRamp(__pyx_t_3, __pyx_v_red_gamma);
65966524
6597 /* "pygame_sdl2/display.pyx":411
6525 /* "pygame_sdl2/display.pyx":412
65986526 *
65996527 * SDL_CalculateGammaRamp(red, red_gamma)
66006528 * SDL_CalculateGammaRamp(green, green_gamma) # <<<<<<<<<<<<<<
66016529 * SDL_CalculateGammaRamp(blue, blue_gamma)
66026530 *
66036531 */
6604 __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_v_green); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 411, __pyx_L1_error)
6532 __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_v_green); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 412, __pyx_L1_error)
66056533 SDL_CalculateGammaRamp(__pyx_t_3, __pyx_v_green_gamma);
66066534
6607 /* "pygame_sdl2/display.pyx":412
6535 /* "pygame_sdl2/display.pyx":413
66086536 * SDL_CalculateGammaRamp(red, red_gamma)
66096537 * SDL_CalculateGammaRamp(green, green_gamma)
66106538 * SDL_CalculateGammaRamp(blue, blue_gamma) # <<<<<<<<<<<<<<
66116539 *
66126540 * if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma):
66136541 */
6614 __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_v_blue); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 412, __pyx_L1_error)
6542 __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_v_blue); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 413, __pyx_L1_error)
66156543 SDL_CalculateGammaRamp(__pyx_t_3, __pyx_v_blue_gamma);
66166544
6617 /* "pygame_sdl2/display.pyx":414
6545 /* "pygame_sdl2/display.pyx":415
66186546 * SDL_CalculateGammaRamp(blue, blue_gamma)
66196547 *
66206548 * if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma): # <<<<<<<<<<<<<<
66246552 __pyx_t_1 = (SDL_SetWindowGammaRamp(__pyx_v_self->window, __pyx_v_red_gamma, __pyx_v_green_gamma, __pyx_v_blue_gamma) != 0);
66256553 if (__pyx_t_1) {
66266554
6627 /* "pygame_sdl2/display.pyx":415
6555 /* "pygame_sdl2/display.pyx":416
66286556 *
66296557 * if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma):
66306558 * return False # <<<<<<<<<<<<<<
66366564 __pyx_r = Py_False;
66376565 goto __pyx_L0;
66386566
6639 /* "pygame_sdl2/display.pyx":414
6567 /* "pygame_sdl2/display.pyx":415
66406568 * SDL_CalculateGammaRamp(blue, blue_gamma)
66416569 *
66426570 * if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma): # <<<<<<<<<<<<<<
66456573 */
66466574 }
66476575
6648 /* "pygame_sdl2/display.pyx":417
6576 /* "pygame_sdl2/display.pyx":418
66496577 * return False
66506578 *
66516579 * return True # <<<<<<<<<<<<<<
66576585 __pyx_r = Py_True;
66586586 goto __pyx_L0;
66596587
6660 /* "pygame_sdl2/display.pyx":400
6588 /* "pygame_sdl2/display.pyx":401
66616589 * return True
66626590 *
66636591 * def set_gamma(self, red, green=None, blue=None): # <<<<<<<<<<<<<<
66776605 return __pyx_r;
66786606 }
66796607
6680 /* "pygame_sdl2/display.pyx":419
6608 /* "pygame_sdl2/display.pyx":420
66816609 * return True
66826610 *
66836611 * def set_gamma_ramp(self, red, green, blue): # <<<<<<<<<<<<<<
67226650 case 1:
67236651 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_green)) != 0)) kw_args--;
67246652 else {
6725 __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, 1); __PYX_ERR(0, 419, __pyx_L3_error)
6653 __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, 1); __PYX_ERR(0, 420, __pyx_L3_error)
67266654 }
67276655 CYTHON_FALLTHROUGH;
67286656 case 2:
67296657 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_blue)) != 0)) kw_args--;
67306658 else {
6731 __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, 2); __PYX_ERR(0, 419, __pyx_L3_error)
6659 __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, 2); __PYX_ERR(0, 420, __pyx_L3_error)
67326660 }
67336661 }
67346662 if (unlikely(kw_args > 0)) {
6735 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_gamma_ramp") < 0)) __PYX_ERR(0, 419, __pyx_L3_error)
6663 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_gamma_ramp") < 0)) __PYX_ERR(0, 420, __pyx_L3_error)
67366664 }
67376665 } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
67386666 goto __pyx_L5_argtuple_error;
67476675 }
67486676 goto __pyx_L4_argument_unpacking_done;
67496677 __pyx_L5_argtuple_error:;
6750 __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 419, __pyx_L3_error)
6678 __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 420, __pyx_L3_error)
67516679 __pyx_L3_error:;
67526680 __Pyx_AddTraceback("pygame_sdl2.display.Window.set_gamma_ramp", __pyx_clineno, __pyx_lineno, __pyx_filename);
67536681 __Pyx_RefNannyFinishContext();
67766704 int __pyx_clineno = 0;
67776705 __Pyx_RefNannySetupContext("set_gamma_ramp", 0);
67786706
6779 /* "pygame_sdl2/display.pyx":425
6707 /* "pygame_sdl2/display.pyx":426
67806708 * cdef Uint16 blue_gamma[256]
67816709 *
67826710 * for i in range(256): # <<<<<<<<<<<<<<
67866714 for (__pyx_t_1 = 0; __pyx_t_1 < 0x100; __pyx_t_1+=1) {
67876715 __pyx_v_i = __pyx_t_1;
67886716
6789 /* "pygame_sdl2/display.pyx":426
6717 /* "pygame_sdl2/display.pyx":427
67906718 *
67916719 * for i in range(256):
67926720 * red_gamma[i] = red[i] # <<<<<<<<<<<<<<
67936721 * green_gamma[i] = green[i]
67946722 * blue_gamma[i] = blue[i]
67956723 */
6796 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_red, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 426, __pyx_L1_error)
6724 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_red, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 427, __pyx_L1_error)
67976725 __Pyx_GOTREF(__pyx_t_2);
6798 __pyx_t_3 = __Pyx_PyInt_As_uint16_t(__pyx_t_2); if (unlikely((__pyx_t_3 == ((Uint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 426, __pyx_L1_error)
6726 __pyx_t_3 = __Pyx_PyInt_As_uint16_t(__pyx_t_2); if (unlikely((__pyx_t_3 == ((Uint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 427, __pyx_L1_error)
67996727 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
68006728 (__pyx_v_red_gamma[__pyx_v_i]) = __pyx_t_3;
68016729
6802 /* "pygame_sdl2/display.pyx":427
6730 /* "pygame_sdl2/display.pyx":428
68036731 * for i in range(256):
68046732 * red_gamma[i] = red[i]
68056733 * green_gamma[i] = green[i] # <<<<<<<<<<<<<<
68066734 * blue_gamma[i] = blue[i]
68076735 *
68086736 */
6809 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_green, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 427, __pyx_L1_error)
6737 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_green, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 428, __pyx_L1_error)
68106738 __Pyx_GOTREF(__pyx_t_2);
6811 __pyx_t_3 = __Pyx_PyInt_As_uint16_t(__pyx_t_2); if (unlikely((__pyx_t_3 == ((Uint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 427, __pyx_L1_error)
6739 __pyx_t_3 = __Pyx_PyInt_As_uint16_t(__pyx_t_2); if (unlikely((__pyx_t_3 == ((Uint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 428, __pyx_L1_error)
68126740 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
68136741 (__pyx_v_green_gamma[__pyx_v_i]) = __pyx_t_3;
68146742
6815 /* "pygame_sdl2/display.pyx":428
6743 /* "pygame_sdl2/display.pyx":429
68166744 * red_gamma[i] = red[i]
68176745 * green_gamma[i] = green[i]
68186746 * blue_gamma[i] = blue[i] # <<<<<<<<<<<<<<
68196747 *
68206748 * if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma):
68216749 */
6822 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_blue, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 428, __pyx_L1_error)
6750 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_blue, __pyx_v_i, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 429, __pyx_L1_error)
68236751 __Pyx_GOTREF(__pyx_t_2);
6824 __pyx_t_3 = __Pyx_PyInt_As_uint16_t(__pyx_t_2); if (unlikely((__pyx_t_3 == ((Uint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 428, __pyx_L1_error)
6752 __pyx_t_3 = __Pyx_PyInt_As_uint16_t(__pyx_t_2); if (unlikely((__pyx_t_3 == ((Uint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 429, __pyx_L1_error)
68256753 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
68266754 (__pyx_v_blue_gamma[__pyx_v_i]) = __pyx_t_3;
68276755 }
68286756
6829 /* "pygame_sdl2/display.pyx":430
6757 /* "pygame_sdl2/display.pyx":431
68306758 * blue_gamma[i] = blue[i]
68316759 *
68326760 * if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma): # <<<<<<<<<<<<<<
68366764 __pyx_t_4 = (SDL_SetWindowGammaRamp(__pyx_v_self->window, __pyx_v_red_gamma, __pyx_v_green_gamma, __pyx_v_blue_gamma) != 0);
68376765 if (__pyx_t_4) {
68386766
6839 /* "pygame_sdl2/display.pyx":431
6767 /* "pygame_sdl2/display.pyx":432
68406768 *
68416769 * if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma):
68426770 * return False # <<<<<<<<<<<<<<
68486776 __pyx_r = Py_False;
68496777 goto __pyx_L0;
68506778
6851 /* "pygame_sdl2/display.pyx":430
6779 /* "pygame_sdl2/display.pyx":431
68526780 * blue_gamma[i] = blue[i]
68536781 *
68546782 * if SDL_SetWindowGammaRamp(self.window, red_gamma, green_gamma, blue_gamma): # <<<<<<<<<<<<<<
68576785 */
68586786 }
68596787
6860 /* "pygame_sdl2/display.pyx":433
6788 /* "pygame_sdl2/display.pyx":434
68616789 * return False
68626790 *
68636791 * return True # <<<<<<<<<<<<<<
68696797 __pyx_r = Py_True;
68706798 goto __pyx_L0;
68716799
6872 /* "pygame_sdl2/display.pyx":419
6800 /* "pygame_sdl2/display.pyx":420
68736801 * return True
68746802 *
68756803 * def set_gamma_ramp(self, red, green, blue): # <<<<<<<<<<<<<<
68886816 return __pyx_r;
68896817 }
68906818
6891 /* "pygame_sdl2/display.pyx":435
6819 /* "pygame_sdl2/display.pyx":436
68926820 * return True
68936821 *
68946822 * def set_icon(self, Surface surface): # <<<<<<<<<<<<<<
69056833 PyObject *__pyx_r = 0;
69066834 __Pyx_RefNannyDeclarations
69076835 __Pyx_RefNannySetupContext("set_icon (wrapper)", 0);
6908 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 435, __pyx_L1_error)
6836 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_11pygame_sdl2_7surface_Surface, 1, "surface", 0))) __PYX_ERR(0, 436, __pyx_L1_error)
69096837 __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_32set_icon(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self), ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_surface));
69106838
69116839 /* function exit code */
69226850 __Pyx_RefNannyDeclarations
69236851 __Pyx_RefNannySetupContext("set_icon", 0);
69246852
6925 /* "pygame_sdl2/display.pyx":436
6853 /* "pygame_sdl2/display.pyx":437
69266854 *
69276855 * def set_icon(self, Surface surface):
69286856 * SDL_SetWindowIcon(self.window, surface.surface) # <<<<<<<<<<<<<<
69316859 */
69326860 SDL_SetWindowIcon(__pyx_v_self->window, __pyx_v_surface->surface);
69336861
6934 /* "pygame_sdl2/display.pyx":435
6862 /* "pygame_sdl2/display.pyx":436
69356863 * return True
69366864 *
69376865 * def set_icon(self, Surface surface): # <<<<<<<<<<<<<<
69466874 return __pyx_r;
69476875 }
69486876
6949 /* "pygame_sdl2/display.pyx":438
6877 /* "pygame_sdl2/display.pyx":439
69506878 * SDL_SetWindowIcon(self.window, surface.surface)
69516879 *
69526880 * def set_caption(self, title): # <<<<<<<<<<<<<<
69826910 __Pyx_RefNannySetupContext("set_caption", 0);
69836911 __Pyx_INCREF(__pyx_v_title);
69846912
6985 /* "pygame_sdl2/display.pyx":440
6913 /* "pygame_sdl2/display.pyx":441
69866914 * def set_caption(self, title):
69876915 *
69886916 * if not isinstance(title, bytes): # <<<<<<<<<<<<<<
69936921 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
69946922 if (__pyx_t_2) {
69956923
6996 /* "pygame_sdl2/display.pyx":441
6924 /* "pygame_sdl2/display.pyx":442
69976925 *
69986926 * if not isinstance(title, bytes):
69996927 * title = title.encode("utf-8") # <<<<<<<<<<<<<<
70006928 *
70016929 * SDL_SetWindowTitle(self.window, title)
70026930 */
7003 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_title, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 441, __pyx_L1_error)
6931 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_title, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 442, __pyx_L1_error)
70046932 __Pyx_GOTREF(__pyx_t_4);
70056933 __pyx_t_5 = NULL;
70066934 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
70146942 }
70156943 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_u_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_utf_8);
70166944 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
7017 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 441, __pyx_L1_error)
6945 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 442, __pyx_L1_error)
70186946 __Pyx_GOTREF(__pyx_t_3);
70196947 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
70206948 __Pyx_DECREF_SET(__pyx_v_title, __pyx_t_3);
70216949 __pyx_t_3 = 0;
70226950
7023 /* "pygame_sdl2/display.pyx":440
6951 /* "pygame_sdl2/display.pyx":441
70246952 * def set_caption(self, title):
70256953 *
70266954 * if not isinstance(title, bytes): # <<<<<<<<<<<<<<
70296957 */
70306958 }
70316959
7032 /* "pygame_sdl2/display.pyx":443
6960 /* "pygame_sdl2/display.pyx":444
70336961 * title = title.encode("utf-8")
70346962 *
70356963 * SDL_SetWindowTitle(self.window, title) # <<<<<<<<<<<<<<
70366964 *
70376965 * def get_drawable_size(self):
70386966 */
7039 __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_title); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 443, __pyx_L1_error)
6967 __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_title); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 444, __pyx_L1_error)
70406968 SDL_SetWindowTitle(__pyx_v_self->window, __pyx_t_6);
70416969
7042 /* "pygame_sdl2/display.pyx":438
6970 /* "pygame_sdl2/display.pyx":439
70436971 * SDL_SetWindowIcon(self.window, surface.surface)
70446972 *
70456973 * def set_caption(self, title): # <<<<<<<<<<<<<<
70636991 return __pyx_r;
70646992 }
70656993
7066 /* "pygame_sdl2/display.pyx":445
6994 /* "pygame_sdl2/display.pyx":446
70676995 * SDL_SetWindowTitle(self.window, title)
70686996 *
70696997 * def get_drawable_size(self): # <<<<<<<<<<<<<<
70977025 int __pyx_clineno = 0;
70987026 __Pyx_RefNannySetupContext("get_drawable_size", 0);
70997027
7100 /* "pygame_sdl2/display.pyx":448
7028 /* "pygame_sdl2/display.pyx":449
71017029 * cdef int w, h
71027030 *
71037031 * SDL_GL_GetDrawableSize(self.window, &w, &h) # <<<<<<<<<<<<<<
71067034 */
71077035 SDL_GL_GetDrawableSize(__pyx_v_self->window, (&__pyx_v_w), (&__pyx_v_h));
71087036
7109 /* "pygame_sdl2/display.pyx":449
7037 /* "pygame_sdl2/display.pyx":450
71107038 *
71117039 * SDL_GL_GetDrawableSize(self.window, &w, &h)
71127040 * return w, h # <<<<<<<<<<<<<<
71147042 *
71157043 */
71167044 __Pyx_XDECREF(__pyx_r);
7117 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L1_error)
7045 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 450, __pyx_L1_error)
71187046 __Pyx_GOTREF(__pyx_t_1);
7119 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 449, __pyx_L1_error)
7047 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 450, __pyx_L1_error)
71207048 __Pyx_GOTREF(__pyx_t_2);
7121 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 449, __pyx_L1_error)
7049 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 450, __pyx_L1_error)
71227050 __Pyx_GOTREF(__pyx_t_3);
71237051 __Pyx_GIVEREF(__pyx_t_1);
71247052 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
71307058 __pyx_t_3 = 0;
71317059 goto __pyx_L0;
71327060
7133 /* "pygame_sdl2/display.pyx":445
7061 /* "pygame_sdl2/display.pyx":446
71347062 * SDL_SetWindowTitle(self.window, title)
71357063 *
71367064 * def get_drawable_size(self): # <<<<<<<<<<<<<<
71517079 return __pyx_r;
71527080 }
71537081
7154 /* "pygame_sdl2/display.pyx":452
7082 /* "pygame_sdl2/display.pyx":453
71557083 *
71567084 *
71577085 * def get_size(self): # <<<<<<<<<<<<<<
71857113 int __pyx_clineno = 0;
71867114 __Pyx_RefNannySetupContext("get_size", 0);
71877115
7188 /* "pygame_sdl2/display.pyx":455
7116 /* "pygame_sdl2/display.pyx":456
71897117 * cdef int w, h
71907118 *
71917119 * SDL_GetWindowSize(self.window, &w, &h) # <<<<<<<<<<<<<<
71947122 */
71957123 SDL_GetWindowSize(__pyx_v_self->window, (&__pyx_v_w), (&__pyx_v_h));
71967124
7197 /* "pygame_sdl2/display.pyx":456
7125 /* "pygame_sdl2/display.pyx":457
71987126 *
71997127 * SDL_GetWindowSize(self.window, &w, &h)
72007128 * return w, h # <<<<<<<<<<<<<<
72027130 * def restore(self):
72037131 */
72047132 __Pyx_XDECREF(__pyx_r);
7205 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error)
7133 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L1_error)
72067134 __Pyx_GOTREF(__pyx_t_1);
7207 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 456, __pyx_L1_error)
7135 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 457, __pyx_L1_error)
72087136 __Pyx_GOTREF(__pyx_t_2);
7209 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error)
7137 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 457, __pyx_L1_error)
72107138 __Pyx_GOTREF(__pyx_t_3);
72117139 __Pyx_GIVEREF(__pyx_t_1);
72127140 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
72187146 __pyx_t_3 = 0;
72197147 goto __pyx_L0;
72207148
7221 /* "pygame_sdl2/display.pyx":452
7149 /* "pygame_sdl2/display.pyx":453
72227150 *
72237151 *
72247152 * def get_size(self): # <<<<<<<<<<<<<<
72397167 return __pyx_r;
72407168 }
72417169
7242 /* "pygame_sdl2/display.pyx":458
7170 /* "pygame_sdl2/display.pyx":459
72437171 * return w, h
72447172 *
72457173 * def restore(self): # <<<<<<<<<<<<<<
72657193 __Pyx_RefNannyDeclarations
72667194 __Pyx_RefNannySetupContext("restore", 0);
72677195
7268 /* "pygame_sdl2/display.pyx":459
7196 /* "pygame_sdl2/display.pyx":460
72697197 *
72707198 * def restore(self):
72717199 * SDL_RestoreWindow(self.window) # <<<<<<<<<<<<<<
72747202 */
72757203 SDL_RestoreWindow(__pyx_v_self->window);
72767204
7277 /* "pygame_sdl2/display.pyx":458
7205 /* "pygame_sdl2/display.pyx":459
72787206 * return w, h
72797207 *
72807208 * def restore(self): # <<<<<<<<<<<<<<
72897217 return __pyx_r;
72907218 }
72917219
7292 /* "pygame_sdl2/display.pyx":461
7220 /* "pygame_sdl2/display.pyx":462
72937221 * SDL_RestoreWindow(self.window)
72947222 *
72957223 * def maximize(self): # <<<<<<<<<<<<<<
73157243 __Pyx_RefNannyDeclarations
73167244 __Pyx_RefNannySetupContext("maximize", 0);
73177245
7318 /* "pygame_sdl2/display.pyx":462
7246 /* "pygame_sdl2/display.pyx":463
73197247 *
73207248 * def maximize(self):
73217249 * SDL_MaximizeWindow(self.window) # <<<<<<<<<<<<<<
73247252 */
73257253 SDL_MaximizeWindow(__pyx_v_self->window);
73267254
7327 /* "pygame_sdl2/display.pyx":461
7255 /* "pygame_sdl2/display.pyx":462
73287256 * SDL_RestoreWindow(self.window)
73297257 *
73307258 * def maximize(self): # <<<<<<<<<<<<<<
73397267 return __pyx_r;
73407268 }
73417269
7342 /* "pygame_sdl2/display.pyx":464
7270 /* "pygame_sdl2/display.pyx":465
73437271 * SDL_MaximizeWindow(self.window)
73447272 *
73457273 * def minimize(self): # <<<<<<<<<<<<<<
73657293 __Pyx_RefNannyDeclarations
73667294 __Pyx_RefNannySetupContext("minimize", 0);
73677295
7368 /* "pygame_sdl2/display.pyx":465
7296 /* "pygame_sdl2/display.pyx":466
73697297 *
73707298 * def minimize(self):
73717299 * SDL_MinimizeWindow(self.window) # <<<<<<<<<<<<<<
73727300 *
7373 *
7301 * def get_sdl_window_pointer(self):
73747302 */
73757303 SDL_MinimizeWindow(__pyx_v_self->window);
73767304
7377 /* "pygame_sdl2/display.pyx":464
7305 /* "pygame_sdl2/display.pyx":465
73787306 * SDL_MaximizeWindow(self.window)
73797307 *
73807308 * def minimize(self): # <<<<<<<<<<<<<<
73847312
73857313 /* function exit code */
73867314 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7315 __Pyx_XGIVEREF(__pyx_r);
7316 __Pyx_RefNannyFinishContext();
7317 return __pyx_r;
7318 }
7319
7320 /* "pygame_sdl2/display.pyx":468
7321 * SDL_MinimizeWindow(self.window)
7322 *
7323 * def get_sdl_window_pointer(self): # <<<<<<<<<<<<<<
7324 * """
7325 * Returns the pointer to the SDL_Window corresponding to this window.
7326 */
7327
7328 /* Python wrapper */
7329 static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_47get_sdl_window_pointer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
7330 static char __pyx_doc_11pygame_sdl2_7display_6Window_46get_sdl_window_pointer[] = "\n Returns the pointer to the SDL_Window corresponding to this window.\n ";
7331 static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_47get_sdl_window_pointer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
7332 PyObject *__pyx_r = 0;
7333 __Pyx_RefNannyDeclarations
7334 __Pyx_RefNannySetupContext("get_sdl_window_pointer (wrapper)", 0);
7335 __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_46get_sdl_window_pointer(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self));
7336
7337 /* function exit code */
7338 __Pyx_RefNannyFinishContext();
7339 return __pyx_r;
7340 }
7341
7342 static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_46get_sdl_window_pointer(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) {
7343 PyObject *__pyx_v_ctypes = NULL;
7344 PyObject *__pyx_r = NULL;
7345 __Pyx_RefNannyDeclarations
7346 PyObject *__pyx_t_1 = NULL;
7347 PyObject *__pyx_t_2 = NULL;
7348 PyObject *__pyx_t_3 = NULL;
7349 PyObject *__pyx_t_4 = NULL;
7350 int __pyx_lineno = 0;
7351 const char *__pyx_filename = NULL;
7352 int __pyx_clineno = 0;
7353 __Pyx_RefNannySetupContext("get_sdl_window_pointer", 0);
7354
7355 /* "pygame_sdl2/display.pyx":473
7356 * """
7357 *
7358 * import ctypes # <<<<<<<<<<<<<<
7359 * return ctypes.c_void_p(<unsigned long> self.window)
7360 *
7361 */
7362 __pyx_t_1 = __Pyx_Import(__pyx_n_s_ctypes, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 473, __pyx_L1_error)
7363 __Pyx_GOTREF(__pyx_t_1);
7364 __pyx_v_ctypes = __pyx_t_1;
7365 __pyx_t_1 = 0;
7366
7367 /* "pygame_sdl2/display.pyx":474
7368 *
7369 * import ctypes
7370 * return ctypes.c_void_p(<unsigned long> self.window) # <<<<<<<<<<<<<<
7371 *
7372 *
7373 */
7374 __Pyx_XDECREF(__pyx_r);
7375 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_ctypes, __pyx_n_s_c_void_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 474, __pyx_L1_error)
7376 __Pyx_GOTREF(__pyx_t_2);
7377 __pyx_t_3 = __Pyx_PyInt_From_unsigned_long(((unsigned long)__pyx_v_self->window)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 474, __pyx_L1_error)
7378 __Pyx_GOTREF(__pyx_t_3);
7379 __pyx_t_4 = NULL;
7380 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
7381 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
7382 if (likely(__pyx_t_4)) {
7383 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
7384 __Pyx_INCREF(__pyx_t_4);
7385 __Pyx_INCREF(function);
7386 __Pyx_DECREF_SET(__pyx_t_2, function);
7387 }
7388 }
7389 __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
7390 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
7391 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7392 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error)
7393 __Pyx_GOTREF(__pyx_t_1);
7394 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7395 __pyx_r = __pyx_t_1;
7396 __pyx_t_1 = 0;
7397 goto __pyx_L0;
7398
7399 /* "pygame_sdl2/display.pyx":468
7400 * SDL_MinimizeWindow(self.window)
7401 *
7402 * def get_sdl_window_pointer(self): # <<<<<<<<<<<<<<
7403 * """
7404 * Returns the pointer to the SDL_Window corresponding to this window.
7405 */
7406
7407 /* function exit code */
7408 __pyx_L1_error:;
7409 __Pyx_XDECREF(__pyx_t_1);
7410 __Pyx_XDECREF(__pyx_t_2);
7411 __Pyx_XDECREF(__pyx_t_3);
7412 __Pyx_XDECREF(__pyx_t_4);
7413 __Pyx_AddTraceback("pygame_sdl2.display.Window.get_sdl_window_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
7414 __pyx_r = NULL;
7415 __pyx_L0:;
7416 __Pyx_XDECREF(__pyx_v_ctypes);
73877417 __Pyx_XGIVEREF(__pyx_r);
73887418 __Pyx_RefNannyFinishContext();
73897419 return __pyx_r;
75047534 */
75057535
75067536 /* Python wrapper */
7507 static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_47__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
7508 static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_47__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
7537 static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_49__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
7538 static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_49__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
75097539 PyObject *__pyx_r = 0;
75107540 __Pyx_RefNannyDeclarations
75117541 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
7512 __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_46__reduce_cython__(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self));
7542 __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_48__reduce_cython__(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self));
75137543
75147544 /* function exit code */
75157545 __Pyx_RefNannyFinishContext();
75167546 return __pyx_r;
75177547 }
75187548
7519 static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_46__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) {
7549 static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_48__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) {
75207550 PyObject *__pyx_r = NULL;
75217551 __Pyx_RefNannyDeclarations
75227552 PyObject *__pyx_t_1 = NULL;
75617591 */
75627592
75637593 /* Python wrapper */
7564 static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_49__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
7565 static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_49__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
7594 static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_51__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
7595 static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_51__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
75667596 PyObject *__pyx_r = 0;
75677597 __Pyx_RefNannyDeclarations
75687598 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
7569 __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_48__setstate_cython__(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
7599 __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_50__setstate_cython__(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
75707600
75717601 /* function exit code */
75727602 __Pyx_RefNannyFinishContext();
75737603 return __pyx_r;
75747604 }
75757605
7576 static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_48__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
7606 static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_50__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
75777607 PyObject *__pyx_r = NULL;
75787608 __Pyx_RefNannyDeclarations
75797609 PyObject *__pyx_t_1 = NULL;
76107640 return __pyx_r;
76117641 }
76127642
7613 /* "pygame_sdl2/display.pyx":477
7643 /* "pygame_sdl2/display.pyx":488
76147644 * default_swap_control = 1
76157645 *
76167646 * def set_mode(resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): # <<<<<<<<<<<<<<
76197649 */
76207650
76217651 /* Python wrapper */
7622 static PyObject *__pyx_pw_11pygame_sdl2_7display_15set_mode(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7623 static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_15set_mode = {"set_mode", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_7display_15set_mode, METH_VARARGS|METH_KEYWORDS, 0};
7624 static PyObject *__pyx_pw_11pygame_sdl2_7display_15set_mode(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7652 static PyObject *__pyx_pw_11pygame_sdl2_7display_13set_mode(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7653 static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_13set_mode = {"set_mode", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_7display_13set_mode, METH_VARARGS|METH_KEYWORDS, 0};
7654 static PyObject *__pyx_pw_11pygame_sdl2_7display_13set_mode(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
76257655 PyObject *__pyx_v_resolution = 0;
76267656 PyObject *__pyx_v_flags = 0;
76277657 PyObject *__pyx_v_depth = 0;
76817711 }
76827712 }
76837713 if (unlikely(kw_args > 0)) {
7684 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_mode") < 0)) __PYX_ERR(0, 477, __pyx_L3_error)
7714 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_mode") < 0)) __PYX_ERR(0, 488, __pyx_L3_error)
76857715 }
76867716 } else {
76877717 switch (PyTuple_GET_SIZE(__pyx_args)) {
77047734 }
77057735 goto __pyx_L4_argument_unpacking_done;
77067736 __pyx_L5_argtuple_error:;
7707 __Pyx_RaiseArgtupleInvalid("set_mode", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 477, __pyx_L3_error)
7737 __Pyx_RaiseArgtupleInvalid("set_mode", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 488, __pyx_L3_error)
77087738 __pyx_L3_error:;
77097739 __Pyx_AddTraceback("pygame_sdl2.display.set_mode", __pyx_clineno, __pyx_lineno, __pyx_filename);
77107740 __Pyx_RefNannyFinishContext();
77117741 return NULL;
77127742 __pyx_L4_argument_unpacking_done:;
7713 __pyx_r = __pyx_pf_11pygame_sdl2_7display_14set_mode(__pyx_self, __pyx_v_resolution, __pyx_v_flags, __pyx_v_depth, __pyx_v_pos);
7743 __pyx_r = __pyx_pf_11pygame_sdl2_7display_12set_mode(__pyx_self, __pyx_v_resolution, __pyx_v_flags, __pyx_v_depth, __pyx_v_pos);
77147744
77157745 /* function exit code */
77167746 __Pyx_RefNannyFinishContext();
77177747 return __pyx_r;
77187748 }
77197749
7720 static PyObject *__pyx_pf_11pygame_sdl2_7display_14set_mode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_resolution, PyObject *__pyx_v_flags, PyObject *__pyx_v_depth, PyObject *__pyx_v_pos) {
7750 static PyObject *__pyx_pf_11pygame_sdl2_7display_12set_mode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_resolution, PyObject *__pyx_v_flags, PyObject *__pyx_v_depth, PyObject *__pyx_v_pos) {
77217751 int __pyx_v_RESIZE_FLAGS;
77227752 PyObject *__pyx_r = NULL;
77237753 __Pyx_RefNannyDeclarations
77357765 int __pyx_clineno = 0;
77367766 __Pyx_RefNannySetupContext("set_mode", 0);
77377767
7738 /* "pygame_sdl2/display.pyx":480
7768 /* "pygame_sdl2/display.pyx":491
77397769 * global main_window
77407770 *
77417771 * RESIZE_FLAGS = SDL_WINDOW_OPENGL | SDL_WINDOW_FULLSCREEN_DESKTOP # <<<<<<<<<<<<<<
77447774 */
77457775 __pyx_v_RESIZE_FLAGS = (SDL_WINDOW_OPENGL | SDL_WINDOW_FULLSCREEN_DESKTOP);
77467776
7747 /* "pygame_sdl2/display.pyx":482
7777 /* "pygame_sdl2/display.pyx":493
77487778 * RESIZE_FLAGS = SDL_WINDOW_OPENGL | SDL_WINDOW_FULLSCREEN_DESKTOP
77497779 *
77507780 * if main_window: # <<<<<<<<<<<<<<
77517781 *
77527782 * if (flags & ~RESIZE_FLAGS) == (main_window.create_flags & ~RESIZE_FLAGS):
77537783 */
7754 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 482, __pyx_L1_error)
7784 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 493, __pyx_L1_error)
77557785 if (__pyx_t_1) {
77567786
7757 /* "pygame_sdl2/display.pyx":484
7787 /* "pygame_sdl2/display.pyx":495
77587788 * if main_window:
77597789 *
77607790 * if (flags & ~RESIZE_FLAGS) == (main_window.create_flags & ~RESIZE_FLAGS): # <<<<<<<<<<<<<<
77617791 * main_window.resize(resolution, flags & SDL_WINDOW_OPENGL, flags & SDL_WINDOW_FULLSCREEN_DESKTOP)
77627792 * return main_window.surface
77637793 */
7764 __pyx_t_2 = __Pyx_PyInt_From_int((~__pyx_v_RESIZE_FLAGS)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 484, __pyx_L1_error)
7794 __pyx_t_2 = __Pyx_PyInt_From_int((~__pyx_v_RESIZE_FLAGS)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 495, __pyx_L1_error)
77657795 __Pyx_GOTREF(__pyx_t_2);
7766 __pyx_t_3 = PyNumber_And(__pyx_v_flags, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 484, __pyx_L1_error)
7796 __pyx_t_3 = PyNumber_And(__pyx_v_flags, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 495, __pyx_L1_error)
77677797 __Pyx_GOTREF(__pyx_t_3);
77687798 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7769 __pyx_t_2 = __Pyx_PyInt_From_uint32_t((__pyx_v_11pygame_sdl2_7display_main_window->create_flags & (~__pyx_v_RESIZE_FLAGS))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 484, __pyx_L1_error)
7799 __pyx_t_2 = __Pyx_PyInt_From_uint32_t((__pyx_v_11pygame_sdl2_7display_main_window->create_flags & (~__pyx_v_RESIZE_FLAGS))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 495, __pyx_L1_error)
77707800 __Pyx_GOTREF(__pyx_t_2);
7771 __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 484, __pyx_L1_error)
7801 __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 495, __pyx_L1_error)
77727802 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
77737803 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7774 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 484, __pyx_L1_error)
7804 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 495, __pyx_L1_error)
77757805 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
77767806 if (__pyx_t_1) {
77777807
7778 /* "pygame_sdl2/display.pyx":485
7808 /* "pygame_sdl2/display.pyx":496
77797809 *
77807810 * if (flags & ~RESIZE_FLAGS) == (main_window.create_flags & ~RESIZE_FLAGS):
77817811 * main_window.resize(resolution, flags & SDL_WINDOW_OPENGL, flags & SDL_WINDOW_FULLSCREEN_DESKTOP) # <<<<<<<<<<<<<<
77827812 * return main_window.surface
77837813 *
77847814 */
7785 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_resize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 485, __pyx_L1_error)
7815 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_resize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 496, __pyx_L1_error)
77867816 __Pyx_GOTREF(__pyx_t_2);
7787 __pyx_t_3 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_OPENGL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 485, __pyx_L1_error)
7817 __pyx_t_3 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_OPENGL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 496, __pyx_L1_error)
77887818 __Pyx_GOTREF(__pyx_t_3);
7789 __pyx_t_5 = PyNumber_And(__pyx_v_flags, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 485, __pyx_L1_error)
7819 __pyx_t_5 = PyNumber_And(__pyx_v_flags, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 496, __pyx_L1_error)
77907820 __Pyx_GOTREF(__pyx_t_5);
77917821 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7792 __pyx_t_3 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_FULLSCREEN_DESKTOP); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 485, __pyx_L1_error)
7822 __pyx_t_3 = __Pyx_PyInt_From_SDL_WindowFlags(SDL_WINDOW_FULLSCREEN_DESKTOP); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 496, __pyx_L1_error)
77937823 __Pyx_GOTREF(__pyx_t_3);
7794 __pyx_t_6 = PyNumber_And(__pyx_v_flags, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 485, __pyx_L1_error)
7824 __pyx_t_6 = PyNumber_And(__pyx_v_flags, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 496, __pyx_L1_error)
77957825 __Pyx_GOTREF(__pyx_t_6);
77967826 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
77977827 __pyx_t_3 = NULL;
78097839 #if CYTHON_FAST_PYCALL
78107840 if (PyFunction_Check(__pyx_t_2)) {
78117841 PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_resolution, __pyx_t_5, __pyx_t_6};
7812 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 485, __pyx_L1_error)
7842 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 496, __pyx_L1_error)
78137843 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
78147844 __Pyx_GOTREF(__pyx_t_4);
78157845 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
78197849 #if CYTHON_FAST_PYCCALL
78207850 if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
78217851 PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_resolution, __pyx_t_5, __pyx_t_6};
7822 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 485, __pyx_L1_error)
7852 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 496, __pyx_L1_error)
78237853 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
78247854 __Pyx_GOTREF(__pyx_t_4);
78257855 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
78277857 } else
78287858 #endif
78297859 {
7830 __pyx_t_8 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 485, __pyx_L1_error)
7860 __pyx_t_8 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 496, __pyx_L1_error)
78317861 __Pyx_GOTREF(__pyx_t_8);
78327862 if (__pyx_t_3) {
78337863 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); __pyx_t_3 = NULL;
78417871 PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_t_6);
78427872 __pyx_t_5 = 0;
78437873 __pyx_t_6 = 0;
7844 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 485, __pyx_L1_error)
7874 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 496, __pyx_L1_error)
78457875 __Pyx_GOTREF(__pyx_t_4);
78467876 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
78477877 }
78487878 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
78497879 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
78507880
7851 /* "pygame_sdl2/display.pyx":486
7881 /* "pygame_sdl2/display.pyx":497
78527882 * if (flags & ~RESIZE_FLAGS) == (main_window.create_flags & ~RESIZE_FLAGS):
78537883 * main_window.resize(resolution, flags & SDL_WINDOW_OPENGL, flags & SDL_WINDOW_FULLSCREEN_DESKTOP)
78547884 * return main_window.surface # <<<<<<<<<<<<<<
78607890 __pyx_r = ((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window->surface);
78617891 goto __pyx_L0;
78627892
7863 /* "pygame_sdl2/display.pyx":484
7893 /* "pygame_sdl2/display.pyx":495
78647894 * if main_window:
78657895 *
78667896 * if (flags & ~RESIZE_FLAGS) == (main_window.create_flags & ~RESIZE_FLAGS): # <<<<<<<<<<<<<<
78697899 */
78707900 }
78717901
7872 /* "pygame_sdl2/display.pyx":489
7902 /* "pygame_sdl2/display.pyx":500
78737903 *
78747904 * else:
78757905 * main_window.destroy() # <<<<<<<<<<<<<<
78777907 * main_window = Window(default_title, resolution, flags, depth, pos=pos)
78787908 */
78797909 /*else*/ {
7880 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_destroy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 489, __pyx_L1_error)
7910 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_destroy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 500, __pyx_L1_error)
78817911 __Pyx_GOTREF(__pyx_t_2);
78827912 __pyx_t_8 = NULL;
78837913 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
78917921 }
78927922 __pyx_t_4 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
78937923 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
7894 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 489, __pyx_L1_error)
7924 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 500, __pyx_L1_error)
78957925 __Pyx_GOTREF(__pyx_t_4);
78967926 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
78977927 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
78987928 }
78997929
7900 /* "pygame_sdl2/display.pyx":482
7930 /* "pygame_sdl2/display.pyx":493
79017931 * RESIZE_FLAGS = SDL_WINDOW_OPENGL | SDL_WINDOW_FULLSCREEN_DESKTOP
79027932 *
79037933 * if main_window: # <<<<<<<<<<<<<<
79067936 */
79077937 }
79087938
7909 /* "pygame_sdl2/display.pyx":491
7939 /* "pygame_sdl2/display.pyx":502
79107940 * main_window.destroy()
79117941 *
79127942 * main_window = Window(default_title, resolution, flags, depth, pos=pos) # <<<<<<<<<<<<<<
79137943 *
79147944 * if default_icon is not None:
79157945 */
7916 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_default_title); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 491, __pyx_L1_error)
7946 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_default_title); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 502, __pyx_L1_error)
79177947 __Pyx_GOTREF(__pyx_t_4);
7918 __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 491, __pyx_L1_error)
7948 __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 502, __pyx_L1_error)
79197949 __Pyx_GOTREF(__pyx_t_2);
79207950 __Pyx_GIVEREF(__pyx_t_4);
79217951 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
79297959 __Pyx_GIVEREF(__pyx_v_depth);
79307960 PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_depth);
79317961 __pyx_t_4 = 0;
7932 __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 491, __pyx_L1_error)
7962 __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 502, __pyx_L1_error)
79337963 __Pyx_GOTREF(__pyx_t_4);
7934 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_pos, __pyx_v_pos) < 0) __PYX_ERR(0, 491, __pyx_L1_error)
7935 __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window), __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 491, __pyx_L1_error)
7964 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_pos, __pyx_v_pos) < 0) __PYX_ERR(0, 502, __pyx_L1_error)
7965 __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window), __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 502, __pyx_L1_error)
79367966 __Pyx_GOTREF(__pyx_t_8);
79377967 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
79387968 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
79417971 __Pyx_GIVEREF(__pyx_t_8);
79427972 __pyx_t_8 = 0;
79437973
7944 /* "pygame_sdl2/display.pyx":493
7974 /* "pygame_sdl2/display.pyx":504
79457975 * main_window = Window(default_title, resolution, flags, depth, pos=pos)
79467976 *
79477977 * if default_icon is not None: # <<<<<<<<<<<<<<
79487978 * main_window.set_icon(default_icon)
79497979 *
79507980 */
7951 __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_default_icon); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 493, __pyx_L1_error)
7981 __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_default_icon); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 504, __pyx_L1_error)
79527982 __Pyx_GOTREF(__pyx_t_8);
79537983 __pyx_t_1 = (__pyx_t_8 != Py_None);
79547984 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
79557985 __pyx_t_9 = (__pyx_t_1 != 0);
79567986 if (__pyx_t_9) {
79577987
7958 /* "pygame_sdl2/display.pyx":494
7988 /* "pygame_sdl2/display.pyx":505
79597989 *
79607990 * if default_icon is not None:
79617991 * main_window.set_icon(default_icon) # <<<<<<<<<<<<<<
79627992 *
79637993 * return main_window.surface
79647994 */
7965 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_set_icon); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 494, __pyx_L1_error)
7995 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_set_icon); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 505, __pyx_L1_error)
79667996 __Pyx_GOTREF(__pyx_t_4);
7967 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_default_icon); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 494, __pyx_L1_error)
7997 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_default_icon); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 505, __pyx_L1_error)
79687998 __Pyx_GOTREF(__pyx_t_2);
79697999 __pyx_t_6 = NULL;
79708000 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
79798009 __pyx_t_8 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2);
79808010 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
79818011 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7982 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 494, __pyx_L1_error)
8012 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 505, __pyx_L1_error)
79838013 __Pyx_GOTREF(__pyx_t_8);
79848014 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
79858015 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
79868016
7987 /* "pygame_sdl2/display.pyx":493
8017 /* "pygame_sdl2/display.pyx":504
79888018 * main_window = Window(default_title, resolution, flags, depth, pos=pos)
79898019 *
79908020 * if default_icon is not None: # <<<<<<<<<<<<<<
79938023 */
79948024 }
79958025
7996 /* "pygame_sdl2/display.pyx":496
8026 /* "pygame_sdl2/display.pyx":507
79978027 * main_window.set_icon(default_icon)
79988028 *
79998029 * return main_window.surface # <<<<<<<<<<<<<<
80008030 *
8001 * def get_surface():
8031 * def destroy():
80028032 */
80038033 __Pyx_XDECREF(__pyx_r);
80048034 __Pyx_INCREF(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window->surface));
80058035 __pyx_r = ((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window->surface);
80068036 goto __pyx_L0;
80078037
8008 /* "pygame_sdl2/display.pyx":477
8038 /* "pygame_sdl2/display.pyx":488
80098039 * default_swap_control = 1
80108040 *
80118041 * def set_mode(resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): # <<<<<<<<<<<<<<
80298059 return __pyx_r;
80308060 }
80318061
8032 /* "pygame_sdl2/display.pyx":498
8062 /* "pygame_sdl2/display.pyx":509
80338063 * return main_window.surface
8064 *
8065 * def destroy(): # <<<<<<<<<<<<<<
8066 * global main_window
8067 *
8068 */
8069
8070 /* Python wrapper */
8071 static PyObject *__pyx_pw_11pygame_sdl2_7display_15destroy(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
8072 static PyMethodDef __pyx_mdef_11pygame_sdl2_7display_15destroy = {"destroy", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_15destroy, METH_NOARGS, 0};
8073 static PyObject *__pyx_pw_11pygame_sdl2_7display_15destroy(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
8074 PyObject *__pyx_r = 0;
8075 __Pyx_RefNannyDeclarations
8076 __Pyx_RefNannySetupContext("destroy (wrapper)", 0);
8077 __pyx_r = __pyx_pf_11pygame_sdl2_7display_14destroy(__pyx_self);
8078
8079 /* function exit code */
8080 __Pyx_RefNannyFinishContext();
8081 return __pyx_r;
8082 }
8083
8084 static PyObject *__pyx_pf_11pygame_sdl2_7display_14destroy(CYTHON_UNUSED PyObject *__pyx_self) {
8085 PyObject *__pyx_r = NULL;
8086 __Pyx_RefNannyDeclarations
8087 int __pyx_t_1;
8088 int __pyx_t_2;
8089 PyObject *__pyx_t_3 = NULL;
8090 PyObject *__pyx_t_4 = NULL;
8091 PyObject *__pyx_t_5 = NULL;
8092 int __pyx_lineno = 0;
8093 const char *__pyx_filename = NULL;
8094 int __pyx_clineno = 0;
8095 __Pyx_RefNannySetupContext("destroy", 0);
8096
8097 /* "pygame_sdl2/display.pyx":512
8098 * global main_window
8099 *
8100 * if main_window is not None: # <<<<<<<<<<<<<<
8101 * main_window.destroy()
8102 * main_window = None
8103 */
8104 __pyx_t_1 = (((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window) != Py_None);
8105 __pyx_t_2 = (__pyx_t_1 != 0);
8106 if (__pyx_t_2) {
8107
8108 /* "pygame_sdl2/display.pyx":513
8109 *
8110 * if main_window is not None:
8111 * main_window.destroy() # <<<<<<<<<<<<<<
8112 * main_window = None
8113 *
8114 */
8115 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_destroy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 513, __pyx_L1_error)
8116 __Pyx_GOTREF(__pyx_t_4);
8117 __pyx_t_5 = NULL;
8118 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
8119 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
8120 if (likely(__pyx_t_5)) {
8121 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
8122 __Pyx_INCREF(__pyx_t_5);
8123 __Pyx_INCREF(function);
8124 __Pyx_DECREF_SET(__pyx_t_4, function);
8125 }
8126 }
8127 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
8128 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
8129 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 513, __pyx_L1_error)
8130 __Pyx_GOTREF(__pyx_t_3);
8131 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8132 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8133
8134 /* "pygame_sdl2/display.pyx":514
8135 * if main_window is not None:
8136 * main_window.destroy()
8137 * main_window = None # <<<<<<<<<<<<<<
8138 *
8139 * def get_surface():
8140 */
8141 __Pyx_INCREF(Py_None);
8142 __Pyx_XGOTREF(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window));
8143 __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_7display_main_window, ((struct __pyx_obj_11pygame_sdl2_7display_Window *)Py_None));
8144 __Pyx_GIVEREF(Py_None);
8145
8146 /* "pygame_sdl2/display.pyx":512
8147 * global main_window
8148 *
8149 * if main_window is not None: # <<<<<<<<<<<<<<
8150 * main_window.destroy()
8151 * main_window = None
8152 */
8153 }
8154
8155 /* "pygame_sdl2/display.pyx":509
8156 * return main_window.surface
8157 *
8158 * def destroy(): # <<<<<<<<<<<<<<
8159 * global main_window
8160 *
8161 */
8162
8163 /* function exit code */
8164 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8165 goto __pyx_L0;
8166 __pyx_L1_error:;
8167 __Pyx_XDECREF(__pyx_t_3);
8168 __Pyx_XDECREF(__pyx_t_4);
8169 __Pyx_XDECREF(__pyx_t_5);
8170 __Pyx_AddTraceback("pygame_sdl2.display.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename);
8171 __pyx_r = NULL;
8172 __pyx_L0:;
8173 __Pyx_XGIVEREF(__pyx_r);
8174 __Pyx_RefNannyFinishContext();
8175 return __pyx_r;
8176 }
8177
8178 /* "pygame_sdl2/display.pyx":516
8179 * main_window = None
80348180 *
80358181 * def get_surface(): # <<<<<<<<<<<<<<
80368182 * if main_window is None:
80648210 int __pyx_clineno = 0;
80658211 __Pyx_RefNannySetupContext("get_surface", 0);
80668212
8067 /* "pygame_sdl2/display.pyx":499
8213 /* "pygame_sdl2/display.pyx":517
80688214 *
80698215 * def get_surface():
80708216 * if main_window is None: # <<<<<<<<<<<<<<
80758221 __pyx_t_2 = (__pyx_t_1 != 0);
80768222 if (__pyx_t_2) {
80778223
8078 /* "pygame_sdl2/display.pyx":500
8224 /* "pygame_sdl2/display.pyx":518
80798225 * def get_surface():
80808226 * if main_window is None:
80818227 * return None # <<<<<<<<<<<<<<
80868232 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
80878233 goto __pyx_L0;
80888234
8089 /* "pygame_sdl2/display.pyx":499
8235 /* "pygame_sdl2/display.pyx":517
80908236 *
80918237 * def get_surface():
80928238 * if main_window is None: # <<<<<<<<<<<<<<
80958241 */
80968242 }
80978243
8098 /* "pygame_sdl2/display.pyx":502
8244 /* "pygame_sdl2/display.pyx":520
80998245 * return None
81008246 *
81018247 * return main_window.get_surface() # <<<<<<<<<<<<<<
81038249 * def get_window():
81048250 */
81058251 __Pyx_XDECREF(__pyx_r);
8106 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_get_surface); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 502, __pyx_L1_error)
8252 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_get_surface); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error)
81078253 __Pyx_GOTREF(__pyx_t_4);
81088254 __pyx_t_5 = NULL;
81098255 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
81178263 }
81188264 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
81198265 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
8120 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 502, __pyx_L1_error)
8266 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 520, __pyx_L1_error)
81218267 __Pyx_GOTREF(__pyx_t_3);
81228268 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
81238269 __pyx_r = __pyx_t_3;
81248270 __pyx_t_3 = 0;
81258271 goto __pyx_L0;
81268272
8127 /* "pygame_sdl2/display.pyx":498
8128 * return main_window.surface
8273 /* "pygame_sdl2/display.pyx":516
8274 * main_window = None
81298275 *
81308276 * def get_surface(): # <<<<<<<<<<<<<<
81318277 * if main_window is None:
81458291 return __pyx_r;
81468292 }
81478293
8148 /* "pygame_sdl2/display.pyx":504
8294 /* "pygame_sdl2/display.pyx":522
81498295 * return main_window.get_surface()
81508296 *
81518297 * def get_window(): # <<<<<<<<<<<<<<
81738319 __Pyx_RefNannyDeclarations
81748320 __Pyx_RefNannySetupContext("get_window", 0);
81758321
8176 /* "pygame_sdl2/display.pyx":510
8322 /* "pygame_sdl2/display.pyx":528
81778323 * """
81788324 *
81798325 * return main_window # <<<<<<<<<<<<<<
81858331 __pyx_r = ((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window);
81868332 goto __pyx_L0;
81878333
8188 /* "pygame_sdl2/display.pyx":504
8334 /* "pygame_sdl2/display.pyx":522
81898335 * return main_window.get_surface()
81908336 *
81918337 * def get_window(): # <<<<<<<<<<<<<<
82008346 return __pyx_r;
82018347 }
82028348
8203 /* "pygame_sdl2/display.pyx":512
8349 /* "pygame_sdl2/display.pyx":530
82048350 * return main_window
82058351 *
82068352 * def flip(): # <<<<<<<<<<<<<<
82348380 int __pyx_clineno = 0;
82358381 __Pyx_RefNannySetupContext("flip", 0);
82368382
8237 /* "pygame_sdl2/display.pyx":513
8383 /* "pygame_sdl2/display.pyx":531
82388384 *
82398385 * def flip():
82408386 * if main_window: # <<<<<<<<<<<<<<
82418387 * main_window.flip()
82428388 *
82438389 */
8244 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 513, __pyx_L1_error)
8390 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 531, __pyx_L1_error)
82458391 if (__pyx_t_1) {
82468392
8247 /* "pygame_sdl2/display.pyx":514
8393 /* "pygame_sdl2/display.pyx":532
82488394 * def flip():
82498395 * if main_window:
82508396 * main_window.flip() # <<<<<<<<<<<<<<
82518397 *
82528398 * def update(rectangles=None):
82538399 */
8254 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_flip); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 514, __pyx_L1_error)
8400 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_flip); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 532, __pyx_L1_error)
82558401 __Pyx_GOTREF(__pyx_t_3);
82568402 __pyx_t_4 = NULL;
82578403 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
82658411 }
82668412 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
82678413 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8268 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error)
8414 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 532, __pyx_L1_error)
82698415 __Pyx_GOTREF(__pyx_t_2);
82708416 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
82718417 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
82728418
8273 /* "pygame_sdl2/display.pyx":513
8419 /* "pygame_sdl2/display.pyx":531
82748420 *
82758421 * def flip():
82768422 * if main_window: # <<<<<<<<<<<<<<
82798425 */
82808426 }
82818427
8282 /* "pygame_sdl2/display.pyx":512
8428 /* "pygame_sdl2/display.pyx":530
82838429 * return main_window
82848430 *
82858431 * def flip(): # <<<<<<<<<<<<<<
83028448 return __pyx_r;
83038449 }
83048450
8305 /* "pygame_sdl2/display.pyx":516
8451 /* "pygame_sdl2/display.pyx":534
83068452 * main_window.flip()
83078453 *
83088454 * def update(rectangles=None): # <<<<<<<<<<<<<<
83438489 }
83448490 }
83458491 if (unlikely(kw_args > 0)) {
8346 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "update") < 0)) __PYX_ERR(0, 516, __pyx_L3_error)
8492 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "update") < 0)) __PYX_ERR(0, 534, __pyx_L3_error)
83478493 }
83488494 } else {
83498495 switch (PyTuple_GET_SIZE(__pyx_args)) {
83578503 }
83588504 goto __pyx_L4_argument_unpacking_done;
83598505 __pyx_L5_argtuple_error:;
8360 __Pyx_RaiseArgtupleInvalid("update", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 516, __pyx_L3_error)
8506 __Pyx_RaiseArgtupleInvalid("update", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 534, __pyx_L3_error)
83618507 __pyx_L3_error:;
83628508 __Pyx_AddTraceback("pygame_sdl2.display.update", __pyx_clineno, __pyx_lineno, __pyx_filename);
83638509 __Pyx_RefNannyFinishContext();
83828528 int __pyx_clineno = 0;
83838529 __Pyx_RefNannySetupContext("update", 0);
83848530
8385 /* "pygame_sdl2/display.pyx":517
8531 /* "pygame_sdl2/display.pyx":535
83868532 *
83878533 * def update(rectangles=None):
83888534 * if main_window: # <<<<<<<<<<<<<<
83898535 * main_window.update(rectangles)
83908536 *
83918537 */
8392 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 517, __pyx_L1_error)
8538 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 535, __pyx_L1_error)
83938539 if (__pyx_t_1) {
83948540
8395 /* "pygame_sdl2/display.pyx":518
8541 /* "pygame_sdl2/display.pyx":536
83968542 * def update(rectangles=None):
83978543 * if main_window:
83988544 * main_window.update(rectangles) # <<<<<<<<<<<<<<
83998545 *
84008546 * def get_driver():
84018547 */
8402 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_update); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 518, __pyx_L1_error)
8548 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_update); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 536, __pyx_L1_error)
84038549 __Pyx_GOTREF(__pyx_t_3);
84048550 __pyx_t_4 = NULL;
84058551 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
84138559 }
84148560 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_rectangles) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_rectangles);
84158561 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8416 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 518, __pyx_L1_error)
8562 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 536, __pyx_L1_error)
84178563 __Pyx_GOTREF(__pyx_t_2);
84188564 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
84198565 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
84208566
8421 /* "pygame_sdl2/display.pyx":517
8567 /* "pygame_sdl2/display.pyx":535
84228568 *
84238569 * def update(rectangles=None):
84248570 * if main_window: # <<<<<<<<<<<<<<
84278573 */
84288574 }
84298575
8430 /* "pygame_sdl2/display.pyx":516
8576 /* "pygame_sdl2/display.pyx":534
84318577 * main_window.flip()
84328578 *
84338579 * def update(rectangles=None): # <<<<<<<<<<<<<<
84508596 return __pyx_r;
84518597 }
84528598
8453 /* "pygame_sdl2/display.pyx":520
8599 /* "pygame_sdl2/display.pyx":538
84548600 * main_window.update(rectangles)
84558601 *
84568602 * def get_driver(): # <<<<<<<<<<<<<<
84858631 int __pyx_clineno = 0;
84868632 __Pyx_RefNannySetupContext("get_driver", 0);
84878633
8488 /* "pygame_sdl2/display.pyx":521
8634 /* "pygame_sdl2/display.pyx":539
84898635 *
84908636 * def get_driver():
84918637 * cdef const char *driver = SDL_GetCurrentVideoDriver() # <<<<<<<<<<<<<<
84948640 */
84958641 __pyx_v_driver = SDL_GetCurrentVideoDriver();
84968642
8497 /* "pygame_sdl2/display.pyx":523
8643 /* "pygame_sdl2/display.pyx":541
84988644 * cdef const char *driver = SDL_GetCurrentVideoDriver()
84998645 *
85008646 * if driver == NULL: # <<<<<<<<<<<<<<
85048650 __pyx_t_1 = ((__pyx_v_driver == NULL) != 0);
85058651 if (unlikely(__pyx_t_1)) {
85068652
8507 /* "pygame_sdl2/display.pyx":524
8653 /* "pygame_sdl2/display.pyx":542
85088654 *
85098655 * if driver == NULL:
85108656 * raise error() # <<<<<<<<<<<<<<
85118657 *
85128658 * return driver
85138659 */
8514 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 524, __pyx_L1_error)
8660 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 542, __pyx_L1_error)
85158661 __Pyx_GOTREF(__pyx_t_3);
85168662 __pyx_t_4 = NULL;
85178663 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
85258671 }
85268672 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
85278673 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8528 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 524, __pyx_L1_error)
8674 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 542, __pyx_L1_error)
85298675 __Pyx_GOTREF(__pyx_t_2);
85308676 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
85318677 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
85328678 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8533 __PYX_ERR(0, 524, __pyx_L1_error)
8534
8535 /* "pygame_sdl2/display.pyx":523
8679 __PYX_ERR(0, 542, __pyx_L1_error)
8680
8681 /* "pygame_sdl2/display.pyx":541
85368682 * cdef const char *driver = SDL_GetCurrentVideoDriver()
85378683 *
85388684 * if driver == NULL: # <<<<<<<<<<<<<<
85418687 */
85428688 }
85438689
8544 /* "pygame_sdl2/display.pyx":526
8690 /* "pygame_sdl2/display.pyx":544
85458691 * raise error()
85468692 *
85478693 * return driver # <<<<<<<<<<<<<<
85498695 * class Info(object):
85508696 */
85518697 __Pyx_XDECREF(__pyx_r);
8552 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_driver); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 526, __pyx_L1_error)
8698 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_driver); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 544, __pyx_L1_error)
85538699 __Pyx_GOTREF(__pyx_t_2);
85548700 __pyx_r = __pyx_t_2;
85558701 __pyx_t_2 = 0;
85568702 goto __pyx_L0;
85578703
8558 /* "pygame_sdl2/display.pyx":520
8704 /* "pygame_sdl2/display.pyx":538
85598705 * main_window.update(rectangles)
85608706 *
85618707 * def get_driver(): # <<<<<<<<<<<<<<
85768722 return __pyx_r;
85778723 }
85788724
8579 /* "pygame_sdl2/display.pyx":530
8725 /* "pygame_sdl2/display.pyx":548
85808726 * class Info(object):
85818727 *
85828728 * def __init__(self): # <<<<<<<<<<<<<<
86158761 int __pyx_clineno = 0;
86168762 __Pyx_RefNannySetupContext("__init__", 0);
86178763
8618 /* "pygame_sdl2/display.pyx":534
8764 /* "pygame_sdl2/display.pyx":552
86198765 * cdef SDL_PixelFormat *format
86208766 *
86218767 * if SDL_GetCurrentDisplayMode(0, &dm): # <<<<<<<<<<<<<<
86258771 __pyx_t_1 = (SDL_GetCurrentDisplayMode(0, (&__pyx_v_dm)) != 0);
86268772 if (unlikely(__pyx_t_1)) {
86278773
8628 /* "pygame_sdl2/display.pyx":535
8774 /* "pygame_sdl2/display.pyx":553
86298775 *
86308776 * if SDL_GetCurrentDisplayMode(0, &dm):
86318777 * raise error() # <<<<<<<<<<<<<<
86328778 *
86338779 * format = SDL_AllocFormat(dm.format)
86348780 */
8635 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 535, __pyx_L1_error)
8781 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 553, __pyx_L1_error)
86368782 __Pyx_GOTREF(__pyx_t_3);
86378783 __pyx_t_4 = NULL;
86388784 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
86468792 }
86478793 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
86488794 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8649 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 535, __pyx_L1_error)
8795 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 553, __pyx_L1_error)
86508796 __Pyx_GOTREF(__pyx_t_2);
86518797 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
86528798 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
86538799 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8654 __PYX_ERR(0, 535, __pyx_L1_error)
8655
8656 /* "pygame_sdl2/display.pyx":534
8800 __PYX_ERR(0, 553, __pyx_L1_error)
8801
8802 /* "pygame_sdl2/display.pyx":552
86578803 * cdef SDL_PixelFormat *format
86588804 *
86598805 * if SDL_GetCurrentDisplayMode(0, &dm): # <<<<<<<<<<<<<<
86628808 */
86638809 }
86648810
8665 /* "pygame_sdl2/display.pyx":537
8811 /* "pygame_sdl2/display.pyx":555
86668812 * raise error()
86678813 *
86688814 * format = SDL_AllocFormat(dm.format) # <<<<<<<<<<<<<<
86718817 */
86728818 __pyx_v_format = SDL_AllocFormat(__pyx_v_dm.format);
86738819
8674 /* "pygame_sdl2/display.pyx":538
8820 /* "pygame_sdl2/display.pyx":556
86758821 *
86768822 * format = SDL_AllocFormat(dm.format)
86778823 * if format == NULL: # <<<<<<<<<<<<<<
86818827 __pyx_t_1 = ((__pyx_v_format == NULL) != 0);
86828828 if (unlikely(__pyx_t_1)) {
86838829
8684 /* "pygame_sdl2/display.pyx":539
8830 /* "pygame_sdl2/display.pyx":557
86858831 * format = SDL_AllocFormat(dm.format)
86868832 * if format == NULL:
86878833 * raise error() # <<<<<<<<<<<<<<
86888834 *
86898835 * self.bitsize = format.BitsPerPixel
86908836 */
8691 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 539, __pyx_L1_error)
8837 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 557, __pyx_L1_error)
86928838 __Pyx_GOTREF(__pyx_t_3);
86938839 __pyx_t_4 = NULL;
86948840 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
87028848 }
87038849 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
87048850 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8705 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 539, __pyx_L1_error)
8851 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 557, __pyx_L1_error)
87068852 __Pyx_GOTREF(__pyx_t_2);
87078853 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
87088854 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
87098855 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8710 __PYX_ERR(0, 539, __pyx_L1_error)
8711
8712 /* "pygame_sdl2/display.pyx":538
8856 __PYX_ERR(0, 557, __pyx_L1_error)
8857
8858 /* "pygame_sdl2/display.pyx":556
87138859 *
87148860 * format = SDL_AllocFormat(dm.format)
87158861 * if format == NULL: # <<<<<<<<<<<<<<
87188864 */
87198865 }
87208866
8721 /* "pygame_sdl2/display.pyx":541
8867 /* "pygame_sdl2/display.pyx":559
87228868 * raise error()
87238869 *
87248870 * self.bitsize = format.BitsPerPixel # <<<<<<<<<<<<<<
87258871 * self.bytesize = format.BytesPerPixel
87268872 *
87278873 */
8728 __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->BitsPerPixel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 541, __pyx_L1_error)
8874 __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->BitsPerPixel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 559, __pyx_L1_error)
87298875 __Pyx_GOTREF(__pyx_t_2);
8730 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_bitsize, __pyx_t_2) < 0) __PYX_ERR(0, 541, __pyx_L1_error)
8876 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_bitsize, __pyx_t_2) < 0) __PYX_ERR(0, 559, __pyx_L1_error)
87318877 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
87328878
8733 /* "pygame_sdl2/display.pyx":542
8879 /* "pygame_sdl2/display.pyx":560
87348880 *
87358881 * self.bitsize = format.BitsPerPixel
87368882 * self.bytesize = format.BytesPerPixel # <<<<<<<<<<<<<<
87378883 *
87388884 * self.masks = (
87398885 */
8740 __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->BytesPerPixel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 542, __pyx_L1_error)
8886 __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->BytesPerPixel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 560, __pyx_L1_error)
87418887 __Pyx_GOTREF(__pyx_t_2);
8742 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_bytesize, __pyx_t_2) < 0) __PYX_ERR(0, 542, __pyx_L1_error)
8888 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_bytesize, __pyx_t_2) < 0) __PYX_ERR(0, 560, __pyx_L1_error)
87438889 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
87448890
8745 /* "pygame_sdl2/display.pyx":545
8891 /* "pygame_sdl2/display.pyx":563
87468892 *
87478893 * self.masks = (
87488894 * format.Rmask, # <<<<<<<<<<<<<<
87498895 * format.Gmask,
87508896 * format.Bmask,
87518897 */
8752 __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_format->Rmask); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 545, __pyx_L1_error)
8898 __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_v_format->Rmask); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 563, __pyx_L1_error)
87538899 __Pyx_GOTREF(__pyx_t_2);
87548900
8755 /* "pygame_sdl2/display.pyx":546
8901 /* "pygame_sdl2/display.pyx":564
87568902 * self.masks = (
87578903 * format.Rmask,
87588904 * format.Gmask, # <<<<<<<<<<<<<<
87598905 * format.Bmask,
87608906 * format.Amask,
87618907 */
8762 __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_format->Gmask); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 546, __pyx_L1_error)
8908 __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_format->Gmask); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 564, __pyx_L1_error)
87638909 __Pyx_GOTREF(__pyx_t_3);
87648910
8765 /* "pygame_sdl2/display.pyx":547
8911 /* "pygame_sdl2/display.pyx":565
87668912 * format.Rmask,
87678913 * format.Gmask,
87688914 * format.Bmask, # <<<<<<<<<<<<<<
87698915 * format.Amask,
87708916 * )
87718917 */
8772 __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_format->Bmask); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 547, __pyx_L1_error)
8918 __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_format->Bmask); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 565, __pyx_L1_error)
87738919 __Pyx_GOTREF(__pyx_t_4);
87748920
8775 /* "pygame_sdl2/display.pyx":548
8921 /* "pygame_sdl2/display.pyx":566
87768922 * format.Gmask,
87778923 * format.Bmask,
87788924 * format.Amask, # <<<<<<<<<<<<<<
87798925 * )
87808926 *
87818927 */
8782 __pyx_t_5 = __Pyx_PyInt_From_uint32_t(__pyx_v_format->Amask); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 548, __pyx_L1_error)
8928 __pyx_t_5 = __Pyx_PyInt_From_uint32_t(__pyx_v_format->Amask); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 566, __pyx_L1_error)
87838929 __Pyx_GOTREF(__pyx_t_5);
87848930
8785 /* "pygame_sdl2/display.pyx":545
8931 /* "pygame_sdl2/display.pyx":563
87868932 *
87878933 * self.masks = (
87888934 * format.Rmask, # <<<<<<<<<<<<<<
87898935 * format.Gmask,
87908936 * format.Bmask,
87918937 */
8792 __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 545, __pyx_L1_error)
8938 __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 563, __pyx_L1_error)
87938939 __Pyx_GOTREF(__pyx_t_6);
87948940 __Pyx_GIVEREF(__pyx_t_2);
87958941 PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
88048950 __pyx_t_4 = 0;
88058951 __pyx_t_5 = 0;
88068952
8807 /* "pygame_sdl2/display.pyx":544
8953 /* "pygame_sdl2/display.pyx":562
88088954 * self.bytesize = format.BytesPerPixel
88098955 *
88108956 * self.masks = ( # <<<<<<<<<<<<<<
88118957 * format.Rmask,
88128958 * format.Gmask,
88138959 */
8814 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_masks, __pyx_t_6) < 0) __PYX_ERR(0, 544, __pyx_L1_error)
8960 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_masks, __pyx_t_6) < 0) __PYX_ERR(0, 562, __pyx_L1_error)
88158961 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
88168962
8817 /* "pygame_sdl2/display.pyx":552
8963 /* "pygame_sdl2/display.pyx":570
88188964 *
88198965 * self.shifts = (
88208966 * format.Rshift, # <<<<<<<<<<<<<<
88218967 * format.Gshift,
88228968 * format.Bshift,
88238969 */
8824 __pyx_t_6 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Rshift); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 552, __pyx_L1_error)
8970 __pyx_t_6 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Rshift); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 570, __pyx_L1_error)
88258971 __Pyx_GOTREF(__pyx_t_6);
88268972
8827 /* "pygame_sdl2/display.pyx":553
8973 /* "pygame_sdl2/display.pyx":571
88288974 * self.shifts = (
88298975 * format.Rshift,
88308976 * format.Gshift, # <<<<<<<<<<<<<<
88318977 * format.Bshift,
88328978 * format.Ashift,
88338979 */
8834 __pyx_t_5 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Gshift); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 553, __pyx_L1_error)
8980 __pyx_t_5 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Gshift); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 571, __pyx_L1_error)
88358981 __Pyx_GOTREF(__pyx_t_5);
88368982
8837 /* "pygame_sdl2/display.pyx":554
8983 /* "pygame_sdl2/display.pyx":572
88388984 * format.Rshift,
88398985 * format.Gshift,
88408986 * format.Bshift, # <<<<<<<<<<<<<<
88418987 * format.Ashift,
88428988 * )
88438989 */
8844 __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Bshift); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 554, __pyx_L1_error)
8990 __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Bshift); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 572, __pyx_L1_error)
88458991 __Pyx_GOTREF(__pyx_t_4);
88468992
8847 /* "pygame_sdl2/display.pyx":555
8993 /* "pygame_sdl2/display.pyx":573
88488994 * format.Gshift,
88498995 * format.Bshift,
88508996 * format.Ashift, # <<<<<<<<<<<<<<
88518997 * )
88528998 *
88538999 */
8854 __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Ashift); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 555, __pyx_L1_error)
9000 __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Ashift); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 573, __pyx_L1_error)
88559001 __Pyx_GOTREF(__pyx_t_3);
88569002
8857 /* "pygame_sdl2/display.pyx":552
9003 /* "pygame_sdl2/display.pyx":570
88589004 *
88599005 * self.shifts = (
88609006 * format.Rshift, # <<<<<<<<<<<<<<
88619007 * format.Gshift,
88629008 * format.Bshift,
88639009 */
8864 __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 552, __pyx_L1_error)
9010 __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 570, __pyx_L1_error)
88659011 __Pyx_GOTREF(__pyx_t_2);
88669012 __Pyx_GIVEREF(__pyx_t_6);
88679013 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6);
88769022 __pyx_t_4 = 0;
88779023 __pyx_t_3 = 0;
88789024
8879 /* "pygame_sdl2/display.pyx":551
9025 /* "pygame_sdl2/display.pyx":569
88809026 * )
88819027 *
88829028 * self.shifts = ( # <<<<<<<<<<<<<<
88839029 * format.Rshift,
88849030 * format.Gshift,
88859031 */
8886 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_shifts, __pyx_t_2) < 0) __PYX_ERR(0, 551, __pyx_L1_error)
9032 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_shifts, __pyx_t_2) < 0) __PYX_ERR(0, 569, __pyx_L1_error)
88879033 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
88889034
8889 /* "pygame_sdl2/display.pyx":559
9035 /* "pygame_sdl2/display.pyx":577
88909036 *
88919037 * self.losses = (
88929038 * format.Rloss, # <<<<<<<<<<<<<<
88939039 * format.Gloss,
88949040 * format.Bloss,
88959041 */
8896 __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Rloss); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 559, __pyx_L1_error)
9042 __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Rloss); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 577, __pyx_L1_error)
88979043 __Pyx_GOTREF(__pyx_t_2);
88989044
8899 /* "pygame_sdl2/display.pyx":560
9045 /* "pygame_sdl2/display.pyx":578
89009046 * self.losses = (
89019047 * format.Rloss,
89029048 * format.Gloss, # <<<<<<<<<<<<<<
89039049 * format.Bloss,
89049050 * format.Aloss,
89059051 */
8906 __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Gloss); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 560, __pyx_L1_error)
9052 __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Gloss); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 578, __pyx_L1_error)
89079053 __Pyx_GOTREF(__pyx_t_3);
89089054
8909 /* "pygame_sdl2/display.pyx":561
9055 /* "pygame_sdl2/display.pyx":579
89109056 * format.Rloss,
89119057 * format.Gloss,
89129058 * format.Bloss, # <<<<<<<<<<<<<<
89139059 * format.Aloss,
89149060 * )
89159061 */
8916 __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Bloss); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 561, __pyx_L1_error)
9062 __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Bloss); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 579, __pyx_L1_error)
89179063 __Pyx_GOTREF(__pyx_t_4);
89189064
8919 /* "pygame_sdl2/display.pyx":562
9065 /* "pygame_sdl2/display.pyx":580
89209066 * format.Gloss,
89219067 * format.Bloss,
89229068 * format.Aloss, # <<<<<<<<<<<<<<
89239069 * )
89249070 *
89259071 */
8926 __pyx_t_5 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Aloss); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 562, __pyx_L1_error)
9072 __pyx_t_5 = __Pyx_PyInt_From_uint8_t(__pyx_v_format->Aloss); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 580, __pyx_L1_error)
89279073 __Pyx_GOTREF(__pyx_t_5);
89289074
8929 /* "pygame_sdl2/display.pyx":559
9075 /* "pygame_sdl2/display.pyx":577
89309076 *
89319077 * self.losses = (
89329078 * format.Rloss, # <<<<<<<<<<<<<<
89339079 * format.Gloss,
89349080 * format.Bloss,
89359081 */
8936 __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 559, __pyx_L1_error)
9082 __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 577, __pyx_L1_error)
89379083 __Pyx_GOTREF(__pyx_t_6);
89389084 __Pyx_GIVEREF(__pyx_t_2);
89399085 PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
89489094 __pyx_t_4 = 0;
89499095 __pyx_t_5 = 0;
89509096
8951 /* "pygame_sdl2/display.pyx":558
9097 /* "pygame_sdl2/display.pyx":576
89529098 * )
89539099 *
89549100 * self.losses = ( # <<<<<<<<<<<<<<
89559101 * format.Rloss,
89569102 * format.Gloss,
89579103 */
8958 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_losses, __pyx_t_6) < 0) __PYX_ERR(0, 558, __pyx_L1_error)
9104 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_losses, __pyx_t_6) < 0) __PYX_ERR(0, 576, __pyx_L1_error)
89599105 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
89609106
8961 /* "pygame_sdl2/display.pyx":565
9107 /* "pygame_sdl2/display.pyx":583
89629108 * )
89639109 *
89649110 * SDL_FreeFormat(format) # <<<<<<<<<<<<<<
89679113 */
89689114 SDL_FreeFormat(__pyx_v_format);
89699115
8970 /* "pygame_sdl2/display.pyx":567
9116 /* "pygame_sdl2/display.pyx":585
89719117 * SDL_FreeFormat(format)
89729118 *
89739119 * if main_window: # <<<<<<<<<<<<<<
89749120 * self.current_w, self.current_h = main_window.surface.get_size()
89759121 * else:
89769122 */
8977 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 567, __pyx_L1_error)
9123 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 585, __pyx_L1_error)
89789124 if (__pyx_t_1) {
89799125
8980 /* "pygame_sdl2/display.pyx":568
9126 /* "pygame_sdl2/display.pyx":586
89819127 *
89829128 * if main_window:
89839129 * self.current_w, self.current_h = main_window.surface.get_size() # <<<<<<<<<<<<<<
89849130 * else:
89859131 *
89869132 */
8987 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window->surface), __pyx_n_s_get_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 568, __pyx_L1_error)
9133 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window->surface), __pyx_n_s_get_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 586, __pyx_L1_error)
89889134 __Pyx_GOTREF(__pyx_t_5);
89899135 __pyx_t_4 = NULL;
89909136 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
89989144 }
89999145 __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
90009146 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
9001 if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 568, __pyx_L1_error)
9147 if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 586, __pyx_L1_error)
90029148 __Pyx_GOTREF(__pyx_t_6);
90039149 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
90049150 if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
90079153 if (unlikely(size != 2)) {
90089154 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
90099155 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
9010 __PYX_ERR(0, 568, __pyx_L1_error)
9156 __PYX_ERR(0, 586, __pyx_L1_error)
90119157 }
90129158 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
90139159 if (likely(PyTuple_CheckExact(sequence))) {
90209166 __Pyx_INCREF(__pyx_t_5);
90219167 __Pyx_INCREF(__pyx_t_4);
90229168 #else
9023 __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 568, __pyx_L1_error)
9169 __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 586, __pyx_L1_error)
90249170 __Pyx_GOTREF(__pyx_t_5);
9025 __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 568, __pyx_L1_error)
9171 __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 586, __pyx_L1_error)
90269172 __Pyx_GOTREF(__pyx_t_4);
90279173 #endif
90289174 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
90299175 } else {
90309176 Py_ssize_t index = -1;
9031 __pyx_t_3 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 568, __pyx_L1_error)
9177 __pyx_t_3 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 586, __pyx_L1_error)
90329178 __Pyx_GOTREF(__pyx_t_3);
90339179 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
90349180 __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext;
90369182 __Pyx_GOTREF(__pyx_t_5);
90379183 index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed;
90389184 __Pyx_GOTREF(__pyx_t_4);
9039 if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_3), 2) < 0) __PYX_ERR(0, 568, __pyx_L1_error)
9185 if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_3), 2) < 0) __PYX_ERR(0, 586, __pyx_L1_error)
90409186 __pyx_t_7 = NULL;
90419187 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
90429188 goto __pyx_L7_unpacking_done;
90449190 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
90459191 __pyx_t_7 = NULL;
90469192 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
9047 __PYX_ERR(0, 568, __pyx_L1_error)
9193 __PYX_ERR(0, 586, __pyx_L1_error)
90489194 __pyx_L7_unpacking_done:;
90499195 }
9050 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_current_w, __pyx_t_5) < 0) __PYX_ERR(0, 568, __pyx_L1_error)
9196 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_current_w, __pyx_t_5) < 0) __PYX_ERR(0, 586, __pyx_L1_error)
90519197 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9052 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_current_h, __pyx_t_4) < 0) __PYX_ERR(0, 568, __pyx_L1_error)
9198 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_current_h, __pyx_t_4) < 0) __PYX_ERR(0, 586, __pyx_L1_error)
90539199 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
90549200
9055 /* "pygame_sdl2/display.pyx":567
9201 /* "pygame_sdl2/display.pyx":585
90569202 * SDL_FreeFormat(format)
90579203 *
90589204 * if main_window: # <<<<<<<<<<<<<<
90629208 goto __pyx_L5;
90639209 }
90649210
9065 /* "pygame_sdl2/display.pyx":571
9211 /* "pygame_sdl2/display.pyx":589
90669212 * else:
90679213 *
90689214 * self.current_w = dm.w # <<<<<<<<<<<<<<
90709216 *
90719217 */
90729218 /*else*/ {
9073 __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_dm.w); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 571, __pyx_L1_error)
9219 __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_dm.w); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 589, __pyx_L1_error)
90749220 __Pyx_GOTREF(__pyx_t_6);
9075 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_current_w, __pyx_t_6) < 0) __PYX_ERR(0, 571, __pyx_L1_error)
9221 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_current_w, __pyx_t_6) < 0) __PYX_ERR(0, 589, __pyx_L1_error)
90769222 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
90779223
9078 /* "pygame_sdl2/display.pyx":572
9224 /* "pygame_sdl2/display.pyx":590
90799225 *
90809226 * self.current_w = dm.w
90819227 * self.current_h = dm.h # <<<<<<<<<<<<<<
90829228 *
90839229 * self.refresh_rate = dm.refresh_rate
90849230 */
9085 __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_dm.h); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 572, __pyx_L1_error)
9231 __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_dm.h); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 590, __pyx_L1_error)
90869232 __Pyx_GOTREF(__pyx_t_6);
9087 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_current_h, __pyx_t_6) < 0) __PYX_ERR(0, 572, __pyx_L1_error)
9233 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_current_h, __pyx_t_6) < 0) __PYX_ERR(0, 590, __pyx_L1_error)
90889234 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
90899235 }
90909236 __pyx_L5:;
90919237
9092 /* "pygame_sdl2/display.pyx":574
9238 /* "pygame_sdl2/display.pyx":592
90939239 * self.current_h = dm.h
90949240 *
90959241 * self.refresh_rate = dm.refresh_rate # <<<<<<<<<<<<<<
90969242 *
90979243 * # The rest of these are just guesses.
90989244 */
9099 __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_dm.refresh_rate); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 574, __pyx_L1_error)
9245 __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_dm.refresh_rate); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 592, __pyx_L1_error)
91009246 __Pyx_GOTREF(__pyx_t_6);
9101 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_refresh_rate, __pyx_t_6) < 0) __PYX_ERR(0, 574, __pyx_L1_error)
9247 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_refresh_rate, __pyx_t_6) < 0) __PYX_ERR(0, 592, __pyx_L1_error)
91029248 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
91039249
9104 /* "pygame_sdl2/display.pyx":577
9250 /* "pygame_sdl2/display.pyx":595
91059251 *
91069252 * # The rest of these are just guesses.
91079253 * self.hw = False # <<<<<<<<<<<<<<
91089254 * self.wm = True
91099255 * self.video_mem = 256 * 1024 * 1024
91109256 */
9111 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_hw, Py_False) < 0) __PYX_ERR(0, 577, __pyx_L1_error)
9112
9113 /* "pygame_sdl2/display.pyx":578
9257 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_hw, Py_False) < 0) __PYX_ERR(0, 595, __pyx_L1_error)
9258
9259 /* "pygame_sdl2/display.pyx":596
91149260 * # The rest of these are just guesses.
91159261 * self.hw = False
91169262 * self.wm = True # <<<<<<<<<<<<<<
91179263 * self.video_mem = 256 * 1024 * 1024
91189264 *
91199265 */
9120 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_wm, Py_True) < 0) __PYX_ERR(0, 578, __pyx_L1_error)
9121
9122 /* "pygame_sdl2/display.pyx":579
9266 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_wm, Py_True) < 0) __PYX_ERR(0, 596, __pyx_L1_error)
9267
9268 /* "pygame_sdl2/display.pyx":597
91239269 * self.hw = False
91249270 * self.wm = True
91259271 * self.video_mem = 256 * 1024 * 1024 # <<<<<<<<<<<<<<
91269272 *
91279273 * self.blit_hw = False
91289274 */
9129 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_video_mem, __pyx_int_268435456) < 0) __PYX_ERR(0, 579, __pyx_L1_error)
9130
9131 /* "pygame_sdl2/display.pyx":581
9275 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_video_mem, __pyx_int_268435456) < 0) __PYX_ERR(0, 597, __pyx_L1_error)
9276
9277 /* "pygame_sdl2/display.pyx":599
91329278 * self.video_mem = 256 * 1024 * 1024
91339279 *
91349280 * self.blit_hw = False # <<<<<<<<<<<<<<
91359281 * self.blit_hw_CC = False
91369282 * self.blit_hw_A = False
91379283 */
9138 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_hw, Py_False) < 0) __PYX_ERR(0, 581, __pyx_L1_error)
9139
9140 /* "pygame_sdl2/display.pyx":582
9284 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_hw, Py_False) < 0) __PYX_ERR(0, 599, __pyx_L1_error)
9285
9286 /* "pygame_sdl2/display.pyx":600
91419287 *
91429288 * self.blit_hw = False
91439289 * self.blit_hw_CC = False # <<<<<<<<<<<<<<
91449290 * self.blit_hw_A = False
91459291 *
91469292 */
9147 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_hw_CC, Py_False) < 0) __PYX_ERR(0, 582, __pyx_L1_error)
9148
9149 /* "pygame_sdl2/display.pyx":583
9293 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_hw_CC, Py_False) < 0) __PYX_ERR(0, 600, __pyx_L1_error)
9294
9295 /* "pygame_sdl2/display.pyx":601
91509296 * self.blit_hw = False
91519297 * self.blit_hw_CC = False
91529298 * self.blit_hw_A = False # <<<<<<<<<<<<<<
91539299 *
91549300 * self.blit_sw = False
91559301 */
9156 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_hw_A, Py_False) < 0) __PYX_ERR(0, 583, __pyx_L1_error)
9157
9158 /* "pygame_sdl2/display.pyx":585
9302 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_hw_A, Py_False) < 0) __PYX_ERR(0, 601, __pyx_L1_error)
9303
9304 /* "pygame_sdl2/display.pyx":603
91599305 * self.blit_hw_A = False
91609306 *
91619307 * self.blit_sw = False # <<<<<<<<<<<<<<
91629308 * self.blit_sw_CC = False
91639309 * self.blit_sw_A = False
91649310 */
9165 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_sw, Py_False) < 0) __PYX_ERR(0, 585, __pyx_L1_error)
9166
9167 /* "pygame_sdl2/display.pyx":586
9311 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_sw, Py_False) < 0) __PYX_ERR(0, 603, __pyx_L1_error)
9312
9313 /* "pygame_sdl2/display.pyx":604
91689314 *
91699315 * self.blit_sw = False
91709316 * self.blit_sw_CC = False # <<<<<<<<<<<<<<
91719317 * self.blit_sw_A = False
91729318 *
91739319 */
9174 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_sw_CC, Py_False) < 0) __PYX_ERR(0, 586, __pyx_L1_error)
9175
9176 /* "pygame_sdl2/display.pyx":587
9320 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_sw_CC, Py_False) < 0) __PYX_ERR(0, 604, __pyx_L1_error)
9321
9322 /* "pygame_sdl2/display.pyx":605
91779323 * self.blit_sw = False
91789324 * self.blit_sw_CC = False
91799325 * self.blit_sw_A = False # <<<<<<<<<<<<<<
91809326 *
91819327 * def __repr__(self):
91829328 */
9183 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_sw_A, Py_False) < 0) __PYX_ERR(0, 587, __pyx_L1_error)
9184
9185 /* "pygame_sdl2/display.pyx":530
9329 if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_blit_sw_A, Py_False) < 0) __PYX_ERR(0, 605, __pyx_L1_error)
9330
9331 /* "pygame_sdl2/display.pyx":548
91869332 * class Info(object):
91879333 *
91889334 * def __init__(self): # <<<<<<<<<<<<<<
92079353 return __pyx_r;
92089354 }
92099355
9210 /* "pygame_sdl2/display.pyx":589
9356 /* "pygame_sdl2/display.pyx":607
92119357 * self.blit_sw_A = False
92129358 *
92139359 * def __repr__(self): # <<<<<<<<<<<<<<
92419387 int __pyx_clineno = 0;
92429388 __Pyx_RefNannySetupContext("__repr__", 0);
92439389
9244 /* "pygame_sdl2/display.pyx":590
9390 /* "pygame_sdl2/display.pyx":608
92459391 *
92469392 * def __repr__(self):
92479393 * return "<Info({!r})>".format(self.__dict__) # <<<<<<<<<<<<<<
92499395 *
92509396 */
92519397 __Pyx_XDECREF(__pyx_r);
9252 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Info_r, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 590, __pyx_L1_error)
9398 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Info_r, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 608, __pyx_L1_error)
92539399 __Pyx_GOTREF(__pyx_t_2);
9254 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 590, __pyx_L1_error)
9400 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 608, __pyx_L1_error)
92559401 __Pyx_GOTREF(__pyx_t_3);
92569402 __pyx_t_4 = NULL;
92579403 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
92669412 __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
92679413 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
92689414 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9269 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 590, __pyx_L1_error)
9415 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 608, __pyx_L1_error)
92709416 __Pyx_GOTREF(__pyx_t_1);
92719417 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
92729418 __pyx_r = __pyx_t_1;
92739419 __pyx_t_1 = 0;
92749420 goto __pyx_L0;
92759421
9276 /* "pygame_sdl2/display.pyx":589
9422 /* "pygame_sdl2/display.pyx":607
92779423 * self.blit_sw_A = False
92789424 *
92799425 * def __repr__(self): # <<<<<<<<<<<<<<
92959441 return __pyx_r;
92969442 }
92979443
9298 /* "pygame_sdl2/display.pyx":593
9444 /* "pygame_sdl2/display.pyx":611
92999445 *
93009446 *
93019447 * def get_wm_info(): # <<<<<<<<<<<<<<
93299475 int __pyx_clineno = 0;
93309476 __Pyx_RefNannySetupContext("get_wm_info", 0);
93319477
9332 /* "pygame_sdl2/display.pyx":594
9478 /* "pygame_sdl2/display.pyx":612
93339479 *
93349480 * def get_wm_info():
93359481 * if main_window: # <<<<<<<<<<<<<<
93369482 * return main_window.get_wm_info()
93379483 *
93389484 */
9339 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 594, __pyx_L1_error)
9485 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 612, __pyx_L1_error)
93409486 if (__pyx_t_1) {
93419487
9342 /* "pygame_sdl2/display.pyx":595
9488 /* "pygame_sdl2/display.pyx":613
93439489 * def get_wm_info():
93449490 * if main_window:
93459491 * return main_window.get_wm_info() # <<<<<<<<<<<<<<
93479493 * return {}
93489494 */
93499495 __Pyx_XDECREF(__pyx_r);
9350 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_get_wm_info); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 595, __pyx_L1_error)
9496 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_get_wm_info); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 613, __pyx_L1_error)
93519497 __Pyx_GOTREF(__pyx_t_3);
93529498 __pyx_t_4 = NULL;
93539499 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
93619507 }
93629508 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
93639509 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
9364 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 595, __pyx_L1_error)
9510 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 613, __pyx_L1_error)
93659511 __Pyx_GOTREF(__pyx_t_2);
93669512 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
93679513 __pyx_r = __pyx_t_2;
93689514 __pyx_t_2 = 0;
93699515 goto __pyx_L0;
93709516
9371 /* "pygame_sdl2/display.pyx":594
9517 /* "pygame_sdl2/display.pyx":612
93729518 *
93739519 * def get_wm_info():
93749520 * if main_window: # <<<<<<<<<<<<<<
93779523 */
93789524 }
93799525
9380 /* "pygame_sdl2/display.pyx":597
9526 /* "pygame_sdl2/display.pyx":615
93819527 * return main_window.get_wm_info()
93829528 *
93839529 * return {} # <<<<<<<<<<<<<<
93859531 *
93869532 */
93879533 __Pyx_XDECREF(__pyx_r);
9388 __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 597, __pyx_L1_error)
9534 __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 615, __pyx_L1_error)
93899535 __Pyx_GOTREF(__pyx_t_2);
93909536 __pyx_r = __pyx_t_2;
93919537 __pyx_t_2 = 0;
93929538 goto __pyx_L0;
93939539
9394 /* "pygame_sdl2/display.pyx":593
9540 /* "pygame_sdl2/display.pyx":611
93959541 *
93969542 *
93979543 * def get_wm_info(): # <<<<<<<<<<<<<<
94129558 return __pyx_r;
94139559 }
94149560
9415 /* "pygame_sdl2/display.pyx":600
9561 /* "pygame_sdl2/display.pyx":618
94169562 *
94179563 *
94189564 * def get_num_video_displays(): # <<<<<<<<<<<<<<
94489594 int __pyx_clineno = 0;
94499595 __Pyx_RefNannySetupContext("get_num_video_displays", 0);
94509596
9451 /* "pygame_sdl2/display.pyx":605
9597 /* "pygame_sdl2/display.pyx":623
94529598 * """
94539599 *
94549600 * rv = SDL_GetNumVideoDisplays() # <<<<<<<<<<<<<<
94579603 */
94589604 __pyx_v_rv = SDL_GetNumVideoDisplays();
94599605
9460 /* "pygame_sdl2/display.pyx":607
9606 /* "pygame_sdl2/display.pyx":625
94619607 * rv = SDL_GetNumVideoDisplays()
94629608 *
94639609 * if rv < 0: # <<<<<<<<<<<<<<
94679613 __pyx_t_1 = ((__pyx_v_rv < 0) != 0);
94689614 if (unlikely(__pyx_t_1)) {
94699615
9470 /* "pygame_sdl2/display.pyx":608
9616 /* "pygame_sdl2/display.pyx":626
94719617 *
94729618 * if rv < 0:
94739619 * raise error() # <<<<<<<<<<<<<<
94749620 *
94759621 * return rv
94769622 */
9477 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 608, __pyx_L1_error)
9623 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 626, __pyx_L1_error)
94789624 __Pyx_GOTREF(__pyx_t_3);
94799625 __pyx_t_4 = NULL;
94809626 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
94889634 }
94899635 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
94909636 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
9491 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 608, __pyx_L1_error)
9637 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 626, __pyx_L1_error)
94929638 __Pyx_GOTREF(__pyx_t_2);
94939639 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
94949640 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
94959641 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9496 __PYX_ERR(0, 608, __pyx_L1_error)
9497
9498 /* "pygame_sdl2/display.pyx":607
9642 __PYX_ERR(0, 626, __pyx_L1_error)
9643
9644 /* "pygame_sdl2/display.pyx":625
94999645 * rv = SDL_GetNumVideoDisplays()
95009646 *
95019647 * if rv < 0: # <<<<<<<<<<<<<<
95049650 */
95059651 }
95069652
9507 /* "pygame_sdl2/display.pyx":610
9653 /* "pygame_sdl2/display.pyx":628
95089654 * raise error()
95099655 *
95109656 * return rv # <<<<<<<<<<<<<<
95129658 *
95139659 */
95149660 __Pyx_XDECREF(__pyx_r);
9515 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 610, __pyx_L1_error)
9661 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 628, __pyx_L1_error)
95169662 __Pyx_GOTREF(__pyx_t_2);
95179663 __pyx_r = __pyx_t_2;
95189664 __pyx_t_2 = 0;
95199665 goto __pyx_L0;
95209666
9521 /* "pygame_sdl2/display.pyx":600
9667 /* "pygame_sdl2/display.pyx":618
95229668 *
95239669 *
95249670 * def get_num_video_displays(): # <<<<<<<<<<<<<<
95399685 return __pyx_r;
95409686 }
95419687
9542 /* "pygame_sdl2/display.pyx":613
9688 /* "pygame_sdl2/display.pyx":631
95439689 *
95449690 *
95459691 * def list_modes(depth=0, flags=0, display=0): # <<<<<<<<<<<<<<
96019747 }
96029748 }
96039749 if (unlikely(kw_args > 0)) {
9604 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "list_modes") < 0)) __PYX_ERR(0, 613, __pyx_L3_error)
9750 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "list_modes") < 0)) __PYX_ERR(0, 631, __pyx_L3_error)
96059751 }
96069752 } else {
96079753 switch (PyTuple_GET_SIZE(__pyx_args)) {
96219767 }
96229768 goto __pyx_L4_argument_unpacking_done;
96239769 __pyx_L5_argtuple_error:;
9624 __Pyx_RaiseArgtupleInvalid("list_modes", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 613, __pyx_L3_error)
9770 __Pyx_RaiseArgtupleInvalid("list_modes", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 631, __pyx_L3_error)
96259771 __pyx_L3_error:;
96269772 __Pyx_AddTraceback("pygame_sdl2.display.list_modes", __pyx_clineno, __pyx_lineno, __pyx_filename);
96279773 __Pyx_RefNannyFinishContext();
96559801 int __pyx_clineno = 0;
96569802 __Pyx_RefNannySetupContext("list_modes", 0);
96579803
9658 /* "pygame_sdl2/display.pyx":623
9804 /* "pygame_sdl2/display.pyx":641
96599805 * cdef SDL_DisplayMode mode
96609806 *
96619807 * rv = [ ] # <<<<<<<<<<<<<<
96629808 *
96639809 * num_modes = SDL_GetNumDisplayModes(display)
96649810 */
9665 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L1_error)
9811 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 641, __pyx_L1_error)
96669812 __Pyx_GOTREF(__pyx_t_1);
96679813 __pyx_v_rv = ((PyObject*)__pyx_t_1);
96689814 __pyx_t_1 = 0;
96699815
9670 /* "pygame_sdl2/display.pyx":625
9816 /* "pygame_sdl2/display.pyx":643
96719817 * rv = [ ]
96729818 *
96739819 * num_modes = SDL_GetNumDisplayModes(display) # <<<<<<<<<<<<<<
96749820 * if num_modes < 0:
96759821 * raise error()
96769822 */
9677 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_display); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 625, __pyx_L1_error)
9823 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_display); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 643, __pyx_L1_error)
96789824 __pyx_v_num_modes = SDL_GetNumDisplayModes(__pyx_t_2);
96799825
9680 /* "pygame_sdl2/display.pyx":626
9826 /* "pygame_sdl2/display.pyx":644
96819827 *
96829828 * num_modes = SDL_GetNumDisplayModes(display)
96839829 * if num_modes < 0: # <<<<<<<<<<<<<<
96879833 __pyx_t_3 = ((__pyx_v_num_modes < 0) != 0);
96889834 if (unlikely(__pyx_t_3)) {
96899835
9690 /* "pygame_sdl2/display.pyx":627
9836 /* "pygame_sdl2/display.pyx":645
96919837 * num_modes = SDL_GetNumDisplayModes(display)
96929838 * if num_modes < 0:
96939839 * raise error() # <<<<<<<<<<<<<<
96949840 *
96959841 * for 0 <= i < num_modes:
96969842 */
9697 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 627, __pyx_L1_error)
9843 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 645, __pyx_L1_error)
96989844 __Pyx_GOTREF(__pyx_t_4);
96999845 __pyx_t_5 = NULL;
97009846 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
97089854 }
97099855 __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
97109856 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9711 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 627, __pyx_L1_error)
9857 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 645, __pyx_L1_error)
97129858 __Pyx_GOTREF(__pyx_t_1);
97139859 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
97149860 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
97159861 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9716 __PYX_ERR(0, 627, __pyx_L1_error)
9717
9718 /* "pygame_sdl2/display.pyx":626
9862 __PYX_ERR(0, 645, __pyx_L1_error)
9863
9864 /* "pygame_sdl2/display.pyx":644
97199865 *
97209866 * num_modes = SDL_GetNumDisplayModes(display)
97219867 * if num_modes < 0: # <<<<<<<<<<<<<<
97249870 */
97259871 }
97269872
9727 /* "pygame_sdl2/display.pyx":629
9873 /* "pygame_sdl2/display.pyx":647
97289874 * raise error()
97299875 *
97309876 * for 0 <= i < num_modes: # <<<<<<<<<<<<<<
97349880 __pyx_t_2 = __pyx_v_num_modes;
97359881 for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {
97369882
9737 /* "pygame_sdl2/display.pyx":630
9883 /* "pygame_sdl2/display.pyx":648
97389884 *
97399885 * for 0 <= i < num_modes:
97409886 * if SDL_GetDisplayMode(display, i, &mode) == 0: # <<<<<<<<<<<<<<
97419887 * t = (mode.w, mode.h)
97429888 * if t not in rv:
97439889 */
9744 __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_display); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 630, __pyx_L1_error)
9890 __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_display); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 648, __pyx_L1_error)
97459891 __pyx_t_3 = ((SDL_GetDisplayMode(__pyx_t_6, __pyx_v_i, (&__pyx_v_mode)) == 0) != 0);
97469892 if (__pyx_t_3) {
97479893
9748 /* "pygame_sdl2/display.pyx":631
9894 /* "pygame_sdl2/display.pyx":649
97499895 * for 0 <= i < num_modes:
97509896 * if SDL_GetDisplayMode(display, i, &mode) == 0:
97519897 * t = (mode.w, mode.h) # <<<<<<<<<<<<<<
97529898 * if t not in rv:
97539899 * rv.append(t)
97549900 */
9755 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_mode.w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 631, __pyx_L1_error)
9901 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_mode.w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 649, __pyx_L1_error)
97569902 __Pyx_GOTREF(__pyx_t_1);
9757 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_mode.h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 631, __pyx_L1_error)
9903 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_mode.h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 649, __pyx_L1_error)
97589904 __Pyx_GOTREF(__pyx_t_4);
9759 __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 631, __pyx_L1_error)
9905 __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 649, __pyx_L1_error)
97609906 __Pyx_GOTREF(__pyx_t_5);
97619907 __Pyx_GIVEREF(__pyx_t_1);
97629908 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
97679913 __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_5);
97689914 __pyx_t_5 = 0;
97699915
9770 /* "pygame_sdl2/display.pyx":632
9916 /* "pygame_sdl2/display.pyx":650
97719917 * if SDL_GetDisplayMode(display, i, &mode) == 0:
97729918 * t = (mode.w, mode.h)
97739919 * if t not in rv: # <<<<<<<<<<<<<<
97749920 * rv.append(t)
97759921 *
97769922 */
9777 __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_t, __pyx_v_rv, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 632, __pyx_L1_error)
9923 __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_t, __pyx_v_rv, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 650, __pyx_L1_error)
97789924 __pyx_t_7 = (__pyx_t_3 != 0);
97799925 if (__pyx_t_7) {
97809926
9781 /* "pygame_sdl2/display.pyx":633
9927 /* "pygame_sdl2/display.pyx":651
97829928 * t = (mode.w, mode.h)
97839929 * if t not in rv:
97849930 * rv.append(t) # <<<<<<<<<<<<<<
97859931 *
97869932 * return rv
97879933 */
9788 __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_rv, __pyx_v_t); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 633, __pyx_L1_error)
9789
9790 /* "pygame_sdl2/display.pyx":632
9934 __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_rv, __pyx_v_t); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 651, __pyx_L1_error)
9935
9936 /* "pygame_sdl2/display.pyx":650
97919937 * if SDL_GetDisplayMode(display, i, &mode) == 0:
97929938 * t = (mode.w, mode.h)
97939939 * if t not in rv: # <<<<<<<<<<<<<<
97969942 */
97979943 }
97989944
9799 /* "pygame_sdl2/display.pyx":630
9945 /* "pygame_sdl2/display.pyx":648
98009946 *
98019947 * for 0 <= i < num_modes:
98029948 * if SDL_GetDisplayMode(display, i, &mode) == 0: # <<<<<<<<<<<<<<
98069952 }
98079953 }
98089954
9809 /* "pygame_sdl2/display.pyx":635
9955 /* "pygame_sdl2/display.pyx":653
98109956 * rv.append(t)
98119957 *
98129958 * return rv # <<<<<<<<<<<<<<
98189964 __pyx_r = __pyx_v_rv;
98199965 goto __pyx_L0;
98209966
9821 /* "pygame_sdl2/display.pyx":613
9967 /* "pygame_sdl2/display.pyx":631
98229968 *
98239969 *
98249970 * def list_modes(depth=0, flags=0, display=0): # <<<<<<<<<<<<<<
98419987 return __pyx_r;
98429988 }
98439989
9844 /* "pygame_sdl2/display.pyx":638
9990 /* "pygame_sdl2/display.pyx":656
98459991 *
98469992 *
98479993 * def mode_ok(size, flags=0, depth=0): # <<<<<<<<<<<<<<
990010046 }
990110047 }
990210048 if (unlikely(kw_args > 0)) {
9903 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mode_ok") < 0)) __PYX_ERR(0, 638, __pyx_L3_error)
10049 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mode_ok") < 0)) __PYX_ERR(0, 656, __pyx_L3_error)
990410050 }
990510051 } else {
990610052 switch (PyTuple_GET_SIZE(__pyx_args)) {
991910065 }
992010066 goto __pyx_L4_argument_unpacking_done;
992110067 __pyx_L5_argtuple_error:;
9922 __Pyx_RaiseArgtupleInvalid("mode_ok", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 638, __pyx_L3_error)
10068 __Pyx_RaiseArgtupleInvalid("mode_ok", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 656, __pyx_L3_error)
992310069 __pyx_L3_error:;
992410070 __Pyx_AddTraceback("pygame_sdl2.display.mode_ok", __pyx_clineno, __pyx_lineno, __pyx_filename);
992510071 __Pyx_RefNannyFinishContext();
994510091 int __pyx_clineno = 0;
994610092 __Pyx_RefNannySetupContext("mode_ok", 0);
994710093
9948 /* "pygame_sdl2/display.pyx":643
10094 /* "pygame_sdl2/display.pyx":661
994910095 * """
995010096 *
995110097 * return tuple(size) in list_modes() # <<<<<<<<<<<<<<
995310099 * def gl_reset_attributes():
995410100 */
995510101 __Pyx_XDECREF(__pyx_r);
9956 __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 643, __pyx_L1_error)
10102 __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 661, __pyx_L1_error)
995710103 __Pyx_GOTREF(__pyx_t_1);
9958 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_list_modes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 643, __pyx_L1_error)
10104 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_list_modes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 661, __pyx_L1_error)
995910105 __Pyx_GOTREF(__pyx_t_3);
996010106 __pyx_t_4 = NULL;
996110107 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
996910115 }
997010116 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
997110117 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
9972 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 643, __pyx_L1_error)
10118 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 661, __pyx_L1_error)
997310119 __Pyx_GOTREF(__pyx_t_2);
997410120 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9975 __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 643, __pyx_L1_error)
10121 __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 661, __pyx_L1_error)
997610122 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
997710123 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9978 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 643, __pyx_L1_error)
10124 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 661, __pyx_L1_error)
997910125 __Pyx_GOTREF(__pyx_t_2);
998010126 __pyx_r = __pyx_t_2;
998110127 __pyx_t_2 = 0;
998210128 goto __pyx_L0;
998310129
9984 /* "pygame_sdl2/display.pyx":638
10130 /* "pygame_sdl2/display.pyx":656
998510131 *
998610132 *
998710133 * def mode_ok(size, flags=0, depth=0): # <<<<<<<<<<<<<<
1000310149 return __pyx_r;
1000410150 }
1000510151
10006 /* "pygame_sdl2/display.pyx":645
10152 /* "pygame_sdl2/display.pyx":663
1000710153 * return tuple(size) in list_modes()
1000810154 *
1000910155 * def gl_reset_attributes(): # <<<<<<<<<<<<<<
1003010176 __Pyx_RefNannyDeclarations
1003110177 __Pyx_RefNannySetupContext("gl_reset_attributes", 0);
1003210178
10033 /* "pygame_sdl2/display.pyx":646
10179 /* "pygame_sdl2/display.pyx":664
1003410180 *
1003510181 * def gl_reset_attributes():
1003610182 * SDL_GL_ResetAttributes() # <<<<<<<<<<<<<<
1003910185 */
1004010186 SDL_GL_ResetAttributes();
1004110187
10042 /* "pygame_sdl2/display.pyx":645
10188 /* "pygame_sdl2/display.pyx":663
1004310189 * return tuple(size) in list_modes()
1004410190 *
1004510191 * def gl_reset_attributes(): # <<<<<<<<<<<<<<
1005410200 return __pyx_r;
1005510201 }
1005610202
10057 /* "pygame_sdl2/display.pyx":648
10203 /* "pygame_sdl2/display.pyx":666
1005810204 * SDL_GL_ResetAttributes()
1005910205 *
1006010206 * def gl_set_attribute(flag, value): # <<<<<<<<<<<<<<
1009710243 case 1:
1009810244 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
1009910245 else {
10100 __Pyx_RaiseArgtupleInvalid("gl_set_attribute", 1, 2, 2, 1); __PYX_ERR(0, 648, __pyx_L3_error)
10246 __Pyx_RaiseArgtupleInvalid("gl_set_attribute", 1, 2, 2, 1); __PYX_ERR(0, 666, __pyx_L3_error)
1010110247 }
1010210248 }
1010310249 if (unlikely(kw_args > 0)) {
10104 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gl_set_attribute") < 0)) __PYX_ERR(0, 648, __pyx_L3_error)
10250 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gl_set_attribute") < 0)) __PYX_ERR(0, 666, __pyx_L3_error)
1010510251 }
1010610252 } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
1010710253 goto __pyx_L5_argtuple_error;
1011410260 }
1011510261 goto __pyx_L4_argument_unpacking_done;
1011610262 __pyx_L5_argtuple_error:;
10117 __Pyx_RaiseArgtupleInvalid("gl_set_attribute", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 648, __pyx_L3_error)
10263 __Pyx_RaiseArgtupleInvalid("gl_set_attribute", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 666, __pyx_L3_error)
1011810264 __pyx_L3_error:;
1011910265 __Pyx_AddTraceback("pygame_sdl2.display.gl_set_attribute", __pyx_clineno, __pyx_lineno, __pyx_filename);
1012010266 __Pyx_RefNannyFinishContext();
1014110287 int __pyx_clineno = 0;
1014210288 __Pyx_RefNannySetupContext("gl_set_attribute", 0);
1014310289
10144 /* "pygame_sdl2/display.pyx":650
10290 /* "pygame_sdl2/display.pyx":668
1014510291 * def gl_set_attribute(flag, value):
1014610292 *
1014710293 * if flag == GL_SWAP_CONTROL: # <<<<<<<<<<<<<<
1014810294 * if ios:
1014910295 * return
1015010296 */
10151 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_GL_SWAP_CONTROL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 650, __pyx_L1_error)
10297 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_GL_SWAP_CONTROL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error)
1015210298 __Pyx_GOTREF(__pyx_t_1);
10153 __pyx_t_2 = PyObject_RichCompare(__pyx_v_flag, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 650, __pyx_L1_error)
10299 __pyx_t_2 = PyObject_RichCompare(__pyx_v_flag, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 668, __pyx_L1_error)
1015410300 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10155 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 650, __pyx_L1_error)
10301 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 668, __pyx_L1_error)
1015610302 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1015710303 if (__pyx_t_3) {
1015810304
10159 /* "pygame_sdl2/display.pyx":651
10305 /* "pygame_sdl2/display.pyx":669
1016010306 *
1016110307 * if flag == GL_SWAP_CONTROL:
1016210308 * if ios: # <<<<<<<<<<<<<<
1016310309 * return
1016410310 *
1016510311 */
10166 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ios); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 651, __pyx_L1_error)
10312 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ios); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 669, __pyx_L1_error)
1016710313 __Pyx_GOTREF(__pyx_t_2);
10168 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 651, __pyx_L1_error)
10314 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 669, __pyx_L1_error)
1016910315 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1017010316 if (__pyx_t_3) {
1017110317
10172 /* "pygame_sdl2/display.pyx":652
10318 /* "pygame_sdl2/display.pyx":670
1017310319 * if flag == GL_SWAP_CONTROL:
1017410320 * if ios:
1017510321 * return # <<<<<<<<<<<<<<
1018010326 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
1018110327 goto __pyx_L0;
1018210328
10183 /* "pygame_sdl2/display.pyx":651
10329 /* "pygame_sdl2/display.pyx":669
1018410330 *
1018510331 * if flag == GL_SWAP_CONTROL:
1018610332 * if ios: # <<<<<<<<<<<<<<
1018910335 */
1019010336 }
1019110337
10192 /* "pygame_sdl2/display.pyx":659
10338 /* "pygame_sdl2/display.pyx":677
1019310339 * # to deal with the case where the negative interval isn't
1019410340 * # supported. Then give up and carry on.
1019510341 * if SDL_GL_SetSwapInterval(value): # <<<<<<<<<<<<<<
1019610342 * SDL_GL_SetSwapInterval(-value)
1019710343 *
1019810344 */
10199 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 659, __pyx_L1_error)
10345 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 677, __pyx_L1_error)
1020010346 __pyx_t_3 = (SDL_GL_SetSwapInterval(__pyx_t_4) != 0);
1020110347 if (__pyx_t_3) {
1020210348
10203 /* "pygame_sdl2/display.pyx":660
10349 /* "pygame_sdl2/display.pyx":678
1020410350 * # supported. Then give up and carry on.
1020510351 * if SDL_GL_SetSwapInterval(value):
1020610352 * SDL_GL_SetSwapInterval(-value) # <<<<<<<<<<<<<<
1020710353 *
1020810354 * default_swap_control = value
1020910355 */
10210 __pyx_t_2 = PyNumber_Negative(__pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 660, __pyx_L1_error)
10356 __pyx_t_2 = PyNumber_Negative(__pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 678, __pyx_L1_error)
1021110357 __Pyx_GOTREF(__pyx_t_2);
10212 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 660, __pyx_L1_error)
10358 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 678, __pyx_L1_error)
1021310359 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1021410360 (void)(SDL_GL_SetSwapInterval(__pyx_t_4));
1021510361
10216 /* "pygame_sdl2/display.pyx":659
10362 /* "pygame_sdl2/display.pyx":677
1021710363 * # to deal with the case where the negative interval isn't
1021810364 * # supported. Then give up and carry on.
1021910365 * if SDL_GL_SetSwapInterval(value): # <<<<<<<<<<<<<<
1022210368 */
1022310369 }
1022410370
10225 /* "pygame_sdl2/display.pyx":662
10371 /* "pygame_sdl2/display.pyx":680
1022610372 * SDL_GL_SetSwapInterval(-value)
1022710373 *
1022810374 * default_swap_control = value # <<<<<<<<<<<<<<
1022910375 * return
1023010376 *
1023110377 */
10232 if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_swap_control, __pyx_v_value) < 0) __PYX_ERR(0, 662, __pyx_L1_error)
10233
10234 /* "pygame_sdl2/display.pyx":663
10378 if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_swap_control, __pyx_v_value) < 0) __PYX_ERR(0, 680, __pyx_L1_error)
10379
10380 /* "pygame_sdl2/display.pyx":681
1023510381 *
1023610382 * default_swap_control = value
1023710383 * return # <<<<<<<<<<<<<<
1024210388 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
1024310389 goto __pyx_L0;
1024410390
10245 /* "pygame_sdl2/display.pyx":650
10391 /* "pygame_sdl2/display.pyx":668
1024610392 * def gl_set_attribute(flag, value):
1024710393 *
1024810394 * if flag == GL_SWAP_CONTROL: # <<<<<<<<<<<<<<
1025110397 */
1025210398 }
1025310399
10254 /* "pygame_sdl2/display.pyx":665
10400 /* "pygame_sdl2/display.pyx":683
1025510401 * return
1025610402 *
1025710403 * if SDL_GL_SetAttribute(flag, value): # <<<<<<<<<<<<<<
1025810404 * raise error()
1025910405 *
1026010406 */
10261 __pyx_t_5 = ((SDL_GLattr)__Pyx_PyInt_As_SDL_GLattr(__pyx_v_flag)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 665, __pyx_L1_error)
10262 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 665, __pyx_L1_error)
10407 __pyx_t_5 = ((SDL_GLattr)__Pyx_PyInt_As_SDL_GLattr(__pyx_v_flag)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 683, __pyx_L1_error)
10408 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 683, __pyx_L1_error)
1026310409 __pyx_t_3 = (SDL_GL_SetAttribute(__pyx_t_5, __pyx_t_4) != 0);
1026410410 if (unlikely(__pyx_t_3)) {
1026510411
10266 /* "pygame_sdl2/display.pyx":666
10412 /* "pygame_sdl2/display.pyx":684
1026710413 *
1026810414 * if SDL_GL_SetAttribute(flag, value):
1026910415 * raise error() # <<<<<<<<<<<<<<
1027010416 *
1027110417 * def gl_get_attribute(flag):
1027210418 */
10273 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 666, __pyx_L1_error)
10419 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 684, __pyx_L1_error)
1027410420 __Pyx_GOTREF(__pyx_t_1);
1027510421 __pyx_t_6 = NULL;
1027610422 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
1028410430 }
1028510431 __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
1028610432 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
10287 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 666, __pyx_L1_error)
10433 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 684, __pyx_L1_error)
1028810434 __Pyx_GOTREF(__pyx_t_2);
1028910435 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1029010436 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
1029110437 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10292 __PYX_ERR(0, 666, __pyx_L1_error)
10293
10294 /* "pygame_sdl2/display.pyx":665
10438 __PYX_ERR(0, 684, __pyx_L1_error)
10439
10440 /* "pygame_sdl2/display.pyx":683
1029510441 * return
1029610442 *
1029710443 * if SDL_GL_SetAttribute(flag, value): # <<<<<<<<<<<<<<
1030010446 */
1030110447 }
1030210448
10303 /* "pygame_sdl2/display.pyx":648
10449 /* "pygame_sdl2/display.pyx":666
1030410450 * SDL_GL_ResetAttributes()
1030510451 *
1030610452 * def gl_set_attribute(flag, value): # <<<<<<<<<<<<<<
1032310469 return __pyx_r;
1032410470 }
1032510471
10326 /* "pygame_sdl2/display.pyx":668
10472 /* "pygame_sdl2/display.pyx":686
1032710473 * raise error()
1032810474 *
1032910475 * def gl_get_attribute(flag): # <<<<<<<<<<<<<<
1035910505 int __pyx_clineno = 0;
1036010506 __Pyx_RefNannySetupContext("gl_get_attribute", 0);
1036110507
10362 /* "pygame_sdl2/display.pyx":671
10508 /* "pygame_sdl2/display.pyx":689
1036310509 * cdef int rv
1036410510 *
1036510511 * if flag == GL_SWAP_CONTROL: # <<<<<<<<<<<<<<
1036610512 * return SDL_GL_GetSwapInterval()
1036710513 *
1036810514 */
10369 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_GL_SWAP_CONTROL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 671, __pyx_L1_error)
10515 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_GL_SWAP_CONTROL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 689, __pyx_L1_error)
1037010516 __Pyx_GOTREF(__pyx_t_1);
10371 __pyx_t_2 = PyObject_RichCompare(__pyx_v_flag, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 671, __pyx_L1_error)
10517 __pyx_t_2 = PyObject_RichCompare(__pyx_v_flag, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 689, __pyx_L1_error)
1037210518 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10373 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 671, __pyx_L1_error)
10519 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 689, __pyx_L1_error)
1037410520 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1037510521 if (__pyx_t_3) {
1037610522
10377 /* "pygame_sdl2/display.pyx":672
10523 /* "pygame_sdl2/display.pyx":690
1037810524 *
1037910525 * if flag == GL_SWAP_CONTROL:
1038010526 * return SDL_GL_GetSwapInterval() # <<<<<<<<<<<<<<
1038210528 * if SDL_GL_GetAttribute(flag, &rv):
1038310529 */
1038410530 __Pyx_XDECREF(__pyx_r);
10385 __pyx_t_2 = __Pyx_PyInt_From_int(SDL_GL_GetSwapInterval()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 672, __pyx_L1_error)
10531 __pyx_t_2 = __Pyx_PyInt_From_int(SDL_GL_GetSwapInterval()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 690, __pyx_L1_error)
1038610532 __Pyx_GOTREF(__pyx_t_2);
1038710533 __pyx_r = __pyx_t_2;
1038810534 __pyx_t_2 = 0;
1038910535 goto __pyx_L0;
1039010536
10391 /* "pygame_sdl2/display.pyx":671
10537 /* "pygame_sdl2/display.pyx":689
1039210538 * cdef int rv
1039310539 *
1039410540 * if flag == GL_SWAP_CONTROL: # <<<<<<<<<<<<<<
1039710543 */
1039810544 }
1039910545
10400 /* "pygame_sdl2/display.pyx":674
10546 /* "pygame_sdl2/display.pyx":692
1040110547 * return SDL_GL_GetSwapInterval()
1040210548 *
1040310549 * if SDL_GL_GetAttribute(flag, &rv): # <<<<<<<<<<<<<<
1040410550 * raise error()
1040510551 *
1040610552 */
10407 __pyx_t_4 = ((SDL_GLattr)__Pyx_PyInt_As_SDL_GLattr(__pyx_v_flag)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 674, __pyx_L1_error)
10553 __pyx_t_4 = ((SDL_GLattr)__Pyx_PyInt_As_SDL_GLattr(__pyx_v_flag)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 692, __pyx_L1_error)
1040810554 __pyx_t_3 = (SDL_GL_GetAttribute(__pyx_t_4, (&__pyx_v_rv)) != 0);
1040910555 if (unlikely(__pyx_t_3)) {
1041010556
10411 /* "pygame_sdl2/display.pyx":675
10557 /* "pygame_sdl2/display.pyx":693
1041210558 *
1041310559 * if SDL_GL_GetAttribute(flag, &rv):
1041410560 * raise error() # <<<<<<<<<<<<<<
1041510561 *
1041610562 * return rv
1041710563 */
10418 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 675, __pyx_L1_error)
10564 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 693, __pyx_L1_error)
1041910565 __Pyx_GOTREF(__pyx_t_1);
1042010566 __pyx_t_5 = NULL;
1042110567 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
1042910575 }
1043010576 __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
1043110577 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10432 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 675, __pyx_L1_error)
10578 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 693, __pyx_L1_error)
1043310579 __Pyx_GOTREF(__pyx_t_2);
1043410580 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1043510581 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
1043610582 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10437 __PYX_ERR(0, 675, __pyx_L1_error)
10438
10439 /* "pygame_sdl2/display.pyx":674
10583 __PYX_ERR(0, 693, __pyx_L1_error)
10584
10585 /* "pygame_sdl2/display.pyx":692
1044010586 * return SDL_GL_GetSwapInterval()
1044110587 *
1044210588 * if SDL_GL_GetAttribute(flag, &rv): # <<<<<<<<<<<<<<
1044510591 */
1044610592 }
1044710593
10448 /* "pygame_sdl2/display.pyx":677
10594 /* "pygame_sdl2/display.pyx":695
1044910595 * raise error()
1045010596 *
1045110597 * return rv # <<<<<<<<<<<<<<
1045310599 * def gl_load_library(path):
1045410600 */
1045510601 __Pyx_XDECREF(__pyx_r);
10456 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 677, __pyx_L1_error)
10602 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 695, __pyx_L1_error)
1045710603 __Pyx_GOTREF(__pyx_t_2);
1045810604 __pyx_r = __pyx_t_2;
1045910605 __pyx_t_2 = 0;
1046010606 goto __pyx_L0;
1046110607
10462 /* "pygame_sdl2/display.pyx":668
10608 /* "pygame_sdl2/display.pyx":686
1046310609 * raise error()
1046410610 *
1046510611 * def gl_get_attribute(flag): # <<<<<<<<<<<<<<
1048010626 return __pyx_r;
1048110627 }
1048210628
10483 /* "pygame_sdl2/display.pyx":679
10629 /* "pygame_sdl2/display.pyx":697
1048410630 * return rv
1048510631 *
1048610632 * def gl_load_library(path): # <<<<<<<<<<<<<<
1051610662 int __pyx_clineno = 0;
1051710663 __Pyx_RefNannySetupContext("gl_load_library", 0);
1051810664
10519 /* "pygame_sdl2/display.pyx":680
10665 /* "pygame_sdl2/display.pyx":698
1052010666 *
1052110667 * def gl_load_library(path):
1052210668 * if path is None: # <<<<<<<<<<<<<<
1052710673 __pyx_t_2 = (__pyx_t_1 != 0);
1052810674 if (__pyx_t_2) {
1052910675
10530 /* "pygame_sdl2/display.pyx":681
10676 /* "pygame_sdl2/display.pyx":699
1053110677 * def gl_load_library(path):
1053210678 * if path is None:
1053310679 * if SDL_GL_LoadLibrary(NULL): # <<<<<<<<<<<<<<
1053710683 __pyx_t_2 = (SDL_GL_LoadLibrary(NULL) != 0);
1053810684 if (unlikely(__pyx_t_2)) {
1053910685
10540 /* "pygame_sdl2/display.pyx":682
10686 /* "pygame_sdl2/display.pyx":700
1054110687 * if path is None:
1054210688 * if SDL_GL_LoadLibrary(NULL):
1054310689 * raise error() # <<<<<<<<<<<<<<
1054410690 * else:
1054510691 * if SDL_GL_LoadLibrary(path):
1054610692 */
10547 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 682, __pyx_L1_error)
10693 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 700, __pyx_L1_error)
1054810694 __Pyx_GOTREF(__pyx_t_4);
1054910695 __pyx_t_5 = NULL;
1055010696 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
1055810704 }
1055910705 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
1056010706 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10561 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 682, __pyx_L1_error)
10707 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 700, __pyx_L1_error)
1056210708 __Pyx_GOTREF(__pyx_t_3);
1056310709 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1056410710 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
1056510711 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10566 __PYX_ERR(0, 682, __pyx_L1_error)
10567
10568 /* "pygame_sdl2/display.pyx":681
10712 __PYX_ERR(0, 700, __pyx_L1_error)
10713
10714 /* "pygame_sdl2/display.pyx":699
1056910715 * def gl_load_library(path):
1057010716 * if path is None:
1057110717 * if SDL_GL_LoadLibrary(NULL): # <<<<<<<<<<<<<<
1057410720 */
1057510721 }
1057610722
10577 /* "pygame_sdl2/display.pyx":680
10723 /* "pygame_sdl2/display.pyx":698
1057810724 *
1057910725 * def gl_load_library(path):
1058010726 * if path is None: # <<<<<<<<<<<<<<
1058410730 goto __pyx_L3;
1058510731 }
1058610732
10587 /* "pygame_sdl2/display.pyx":684
10733 /* "pygame_sdl2/display.pyx":702
1058810734 * raise error()
1058910735 * else:
1059010736 * if SDL_GL_LoadLibrary(path): # <<<<<<<<<<<<<<
1059210738 *
1059310739 */
1059410740 /*else*/ {
10595 __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_path); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 684, __pyx_L1_error)
10741 __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_path); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 702, __pyx_L1_error)
1059610742 __pyx_t_2 = (SDL_GL_LoadLibrary(__pyx_t_6) != 0);
1059710743 if (unlikely(__pyx_t_2)) {
1059810744
10599 /* "pygame_sdl2/display.pyx":685
10745 /* "pygame_sdl2/display.pyx":703
1060010746 * else:
1060110747 * if SDL_GL_LoadLibrary(path):
1060210748 * raise error() # <<<<<<<<<<<<<<
1060310749 *
1060410750 * def gl_unload_library():
1060510751 */
10606 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 685, __pyx_L1_error)
10752 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 703, __pyx_L1_error)
1060710753 __Pyx_GOTREF(__pyx_t_4);
1060810754 __pyx_t_5 = NULL;
1060910755 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
1061710763 }
1061810764 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
1061910765 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10620 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 685, __pyx_L1_error)
10766 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 703, __pyx_L1_error)
1062110767 __Pyx_GOTREF(__pyx_t_3);
1062210768 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1062310769 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
1062410770 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10625 __PYX_ERR(0, 685, __pyx_L1_error)
10626
10627 /* "pygame_sdl2/display.pyx":684
10771 __PYX_ERR(0, 703, __pyx_L1_error)
10772
10773 /* "pygame_sdl2/display.pyx":702
1062810774 * raise error()
1062910775 * else:
1063010776 * if SDL_GL_LoadLibrary(path): # <<<<<<<<<<<<<<
1063510781 }
1063610782 __pyx_L3:;
1063710783
10638 /* "pygame_sdl2/display.pyx":679
10784 /* "pygame_sdl2/display.pyx":697
1063910785 * return rv
1064010786 *
1064110787 * def gl_load_library(path): # <<<<<<<<<<<<<<
1065810804 return __pyx_r;
1065910805 }
1066010806
10661 /* "pygame_sdl2/display.pyx":687
10807 /* "pygame_sdl2/display.pyx":705
1066210808 * raise error()
1066310809 *
1066410810 * def gl_unload_library(): # <<<<<<<<<<<<<<
1068510831 __Pyx_RefNannyDeclarations
1068610832 __Pyx_RefNannySetupContext("gl_unload_library", 0);
1068710833
10688 /* "pygame_sdl2/display.pyx":688
10834 /* "pygame_sdl2/display.pyx":706
1068910835 *
1069010836 * def gl_unload_library():
1069110837 * SDL_GL_UnloadLibrary() # <<<<<<<<<<<<<<
1069410840 */
1069510841 SDL_GL_UnloadLibrary();
1069610842
10697 /* "pygame_sdl2/display.pyx":687
10843 /* "pygame_sdl2/display.pyx":705
1069810844 * raise error()
1069910845 *
1070010846 * def gl_unload_library(): # <<<<<<<<<<<<<<
1070910855 return __pyx_r;
1071010856 }
1071110857
10712 /* "pygame_sdl2/display.pyx":690
10858 /* "pygame_sdl2/display.pyx":708
1071310859 * SDL_GL_UnloadLibrary()
1071410860 *
1071510861 * def get_active(): # <<<<<<<<<<<<<<
1074310889 int __pyx_clineno = 0;
1074410890 __Pyx_RefNannySetupContext("get_active", 0);
1074510891
10746 /* "pygame_sdl2/display.pyx":691
10892 /* "pygame_sdl2/display.pyx":709
1074710893 *
1074810894 * def get_active():
1074910895 * if main_window: # <<<<<<<<<<<<<<
1075010896 * return main_window.get_active()
1075110897 * return False
1075210898 */
10753 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 691, __pyx_L1_error)
10899 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 709, __pyx_L1_error)
1075410900 if (__pyx_t_1) {
1075510901
10756 /* "pygame_sdl2/display.pyx":692
10902 /* "pygame_sdl2/display.pyx":710
1075710903 * def get_active():
1075810904 * if main_window:
1075910905 * return main_window.get_active() # <<<<<<<<<<<<<<
1076110907 *
1076210908 */
1076310909 __Pyx_XDECREF(__pyx_r);
10764 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_get_active); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 692, __pyx_L1_error)
10910 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_get_active); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 710, __pyx_L1_error)
1076510911 __Pyx_GOTREF(__pyx_t_3);
1076610912 __pyx_t_4 = NULL;
1076710913 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
1077510921 }
1077610922 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
1077710923 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
10778 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __pyx_L1_error)
10924 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 710, __pyx_L1_error)
1077910925 __Pyx_GOTREF(__pyx_t_2);
1078010926 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1078110927 __pyx_r = __pyx_t_2;
1078210928 __pyx_t_2 = 0;
1078310929 goto __pyx_L0;
1078410930
10785 /* "pygame_sdl2/display.pyx":691
10931 /* "pygame_sdl2/display.pyx":709
1078610932 *
1078710933 * def get_active():
1078810934 * if main_window: # <<<<<<<<<<<<<<
1079110937 */
1079210938 }
1079310939
10794 /* "pygame_sdl2/display.pyx":693
10940 /* "pygame_sdl2/display.pyx":711
1079510941 * if main_window:
1079610942 * return main_window.get_active()
1079710943 * return False # <<<<<<<<<<<<<<
1080310949 __pyx_r = Py_False;
1080410950 goto __pyx_L0;
1080510951
10806 /* "pygame_sdl2/display.pyx":690
10952 /* "pygame_sdl2/display.pyx":708
1080710953 * SDL_GL_UnloadLibrary()
1080810954 *
1080910955 * def get_active(): # <<<<<<<<<<<<<<
1082410970 return __pyx_r;
1082510971 }
1082610972
10827 /* "pygame_sdl2/display.pyx":695
10973 /* "pygame_sdl2/display.pyx":713
1082810974 * return False
1082910975 *
1083010976 * def iconify(): # <<<<<<<<<<<<<<
1085811004 int __pyx_clineno = 0;
1085911005 __Pyx_RefNannySetupContext("iconify", 0);
1086011006
10861 /* "pygame_sdl2/display.pyx":696
11007 /* "pygame_sdl2/display.pyx":714
1086211008 *
1086311009 * def iconify():
1086411010 * if main_window: # <<<<<<<<<<<<<<
1086511011 * return main_window.iconify()
1086611012 *
1086711013 */
10868 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 696, __pyx_L1_error)
11014 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 714, __pyx_L1_error)
1086911015 if (__pyx_t_1) {
1087011016
10871 /* "pygame_sdl2/display.pyx":697
11017 /* "pygame_sdl2/display.pyx":715
1087211018 * def iconify():
1087311019 * if main_window:
1087411020 * return main_window.iconify() # <<<<<<<<<<<<<<
1087611022 * return False
1087711023 */
1087811024 __Pyx_XDECREF(__pyx_r);
10879 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_iconify); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 697, __pyx_L1_error)
11025 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_iconify); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 715, __pyx_L1_error)
1088011026 __Pyx_GOTREF(__pyx_t_3);
1088111027 __pyx_t_4 = NULL;
1088211028 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
1089011036 }
1089111037 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
1089211038 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
10893 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 697, __pyx_L1_error)
11039 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 715, __pyx_L1_error)
1089411040 __Pyx_GOTREF(__pyx_t_2);
1089511041 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1089611042 __pyx_r = __pyx_t_2;
1089711043 __pyx_t_2 = 0;
1089811044 goto __pyx_L0;
1089911045
10900 /* "pygame_sdl2/display.pyx":696
11046 /* "pygame_sdl2/display.pyx":714
1090111047 *
1090211048 * def iconify():
1090311049 * if main_window: # <<<<<<<<<<<<<<
1090611052 */
1090711053 }
1090811054
10909 /* "pygame_sdl2/display.pyx":699
11055 /* "pygame_sdl2/display.pyx":717
1091011056 * return main_window.iconify()
1091111057 *
1091211058 * return False # <<<<<<<<<<<<<<
1091811064 __pyx_r = Py_False;
1091911065 goto __pyx_L0;
1092011066
10921 /* "pygame_sdl2/display.pyx":695
11067 /* "pygame_sdl2/display.pyx":713
1092211068 * return False
1092311069 *
1092411070 * def iconify(): # <<<<<<<<<<<<<<
1093911085 return __pyx_r;
1094011086 }
1094111087
10942 /* "pygame_sdl2/display.pyx":701
11088 /* "pygame_sdl2/display.pyx":719
1094311089 * return False
1094411090 *
1094511091 * def toggle_fullscreen(): # <<<<<<<<<<<<<<
1097311119 int __pyx_clineno = 0;
1097411120 __Pyx_RefNannySetupContext("toggle_fullscreen", 0);
1097511121
10976 /* "pygame_sdl2/display.pyx":702
11122 /* "pygame_sdl2/display.pyx":720
1097711123 *
1097811124 * def toggle_fullscreen():
1097911125 * if main_window: # <<<<<<<<<<<<<<
1098011126 * return main_window.toggle_fullscreen()
1098111127 *
1098211128 */
10983 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 702, __pyx_L1_error)
11129 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 720, __pyx_L1_error)
1098411130 if (__pyx_t_1) {
1098511131
10986 /* "pygame_sdl2/display.pyx":703
11132 /* "pygame_sdl2/display.pyx":721
1098711133 * def toggle_fullscreen():
1098811134 * if main_window:
1098911135 * return main_window.toggle_fullscreen() # <<<<<<<<<<<<<<
1099111137 * return True
1099211138 */
1099311139 __Pyx_XDECREF(__pyx_r);
10994 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_toggle_fullscreen); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 703, __pyx_L1_error)
11140 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_toggle_fullscreen); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 721, __pyx_L1_error)
1099511141 __Pyx_GOTREF(__pyx_t_3);
1099611142 __pyx_t_4 = NULL;
1099711143 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
1100511151 }
1100611152 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
1100711153 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11008 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 703, __pyx_L1_error)
11154 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 721, __pyx_L1_error)
1100911155 __Pyx_GOTREF(__pyx_t_2);
1101011156 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1101111157 __pyx_r = __pyx_t_2;
1101211158 __pyx_t_2 = 0;
1101311159 goto __pyx_L0;
1101411160
11015 /* "pygame_sdl2/display.pyx":702
11161 /* "pygame_sdl2/display.pyx":720
1101611162 *
1101711163 * def toggle_fullscreen():
1101811164 * if main_window: # <<<<<<<<<<<<<<
1102111167 */
1102211168 }
1102311169
11024 /* "pygame_sdl2/display.pyx":705
11170 /* "pygame_sdl2/display.pyx":723
1102511171 * return main_window.toggle_fullscreen()
1102611172 *
1102711173 * return True # <<<<<<<<<<<<<<
1103311179 __pyx_r = Py_True;
1103411180 goto __pyx_L0;
1103511181
11036 /* "pygame_sdl2/display.pyx":701
11182 /* "pygame_sdl2/display.pyx":719
1103711183 * return False
1103811184 *
1103911185 * def toggle_fullscreen(): # <<<<<<<<<<<<<<
1105411200 return __pyx_r;
1105511201 }
1105611202
11057 /* "pygame_sdl2/display.pyx":707
11203 /* "pygame_sdl2/display.pyx":725
1105811204 * return True
1105911205 *
1106011206 * def set_gamma(red, green=None, blue=None): # <<<<<<<<<<<<<<
1111211258 }
1111311259 }
1111411260 if (unlikely(kw_args > 0)) {
11115 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_gamma") < 0)) __PYX_ERR(0, 707, __pyx_L3_error)
11261 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_gamma") < 0)) __PYX_ERR(0, 725, __pyx_L3_error)
1111611262 }
1111711263 } else {
1111811264 switch (PyTuple_GET_SIZE(__pyx_args)) {
1113111277 }
1113211278 goto __pyx_L4_argument_unpacking_done;
1113311279 __pyx_L5_argtuple_error:;
11134 __Pyx_RaiseArgtupleInvalid("set_gamma", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 707, __pyx_L3_error)
11280 __Pyx_RaiseArgtupleInvalid("set_gamma", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 725, __pyx_L3_error)
1113511281 __pyx_L3_error:;
1113611282 __Pyx_AddTraceback("pygame_sdl2.display.set_gamma", __pyx_clineno, __pyx_lineno, __pyx_filename);
1113711283 __Pyx_RefNannyFinishContext();
1115811304 int __pyx_clineno = 0;
1115911305 __Pyx_RefNannySetupContext("set_gamma", 0);
1116011306
11161 /* "pygame_sdl2/display.pyx":708
11307 /* "pygame_sdl2/display.pyx":726
1116211308 *
1116311309 * def set_gamma(red, green=None, blue=None):
1116411310 * if main_window: # <<<<<<<<<<<<<<
1116511311 * return main_window.set_gamma(red, green, blue)
1116611312 * return False
1116711313 */
11168 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 708, __pyx_L1_error)
11314 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 726, __pyx_L1_error)
1116911315 if (__pyx_t_1) {
1117011316
11171 /* "pygame_sdl2/display.pyx":709
11317 /* "pygame_sdl2/display.pyx":727
1117211318 * def set_gamma(red, green=None, blue=None):
1117311319 * if main_window:
1117411320 * return main_window.set_gamma(red, green, blue) # <<<<<<<<<<<<<<
1117611322 *
1117711323 */
1117811324 __Pyx_XDECREF(__pyx_r);
11179 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_set_gamma); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 709, __pyx_L1_error)
11325 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_set_gamma); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 727, __pyx_L1_error)
1118011326 __Pyx_GOTREF(__pyx_t_3);
1118111327 __pyx_t_4 = NULL;
1118211328 __pyx_t_5 = 0;
1119311339 #if CYTHON_FAST_PYCALL
1119411340 if (PyFunction_Check(__pyx_t_3)) {
1119511341 PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_red, __pyx_v_green, __pyx_v_blue};
11196 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 709, __pyx_L1_error)
11342 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 727, __pyx_L1_error)
1119711343 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
1119811344 __Pyx_GOTREF(__pyx_t_2);
1119911345 } else
1120111347 #if CYTHON_FAST_PYCCALL
1120211348 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
1120311349 PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_red, __pyx_v_green, __pyx_v_blue};
11204 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 709, __pyx_L1_error)
11350 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 727, __pyx_L1_error)
1120511351 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
1120611352 __Pyx_GOTREF(__pyx_t_2);
1120711353 } else
1120811354 #endif
1120911355 {
11210 __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 709, __pyx_L1_error)
11356 __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 727, __pyx_L1_error)
1121111357 __Pyx_GOTREF(__pyx_t_6);
1121211358 if (__pyx_t_4) {
1121311359 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
1122111367 __Pyx_INCREF(__pyx_v_blue);
1122211368 __Pyx_GIVEREF(__pyx_v_blue);
1122311369 PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_blue);
11224 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 709, __pyx_L1_error)
11370 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 727, __pyx_L1_error)
1122511371 __Pyx_GOTREF(__pyx_t_2);
1122611372 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
1122711373 }
1123011376 __pyx_t_2 = 0;
1123111377 goto __pyx_L0;
1123211378
11233 /* "pygame_sdl2/display.pyx":708
11379 /* "pygame_sdl2/display.pyx":726
1123411380 *
1123511381 * def set_gamma(red, green=None, blue=None):
1123611382 * if main_window: # <<<<<<<<<<<<<<
1123911385 */
1124011386 }
1124111387
11242 /* "pygame_sdl2/display.pyx":710
11388 /* "pygame_sdl2/display.pyx":728
1124311389 * if main_window:
1124411390 * return main_window.set_gamma(red, green, blue)
1124511391 * return False # <<<<<<<<<<<<<<
1125111397 __pyx_r = Py_False;
1125211398 goto __pyx_L0;
1125311399
11254 /* "pygame_sdl2/display.pyx":707
11400 /* "pygame_sdl2/display.pyx":725
1125511401 * return True
1125611402 *
1125711403 * def set_gamma(red, green=None, blue=None): # <<<<<<<<<<<<<<
1127311419 return __pyx_r;
1127411420 }
1127511421
11276 /* "pygame_sdl2/display.pyx":712
11422 /* "pygame_sdl2/display.pyx":730
1127711423 * return False
1127811424 *
1127911425 * def set_gamma_ramp(red, green, blue): # <<<<<<<<<<<<<<
1131911465 case 1:
1132011466 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_green)) != 0)) kw_args--;
1132111467 else {
11322 __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, 1); __PYX_ERR(0, 712, __pyx_L3_error)
11468 __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, 1); __PYX_ERR(0, 730, __pyx_L3_error)
1132311469 }
1132411470 CYTHON_FALLTHROUGH;
1132511471 case 2:
1132611472 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_blue)) != 0)) kw_args--;
1132711473 else {
11328 __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, 2); __PYX_ERR(0, 712, __pyx_L3_error)
11474 __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, 2); __PYX_ERR(0, 730, __pyx_L3_error)
1132911475 }
1133011476 }
1133111477 if (unlikely(kw_args > 0)) {
11332 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_gamma_ramp") < 0)) __PYX_ERR(0, 712, __pyx_L3_error)
11478 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_gamma_ramp") < 0)) __PYX_ERR(0, 730, __pyx_L3_error)
1133311479 }
1133411480 } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
1133511481 goto __pyx_L5_argtuple_error;
1134411490 }
1134511491 goto __pyx_L4_argument_unpacking_done;
1134611492 __pyx_L5_argtuple_error:;
11347 __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 712, __pyx_L3_error)
11493 __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 730, __pyx_L3_error)
1134811494 __pyx_L3_error:;
1134911495 __Pyx_AddTraceback("pygame_sdl2.display.set_gamma_ramp", __pyx_clineno, __pyx_lineno, __pyx_filename);
1135011496 __Pyx_RefNannyFinishContext();
1137111517 int __pyx_clineno = 0;
1137211518 __Pyx_RefNannySetupContext("set_gamma_ramp", 0);
1137311519
11374 /* "pygame_sdl2/display.pyx":713
11520 /* "pygame_sdl2/display.pyx":731
1137511521 *
1137611522 * def set_gamma_ramp(red, green, blue):
1137711523 * if main_window: # <<<<<<<<<<<<<<
1137811524 * return main_window.set_gamma_ramp(red, green, blue)
1137911525 * return False
1138011526 */
11381 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 713, __pyx_L1_error)
11527 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 731, __pyx_L1_error)
1138211528 if (__pyx_t_1) {
1138311529
11384 /* "pygame_sdl2/display.pyx":714
11530 /* "pygame_sdl2/display.pyx":732
1138511531 * def set_gamma_ramp(red, green, blue):
1138611532 * if main_window:
1138711533 * return main_window.set_gamma_ramp(red, green, blue) # <<<<<<<<<<<<<<
1138911535 *
1139011536 */
1139111537 __Pyx_XDECREF(__pyx_r);
11392 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_set_gamma_ramp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 714, __pyx_L1_error)
11538 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_set_gamma_ramp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 732, __pyx_L1_error)
1139311539 __Pyx_GOTREF(__pyx_t_3);
1139411540 __pyx_t_4 = NULL;
1139511541 __pyx_t_5 = 0;
1140611552 #if CYTHON_FAST_PYCALL
1140711553 if (PyFunction_Check(__pyx_t_3)) {
1140811554 PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_red, __pyx_v_green, __pyx_v_blue};
11409 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 714, __pyx_L1_error)
11555 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 732, __pyx_L1_error)
1141011556 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
1141111557 __Pyx_GOTREF(__pyx_t_2);
1141211558 } else
1141411560 #if CYTHON_FAST_PYCCALL
1141511561 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
1141611562 PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_red, __pyx_v_green, __pyx_v_blue};
11417 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 714, __pyx_L1_error)
11563 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 732, __pyx_L1_error)
1141811564 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
1141911565 __Pyx_GOTREF(__pyx_t_2);
1142011566 } else
1142111567 #endif
1142211568 {
11423 __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 714, __pyx_L1_error)
11569 __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 732, __pyx_L1_error)
1142411570 __Pyx_GOTREF(__pyx_t_6);
1142511571 if (__pyx_t_4) {
1142611572 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
1143411580 __Pyx_INCREF(__pyx_v_blue);
1143511581 __Pyx_GIVEREF(__pyx_v_blue);
1143611582 PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_blue);
11437 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 714, __pyx_L1_error)
11583 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 732, __pyx_L1_error)
1143811584 __Pyx_GOTREF(__pyx_t_2);
1143911585 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
1144011586 }
1144311589 __pyx_t_2 = 0;
1144411590 goto __pyx_L0;
1144511591
11446 /* "pygame_sdl2/display.pyx":713
11592 /* "pygame_sdl2/display.pyx":731
1144711593 *
1144811594 * def set_gamma_ramp(red, green, blue):
1144911595 * if main_window: # <<<<<<<<<<<<<<
1145211598 */
1145311599 }
1145411600
11455 /* "pygame_sdl2/display.pyx":715
11601 /* "pygame_sdl2/display.pyx":733
1145611602 * if main_window:
1145711603 * return main_window.set_gamma_ramp(red, green, blue)
1145811604 * return False # <<<<<<<<<<<<<<
1146411610 __pyx_r = Py_False;
1146511611 goto __pyx_L0;
1146611612
11467 /* "pygame_sdl2/display.pyx":712
11613 /* "pygame_sdl2/display.pyx":730
1146811614 * return False
1146911615 *
1147011616 * def set_gamma_ramp(red, green, blue): # <<<<<<<<<<<<<<
1148611632 return __pyx_r;
1148711633 }
1148811634
11489 /* "pygame_sdl2/display.pyx":717
11635 /* "pygame_sdl2/display.pyx":735
1149011636 * return False
1149111637 *
1149211638 * def set_icon(surface): # <<<<<<<<<<<<<<
1152211668 int __pyx_clineno = 0;
1152311669 __Pyx_RefNannySetupContext("set_icon", 0);
1152411670
11525 /* "pygame_sdl2/display.pyx":720
11671 /* "pygame_sdl2/display.pyx":738
1152611672 * global default_icon
1152711673 *
1152811674 * default_icon = surface.copy() # <<<<<<<<<<<<<<
1152911675 *
1153011676 * if main_window is not None:
1153111677 */
11532 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_surface, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 720, __pyx_L1_error)
11678 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_surface, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 738, __pyx_L1_error)
1153311679 __Pyx_GOTREF(__pyx_t_2);
1153411680 __pyx_t_3 = NULL;
1153511681 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
1154311689 }
1154411690 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
1154511691 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11546 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 720, __pyx_L1_error)
11692 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 738, __pyx_L1_error)
1154711693 __Pyx_GOTREF(__pyx_t_1);
1154811694 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11549 if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_icon, __pyx_t_1) < 0) __PYX_ERR(0, 720, __pyx_L1_error)
11695 if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_icon, __pyx_t_1) < 0) __PYX_ERR(0, 738, __pyx_L1_error)
1155011696 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1155111697
11552 /* "pygame_sdl2/display.pyx":722
11698 /* "pygame_sdl2/display.pyx":740
1155311699 * default_icon = surface.copy()
1155411700 *
1155511701 * if main_window is not None: # <<<<<<<<<<<<<<
1156011706 __pyx_t_5 = (__pyx_t_4 != 0);
1156111707 if (__pyx_t_5) {
1156211708
11563 /* "pygame_sdl2/display.pyx":723
11709 /* "pygame_sdl2/display.pyx":741
1156411710 *
1156511711 * if main_window is not None:
1156611712 * main_window.set_icon(default_icon) # <<<<<<<<<<<<<<
1156711713 *
1156811714 * def set_caption(title, icontitle = None):
1156911715 */
11570 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_set_icon); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 723, __pyx_L1_error)
11716 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_set_icon); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 741, __pyx_L1_error)
1157111717 __Pyx_GOTREF(__pyx_t_2);
11572 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_default_icon); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 723, __pyx_L1_error)
11718 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_default_icon); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 741, __pyx_L1_error)
1157311719 __Pyx_GOTREF(__pyx_t_3);
1157411720 __pyx_t_6 = NULL;
1157511721 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
1158411730 __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
1158511731 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
1158611732 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11587 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 723, __pyx_L1_error)
11733 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 741, __pyx_L1_error)
1158811734 __Pyx_GOTREF(__pyx_t_1);
1158911735 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1159011736 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1159111737
11592 /* "pygame_sdl2/display.pyx":722
11738 /* "pygame_sdl2/display.pyx":740
1159311739 * default_icon = surface.copy()
1159411740 *
1159511741 * if main_window is not None: # <<<<<<<<<<<<<<
1159811744 */
1159911745 }
1160011746
11601 /* "pygame_sdl2/display.pyx":717
11747 /* "pygame_sdl2/display.pyx":735
1160211748 * return False
1160311749 *
1160411750 * def set_icon(surface): # <<<<<<<<<<<<<<
1162211768 return __pyx_r;
1162311769 }
1162411770
11625 /* "pygame_sdl2/display.pyx":725
11771 /* "pygame_sdl2/display.pyx":743
1162611772 * main_window.set_icon(default_icon)
1162711773 *
1162811774 * def set_caption(title, icontitle = None): # <<<<<<<<<<<<<<
1167011816 }
1167111817 }
1167211818 if (unlikely(kw_args > 0)) {
11673 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_caption") < 0)) __PYX_ERR(0, 725, __pyx_L3_error)
11819 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_caption") < 0)) __PYX_ERR(0, 743, __pyx_L3_error)
1167411820 }
1167511821 } else {
1167611822 switch (PyTuple_GET_SIZE(__pyx_args)) {
1168611832 }
1168711833 goto __pyx_L4_argument_unpacking_done;
1168811834 __pyx_L5_argtuple_error:;
11689 __Pyx_RaiseArgtupleInvalid("set_caption", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 725, __pyx_L3_error)
11835 __Pyx_RaiseArgtupleInvalid("set_caption", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 743, __pyx_L3_error)
1169011836 __pyx_L3_error:;
1169111837 __Pyx_AddTraceback("pygame_sdl2.display.set_caption", __pyx_clineno, __pyx_lineno, __pyx_filename);
1169211838 __Pyx_RefNannyFinishContext();
1171211858 int __pyx_clineno = 0;
1171311859 __Pyx_RefNannySetupContext("set_caption", 0);
1171411860
11715 /* "pygame_sdl2/display.pyx":728
11861 /* "pygame_sdl2/display.pyx":746
1171611862 * global default_title
1171711863 *
1171811864 * default_title = title # <<<<<<<<<<<<<<
1171911865 *
1172011866 * if main_window:
1172111867 */
11722 if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_title, __pyx_v_title) < 0) __PYX_ERR(0, 728, __pyx_L1_error)
11723
11724 /* "pygame_sdl2/display.pyx":730
11868 if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_title, __pyx_v_title) < 0) __PYX_ERR(0, 746, __pyx_L1_error)
11869
11870 /* "pygame_sdl2/display.pyx":748
1172511871 * default_title = title
1172611872 *
1172711873 * if main_window: # <<<<<<<<<<<<<<
1172811874 * main_window.set_caption(default_title)
1172911875 *
1173011876 */
11731 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 730, __pyx_L1_error)
11877 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 748, __pyx_L1_error)
1173211878 if (__pyx_t_1) {
1173311879
11734 /* "pygame_sdl2/display.pyx":731
11880 /* "pygame_sdl2/display.pyx":749
1173511881 *
1173611882 * if main_window:
1173711883 * main_window.set_caption(default_title) # <<<<<<<<<<<<<<
1173811884 *
1173911885 * def get_caption():
1174011886 */
11741 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_set_caption); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 731, __pyx_L1_error)
11887 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_set_caption); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 749, __pyx_L1_error)
1174211888 __Pyx_GOTREF(__pyx_t_3);
11743 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_default_title); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 731, __pyx_L1_error)
11889 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_default_title); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 749, __pyx_L1_error)
1174411890 __Pyx_GOTREF(__pyx_t_4);
1174511891 __pyx_t_5 = NULL;
1174611892 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
1175511901 __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
1175611902 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
1175711903 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11758 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 731, __pyx_L1_error)
11904 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 749, __pyx_L1_error)
1175911905 __Pyx_GOTREF(__pyx_t_2);
1176011906 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1176111907 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1176211908
11763 /* "pygame_sdl2/display.pyx":730
11909 /* "pygame_sdl2/display.pyx":748
1176411910 * default_title = title
1176511911 *
1176611912 * if main_window: # <<<<<<<<<<<<<<
1176911915 */
1177011916 }
1177111917
11772 /* "pygame_sdl2/display.pyx":725
11918 /* "pygame_sdl2/display.pyx":743
1177311919 * main_window.set_icon(default_icon)
1177411920 *
1177511921 * def set_caption(title, icontitle = None): # <<<<<<<<<<<<<<
1179311939 return __pyx_r;
1179411940 }
1179511941
11796 /* "pygame_sdl2/display.pyx":733
11942 /* "pygame_sdl2/display.pyx":751
1179711943 * main_window.set_caption(default_title)
1179811944 *
1179911945 * def get_caption(): # <<<<<<<<<<<<<<
1182411970 int __pyx_clineno = 0;
1182511971 __Pyx_RefNannySetupContext("get_caption", 0);
1182611972
11827 /* "pygame_sdl2/display.pyx":734
11973 /* "pygame_sdl2/display.pyx":752
1182811974 *
1182911975 * def get_caption():
1183011976 * return default_title # <<<<<<<<<<<<<<
1183211978 * def get_drawable_size():
1183311979 */
1183411980 __Pyx_XDECREF(__pyx_r);
11835 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_default_title); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 734, __pyx_L1_error)
11981 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_default_title); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 752, __pyx_L1_error)
1183611982 __Pyx_GOTREF(__pyx_t_1);
1183711983 __pyx_r = __pyx_t_1;
1183811984 __pyx_t_1 = 0;
1183911985 goto __pyx_L0;
1184011986
11841 /* "pygame_sdl2/display.pyx":733
11987 /* "pygame_sdl2/display.pyx":751
1184211988 * main_window.set_caption(default_title)
1184311989 *
1184411990 * def get_caption(): # <<<<<<<<<<<<<<
1185712003 return __pyx_r;
1185812004 }
1185912005
11860 /* "pygame_sdl2/display.pyx":736
12006 /* "pygame_sdl2/display.pyx":754
1186112007 * return default_title
1186212008 *
1186312009 * def get_drawable_size(): # <<<<<<<<<<<<<<
1189112037 int __pyx_clineno = 0;
1189212038 __Pyx_RefNannySetupContext("get_drawable_size", 0);
1189312039
11894 /* "pygame_sdl2/display.pyx":737
12040 /* "pygame_sdl2/display.pyx":755
1189512041 *
1189612042 * def get_drawable_size():
1189712043 * if main_window: # <<<<<<<<<<<<<<
1189812044 * return main_window.get_drawable_size()
1189912045 * return None
1190012046 */
11901 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 737, __pyx_L1_error)
12047 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 755, __pyx_L1_error)
1190212048 if (__pyx_t_1) {
1190312049
11904 /* "pygame_sdl2/display.pyx":738
12050 /* "pygame_sdl2/display.pyx":756
1190512051 * def get_drawable_size():
1190612052 * if main_window:
1190712053 * return main_window.get_drawable_size() # <<<<<<<<<<<<<<
1190912055 *
1191012056 */
1191112057 __Pyx_XDECREF(__pyx_r);
11912 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_get_drawable_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 738, __pyx_L1_error)
12058 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_get_drawable_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 756, __pyx_L1_error)
1191312059 __Pyx_GOTREF(__pyx_t_3);
1191412060 __pyx_t_4 = NULL;
1191512061 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
1192312069 }
1192412070 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
1192512071 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11926 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 738, __pyx_L1_error)
12072 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 756, __pyx_L1_error)
1192712073 __Pyx_GOTREF(__pyx_t_2);
1192812074 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1192912075 __pyx_r = __pyx_t_2;
1193012076 __pyx_t_2 = 0;
1193112077 goto __pyx_L0;
1193212078
11933 /* "pygame_sdl2/display.pyx":737
12079 /* "pygame_sdl2/display.pyx":755
1193412080 *
1193512081 * def get_drawable_size():
1193612082 * if main_window: # <<<<<<<<<<<<<<
1193912085 */
1194012086 }
1194112087
11942 /* "pygame_sdl2/display.pyx":739
12088 /* "pygame_sdl2/display.pyx":757
1194312089 * if main_window:
1194412090 * return main_window.get_drawable_size()
1194512091 * return None # <<<<<<<<<<<<<<
1195012096 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
1195112097 goto __pyx_L0;
1195212098
11953 /* "pygame_sdl2/display.pyx":736
12099 /* "pygame_sdl2/display.pyx":754
1195412100 * return default_title
1195512101 *
1195612102 * def get_drawable_size(): # <<<<<<<<<<<<<<
1197112117 return __pyx_r;
1197212118 }
1197312119
11974 /* "pygame_sdl2/display.pyx":741
12120 /* "pygame_sdl2/display.pyx":759
1197512121 * return None
1197612122 *
1197712123 * def get_size(): # <<<<<<<<<<<<<<
1200512151 int __pyx_clineno = 0;
1200612152 __Pyx_RefNannySetupContext("get_size", 0);
1200712153
12008 /* "pygame_sdl2/display.pyx":742
12154 /* "pygame_sdl2/display.pyx":760
1200912155 *
1201012156 * def get_size():
1201112157 * if main_window: # <<<<<<<<<<<<<<
1201212158 * return main_window.get_size()
1201312159 * return None
1201412160 */
12015 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 742, __pyx_L1_error)
12161 __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 760, __pyx_L1_error)
1201612162 if (__pyx_t_1) {
1201712163
12018 /* "pygame_sdl2/display.pyx":743
12164 /* "pygame_sdl2/display.pyx":761
1201912165 * def get_size():
1202012166 * if main_window:
1202112167 * return main_window.get_size() # <<<<<<<<<<<<<<
1202312169 *
1202412170 */
1202512171 __Pyx_XDECREF(__pyx_r);
12026 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_get_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 743, __pyx_L1_error)
12172 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window), __pyx_n_s_get_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 761, __pyx_L1_error)
1202712173 __Pyx_GOTREF(__pyx_t_3);
1202812174 __pyx_t_4 = NULL;
1202912175 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
1203712183 }
1203812184 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
1203912185 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
12040 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 743, __pyx_L1_error)
12186 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 761, __pyx_L1_error)
1204112187 __Pyx_GOTREF(__pyx_t_2);
1204212188 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1204312189 __pyx_r = __pyx_t_2;
1204412190 __pyx_t_2 = 0;
1204512191 goto __pyx_L0;
1204612192
12047 /* "pygame_sdl2/display.pyx":742
12193 /* "pygame_sdl2/display.pyx":760
1204812194 *
1204912195 * def get_size():
1205012196 * if main_window: # <<<<<<<<<<<<<<
1205312199 */
1205412200 }
1205512201
12056 /* "pygame_sdl2/display.pyx":744
12202 /* "pygame_sdl2/display.pyx":762
1205712203 * if main_window:
1205812204 * return main_window.get_size()
1205912205 * return None # <<<<<<<<<<<<<<
1206412210 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
1206512211 goto __pyx_L0;
1206612212
12067 /* "pygame_sdl2/display.pyx":741
12213 /* "pygame_sdl2/display.pyx":759
1206812214 * return None
1206912215 *
1207012216 * def get_size(): # <<<<<<<<<<<<<<
1208512231 return __pyx_r;
1208612232 }
1208712233
12088 /* "pygame_sdl2/display.pyx":746
12234 /* "pygame_sdl2/display.pyx":764
1208912235 * return None
1209012236 *
1209112237 * def get_num_video_displays(): # <<<<<<<<<<<<<<
1212012266 int __pyx_clineno = 0;
1212112267 __Pyx_RefNannySetupContext("get_num_video_displays", 0);
1212212268
12123 /* "pygame_sdl2/display.pyx":747
12269 /* "pygame_sdl2/display.pyx":765
1212412270 *
1212512271 * def get_num_video_displays():
1212612272 * rv = SDL_GetNumVideoDisplays() # <<<<<<<<<<<<<<
1212912275 */
1213012276 __pyx_v_rv = SDL_GetNumVideoDisplays();
1213112277
12132 /* "pygame_sdl2/display.pyx":748
12278 /* "pygame_sdl2/display.pyx":766
1213312279 * def get_num_video_displays():
1213412280 * rv = SDL_GetNumVideoDisplays()
1213512281 * if rv < 0: # <<<<<<<<<<<<<<
1213912285 __pyx_t_1 = ((__pyx_v_rv < 0) != 0);
1214012286 if (unlikely(__pyx_t_1)) {
1214112287
12142 /* "pygame_sdl2/display.pyx":749
12288 /* "pygame_sdl2/display.pyx":767
1214312289 * rv = SDL_GetNumVideoDisplays()
1214412290 * if rv < 0:
1214512291 * raise error() # <<<<<<<<<<<<<<
1214612292 *
1214712293 * return rv
1214812294 */
12149 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 749, __pyx_L1_error)
12295 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 767, __pyx_L1_error)
1215012296 __Pyx_GOTREF(__pyx_t_3);
1215112297 __pyx_t_4 = NULL;
1215212298 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
1216012306 }
1216112307 __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
1216212308 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
12163 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 749, __pyx_L1_error)
12309 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 767, __pyx_L1_error)
1216412310 __Pyx_GOTREF(__pyx_t_2);
1216512311 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1216612312 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
1216712313 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12168 __PYX_ERR(0, 749, __pyx_L1_error)
12169
12170 /* "pygame_sdl2/display.pyx":748
12314 __PYX_ERR(0, 767, __pyx_L1_error)
12315
12316 /* "pygame_sdl2/display.pyx":766
1217112317 * def get_num_video_displays():
1217212318 * rv = SDL_GetNumVideoDisplays()
1217312319 * if rv < 0: # <<<<<<<<<<<<<<
1217612322 */
1217712323 }
1217812324
12179 /* "pygame_sdl2/display.pyx":751
12325 /* "pygame_sdl2/display.pyx":769
1218012326 * raise error()
1218112327 *
1218212328 * return rv # <<<<<<<<<<<<<<
1218412330 * def get_display_bounds(index):
1218512331 */
1218612332 __Pyx_XDECREF(__pyx_r);
12187 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 751, __pyx_L1_error)
12333 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 769, __pyx_L1_error)
1218812334 __Pyx_GOTREF(__pyx_t_2);
1218912335 __pyx_r = __pyx_t_2;
1219012336 __pyx_t_2 = 0;
1219112337 goto __pyx_L0;
1219212338
12193 /* "pygame_sdl2/display.pyx":746
12339 /* "pygame_sdl2/display.pyx":764
1219412340 * return None
1219512341 *
1219612342 * def get_num_video_displays(): # <<<<<<<<<<<<<<
1221112357 return __pyx_r;
1221212358 }
1221312359
12214 /* "pygame_sdl2/display.pyx":753
12360 /* "pygame_sdl2/display.pyx":771
1221512361 * return rv
1221612362 *
1221712363 * def get_display_bounds(index): # <<<<<<<<<<<<<<
1224912395 int __pyx_clineno = 0;
1225012396 __Pyx_RefNannySetupContext("get_display_bounds", 0);
1225112397
12252 /* "pygame_sdl2/display.pyx":755
12398 /* "pygame_sdl2/display.pyx":773
1225312399 * def get_display_bounds(index):
1225412400 * cdef SDL_Rect rect
1225512401 * rv = SDL_GetDisplayBounds(index, &rect) # <<<<<<<<<<<<<<
1225612402 *
1225712403 * return (rect.x, rect.y, rect.w, rect.h)
1225812404 */
12259 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_index); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 755, __pyx_L1_error)
12405 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_index); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 773, __pyx_L1_error)
1226012406 __pyx_v_rv = SDL_GetDisplayBounds(__pyx_t_1, (&__pyx_v_rect));
1226112407
12262 /* "pygame_sdl2/display.pyx":757
12408 /* "pygame_sdl2/display.pyx":775
1226312409 * rv = SDL_GetDisplayBounds(index, &rect)
1226412410 *
1226512411 * return (rect.x, rect.y, rect.w, rect.h) # <<<<<<<<<<<<<<
1226712413 * def set_screensaver(state):
1226812414 */
1226912415 __Pyx_XDECREF(__pyx_r);
12270 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rect.x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 757, __pyx_L1_error)
12416 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_rect.x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 775, __pyx_L1_error)
1227112417 __Pyx_GOTREF(__pyx_t_2);
12272 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rect.y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 757, __pyx_L1_error)
12418 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_rect.y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 775, __pyx_L1_error)
1227312419 __Pyx_GOTREF(__pyx_t_3);
12274 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_rect.w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 757, __pyx_L1_error)
12420 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_rect.w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 775, __pyx_L1_error)
1227512421 __Pyx_GOTREF(__pyx_t_4);
12276 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_rect.h); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 757, __pyx_L1_error)
12422 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_rect.h); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 775, __pyx_L1_error)
1227712423 __Pyx_GOTREF(__pyx_t_5);
12278 __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 757, __pyx_L1_error)
12424 __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 775, __pyx_L1_error)
1227912425 __Pyx_GOTREF(__pyx_t_6);
1228012426 __Pyx_GIVEREF(__pyx_t_2);
1228112427 PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
1229312439 __pyx_t_6 = 0;
1229412440 goto __pyx_L0;
1229512441
12296 /* "pygame_sdl2/display.pyx":753
12442 /* "pygame_sdl2/display.pyx":771
1229712443 * return rv
1229812444 *
1229912445 * def get_display_bounds(index): # <<<<<<<<<<<<<<
1231612462 return __pyx_r;
1231712463 }
1231812464
12319 /* "pygame_sdl2/display.pyx":759
12465 /* "pygame_sdl2/display.pyx":777
1232012466 * return (rect.x, rect.y, rect.w, rect.h)
1232112467 *
1232212468 * def set_screensaver(state): # <<<<<<<<<<<<<<
1234812494 int __pyx_clineno = 0;
1234912495 __Pyx_RefNannySetupContext("set_screensaver", 0);
1235012496
12351 /* "pygame_sdl2/display.pyx":764
12497 /* "pygame_sdl2/display.pyx":782
1235212498 * """
1235312499 *
1235412500 * if state: # <<<<<<<<<<<<<<
1235512501 * SDL_EnableScreenSaver()
1235612502 * else:
1235712503 */
12358 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_state); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 764, __pyx_L1_error)
12504 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_state); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 782, __pyx_L1_error)
1235912505 if (__pyx_t_1) {
1236012506
12361 /* "pygame_sdl2/display.pyx":765
12507 /* "pygame_sdl2/display.pyx":783
1236212508 *
1236312509 * if state:
1236412510 * SDL_EnableScreenSaver() # <<<<<<<<<<<<<<
1236712513 */
1236812514 SDL_EnableScreenSaver();
1236912515
12370 /* "pygame_sdl2/display.pyx":764
12516 /* "pygame_sdl2/display.pyx":782
1237112517 * """
1237212518 *
1237312519 * if state: # <<<<<<<<<<<<<<
1237712523 goto __pyx_L3;
1237812524 }
1237912525
12380 /* "pygame_sdl2/display.pyx":767
12526 /* "pygame_sdl2/display.pyx":785
1238112527 * SDL_EnableScreenSaver()
1238212528 * else:
1238312529 * SDL_DisableScreenSaver() # <<<<<<<<<<<<<<
1238912535 }
1239012536 __pyx_L3:;
1239112537
12392 /* "pygame_sdl2/display.pyx":759
12538 /* "pygame_sdl2/display.pyx":777
1239312539 * return (rect.x, rect.y, rect.w, rect.h)
1239412540 *
1239512541 * def set_screensaver(state): # <<<<<<<<<<<<<<
1240912555 return __pyx_r;
1241012556 }
1241112557
12412 /* "pygame_sdl2/display.pyx":769
12558 /* "pygame_sdl2/display.pyx":787
1241312559 * SDL_DisableScreenSaver()
1241412560 *
1241512561 * def get_platform(): # <<<<<<<<<<<<<<
1244012586 int __pyx_clineno = 0;
1244112587 __Pyx_RefNannySetupContext("get_platform", 0);
1244212588
12443 /* "pygame_sdl2/display.pyx":770
12589 /* "pygame_sdl2/display.pyx":788
1244412590 *
1244512591 * def get_platform():
1244612592 * return SDL_GetPlatform() # <<<<<<<<<<<<<<
1244812594 * cdef api SDL_Window *PyWindow_AsWindow(window):
1244912595 */
1245012596 __Pyx_XDECREF(__pyx_r);
12451 __pyx_t_1 = __Pyx_PyBytes_FromString(SDL_GetPlatform()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 770, __pyx_L1_error)
12597 __pyx_t_1 = __Pyx_PyBytes_FromString(SDL_GetPlatform()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 788, __pyx_L1_error)
1245212598 __Pyx_GOTREF(__pyx_t_1);
1245312599 __pyx_r = __pyx_t_1;
1245412600 __pyx_t_1 = 0;
1245512601 goto __pyx_L0;
1245612602
12457 /* "pygame_sdl2/display.pyx":769
12603 /* "pygame_sdl2/display.pyx":787
1245812604 * SDL_DisableScreenSaver()
1245912605 *
1246012606 * def get_platform(): # <<<<<<<<<<<<<<
1247312619 return __pyx_r;
1247412620 }
1247512621
12476 /* "pygame_sdl2/display.pyx":772
12622 /* "pygame_sdl2/display.pyx":790
1247712623 * return SDL_GetPlatform()
1247812624 *
1247912625 * cdef api SDL_Window *PyWindow_AsWindow(window): # <<<<<<<<<<<<<<
1248912635 __Pyx_RefNannySetupContext("PyWindow_AsWindow", 0);
1249012636 __Pyx_INCREF(__pyx_v_window);
1249112637
12492 /* "pygame_sdl2/display.pyx":779
12638 /* "pygame_sdl2/display.pyx":797
1249312639 * """
1249412640 *
1249512641 * if window is None: # <<<<<<<<<<<<<<
1250012646 __pyx_t_2 = (__pyx_t_1 != 0);
1250112647 if (__pyx_t_2) {
1250212648
12503 /* "pygame_sdl2/display.pyx":780
12649 /* "pygame_sdl2/display.pyx":798
1250412650 *
1250512651 * if window is None:
1250612652 * window = main_window # <<<<<<<<<<<<<<
1251012656 __Pyx_INCREF(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window));
1251112657 __Pyx_DECREF_SET(__pyx_v_window, ((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window));
1251212658
12513 /* "pygame_sdl2/display.pyx":779
12659 /* "pygame_sdl2/display.pyx":797
1251412660 * """
1251512661 *
1251612662 * if window is None: # <<<<<<<<<<<<<<
1251912665 */
1252012666 }
1252112667
12522 /* "pygame_sdl2/display.pyx":782
12668 /* "pygame_sdl2/display.pyx":800
1252312669 * window = main_window
1252412670 *
1252512671 * if window is None: # <<<<<<<<<<<<<<
1253012676 __pyx_t_1 = (__pyx_t_2 != 0);
1253112677 if (__pyx_t_1) {
1253212678
12533 /* "pygame_sdl2/display.pyx":783
12679 /* "pygame_sdl2/display.pyx":801
1253412680 *
1253512681 * if window is None:
1253612682 * return NULL # <<<<<<<<<<<<<<
1254012686 __pyx_r = NULL;
1254112687 goto __pyx_L0;
1254212688
12543 /* "pygame_sdl2/display.pyx":782
12689 /* "pygame_sdl2/display.pyx":800
1254412690 * window = main_window
1254512691 *
1254612692 * if window is None: # <<<<<<<<<<<<<<
1254912695 */
1255012696 }
1255112697
12552 /* "pygame_sdl2/display.pyx":785
12698 /* "pygame_sdl2/display.pyx":803
1255312699 * return NULL
1255412700 *
1255512701 * return (<Window> window).window # <<<<<<<<<<<<<<
1255712703 __pyx_r = ((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_window)->window;
1255812704 goto __pyx_L0;
1255912705
12560 /* "pygame_sdl2/display.pyx":772
12706 /* "pygame_sdl2/display.pyx":790
1256112707 * return SDL_GetPlatform()
1256212708 *
1256312709 * cdef api SDL_Window *PyWindow_AsWindow(window): # <<<<<<<<<<<<<<
1265312799 {"restore", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_41restore, METH_NOARGS, 0},
1265412800 {"maximize", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_43maximize, METH_NOARGS, 0},
1265512801 {"minimize", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_45minimize, METH_NOARGS, 0},
12656 {"__reduce_cython__", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_47__reduce_cython__, METH_NOARGS, 0},
12657 {"__setstate_cython__", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_49__setstate_cython__, METH_O, 0},
12802 {"get_sdl_window_pointer", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_47get_sdl_window_pointer, METH_NOARGS, __pyx_doc_11pygame_sdl2_7display_6Window_46get_sdl_window_pointer},
12803 {"__reduce_cython__", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_49__reduce_cython__, METH_NOARGS, 0},
12804 {"__setstate_cython__", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_51__setstate_cython__, METH_O, 0},
1265812805 {0, 0, 0, 0}
1265912806 };
1266012807
1279612943 {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
1279712944 {&__pyx_n_s_Window, __pyx_k_Window, sizeof(__pyx_k_Window), 0, 0, 1, 1},
1279812945 {&__pyx_n_s_androidembed, __pyx_k_androidembed, sizeof(__pyx_k_androidembed), 0, 0, 1, 1},
12799 {&__pyx_n_s_before_first_window, __pyx_k_before_first_window, sizeof(__pyx_k_before_first_window), 0, 0, 1, 1},
1280012946 {&__pyx_n_s_bitsize, __pyx_k_bitsize, sizeof(__pyx_k_bitsize), 0, 0, 1, 1},
1280112947 {&__pyx_n_s_blit_hw, __pyx_k_blit_hw, sizeof(__pyx_k_blit_hw), 0, 0, 1, 1},
1280212948 {&__pyx_n_s_blit_hw_A, __pyx_k_blit_hw_A, sizeof(__pyx_k_blit_hw_A), 0, 0, 1, 1},
1280612952 {&__pyx_n_s_blit_sw_CC, __pyx_k_blit_sw_CC, sizeof(__pyx_k_blit_sw_CC), 0, 0, 1, 1},
1280712953 {&__pyx_n_s_blue, __pyx_k_blue, sizeof(__pyx_k_blue), 0, 0, 1, 1},
1280812954 {&__pyx_n_s_bytesize, __pyx_k_bytesize, sizeof(__pyx_k_bytesize), 0, 0, 1, 1},
12955 {&__pyx_n_s_c_void_p, __pyx_k_c_void_p, sizeof(__pyx_k_c_void_p), 0, 0, 1, 1},
1280912956 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
12810 {&__pyx_n_s_close_window, __pyx_k_close_window, sizeof(__pyx_k_close_window), 0, 0, 1, 1},
1281112957 {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
1281212958 {&__pyx_n_s_create_surface, __pyx_k_create_surface, sizeof(__pyx_k_create_surface), 0, 0, 1, 1},
12959 {&__pyx_n_s_ctypes, __pyx_k_ctypes, sizeof(__pyx_k_ctypes), 0, 0, 1, 1},
1281312960 {&__pyx_n_s_current_h, __pyx_k_current_h, sizeof(__pyx_k_current_h), 0, 0, 1, 1},
1281412961 {&__pyx_n_s_current_w, __pyx_k_current_w, sizeof(__pyx_k_current_w), 0, 0, 1, 1},
1281512962 {&__pyx_n_s_default, __pyx_k_default, sizeof(__pyx_k_default), 0, 0, 1, 1},
1292013067 {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
1292113068 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
1292213069 {&__pyx_n_s_shifts, __pyx_k_shifts, sizeof(__pyx_k_shifts), 0, 0, 1, 1},
12923 {&__pyx_n_s_shown_first_window, __pyx_k_shown_first_window, sizeof(__pyx_k_shown_first_window), 0, 0, 1, 1},
1292413070 {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
1292513071 {&__pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_k_src_pygame_sdl2_display_pyx, sizeof(__pyx_k_src_pygame_sdl2_display_pyx), 0, 0, 1, 0},
1292613072 {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1},
1293813084 {0, 0, 0, 0, 0, 0, 0}
1293913085 };
1294013086 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
12941 __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 528, __pyx_L1_error)
12942 __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(0, 139, __pyx_L1_error)
12943 __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 361, __pyx_L1_error)
12944 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 425, __pyx_L1_error)
13087 __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(0, 125, __pyx_L1_error)
13088 __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 546, __pyx_L1_error)
13089 __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 362, __pyx_L1_error)
13090 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 426, __pyx_L1_error)
1294513091 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
1294613092 return 0;
1294713093 __pyx_L1_error:;
1296313109 __Pyx_GOTREF(__pyx_tuple_);
1296413110 __Pyx_GIVEREF(__pyx_tuple_);
1296513111
12966 /* "pygame_sdl2/display.pyx":145
13112 /* "pygame_sdl2/display.pyx":130
1296713113 *
1296813114 * cdef class Window:
1296913115 * def __init__(self, title, resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): # <<<<<<<<<<<<<<
1297013116 *
1297113117 * if not isinstance(title, bytes):
1297213118 */
12973 __pyx_tuple__2 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 145, __pyx_L1_error)
13119 __pyx_tuple__2 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 130, __pyx_L1_error)
1297413120 __Pyx_GOTREF(__pyx_tuple__2);
1297513121 __Pyx_GIVEREF(__pyx_tuple__2);
1297613122
12977 /* "pygame_sdl2/display.pyx":156
13123 /* "pygame_sdl2/display.pyx":139
1297813124 * # If we do not get the AVOID_GL hint, we always create a GL-compatible
1297913125 * # window. This lets us change the OPENGL flag later on.
1298013126 * if int(_get_hint("PYGAME_SDL2_AVOID_GL", "0")): # <<<<<<<<<<<<<<
1298113127 * gl_flag = 0
1298213128 * else:
1298313129 */
12984 __pyx_tuple__4 = PyTuple_Pack(2, __pyx_n_u_PYGAME_SDL2_AVOID_GL, __pyx_kp_u_0); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 156, __pyx_L1_error)
13130 __pyx_tuple__4 = PyTuple_Pack(2, __pyx_n_u_PYGAME_SDL2_AVOID_GL, __pyx_kp_u_0); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 139, __pyx_L1_error)
1298513131 __Pyx_GOTREF(__pyx_tuple__4);
1298613132 __Pyx_GIVEREF(__pyx_tuple__4);
1298713133
12988 /* "pygame_sdl2/display.pyx":218
13134 /* "pygame_sdl2/display.pyx":219
1298913135 * if self.window_surface.format.BitsPerPixel == 32:
1299013136 *
1299113137 * self.surface = Surface(()) # <<<<<<<<<<<<<<
1299213138 * self.surface.surface = self.window_surface
1299313139 * self.surface.owns_surface = False
1299413140 */
12995 __pyx_tuple__5 = PyTuple_Pack(1, __pyx_empty_tuple); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 218, __pyx_L1_error)
13141 __pyx_tuple__5 = PyTuple_Pack(1, __pyx_empty_tuple); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 219, __pyx_L1_error)
1299613142 __Pyx_GOTREF(__pyx_tuple__5);
1299713143 __Pyx_GIVEREF(__pyx_tuple__5);
1299813144
12999 /* "pygame_sdl2/display.pyx":361
13145 /* "pygame_sdl2/display.pyx":362
1300013146 * rects = <SDL_Rect *> calloc(len(rectangles), sizeof(SDL_Rect))
1300113147 * if rects == NULL:
1300213148 * raise MemoryError("Couldn't allocate rectangles.") # <<<<<<<<<<<<<<
1300313149 *
1300413150 * try:
1300513151 */
13006 __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Couldn_t_allocate_rectangles); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 361, __pyx_L1_error)
13152 __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Couldn_t_allocate_rectangles); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 362, __pyx_L1_error)
1300713153 __Pyx_GOTREF(__pyx_tuple__6);
1300813154 __Pyx_GIVEREF(__pyx_tuple__6);
1300913155
1308613232 */
1308713233 __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_init, 116, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 116, __pyx_L1_error)
1308813234
13089 /* "pygame_sdl2/display.pyx":126
13090 * _shown_first_window = False
13091 *
13092 * def _before_first_window(): # <<<<<<<<<<<<<<
13093 * global _shown_first_window
13094 *
13095 */
13096 __pyx_tuple__18 = PyTuple_Pack(1, __pyx_n_s_androidembed); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 126, __pyx_L1_error)
13235 /* "pygame_sdl2/display.pyx":488
13236 * default_swap_control = 1
13237 *
13238 * def set_mode(resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): # <<<<<<<<<<<<<<
13239 * global main_window
13240 *
13241 */
13242 __pyx_tuple__18 = PyTuple_Pack(5, __pyx_n_s_resolution, __pyx_n_s_flags, __pyx_n_s_depth, __pyx_n_s_pos, __pyx_n_s_RESIZE_FLAGS); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 488, __pyx_L1_error)
1309713243 __Pyx_GOTREF(__pyx_tuple__18);
1309813244 __Pyx_GIVEREF(__pyx_tuple__18);
13099 __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_before_first_window, 126, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 126, __pyx_L1_error)
13100
13101 /* "pygame_sdl2/display.pyx":477
13102 * default_swap_control = 1
13103 *
13104 * def set_mode(resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): # <<<<<<<<<<<<<<
13245 __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_mode, 488, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 488, __pyx_L1_error)
13246
13247 /* "pygame_sdl2/display.pyx":509
13248 * return main_window.surface
13249 *
13250 * def destroy(): # <<<<<<<<<<<<<<
1310513251 * global main_window
1310613252 *
1310713253 */
13108 __pyx_tuple__20 = PyTuple_Pack(5, __pyx_n_s_resolution, __pyx_n_s_flags, __pyx_n_s_depth, __pyx_n_s_pos, __pyx_n_s_RESIZE_FLAGS); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 477, __pyx_L1_error)
13109 __Pyx_GOTREF(__pyx_tuple__20);
13110 __Pyx_GIVEREF(__pyx_tuple__20);
13111 __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_mode, 477, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 477, __pyx_L1_error)
13112
13113 /* "pygame_sdl2/display.pyx":498
13114 * return main_window.surface
13254 __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_destroy, 509, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 509, __pyx_L1_error)
13255
13256 /* "pygame_sdl2/display.pyx":516
13257 * main_window = None
1311513258 *
1311613259 * def get_surface(): # <<<<<<<<<<<<<<
1311713260 * if main_window is None:
1311813261 * return None
1311913262 */
13120 __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_surface, 498, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 498, __pyx_L1_error)
13121
13122 /* "pygame_sdl2/display.pyx":504
13263 __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_surface, 516, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 516, __pyx_L1_error)
13264
13265 /* "pygame_sdl2/display.pyx":522
1312313266 * return main_window.get_surface()
1312413267 *
1312513268 * def get_window(): # <<<<<<<<<<<<<<
1312613269 * """
1312713270 * Returns the Window created by set_mode, or None if no such window
1312813271 */
13129 __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_window, 504, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 504, __pyx_L1_error)
13130
13131 /* "pygame_sdl2/display.pyx":512
13272 __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_window, 522, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 522, __pyx_L1_error)
13273
13274 /* "pygame_sdl2/display.pyx":530
1313213275 * return main_window
1313313276 *
1313413277 * def flip(): # <<<<<<<<<<<<<<
1313513278 * if main_window:
1313613279 * main_window.flip()
1313713280 */
13138 __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_flip, 512, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 512, __pyx_L1_error)
13139
13140 /* "pygame_sdl2/display.pyx":516
13281 __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_flip, 530, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 530, __pyx_L1_error)
13282
13283 /* "pygame_sdl2/display.pyx":534
1314113284 * main_window.flip()
1314213285 *
1314313286 * def update(rectangles=None): # <<<<<<<<<<<<<<
1314413287 * if main_window:
1314513288 * main_window.update(rectangles)
1314613289 */
13147 __pyx_tuple__25 = PyTuple_Pack(1, __pyx_n_s_rectangles); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 516, __pyx_L1_error)
13148 __Pyx_GOTREF(__pyx_tuple__25);
13149 __Pyx_GIVEREF(__pyx_tuple__25);
13150 __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_update, 516, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 516, __pyx_L1_error)
13151
13152 /* "pygame_sdl2/display.pyx":520
13290 __pyx_tuple__24 = PyTuple_Pack(1, __pyx_n_s_rectangles); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 534, __pyx_L1_error)
13291 __Pyx_GOTREF(__pyx_tuple__24);
13292 __Pyx_GIVEREF(__pyx_tuple__24);
13293 __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_update, 534, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 534, __pyx_L1_error)
13294
13295 /* "pygame_sdl2/display.pyx":538
1315313296 * main_window.update(rectangles)
1315413297 *
1315513298 * def get_driver(): # <<<<<<<<<<<<<<
1315613299 * cdef const char *driver = SDL_GetCurrentVideoDriver()
1315713300 *
1315813301 */
13159 __pyx_tuple__27 = PyTuple_Pack(1, __pyx_n_s_driver); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 520, __pyx_L1_error)
13160 __Pyx_GOTREF(__pyx_tuple__27);
13161 __Pyx_GIVEREF(__pyx_tuple__27);
13162 __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_driver, 520, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 520, __pyx_L1_error)
13163
13164 /* "pygame_sdl2/display.pyx":528
13302 __pyx_tuple__26 = PyTuple_Pack(1, __pyx_n_s_driver); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 538, __pyx_L1_error)
13303 __Pyx_GOTREF(__pyx_tuple__26);
13304 __Pyx_GIVEREF(__pyx_tuple__26);
13305 __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_driver, 538, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 538, __pyx_L1_error)
13306
13307 /* "pygame_sdl2/display.pyx":546
1316513308 * return driver
1316613309 *
1316713310 * class Info(object): # <<<<<<<<<<<<<<
1316813311 *
1316913312 * def __init__(self):
1317013313 */
13171 __pyx_tuple__29 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 528, __pyx_L1_error)
13172 __Pyx_GOTREF(__pyx_tuple__29);
13173 __Pyx_GIVEREF(__pyx_tuple__29);
13174
13175 /* "pygame_sdl2/display.pyx":530
13314 __pyx_tuple__28 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 546, __pyx_L1_error)
13315 __Pyx_GOTREF(__pyx_tuple__28);
13316 __Pyx_GIVEREF(__pyx_tuple__28);
13317
13318 /* "pygame_sdl2/display.pyx":548
1317613319 * class Info(object):
1317713320 *
1317813321 * def __init__(self): # <<<<<<<<<<<<<<
1317913322 * cdef SDL_DisplayMode dm
1318013323 * cdef SDL_PixelFormat *format
1318113324 */
13182 __pyx_tuple__30 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_dm, __pyx_n_s_format); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 530, __pyx_L1_error)
13183 __Pyx_GOTREF(__pyx_tuple__30);
13184 __Pyx_GIVEREF(__pyx_tuple__30);
13185 __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_init_2, 530, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 530, __pyx_L1_error)
13186
13187 /* "pygame_sdl2/display.pyx":589
13325 __pyx_tuple__29 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_dm, __pyx_n_s_format); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 548, __pyx_L1_error)
13326 __Pyx_GOTREF(__pyx_tuple__29);
13327 __Pyx_GIVEREF(__pyx_tuple__29);
13328 __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_init_2, 548, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 548, __pyx_L1_error)
13329
13330 /* "pygame_sdl2/display.pyx":607
1318813331 * self.blit_sw_A = False
1318913332 *
1319013333 * def __repr__(self): # <<<<<<<<<<<<<<
1319113334 * return "<Info({!r})>".format(self.__dict__)
1319213335 *
1319313336 */
13194 __pyx_tuple__32 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 589, __pyx_L1_error)
13195 __Pyx_GOTREF(__pyx_tuple__32);
13196 __Pyx_GIVEREF(__pyx_tuple__32);
13197 __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_repr, 589, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 589, __pyx_L1_error)
13198
13199 /* "pygame_sdl2/display.pyx":593
13337 __pyx_tuple__31 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 607, __pyx_L1_error)
13338 __Pyx_GOTREF(__pyx_tuple__31);
13339 __Pyx_GIVEREF(__pyx_tuple__31);
13340 __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_repr, 607, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 607, __pyx_L1_error)
13341
13342 /* "pygame_sdl2/display.pyx":611
1320013343 *
1320113344 *
1320213345 * def get_wm_info(): # <<<<<<<<<<<<<<
1320313346 * if main_window:
1320413347 * return main_window.get_wm_info()
1320513348 */
13206 __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_wm_info, 593, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 593, __pyx_L1_error)
13207
13208 /* "pygame_sdl2/display.pyx":600
13349 __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_wm_info, 611, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 611, __pyx_L1_error)
13350
13351 /* "pygame_sdl2/display.pyx":618
1320913352 *
1321013353 *
1321113354 * def get_num_video_displays(): # <<<<<<<<<<<<<<
1321213355 * """
1321313356 * Returns the number of video displays connected to the system.
1321413357 */
13215 __pyx_tuple__35 = PyTuple_Pack(1, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 600, __pyx_L1_error)
13216 __Pyx_GOTREF(__pyx_tuple__35);
13217 __Pyx_GIVEREF(__pyx_tuple__35);
13218 __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_num_video_displays, 600, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 600, __pyx_L1_error)
13219
13220 /* "pygame_sdl2/display.pyx":613
13358 __pyx_tuple__34 = PyTuple_Pack(1, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 618, __pyx_L1_error)
13359 __Pyx_GOTREF(__pyx_tuple__34);
13360 __Pyx_GIVEREF(__pyx_tuple__34);
13361 __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_num_video_displays, 618, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 618, __pyx_L1_error)
13362
13363 /* "pygame_sdl2/display.pyx":631
1322113364 *
1322213365 *
1322313366 * def list_modes(depth=0, flags=0, display=0): # <<<<<<<<<<<<<<
1322413367 * """
1322513368 * Returns a list of possible display modes for the display `display`.
1322613369 */
13227 __pyx_tuple__37 = PyTuple_Pack(8, __pyx_n_s_depth, __pyx_n_s_flags, __pyx_n_s_display, __pyx_n_s_num_modes, __pyx_n_s_i, __pyx_n_s_mode, __pyx_n_s_rv, __pyx_n_s_t); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 613, __pyx_L1_error)
13228 __Pyx_GOTREF(__pyx_tuple__37);
13229 __Pyx_GIVEREF(__pyx_tuple__37);
13230 __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_list_modes, 613, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 613, __pyx_L1_error)
13231
13232 /* "pygame_sdl2/display.pyx":638
13370 __pyx_tuple__36 = PyTuple_Pack(8, __pyx_n_s_depth, __pyx_n_s_flags, __pyx_n_s_display, __pyx_n_s_num_modes, __pyx_n_s_i, __pyx_n_s_mode, __pyx_n_s_rv, __pyx_n_s_t); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 631, __pyx_L1_error)
13371 __Pyx_GOTREF(__pyx_tuple__36);
13372 __Pyx_GIVEREF(__pyx_tuple__36);
13373 __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_list_modes, 631, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 631, __pyx_L1_error)
13374
13375 /* "pygame_sdl2/display.pyx":656
1323313376 *
1323413377 *
1323513378 * def mode_ok(size, flags=0, depth=0): # <<<<<<<<<<<<<<
1323613379 * """
1323713380 * Returns true if size is in the result of list_modes().
1323813381 */
13239 __pyx_tuple__39 = PyTuple_Pack(3, __pyx_n_s_size, __pyx_n_s_flags, __pyx_n_s_depth); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 638, __pyx_L1_error)
13240 __Pyx_GOTREF(__pyx_tuple__39);
13241 __Pyx_GIVEREF(__pyx_tuple__39);
13242 __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_mode_ok, 638, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 638, __pyx_L1_error)
13243
13244 /* "pygame_sdl2/display.pyx":645
13382 __pyx_tuple__38 = PyTuple_Pack(3, __pyx_n_s_size, __pyx_n_s_flags, __pyx_n_s_depth); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 656, __pyx_L1_error)
13383 __Pyx_GOTREF(__pyx_tuple__38);
13384 __Pyx_GIVEREF(__pyx_tuple__38);
13385 __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_mode_ok, 656, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 656, __pyx_L1_error)
13386
13387 /* "pygame_sdl2/display.pyx":663
1324513388 * return tuple(size) in list_modes()
1324613389 *
1324713390 * def gl_reset_attributes(): # <<<<<<<<<<<<<<
1324813391 * SDL_GL_ResetAttributes()
1324913392 *
1325013393 */
13251 __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_gl_reset_attributes, 645, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 645, __pyx_L1_error)
13252
13253 /* "pygame_sdl2/display.pyx":648
13394 __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_gl_reset_attributes, 663, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 663, __pyx_L1_error)
13395
13396 /* "pygame_sdl2/display.pyx":666
1325413397 * SDL_GL_ResetAttributes()
1325513398 *
1325613399 * def gl_set_attribute(flag, value): # <<<<<<<<<<<<<<
1325713400 *
1325813401 * if flag == GL_SWAP_CONTROL:
1325913402 */
13260 __pyx_tuple__42 = PyTuple_Pack(2, __pyx_n_s_flag, __pyx_n_s_value); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 648, __pyx_L1_error)
13261 __Pyx_GOTREF(__pyx_tuple__42);
13262 __Pyx_GIVEREF(__pyx_tuple__42);
13263 __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_gl_set_attribute, 648, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 648, __pyx_L1_error)
13264
13265 /* "pygame_sdl2/display.pyx":668
13403 __pyx_tuple__41 = PyTuple_Pack(2, __pyx_n_s_flag, __pyx_n_s_value); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 666, __pyx_L1_error)
13404 __Pyx_GOTREF(__pyx_tuple__41);
13405 __Pyx_GIVEREF(__pyx_tuple__41);
13406 __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_gl_set_attribute, 666, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 666, __pyx_L1_error)
13407
13408 /* "pygame_sdl2/display.pyx":686
1326613409 * raise error()
1326713410 *
1326813411 * def gl_get_attribute(flag): # <<<<<<<<<<<<<<
1326913412 * cdef int rv
1327013413 *
1327113414 */
13272 __pyx_tuple__44 = PyTuple_Pack(2, __pyx_n_s_flag, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 668, __pyx_L1_error)
13273 __Pyx_GOTREF(__pyx_tuple__44);
13274 __Pyx_GIVEREF(__pyx_tuple__44);
13275 __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_gl_get_attribute, 668, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(0, 668, __pyx_L1_error)
13276
13277 /* "pygame_sdl2/display.pyx":679
13415 __pyx_tuple__43 = PyTuple_Pack(2, __pyx_n_s_flag, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 686, __pyx_L1_error)
13416 __Pyx_GOTREF(__pyx_tuple__43);
13417 __Pyx_GIVEREF(__pyx_tuple__43);
13418 __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_gl_get_attribute, 686, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 686, __pyx_L1_error)
13419
13420 /* "pygame_sdl2/display.pyx":697
1327813421 * return rv
1327913422 *
1328013423 * def gl_load_library(path): # <<<<<<<<<<<<<<
1328113424 * if path is None:
1328213425 * if SDL_GL_LoadLibrary(NULL):
1328313426 */
13284 __pyx_tuple__46 = PyTuple_Pack(1, __pyx_n_s_path); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 679, __pyx_L1_error)
13285 __Pyx_GOTREF(__pyx_tuple__46);
13286 __Pyx_GIVEREF(__pyx_tuple__46);
13287 __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_gl_load_library, 679, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 679, __pyx_L1_error)
13288
13289 /* "pygame_sdl2/display.pyx":687
13427 __pyx_tuple__45 = PyTuple_Pack(1, __pyx_n_s_path); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 697, __pyx_L1_error)
13428 __Pyx_GOTREF(__pyx_tuple__45);
13429 __Pyx_GIVEREF(__pyx_tuple__45);
13430 __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_gl_load_library, 697, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 697, __pyx_L1_error)
13431
13432 /* "pygame_sdl2/display.pyx":705
1329013433 * raise error()
1329113434 *
1329213435 * def gl_unload_library(): # <<<<<<<<<<<<<<
1329313436 * SDL_GL_UnloadLibrary()
1329413437 *
1329513438 */
13296 __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_gl_unload_library, 687, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 687, __pyx_L1_error)
13297
13298 /* "pygame_sdl2/display.pyx":690
13439 __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_gl_unload_library, 705, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 705, __pyx_L1_error)
13440
13441 /* "pygame_sdl2/display.pyx":708
1329913442 * SDL_GL_UnloadLibrary()
1330013443 *
1330113444 * def get_active(): # <<<<<<<<<<<<<<
1330213445 * if main_window:
1330313446 * return main_window.get_active()
1330413447 */
13305 __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_active, 690, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 690, __pyx_L1_error)
13306
13307 /* "pygame_sdl2/display.pyx":695
13448 __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_active, 708, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 708, __pyx_L1_error)
13449
13450 /* "pygame_sdl2/display.pyx":713
1330813451 * return False
1330913452 *
1331013453 * def iconify(): # <<<<<<<<<<<<<<
1331113454 * if main_window:
1331213455 * return main_window.iconify()
1331313456 */
13314 __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_iconify, 695, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 695, __pyx_L1_error)
13315
13316 /* "pygame_sdl2/display.pyx":701
13457 __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_iconify, 713, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 713, __pyx_L1_error)
13458
13459 /* "pygame_sdl2/display.pyx":719
1331713460 * return False
1331813461 *
1331913462 * def toggle_fullscreen(): # <<<<<<<<<<<<<<
1332013463 * if main_window:
1332113464 * return main_window.toggle_fullscreen()
1332213465 */
13323 __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_toggle_fullscreen, 701, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 701, __pyx_L1_error)
13324
13325 /* "pygame_sdl2/display.pyx":707
13466 __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_toggle_fullscreen, 719, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 719, __pyx_L1_error)
13467
13468 /* "pygame_sdl2/display.pyx":725
1332613469 * return True
1332713470 *
1332813471 * def set_gamma(red, green=None, blue=None): # <<<<<<<<<<<<<<
1332913472 * if main_window:
1333013473 * return main_window.set_gamma(red, green, blue)
1333113474 */
13332 __pyx_tuple__52 = PyTuple_Pack(3, __pyx_n_s_red, __pyx_n_s_green, __pyx_n_s_blue); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 707, __pyx_L1_error)
13333 __Pyx_GOTREF(__pyx_tuple__52);
13334 __Pyx_GIVEREF(__pyx_tuple__52);
13335 __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_gamma, 707, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 707, __pyx_L1_error)
13336
13337 /* "pygame_sdl2/display.pyx":712
13475 __pyx_tuple__51 = PyTuple_Pack(3, __pyx_n_s_red, __pyx_n_s_green, __pyx_n_s_blue); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 725, __pyx_L1_error)
13476 __Pyx_GOTREF(__pyx_tuple__51);
13477 __Pyx_GIVEREF(__pyx_tuple__51);
13478 __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_gamma, 725, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 725, __pyx_L1_error)
13479
13480 /* "pygame_sdl2/display.pyx":730
1333813481 * return False
1333913482 *
1334013483 * def set_gamma_ramp(red, green, blue): # <<<<<<<<<<<<<<
1334113484 * if main_window:
1334213485 * return main_window.set_gamma_ramp(red, green, blue)
1334313486 */
13344 __pyx_tuple__54 = PyTuple_Pack(3, __pyx_n_s_red, __pyx_n_s_green, __pyx_n_s_blue); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 712, __pyx_L1_error)
13345 __Pyx_GOTREF(__pyx_tuple__54);
13346 __Pyx_GIVEREF(__pyx_tuple__54);
13347 __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_gamma_ramp, 712, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 712, __pyx_L1_error)
13348
13349 /* "pygame_sdl2/display.pyx":717
13487 __pyx_tuple__53 = PyTuple_Pack(3, __pyx_n_s_red, __pyx_n_s_green, __pyx_n_s_blue); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 730, __pyx_L1_error)
13488 __Pyx_GOTREF(__pyx_tuple__53);
13489 __Pyx_GIVEREF(__pyx_tuple__53);
13490 __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_gamma_ramp, 730, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 730, __pyx_L1_error)
13491
13492 /* "pygame_sdl2/display.pyx":735
1335013493 * return False
1335113494 *
1335213495 * def set_icon(surface): # <<<<<<<<<<<<<<
1335313496 * global default_icon
1335413497 *
1335513498 */
13356 __pyx_tuple__56 = PyTuple_Pack(1, __pyx_n_s_surface); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 717, __pyx_L1_error)
13357 __Pyx_GOTREF(__pyx_tuple__56);
13358 __Pyx_GIVEREF(__pyx_tuple__56);
13359 __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_icon, 717, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(0, 717, __pyx_L1_error)
13360
13361 /* "pygame_sdl2/display.pyx":725
13499 __pyx_tuple__55 = PyTuple_Pack(1, __pyx_n_s_surface); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 735, __pyx_L1_error)
13500 __Pyx_GOTREF(__pyx_tuple__55);
13501 __Pyx_GIVEREF(__pyx_tuple__55);
13502 __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_icon, 735, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(0, 735, __pyx_L1_error)
13503
13504 /* "pygame_sdl2/display.pyx":743
1336213505 * main_window.set_icon(default_icon)
1336313506 *
1336413507 * def set_caption(title, icontitle = None): # <<<<<<<<<<<<<<
1336513508 * global default_title
1336613509 *
1336713510 */
13368 __pyx_tuple__58 = PyTuple_Pack(2, __pyx_n_s_title, __pyx_n_s_icontitle); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 725, __pyx_L1_error)
13369 __Pyx_GOTREF(__pyx_tuple__58);
13370 __Pyx_GIVEREF(__pyx_tuple__58);
13371 __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_caption, 725, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 725, __pyx_L1_error)
13372
13373 /* "pygame_sdl2/display.pyx":733
13511 __pyx_tuple__57 = PyTuple_Pack(2, __pyx_n_s_title, __pyx_n_s_icontitle); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 743, __pyx_L1_error)
13512 __Pyx_GOTREF(__pyx_tuple__57);
13513 __Pyx_GIVEREF(__pyx_tuple__57);
13514 __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_caption, 743, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 743, __pyx_L1_error)
13515
13516 /* "pygame_sdl2/display.pyx":751
1337413517 * main_window.set_caption(default_title)
1337513518 *
1337613519 * def get_caption(): # <<<<<<<<<<<<<<
1337713520 * return default_title
1337813521 *
1337913522 */
13380 __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_caption, 733, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 733, __pyx_L1_error)
13381
13382 /* "pygame_sdl2/display.pyx":736
13523 __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_caption, 751, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 751, __pyx_L1_error)
13524
13525 /* "pygame_sdl2/display.pyx":754
1338313526 * return default_title
1338413527 *
1338513528 * def get_drawable_size(): # <<<<<<<<<<<<<<
1338613529 * if main_window:
1338713530 * return main_window.get_drawable_size()
1338813531 */
13389 __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_drawable_size, 736, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(0, 736, __pyx_L1_error)
13390
13391 /* "pygame_sdl2/display.pyx":741
13532 __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_drawable_size, 754, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 754, __pyx_L1_error)
13533
13534 /* "pygame_sdl2/display.pyx":759
1339213535 * return None
1339313536 *
1339413537 * def get_size(): # <<<<<<<<<<<<<<
1339513538 * if main_window:
1339613539 * return main_window.get_size()
1339713540 */
13398 __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_size, 741, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(0, 741, __pyx_L1_error)
13399
13400 /* "pygame_sdl2/display.pyx":746
13541 __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_size, 759, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(0, 759, __pyx_L1_error)
13542
13543 /* "pygame_sdl2/display.pyx":764
1340113544 * return None
1340213545 *
1340313546 * def get_num_video_displays(): # <<<<<<<<<<<<<<
1340413547 * rv = SDL_GetNumVideoDisplays()
1340513548 * if rv < 0:
1340613549 */
13407 __pyx_tuple__63 = PyTuple_Pack(1, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 746, __pyx_L1_error)
13408 __Pyx_GOTREF(__pyx_tuple__63);
13409 __Pyx_GIVEREF(__pyx_tuple__63);
13410 __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_num_video_displays, 746, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(0, 746, __pyx_L1_error)
13411
13412 /* "pygame_sdl2/display.pyx":753
13550 __pyx_tuple__62 = PyTuple_Pack(1, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 764, __pyx_L1_error)
13551 __Pyx_GOTREF(__pyx_tuple__62);
13552 __Pyx_GIVEREF(__pyx_tuple__62);
13553 __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__62, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_num_video_displays, 764, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(0, 764, __pyx_L1_error)
13554
13555 /* "pygame_sdl2/display.pyx":771
1341313556 * return rv
1341413557 *
1341513558 * def get_display_bounds(index): # <<<<<<<<<<<<<<
1341613559 * cdef SDL_Rect rect
1341713560 * rv = SDL_GetDisplayBounds(index, &rect)
1341813561 */
13419 __pyx_tuple__65 = PyTuple_Pack(3, __pyx_n_s_index, __pyx_n_s_rect, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 753, __pyx_L1_error)
13420 __Pyx_GOTREF(__pyx_tuple__65);
13421 __Pyx_GIVEREF(__pyx_tuple__65);
13422 __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_display_bounds, 753, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(0, 753, __pyx_L1_error)
13423
13424 /* "pygame_sdl2/display.pyx":759
13562 __pyx_tuple__64 = PyTuple_Pack(3, __pyx_n_s_index, __pyx_n_s_rect, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 771, __pyx_L1_error)
13563 __Pyx_GOTREF(__pyx_tuple__64);
13564 __Pyx_GIVEREF(__pyx_tuple__64);
13565 __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_display_bounds, 771, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 771, __pyx_L1_error)
13566
13567 /* "pygame_sdl2/display.pyx":777
1342513568 * return (rect.x, rect.y, rect.w, rect.h)
1342613569 *
1342713570 * def set_screensaver(state): # <<<<<<<<<<<<<<
1342813571 * """
1342913572 * Sets the screenslaver to `state`.
1343013573 */
13431 __pyx_tuple__67 = PyTuple_Pack(1, __pyx_n_s_state); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 759, __pyx_L1_error)
13432 __Pyx_GOTREF(__pyx_tuple__67);
13433 __Pyx_GIVEREF(__pyx_tuple__67);
13434 __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_screensaver, 759, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(0, 759, __pyx_L1_error)
13435
13436 /* "pygame_sdl2/display.pyx":769
13574 __pyx_tuple__66 = PyTuple_Pack(1, __pyx_n_s_state); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 777, __pyx_L1_error)
13575 __Pyx_GOTREF(__pyx_tuple__66);
13576 __Pyx_GIVEREF(__pyx_tuple__66);
13577 __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_screensaver, 777, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(0, 777, __pyx_L1_error)
13578
13579 /* "pygame_sdl2/display.pyx":787
1343713580 * SDL_DisableScreenSaver()
1343813581 *
1343913582 * def get_platform(): # <<<<<<<<<<<<<<
1344013583 * return SDL_GetPlatform()
1344113584 *
1344213585 */
13443 __pyx_codeobj__69 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_platform, 769, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__69)) __PYX_ERR(0, 769, __pyx_L1_error)
13586 __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_platform, 787, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(0, 787, __pyx_L1_error)
1344413587 __Pyx_RefNannyFinishContext();
1344513588 return 0;
1344613589 __pyx_L1_error:;
1351313656 int __pyx_clineno = 0;
1351413657 __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
1351513658 /*--- Type init code ---*/
13516 if (PyType_Ready(&__pyx_type_11pygame_sdl2_7display_Window) < 0) __PYX_ERR(0, 144, __pyx_L1_error)
13659 if (PyType_Ready(&__pyx_type_11pygame_sdl2_7display_Window) < 0) __PYX_ERR(0, 129, __pyx_L1_error)
1351713660 #if PY_VERSION_HEX < 0x030800B1
1351813661 __pyx_type_11pygame_sdl2_7display_Window.tp_print = 0;
1351913662 #endif
1352013663 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11pygame_sdl2_7display_Window.tp_dictoffset && __pyx_type_11pygame_sdl2_7display_Window.tp_getattro == PyObject_GenericGetAttr)) {
1352113664 __pyx_type_11pygame_sdl2_7display_Window.tp_getattro = __Pyx_PyObject_GenericGetAttr;
1352213665 }
13523 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Window, (PyObject *)&__pyx_type_11pygame_sdl2_7display_Window) < 0) __PYX_ERR(0, 144, __pyx_L1_error)
13666 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Window, (PyObject *)&__pyx_type_11pygame_sdl2_7display_Window) < 0) __PYX_ERR(0, 129, __pyx_L1_error)
1352413667 if (__pyx_type_11pygame_sdl2_7display_Window.tp_weaklistoffset == 0) __pyx_type_11pygame_sdl2_7display_Window.tp_weaklistoffset = offsetof(struct __pyx_obj_11pygame_sdl2_7display_Window, __weakref__);
13525 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_11pygame_sdl2_7display_Window) < 0) __PYX_ERR(0, 144, __pyx_L1_error)
13668 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_11pygame_sdl2_7display_Window) < 0) __PYX_ERR(0, 129, __pyx_L1_error)
1352613669 __pyx_ptype_11pygame_sdl2_7display_Window = &__pyx_type_11pygame_sdl2_7display_Window;
1352713670 __Pyx_RefNannyFinishContext();
1352813671 return 0;
1368313826 PyObject *__pyx_t_2 = NULL;
1368413827 int __pyx_t_3;
1368513828 PyObject *__pyx_t_4 = NULL;
13829 PyObject *__pyx_t_5 = NULL;
13830 PyObject *__pyx_t_6 = NULL;
13831 PyObject *__pyx_t_7 = NULL;
13832 int __pyx_t_8;
1368613833 int __pyx_lineno = 0;
1368713834 const char *__pyx_filename = NULL;
1368813835 int __pyx_clineno = 0;
1405114198 * # The window that is used by the various module globals.
1405214199 * main_window = None # <<<<<<<<<<<<<<
1405314200 *
14054 * # Have we shown the first window?
14201 * try:
1405514202 */
1405614203 __Pyx_INCREF(Py_None);
1405714204 __Pyx_XGOTREF(((PyObject *)__pyx_v_11pygame_sdl2_7display_main_window));
1405814205 __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_7display_main_window, ((struct __pyx_obj_11pygame_sdl2_7display_Window *)Py_None));
1405914206 __Pyx_GIVEREF(Py_None);
1406014207
14061 /* "pygame_sdl2/display.pyx":124
14062 *
14063 * # Have we shown the first window?
14064 * _shown_first_window = False # <<<<<<<<<<<<<<
14065 *
14066 * def _before_first_window():
14067 */
14068 if (PyDict_SetItem(__pyx_d, __pyx_n_s_shown_first_window, Py_False) < 0) __PYX_ERR(0, 124, __pyx_L1_error)
14069
14070 /* "pygame_sdl2/display.pyx":126
14071 * _shown_first_window = False
14072 *
14073 * def _before_first_window(): # <<<<<<<<<<<<<<
14074 * global _shown_first_window
14075 *
14076 */
14077 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_13_before_first_window, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error)
14078 __Pyx_GOTREF(__pyx_t_1);
14079 if (PyDict_SetItem(__pyx_d, __pyx_n_s_before_first_window, __pyx_t_1) < 0) __PYX_ERR(0, 126, __pyx_L1_error)
14080 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14081
14082 /* "pygame_sdl2/display.pyx":145
14208 /* "pygame_sdl2/display.pyx":123
14209 * main_window = None
14210 *
14211 * try: # <<<<<<<<<<<<<<
14212 * import androidembed
14213 * except ImportError:
14214 */
14215 {
14216 __Pyx_PyThreadState_declare
14217 __Pyx_PyThreadState_assign
14218 __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
14219 __Pyx_XGOTREF(__pyx_t_5);
14220 __Pyx_XGOTREF(__pyx_t_6);
14221 __Pyx_XGOTREF(__pyx_t_7);
14222 /*try:*/ {
14223
14224 /* "pygame_sdl2/display.pyx":124
14225 *
14226 * try:
14227 * import androidembed # <<<<<<<<<<<<<<
14228 * except ImportError:
14229 * androidembed = None
14230 */
14231 __pyx_t_1 = __Pyx_Import(__pyx_n_s_androidembed, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L2_error)
14232 __Pyx_GOTREF(__pyx_t_1);
14233 if (PyDict_SetItem(__pyx_d, __pyx_n_s_androidembed, __pyx_t_1) < 0) __PYX_ERR(0, 124, __pyx_L2_error)
14234 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14235
14236 /* "pygame_sdl2/display.pyx":123
14237 * main_window = None
14238 *
14239 * try: # <<<<<<<<<<<<<<
14240 * import androidembed
14241 * except ImportError:
14242 */
14243 }
14244 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14245 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
14246 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
14247 goto __pyx_L7_try_end;
14248 __pyx_L2_error:;
14249 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
14250 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
14251 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
14252
14253 /* "pygame_sdl2/display.pyx":125
14254 * try:
14255 * import androidembed
14256 * except ImportError: # <<<<<<<<<<<<<<
14257 * androidembed = None
14258 *
14259 */
14260 __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
14261 if (__pyx_t_8) {
14262 __Pyx_AddTraceback("pygame_sdl2.display", __pyx_clineno, __pyx_lineno, __pyx_filename);
14263 if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_4, &__pyx_t_2) < 0) __PYX_ERR(0, 125, __pyx_L4_except_error)
14264 __Pyx_GOTREF(__pyx_t_1);
14265 __Pyx_GOTREF(__pyx_t_4);
14266 __Pyx_GOTREF(__pyx_t_2);
14267
14268 /* "pygame_sdl2/display.pyx":126
14269 * import androidembed
14270 * except ImportError:
14271 * androidembed = None # <<<<<<<<<<<<<<
14272 *
14273 *
14274 */
14275 if (PyDict_SetItem(__pyx_d, __pyx_n_s_androidembed, Py_None) < 0) __PYX_ERR(0, 126, __pyx_L4_except_error)
14276 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
14277 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
14278 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
14279 goto __pyx_L3_exception_handled;
14280 }
14281 goto __pyx_L4_except_error;
14282 __pyx_L4_except_error:;
14283
14284 /* "pygame_sdl2/display.pyx":123
14285 * main_window = None
14286 *
14287 * try: # <<<<<<<<<<<<<<
14288 * import androidembed
14289 * except ImportError:
14290 */
14291 __Pyx_XGIVEREF(__pyx_t_5);
14292 __Pyx_XGIVEREF(__pyx_t_6);
14293 __Pyx_XGIVEREF(__pyx_t_7);
14294 __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
14295 goto __pyx_L1_error;
14296 __pyx_L3_exception_handled:;
14297 __Pyx_XGIVEREF(__pyx_t_5);
14298 __Pyx_XGIVEREF(__pyx_t_6);
14299 __Pyx_XGIVEREF(__pyx_t_7);
14300 __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
14301 __pyx_L7_try_end:;
14302 }
14303
14304 /* "pygame_sdl2/display.pyx":130
1408314305 *
1408414306 * cdef class Window:
1408514307 * def __init__(self, title, resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): # <<<<<<<<<<<<<<
1408614308 *
1408714309 * if not isinstance(title, bytes):
1408814310 */
14089 __pyx_t_1 = __Pyx_PyInt_From_int(SDL_WINDOWPOS_UNDEFINED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error)
14311 __pyx_t_2 = __Pyx_PyInt_From_int(SDL_WINDOWPOS_UNDEFINED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 130, __pyx_L1_error)
14312 __Pyx_GOTREF(__pyx_t_2);
14313 __pyx_t_4 = __Pyx_PyInt_From_int(SDL_WINDOWPOS_UNDEFINED); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 130, __pyx_L1_error)
14314 __Pyx_GOTREF(__pyx_t_4);
14315 __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 130, __pyx_L1_error)
1409014316 __Pyx_GOTREF(__pyx_t_1);
14091 __pyx_t_4 = __Pyx_PyInt_From_int(SDL_WINDOWPOS_UNDEFINED); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 145, __pyx_L1_error)
14317 __Pyx_GIVEREF(__pyx_t_2);
14318 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
14319 __Pyx_GIVEREF(__pyx_t_4);
14320 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
14321 __pyx_t_2 = 0;
14322 __pyx_t_4 = 0;
14323 __pyx_k__3 = __pyx_t_1;
14324 __Pyx_GIVEREF(__pyx_t_1);
14325 __pyx_t_1 = 0;
14326
14327 /* "pygame_sdl2/display.pyx":480
14328 *
14329 * # The icon that's used for new windows.
14330 * default_icon = None # <<<<<<<<<<<<<<
14331 *
14332 * # The title that's used for new windows.
14333 */
14334 if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_icon, Py_None) < 0) __PYX_ERR(0, 480, __pyx_L1_error)
14335
14336 /* "pygame_sdl2/display.pyx":483
14337 *
14338 * # The title that's used for new windows.
14339 * default_title = "pygame window" # <<<<<<<<<<<<<<
14340 *
14341 * # The default gl_swap_control
14342 */
14343 if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_title, __pyx_kp_u_pygame_window) < 0) __PYX_ERR(0, 483, __pyx_L1_error)
14344
14345 /* "pygame_sdl2/display.pyx":486
14346 *
14347 * # The default gl_swap_control
14348 * default_swap_control = 1 # <<<<<<<<<<<<<<
14349 *
14350 * def set_mode(resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)):
14351 */
14352 if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_swap_control, __pyx_int_1) < 0) __PYX_ERR(0, 486, __pyx_L1_error)
14353
14354 /* "pygame_sdl2/display.pyx":488
14355 * default_swap_control = 1
14356 *
14357 * def set_mode(resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): # <<<<<<<<<<<<<<
14358 * global main_window
14359 *
14360 */
14361 __pyx_t_1 = __Pyx_PyInt_From_int(SDL_WINDOWPOS_UNDEFINED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 488, __pyx_L1_error)
14362 __Pyx_GOTREF(__pyx_t_1);
14363 __pyx_t_4 = __Pyx_PyInt_From_int(SDL_WINDOWPOS_UNDEFINED); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 488, __pyx_L1_error)
1409214364 __Pyx_GOTREF(__pyx_t_4);
14093 __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error)
14365 __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 488, __pyx_L1_error)
1409414366 __Pyx_GOTREF(__pyx_t_2);
1409514367 __Pyx_GIVEREF(__pyx_t_1);
1409614368 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
1409814370 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
1409914371 __pyx_t_1 = 0;
1410014372 __pyx_t_4 = 0;
14101 __pyx_k__3 = __pyx_t_2;
14373 __pyx_k__9 = __pyx_t_2;
1410214374 __Pyx_GIVEREF(__pyx_t_2);
1410314375 __pyx_t_2 = 0;
14104
14105 /* "pygame_sdl2/display.pyx":469
14106 *
14107 * # The icon that's used for new windows.
14108 * default_icon = None # <<<<<<<<<<<<<<
14109 *
14110 * # The title that's used for new windows.
14111 */
14112 if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_icon, Py_None) < 0) __PYX_ERR(0, 469, __pyx_L1_error)
14113
14114 /* "pygame_sdl2/display.pyx":472
14115 *
14116 * # The title that's used for new windows.
14117 * default_title = "pygame window" # <<<<<<<<<<<<<<
14118 *
14119 * # The default gl_swap_control
14120 */
14121 if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_title, __pyx_kp_u_pygame_window) < 0) __PYX_ERR(0, 472, __pyx_L1_error)
14122
14123 /* "pygame_sdl2/display.pyx":475
14124 *
14125 * # The default gl_swap_control
14126 * default_swap_control = 1 # <<<<<<<<<<<<<<
14127 *
14128 * def set_mode(resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)):
14129 */
14130 if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_swap_control, __pyx_int_1) < 0) __PYX_ERR(0, 475, __pyx_L1_error)
14131
14132 /* "pygame_sdl2/display.pyx":477
14133 * default_swap_control = 1
14134 *
14135 * def set_mode(resolution=(0, 0), flags=0, depth=0, pos=(SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED)): # <<<<<<<<<<<<<<
14376 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_13set_mode, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 488, __pyx_L1_error)
14377 __Pyx_GOTREF(__pyx_t_2);
14378 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_mode, __pyx_t_2) < 0) __PYX_ERR(0, 488, __pyx_L1_error)
14379 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14380
14381 /* "pygame_sdl2/display.pyx":509
14382 * return main_window.surface
14383 *
14384 * def destroy(): # <<<<<<<<<<<<<<
1413614385 * global main_window
1413714386 *
1413814387 */
14139 __pyx_t_2 = __Pyx_PyInt_From_int(SDL_WINDOWPOS_UNDEFINED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 477, __pyx_L1_error)
14388 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_15destroy, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 509, __pyx_L1_error)
1414014389 __Pyx_GOTREF(__pyx_t_2);
14141 __pyx_t_4 = __Pyx_PyInt_From_int(SDL_WINDOWPOS_UNDEFINED); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 477, __pyx_L1_error)
14142 __Pyx_GOTREF(__pyx_t_4);
14143 __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 477, __pyx_L1_error)
14144 __Pyx_GOTREF(__pyx_t_1);
14145 __Pyx_GIVEREF(__pyx_t_2);
14146 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
14147 __Pyx_GIVEREF(__pyx_t_4);
14148 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
14149 __pyx_t_2 = 0;
14150 __pyx_t_4 = 0;
14151 __pyx_k__9 = __pyx_t_1;
14152 __Pyx_GIVEREF(__pyx_t_1);
14153 __pyx_t_1 = 0;
14154 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_15set_mode, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 477, __pyx_L1_error)
14155 __Pyx_GOTREF(__pyx_t_1);
14156 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_mode, __pyx_t_1) < 0) __PYX_ERR(0, 477, __pyx_L1_error)
14157 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14158
14159 /* "pygame_sdl2/display.pyx":498
14160 * return main_window.surface
14390 if (PyDict_SetItem(__pyx_d, __pyx_n_s_destroy, __pyx_t_2) < 0) __PYX_ERR(0, 509, __pyx_L1_error)
14391 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14392
14393 /* "pygame_sdl2/display.pyx":516
14394 * main_window = None
1416114395 *
1416214396 * def get_surface(): # <<<<<<<<<<<<<<
1416314397 * if main_window is None:
1416414398 * return None
1416514399 */
14166 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_17get_surface, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 498, __pyx_L1_error)
14167 __Pyx_GOTREF(__pyx_t_1);
14168 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_surface, __pyx_t_1) < 0) __PYX_ERR(0, 498, __pyx_L1_error)
14169 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14170
14171 /* "pygame_sdl2/display.pyx":504
14400 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_17get_surface, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 516, __pyx_L1_error)
14401 __Pyx_GOTREF(__pyx_t_2);
14402 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_surface, __pyx_t_2) < 0) __PYX_ERR(0, 516, __pyx_L1_error)
14403 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14404
14405 /* "pygame_sdl2/display.pyx":522
1417214406 * return main_window.get_surface()
1417314407 *
1417414408 * def get_window(): # <<<<<<<<<<<<<<
1417514409 * """
1417614410 * Returns the Window created by set_mode, or None if no such window
1417714411 */
14178 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_19get_window, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error)
14179 __Pyx_GOTREF(__pyx_t_1);
14180 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_window, __pyx_t_1) < 0) __PYX_ERR(0, 504, __pyx_L1_error)
14181 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14182
14183 /* "pygame_sdl2/display.pyx":512
14412 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_19get_window, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 522, __pyx_L1_error)
14413 __Pyx_GOTREF(__pyx_t_2);
14414 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_window, __pyx_t_2) < 0) __PYX_ERR(0, 522, __pyx_L1_error)
14415 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14416
14417 /* "pygame_sdl2/display.pyx":530
1418414418 * return main_window
1418514419 *
1418614420 * def flip(): # <<<<<<<<<<<<<<
1418714421 * if main_window:
1418814422 * main_window.flip()
1418914423 */
14190 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_21flip, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error)
14191 __Pyx_GOTREF(__pyx_t_1);
14192 if (PyDict_SetItem(__pyx_d, __pyx_n_s_flip, __pyx_t_1) < 0) __PYX_ERR(0, 512, __pyx_L1_error)
14193 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14194
14195 /* "pygame_sdl2/display.pyx":516
14424 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_21flip, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 530, __pyx_L1_error)
14425 __Pyx_GOTREF(__pyx_t_2);
14426 if (PyDict_SetItem(__pyx_d, __pyx_n_s_flip, __pyx_t_2) < 0) __PYX_ERR(0, 530, __pyx_L1_error)
14427 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14428
14429 /* "pygame_sdl2/display.pyx":534
1419614430 * main_window.flip()
1419714431 *
1419814432 * def update(rectangles=None): # <<<<<<<<<<<<<<
1419914433 * if main_window:
1420014434 * main_window.update(rectangles)
1420114435 */
14202 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_23update, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error)
14203 __Pyx_GOTREF(__pyx_t_1);
14204 if (PyDict_SetItem(__pyx_d, __pyx_n_s_update, __pyx_t_1) < 0) __PYX_ERR(0, 516, __pyx_L1_error)
14205 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14206
14207 /* "pygame_sdl2/display.pyx":520
14436 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_23update, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 534, __pyx_L1_error)
14437 __Pyx_GOTREF(__pyx_t_2);
14438 if (PyDict_SetItem(__pyx_d, __pyx_n_s_update, __pyx_t_2) < 0) __PYX_ERR(0, 534, __pyx_L1_error)
14439 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14440
14441 /* "pygame_sdl2/display.pyx":538
1420814442 * main_window.update(rectangles)
1420914443 *
1421014444 * def get_driver(): # <<<<<<<<<<<<<<
1421114445 * cdef const char *driver = SDL_GetCurrentVideoDriver()
1421214446 *
1421314447 */
14214 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_25get_driver, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error)
14215 __Pyx_GOTREF(__pyx_t_1);
14216 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_driver, __pyx_t_1) < 0) __PYX_ERR(0, 520, __pyx_L1_error)
14217 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14218
14219 /* "pygame_sdl2/display.pyx":528
14448 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_25get_driver, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 538, __pyx_L1_error)
14449 __Pyx_GOTREF(__pyx_t_2);
14450 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_driver, __pyx_t_2) < 0) __PYX_ERR(0, 538, __pyx_L1_error)
14451 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14452
14453 /* "pygame_sdl2/display.pyx":546
1422014454 * return driver
1422114455 *
1422214456 * class Info(object): # <<<<<<<<<<<<<<
1422314457 *
1422414458 * def __init__(self):
1422514459 */
14226 __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__29); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 528, __pyx_L1_error)
14227 __Pyx_GOTREF(__pyx_t_1);
14228 __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_tuple__29, __pyx_n_s_Info, __pyx_n_s_Info, (PyObject *) NULL, __pyx_n_s_pygame_sdl2_display, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 528, __pyx_L1_error)
14460 __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__28); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 546, __pyx_L1_error)
14461 __Pyx_GOTREF(__pyx_t_2);
14462 __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_tuple__28, __pyx_n_s_Info, __pyx_n_s_Info, (PyObject *) NULL, __pyx_n_s_pygame_sdl2_display, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 546, __pyx_L1_error)
1422914463 __Pyx_GOTREF(__pyx_t_4);
1423014464
14231 /* "pygame_sdl2/display.pyx":530
14465 /* "pygame_sdl2/display.pyx":548
1423214466 * class Info(object):
1423314467 *
1423414468 * def __init__(self): # <<<<<<<<<<<<<<
1423514469 * cdef SDL_DisplayMode dm
1423614470 * cdef SDL_PixelFormat *format
1423714471 */
14238 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_4Info_1__init__, 0, __pyx_n_s_Info___init, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 530, __pyx_L1_error)
14239 __Pyx_GOTREF(__pyx_t_2);
14240 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_init_2, __pyx_t_2) < 0) __PYX_ERR(0, 530, __pyx_L1_error)
14241 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14242
14243 /* "pygame_sdl2/display.pyx":589
14472 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_4Info_1__init__, 0, __pyx_n_s_Info___init, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 548, __pyx_L1_error)
14473 __Pyx_GOTREF(__pyx_t_1);
14474 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_init_2, __pyx_t_1) < 0) __PYX_ERR(0, 548, __pyx_L1_error)
14475 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14476
14477 /* "pygame_sdl2/display.pyx":607
1424414478 * self.blit_sw_A = False
1424514479 *
1424614480 * def __repr__(self): # <<<<<<<<<<<<<<
1424714481 * return "<Info({!r})>".format(self.__dict__)
1424814482 *
1424914483 */
14250 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_4Info_3__repr__, 0, __pyx_n_s_Info___repr, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 589, __pyx_L1_error)
14251 __Pyx_GOTREF(__pyx_t_2);
14252 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_repr, __pyx_t_2) < 0) __PYX_ERR(0, 589, __pyx_L1_error)
14484 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_11pygame_sdl2_7display_4Info_3__repr__, 0, __pyx_n_s_Info___repr, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 607, __pyx_L1_error)
14485 __Pyx_GOTREF(__pyx_t_1);
14486 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_repr, __pyx_t_1) < 0) __PYX_ERR(0, 607, __pyx_L1_error)
14487 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14488
14489 /* "pygame_sdl2/display.pyx":546
14490 * return driver
14491 *
14492 * class Info(object): # <<<<<<<<<<<<<<
14493 *
14494 * def __init__(self):
14495 */
14496 __pyx_t_1 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Info, __pyx_tuple__28, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 546, __pyx_L1_error)
14497 __Pyx_GOTREF(__pyx_t_1);
14498 if (PyDict_SetItem(__pyx_d, __pyx_n_s_Info, __pyx_t_1) < 0) __PYX_ERR(0, 546, __pyx_L1_error)
14499 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14500 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1425314501 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1425414502
14255 /* "pygame_sdl2/display.pyx":528
14256 * return driver
14257 *
14258 * class Info(object): # <<<<<<<<<<<<<<
14259 *
14260 * def __init__(self):
14261 */
14262 __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Info, __pyx_tuple__29, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 528, __pyx_L1_error)
14263 __Pyx_GOTREF(__pyx_t_2);
14264 if (PyDict_SetItem(__pyx_d, __pyx_n_s_Info, __pyx_t_2) < 0) __PYX_ERR(0, 528, __pyx_L1_error)
14265 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14266 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14267 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14268
14269 /* "pygame_sdl2/display.pyx":593
14503 /* "pygame_sdl2/display.pyx":611
1427014504 *
1427114505 *
1427214506 * def get_wm_info(): # <<<<<<<<<<<<<<
1427314507 * if main_window:
1427414508 * return main_window.get_wm_info()
1427514509 */
14276 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_27get_wm_info, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 593, __pyx_L1_error)
14277 __Pyx_GOTREF(__pyx_t_1);
14278 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_wm_info, __pyx_t_1) < 0) __PYX_ERR(0, 593, __pyx_L1_error)
14279 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14280
14281 /* "pygame_sdl2/display.pyx":600
14510 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_27get_wm_info, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 611, __pyx_L1_error)
14511 __Pyx_GOTREF(__pyx_t_2);
14512 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_wm_info, __pyx_t_2) < 0) __PYX_ERR(0, 611, __pyx_L1_error)
14513 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14514
14515 /* "pygame_sdl2/display.pyx":618
1428214516 *
1428314517 *
1428414518 * def get_num_video_displays(): # <<<<<<<<<<<<<<
1428514519 * """
1428614520 * Returns the number of video displays connected to the system.
1428714521 */
14288 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_29get_num_video_displays, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 600, __pyx_L1_error)
14289 __Pyx_GOTREF(__pyx_t_1);
14290 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_num_video_displays, __pyx_t_1) < 0) __PYX_ERR(0, 600, __pyx_L1_error)
14291 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14292
14293 /* "pygame_sdl2/display.pyx":613
14522 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_29get_num_video_displays, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 618, __pyx_L1_error)
14523 __Pyx_GOTREF(__pyx_t_2);
14524 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_num_video_displays, __pyx_t_2) < 0) __PYX_ERR(0, 618, __pyx_L1_error)
14525 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14526
14527 /* "pygame_sdl2/display.pyx":631
1429414528 *
1429514529 *
1429614530 * def list_modes(depth=0, flags=0, display=0): # <<<<<<<<<<<<<<
1429714531 * """
1429814532 * Returns a list of possible display modes for the display `display`.
1429914533 */
14300 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_31list_modes, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 613, __pyx_L1_error)
14301 __Pyx_GOTREF(__pyx_t_1);
14302 if (PyDict_SetItem(__pyx_d, __pyx_n_s_list_modes, __pyx_t_1) < 0) __PYX_ERR(0, 613, __pyx_L1_error)
14303 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14304
14305 /* "pygame_sdl2/display.pyx":638
14534 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_31list_modes, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 631, __pyx_L1_error)
14535 __Pyx_GOTREF(__pyx_t_2);
14536 if (PyDict_SetItem(__pyx_d, __pyx_n_s_list_modes, __pyx_t_2) < 0) __PYX_ERR(0, 631, __pyx_L1_error)
14537 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14538
14539 /* "pygame_sdl2/display.pyx":656
1430614540 *
1430714541 *
1430814542 * def mode_ok(size, flags=0, depth=0): # <<<<<<<<<<<<<<
1430914543 * """
1431014544 * Returns true if size is in the result of list_modes().
1431114545 */
14312 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_33mode_ok, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 638, __pyx_L1_error)
14313 __Pyx_GOTREF(__pyx_t_1);
14314 if (PyDict_SetItem(__pyx_d, __pyx_n_s_mode_ok, __pyx_t_1) < 0) __PYX_ERR(0, 638, __pyx_L1_error)
14315 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14316
14317 /* "pygame_sdl2/display.pyx":645
14546 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_33mode_ok, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 656, __pyx_L1_error)
14547 __Pyx_GOTREF(__pyx_t_2);
14548 if (PyDict_SetItem(__pyx_d, __pyx_n_s_mode_ok, __pyx_t_2) < 0) __PYX_ERR(0, 656, __pyx_L1_error)
14549 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14550
14551 /* "pygame_sdl2/display.pyx":663
1431814552 * return tuple(size) in list_modes()
1431914553 *
1432014554 * def gl_reset_attributes(): # <<<<<<<<<<<<<<
1432114555 * SDL_GL_ResetAttributes()
1432214556 *
1432314557 */
14324 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_35gl_reset_attributes, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 645, __pyx_L1_error)
14325 __Pyx_GOTREF(__pyx_t_1);
14326 if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_reset_attributes, __pyx_t_1) < 0) __PYX_ERR(0, 645, __pyx_L1_error)
14327 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14328
14329 /* "pygame_sdl2/display.pyx":648
14558 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_35gl_reset_attributes, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error)
14559 __Pyx_GOTREF(__pyx_t_2);
14560 if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_reset_attributes, __pyx_t_2) < 0) __PYX_ERR(0, 663, __pyx_L1_error)
14561 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14562
14563 /* "pygame_sdl2/display.pyx":666
1433014564 * SDL_GL_ResetAttributes()
1433114565 *
1433214566 * def gl_set_attribute(flag, value): # <<<<<<<<<<<<<<
1433314567 *
1433414568 * if flag == GL_SWAP_CONTROL:
1433514569 */
14336 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_37gl_set_attribute, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 648, __pyx_L1_error)
14337 __Pyx_GOTREF(__pyx_t_1);
14338 if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_set_attribute, __pyx_t_1) < 0) __PYX_ERR(0, 648, __pyx_L1_error)
14339 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14340
14341 /* "pygame_sdl2/display.pyx":668
14570 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_37gl_set_attribute, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 666, __pyx_L1_error)
14571 __Pyx_GOTREF(__pyx_t_2);
14572 if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_set_attribute, __pyx_t_2) < 0) __PYX_ERR(0, 666, __pyx_L1_error)
14573 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14574
14575 /* "pygame_sdl2/display.pyx":686
1434214576 * raise error()
1434314577 *
1434414578 * def gl_get_attribute(flag): # <<<<<<<<<<<<<<
1434514579 * cdef int rv
1434614580 *
1434714581 */
14348 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_39gl_get_attribute, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error)
14349 __Pyx_GOTREF(__pyx_t_1);
14350 if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_get_attribute, __pyx_t_1) < 0) __PYX_ERR(0, 668, __pyx_L1_error)
14351 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14352
14353 /* "pygame_sdl2/display.pyx":679
14582 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_39gl_get_attribute, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 686, __pyx_L1_error)
14583 __Pyx_GOTREF(__pyx_t_2);
14584 if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_get_attribute, __pyx_t_2) < 0) __PYX_ERR(0, 686, __pyx_L1_error)
14585 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14586
14587 /* "pygame_sdl2/display.pyx":697
1435414588 * return rv
1435514589 *
1435614590 * def gl_load_library(path): # <<<<<<<<<<<<<<
1435714591 * if path is None:
1435814592 * if SDL_GL_LoadLibrary(NULL):
1435914593 */
14360 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_41gl_load_library, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 679, __pyx_L1_error)
14361 __Pyx_GOTREF(__pyx_t_1);
14362 if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_load_library, __pyx_t_1) < 0) __PYX_ERR(0, 679, __pyx_L1_error)
14363 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14364
14365 /* "pygame_sdl2/display.pyx":687
14594 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_41gl_load_library, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 697, __pyx_L1_error)
14595 __Pyx_GOTREF(__pyx_t_2);
14596 if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_load_library, __pyx_t_2) < 0) __PYX_ERR(0, 697, __pyx_L1_error)
14597 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14598
14599 /* "pygame_sdl2/display.pyx":705
1436614600 * raise error()
1436714601 *
1436814602 * def gl_unload_library(): # <<<<<<<<<<<<<<
1436914603 * SDL_GL_UnloadLibrary()
1437014604 *
1437114605 */
14372 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_43gl_unload_library, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 687, __pyx_L1_error)
14373 __Pyx_GOTREF(__pyx_t_1);
14374 if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_unload_library, __pyx_t_1) < 0) __PYX_ERR(0, 687, __pyx_L1_error)
14375 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14376
14377 /* "pygame_sdl2/display.pyx":690
14606 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_43gl_unload_library, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 705, __pyx_L1_error)
14607 __Pyx_GOTREF(__pyx_t_2);
14608 if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_unload_library, __pyx_t_2) < 0) __PYX_ERR(0, 705, __pyx_L1_error)
14609 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14610
14611 /* "pygame_sdl2/display.pyx":708
1437814612 * SDL_GL_UnloadLibrary()
1437914613 *
1438014614 * def get_active(): # <<<<<<<<<<<<<<
1438114615 * if main_window:
1438214616 * return main_window.get_active()
1438314617 */
14384 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_45get_active, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 690, __pyx_L1_error)
14385 __Pyx_GOTREF(__pyx_t_1);
14386 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_active, __pyx_t_1) < 0) __PYX_ERR(0, 690, __pyx_L1_error)
14387 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14388
14389 /* "pygame_sdl2/display.pyx":695
14618 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_45get_active, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 708, __pyx_L1_error)
14619 __Pyx_GOTREF(__pyx_t_2);
14620 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_active, __pyx_t_2) < 0) __PYX_ERR(0, 708, __pyx_L1_error)
14621 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14622
14623 /* "pygame_sdl2/display.pyx":713
1439014624 * return False
1439114625 *
1439214626 * def iconify(): # <<<<<<<<<<<<<<
1439314627 * if main_window:
1439414628 * return main_window.iconify()
1439514629 */
14396 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_47iconify, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 695, __pyx_L1_error)
14397 __Pyx_GOTREF(__pyx_t_1);
14398 if (PyDict_SetItem(__pyx_d, __pyx_n_s_iconify, __pyx_t_1) < 0) __PYX_ERR(0, 695, __pyx_L1_error)
14399 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14400
14401 /* "pygame_sdl2/display.pyx":701
14630 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_47iconify, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 713, __pyx_L1_error)
14631 __Pyx_GOTREF(__pyx_t_2);
14632 if (PyDict_SetItem(__pyx_d, __pyx_n_s_iconify, __pyx_t_2) < 0) __PYX_ERR(0, 713, __pyx_L1_error)
14633 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14634
14635 /* "pygame_sdl2/display.pyx":719
1440214636 * return False
1440314637 *
1440414638 * def toggle_fullscreen(): # <<<<<<<<<<<<<<
1440514639 * if main_window:
1440614640 * return main_window.toggle_fullscreen()
1440714641 */
14408 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_49toggle_fullscreen, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 701, __pyx_L1_error)
14409 __Pyx_GOTREF(__pyx_t_1);
14410 if (PyDict_SetItem(__pyx_d, __pyx_n_s_toggle_fullscreen, __pyx_t_1) < 0) __PYX_ERR(0, 701, __pyx_L1_error)
14411 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14412
14413 /* "pygame_sdl2/display.pyx":707
14642 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_49toggle_fullscreen, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 719, __pyx_L1_error)
14643 __Pyx_GOTREF(__pyx_t_2);
14644 if (PyDict_SetItem(__pyx_d, __pyx_n_s_toggle_fullscreen, __pyx_t_2) < 0) __PYX_ERR(0, 719, __pyx_L1_error)
14645 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14646
14647 /* "pygame_sdl2/display.pyx":725
1441414648 * return True
1441514649 *
1441614650 * def set_gamma(red, green=None, blue=None): # <<<<<<<<<<<<<<
1441714651 * if main_window:
1441814652 * return main_window.set_gamma(red, green, blue)
1441914653 */
14420 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_51set_gamma, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 707, __pyx_L1_error)
14421 __Pyx_GOTREF(__pyx_t_1);
14422 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_gamma, __pyx_t_1) < 0) __PYX_ERR(0, 707, __pyx_L1_error)
14423 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14424
14425 /* "pygame_sdl2/display.pyx":712
14654 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_51set_gamma, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 725, __pyx_L1_error)
14655 __Pyx_GOTREF(__pyx_t_2);
14656 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_gamma, __pyx_t_2) < 0) __PYX_ERR(0, 725, __pyx_L1_error)
14657 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14658
14659 /* "pygame_sdl2/display.pyx":730
1442614660 * return False
1442714661 *
1442814662 * def set_gamma_ramp(red, green, blue): # <<<<<<<<<<<<<<
1442914663 * if main_window:
1443014664 * return main_window.set_gamma_ramp(red, green, blue)
1443114665 */
14432 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_53set_gamma_ramp, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 712, __pyx_L1_error)
14433 __Pyx_GOTREF(__pyx_t_1);
14434 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_gamma_ramp, __pyx_t_1) < 0) __PYX_ERR(0, 712, __pyx_L1_error)
14435 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14436
14437 /* "pygame_sdl2/display.pyx":717
14666 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_53set_gamma_ramp, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L1_error)
14667 __Pyx_GOTREF(__pyx_t_2);
14668 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_gamma_ramp, __pyx_t_2) < 0) __PYX_ERR(0, 730, __pyx_L1_error)
14669 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14670
14671 /* "pygame_sdl2/display.pyx":735
1443814672 * return False
1443914673 *
1444014674 * def set_icon(surface): # <<<<<<<<<<<<<<
1444114675 * global default_icon
1444214676 *
1444314677 */
14444 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_55set_icon, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 717, __pyx_L1_error)
14445 __Pyx_GOTREF(__pyx_t_1);
14446 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_icon, __pyx_t_1) < 0) __PYX_ERR(0, 717, __pyx_L1_error)
14447 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14448
14449 /* "pygame_sdl2/display.pyx":725
14678 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_55set_icon, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 735, __pyx_L1_error)
14679 __Pyx_GOTREF(__pyx_t_2);
14680 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_icon, __pyx_t_2) < 0) __PYX_ERR(0, 735, __pyx_L1_error)
14681 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14682
14683 /* "pygame_sdl2/display.pyx":743
1445014684 * main_window.set_icon(default_icon)
1445114685 *
1445214686 * def set_caption(title, icontitle = None): # <<<<<<<<<<<<<<
1445314687 * global default_title
1445414688 *
1445514689 */
14456 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_57set_caption, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 725, __pyx_L1_error)
14457 __Pyx_GOTREF(__pyx_t_1);
14458 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_caption, __pyx_t_1) < 0) __PYX_ERR(0, 725, __pyx_L1_error)
14459 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14460
14461 /* "pygame_sdl2/display.pyx":733
14690 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_57set_caption, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 743, __pyx_L1_error)
14691 __Pyx_GOTREF(__pyx_t_2);
14692 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_caption, __pyx_t_2) < 0) __PYX_ERR(0, 743, __pyx_L1_error)
14693 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14694
14695 /* "pygame_sdl2/display.pyx":751
1446214696 * main_window.set_caption(default_title)
1446314697 *
1446414698 * def get_caption(): # <<<<<<<<<<<<<<
1446514699 * return default_title
1446614700 *
1446714701 */
14468 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_59get_caption, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 733, __pyx_L1_error)
14469 __Pyx_GOTREF(__pyx_t_1);
14470 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_caption, __pyx_t_1) < 0) __PYX_ERR(0, 733, __pyx_L1_error)
14471 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14472
14473 /* "pygame_sdl2/display.pyx":736
14702 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_59get_caption, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 751, __pyx_L1_error)
14703 __Pyx_GOTREF(__pyx_t_2);
14704 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_caption, __pyx_t_2) < 0) __PYX_ERR(0, 751, __pyx_L1_error)
14705 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14706
14707 /* "pygame_sdl2/display.pyx":754
1447414708 * return default_title
1447514709 *
1447614710 * def get_drawable_size(): # <<<<<<<<<<<<<<
1447714711 * if main_window:
1447814712 * return main_window.get_drawable_size()
1447914713 */
14480 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_61get_drawable_size, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 736, __pyx_L1_error)
14481 __Pyx_GOTREF(__pyx_t_1);
14482 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_drawable_size, __pyx_t_1) < 0) __PYX_ERR(0, 736, __pyx_L1_error)
14483 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14484
14485 /* "pygame_sdl2/display.pyx":741
14714 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_61get_drawable_size, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 754, __pyx_L1_error)
14715 __Pyx_GOTREF(__pyx_t_2);
14716 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_drawable_size, __pyx_t_2) < 0) __PYX_ERR(0, 754, __pyx_L1_error)
14717 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14718
14719 /* "pygame_sdl2/display.pyx":759
1448614720 * return None
1448714721 *
1448814722 * def get_size(): # <<<<<<<<<<<<<<
1448914723 * if main_window:
1449014724 * return main_window.get_size()
1449114725 */
14492 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_63get_size, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 741, __pyx_L1_error)
14493 __Pyx_GOTREF(__pyx_t_1);
14494 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_size, __pyx_t_1) < 0) __PYX_ERR(0, 741, __pyx_L1_error)
14495 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14496
14497 /* "pygame_sdl2/display.pyx":746
14726 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_63get_size, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 759, __pyx_L1_error)
14727 __Pyx_GOTREF(__pyx_t_2);
14728 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_size, __pyx_t_2) < 0) __PYX_ERR(0, 759, __pyx_L1_error)
14729 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14730
14731 /* "pygame_sdl2/display.pyx":764
1449814732 * return None
1449914733 *
1450014734 * def get_num_video_displays(): # <<<<<<<<<<<<<<
1450114735 * rv = SDL_GetNumVideoDisplays()
1450214736 * if rv < 0:
1450314737 */
14504 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_65get_num_video_displays, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 746, __pyx_L1_error)
14505 __Pyx_GOTREF(__pyx_t_1);
14506 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_num_video_displays, __pyx_t_1) < 0) __PYX_ERR(0, 746, __pyx_L1_error)
14507 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14508
14509 /* "pygame_sdl2/display.pyx":753
14738 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_65get_num_video_displays, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 764, __pyx_L1_error)
14739 __Pyx_GOTREF(__pyx_t_2);
14740 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_num_video_displays, __pyx_t_2) < 0) __PYX_ERR(0, 764, __pyx_L1_error)
14741 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14742
14743 /* "pygame_sdl2/display.pyx":771
1451014744 * return rv
1451114745 *
1451214746 * def get_display_bounds(index): # <<<<<<<<<<<<<<
1451314747 * cdef SDL_Rect rect
1451414748 * rv = SDL_GetDisplayBounds(index, &rect)
1451514749 */
14516 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_67get_display_bounds, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 753, __pyx_L1_error)
14517 __Pyx_GOTREF(__pyx_t_1);
14518 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_display_bounds, __pyx_t_1) < 0) __PYX_ERR(0, 753, __pyx_L1_error)
14519 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14520
14521 /* "pygame_sdl2/display.pyx":759
14750 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_67get_display_bounds, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 771, __pyx_L1_error)
14751 __Pyx_GOTREF(__pyx_t_2);
14752 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_display_bounds, __pyx_t_2) < 0) __PYX_ERR(0, 771, __pyx_L1_error)
14753 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14754
14755 /* "pygame_sdl2/display.pyx":777
1452214756 * return (rect.x, rect.y, rect.w, rect.h)
1452314757 *
1452414758 * def set_screensaver(state): # <<<<<<<<<<<<<<
1452514759 * """
1452614760 * Sets the screenslaver to `state`.
1452714761 */
14528 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_69set_screensaver, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 759, __pyx_L1_error)
14529 __Pyx_GOTREF(__pyx_t_1);
14530 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_screensaver, __pyx_t_1) < 0) __PYX_ERR(0, 759, __pyx_L1_error)
14531 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14532
14533 /* "pygame_sdl2/display.pyx":769
14762 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_69set_screensaver, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 777, __pyx_L1_error)
14763 __Pyx_GOTREF(__pyx_t_2);
14764 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_screensaver, __pyx_t_2) < 0) __PYX_ERR(0, 777, __pyx_L1_error)
14765 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14766
14767 /* "pygame_sdl2/display.pyx":787
1453414768 * SDL_DisableScreenSaver()
1453514769 *
1453614770 * def get_platform(): # <<<<<<<<<<<<<<
1453714771 * return SDL_GetPlatform()
1453814772 *
1453914773 */
14540 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_71get_platform, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 769, __pyx_L1_error)
14541 __Pyx_GOTREF(__pyx_t_1);
14542 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_platform, __pyx_t_1) < 0) __PYX_ERR(0, 769, __pyx_L1_error)
14543 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14774 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_71get_platform, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 787, __pyx_L1_error)
14775 __Pyx_GOTREF(__pyx_t_2);
14776 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_platform, __pyx_t_2) < 0) __PYX_ERR(0, 787, __pyx_L1_error)
14777 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1454414778
1454514779 /* "pygame_sdl2/display.pyx":1
1454614780 * # Copyright 2014 Patrick Dawson <pat@dw.is> # <<<<<<<<<<<<<<
1454714781 * # Copyright 2014 Tom Rothamel <tom@rothamel.us>
1454814782 * #
1454914783 */
14550 __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
14551 __Pyx_GOTREF(__pyx_t_1);
14552 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
14553 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14784 __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
14785 __Pyx_GOTREF(__pyx_t_2);
14786 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
14787 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1455414788
1455514789 /*--- Wrapped vars code ---*/
1455614790
1542815662 }
1542915663 #endif
1543015664
15665 /* GetTopmostException */
15666 #if CYTHON_USE_EXC_INFO_STACK
15667 static _PyErr_StackItem *
15668 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
15669 {
15670 _PyErr_StackItem *exc_info = tstate->exc_info;
15671 while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
15672 exc_info->previous_item != NULL)
15673 {
15674 exc_info = exc_info->previous_item;
15675 }
15676 return exc_info;
15677 }
15678 #endif
15679
15680 /* SaveResetException */
15681 #if CYTHON_FAST_THREAD_STATE
15682 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
15683 #if CYTHON_USE_EXC_INFO_STACK
15684 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
15685 *type = exc_info->exc_type;
15686 *value = exc_info->exc_value;
15687 *tb = exc_info->exc_traceback;
15688 #else
15689 *type = tstate->exc_type;
15690 *value = tstate->exc_value;
15691 *tb = tstate->exc_traceback;
15692 #endif
15693 Py_XINCREF(*type);
15694 Py_XINCREF(*value);
15695 Py_XINCREF(*tb);
15696 }
15697 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
15698 PyObject *tmp_type, *tmp_value, *tmp_tb;
15699 #if CYTHON_USE_EXC_INFO_STACK
15700 _PyErr_StackItem *exc_info = tstate->exc_info;
15701 tmp_type = exc_info->exc_type;
15702 tmp_value = exc_info->exc_value;
15703 tmp_tb = exc_info->exc_traceback;
15704 exc_info->exc_type = type;
15705 exc_info->exc_value = value;
15706 exc_info->exc_traceback = tb;
15707 #else
15708 tmp_type = tstate->exc_type;
15709 tmp_value = tstate->exc_value;
15710 tmp_tb = tstate->exc_traceback;
15711 tstate->exc_type = type;
15712 tstate->exc_value = value;
15713 tstate->exc_traceback = tb;
15714 #endif
15715 Py_XDECREF(tmp_type);
15716 Py_XDECREF(tmp_value);
15717 Py_XDECREF(tmp_tb);
15718 }
15719 #endif
15720
15721 /* GetException */
15722 #if CYTHON_FAST_THREAD_STATE
15723 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
15724 #else
15725 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
15726 #endif
15727 {
15728 PyObject *local_type, *local_value, *local_tb;
15729 #if CYTHON_FAST_THREAD_STATE
15730 PyObject *tmp_type, *tmp_value, *tmp_tb;
15731 local_type = tstate->curexc_type;
15732 local_value = tstate->curexc_value;
15733 local_tb = tstate->curexc_traceback;
15734 tstate->curexc_type = 0;
15735 tstate->curexc_value = 0;
15736 tstate->curexc_traceback = 0;
15737 #else
15738 PyErr_Fetch(&local_type, &local_value, &local_tb);
15739 #endif
15740 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
15741 #if CYTHON_FAST_THREAD_STATE
15742 if (unlikely(tstate->curexc_type))
15743 #else
15744 if (unlikely(PyErr_Occurred()))
15745 #endif
15746 goto bad;
15747 #if PY_MAJOR_VERSION >= 3
15748 if (local_tb) {
15749 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
15750 goto bad;
15751 }
15752 #endif
15753 Py_XINCREF(local_tb);
15754 Py_XINCREF(local_type);
15755 Py_XINCREF(local_value);
15756 *type = local_type;
15757 *value = local_value;
15758 *tb = local_tb;
15759 #if CYTHON_FAST_THREAD_STATE
15760 #if CYTHON_USE_EXC_INFO_STACK
15761 {
15762 _PyErr_StackItem *exc_info = tstate->exc_info;
15763 tmp_type = exc_info->exc_type;
15764 tmp_value = exc_info->exc_value;
15765 tmp_tb = exc_info->exc_traceback;
15766 exc_info->exc_type = local_type;
15767 exc_info->exc_value = local_value;
15768 exc_info->exc_traceback = local_tb;
15769 }
15770 #else
15771 tmp_type = tstate->exc_type;
15772 tmp_value = tstate->exc_value;
15773 tmp_tb = tstate->exc_traceback;
15774 tstate->exc_type = local_type;
15775 tstate->exc_value = local_value;
15776 tstate->exc_traceback = local_tb;
15777 #endif
15778 Py_XDECREF(tmp_type);
15779 Py_XDECREF(tmp_value);
15780 Py_XDECREF(tmp_tb);
15781 #else
15782 PyErr_SetExcInfo(local_type, local_value, local_tb);
15783 #endif
15784 return 0;
15785 bad:
15786 *type = 0;
15787 *value = 0;
15788 *tb = 0;
15789 Py_XDECREF(local_type);
15790 Py_XDECREF(local_value);
15791 Py_XDECREF(local_tb);
15792 return -1;
15793 }
15794
15795 /* RaiseTooManyValuesToUnpack */
15796 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
15797 PyErr_Format(PyExc_ValueError,
15798 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
15799 }
15800
15801 /* RaiseNeedMoreValuesToUnpack */
15802 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
15803 PyErr_Format(PyExc_ValueError,
15804 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
15805 index, (index == 1) ? "" : "s");
15806 }
15807
15808 /* IterFinish */
15809 static CYTHON_INLINE int __Pyx_IterFinish(void) {
15810 #if CYTHON_FAST_THREAD_STATE
15811 PyThreadState *tstate = __Pyx_PyThreadState_Current;
15812 PyObject* exc_type = tstate->curexc_type;
15813 if (unlikely(exc_type)) {
15814 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
15815 PyObject *exc_value, *exc_tb;
15816 exc_value = tstate->curexc_value;
15817 exc_tb = tstate->curexc_traceback;
15818 tstate->curexc_type = 0;
15819 tstate->curexc_value = 0;
15820 tstate->curexc_traceback = 0;
15821 Py_DECREF(exc_type);
15822 Py_XDECREF(exc_value);
15823 Py_XDECREF(exc_tb);
15824 return 0;
15825 } else {
15826 return -1;
15827 }
15828 }
15829 return 0;
15830 #else
15831 if (unlikely(PyErr_Occurred())) {
15832 if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
15833 PyErr_Clear();
15834 return 0;
15835 } else {
15836 return -1;
15837 }
15838 }
15839 return 0;
15840 #endif
15841 }
15842
15843 /* UnpackItemEndCheck */
15844 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
15845 if (unlikely(retval)) {
15846 Py_DECREF(retval);
15847 __Pyx_RaiseTooManyValuesError(expected);
15848 return -1;
15849 } else {
15850 return __Pyx_IterFinish();
15851 }
15852 return 0;
15853 }
15854
15855 /* SwapException */
15856 #if CYTHON_FAST_THREAD_STATE
15857 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
15858 PyObject *tmp_type, *tmp_value, *tmp_tb;
15859 #if CYTHON_USE_EXC_INFO_STACK
15860 _PyErr_StackItem *exc_info = tstate->exc_info;
15861 tmp_type = exc_info->exc_type;
15862 tmp_value = exc_info->exc_value;
15863 tmp_tb = exc_info->exc_traceback;
15864 exc_info->exc_type = *type;
15865 exc_info->exc_value = *value;
15866 exc_info->exc_traceback = *tb;
15867 #else
15868 tmp_type = tstate->exc_type;
15869 tmp_value = tstate->exc_value;
15870 tmp_tb = tstate->exc_traceback;
15871 tstate->exc_type = *type;
15872 tstate->exc_value = *value;
15873 tstate->exc_traceback = *tb;
15874 #endif
15875 *type = tmp_type;
15876 *value = tmp_value;
15877 *tb = tmp_tb;
15878 }
15879 #else
15880 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
15881 PyObject *tmp_type, *tmp_value, *tmp_tb;
15882 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
15883 PyErr_SetExcInfo(*type, *value, *tb);
15884 *type = tmp_type;
15885 *value = tmp_value;
15886 *tb = tmp_tb;
15887 }
15888 #endif
15889
15890 /* ArgTypeTest */
15891 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
15892 {
15893 if (unlikely(!type)) {
15894 PyErr_SetString(PyExc_SystemError, "Missing type object");
15895 return 0;
15896 }
15897 else if (exact) {
15898 #if PY_MAJOR_VERSION == 2
15899 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
15900 #endif
15901 }
15902 else {
15903 if (likely(__Pyx_TypeCheck(obj, type))) return 1;
15904 }
15905 PyErr_Format(PyExc_TypeError,
15906 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
15907 name, type->tp_name, Py_TYPE(obj)->tp_name);
15908 return 0;
15909 }
15910
1543115911 /* Import */
1543215912 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
1543315913 PyObject *empty_list = 0;
1549315973 return module;
1549415974 }
1549515975
15496 /* GetTopmostException */
15497 #if CYTHON_USE_EXC_INFO_STACK
15498 static _PyErr_StackItem *
15499 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
15500 {
15501 _PyErr_StackItem *exc_info = tstate->exc_info;
15502 while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
15503 exc_info->previous_item != NULL)
15504 {
15505 exc_info = exc_info->previous_item;
15506 }
15507 return exc_info;
15508 }
15509 #endif
15510
15511 /* SaveResetException */
15512 #if CYTHON_FAST_THREAD_STATE
15513 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
15514 #if CYTHON_USE_EXC_INFO_STACK
15515 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
15516 *type = exc_info->exc_type;
15517 *value = exc_info->exc_value;
15518 *tb = exc_info->exc_traceback;
15519 #else
15520 *type = tstate->exc_type;
15521 *value = tstate->exc_value;
15522 *tb = tstate->exc_traceback;
15523 #endif
15524 Py_XINCREF(*type);
15525 Py_XINCREF(*value);
15526 Py_XINCREF(*tb);
15527 }
15528 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
15529 PyObject *tmp_type, *tmp_value, *tmp_tb;
15530 #if CYTHON_USE_EXC_INFO_STACK
15531 _PyErr_StackItem *exc_info = tstate->exc_info;
15532 tmp_type = exc_info->exc_type;
15533 tmp_value = exc_info->exc_value;
15534 tmp_tb = exc_info->exc_traceback;
15535 exc_info->exc_type = type;
15536 exc_info->exc_value = value;
15537 exc_info->exc_traceback = tb;
15538 #else
15539 tmp_type = tstate->exc_type;
15540 tmp_value = tstate->exc_value;
15541 tmp_tb = tstate->exc_traceback;
15542 tstate->exc_type = type;
15543 tstate->exc_value = value;
15544 tstate->exc_traceback = tb;
15545 #endif
15546 Py_XDECREF(tmp_type);
15547 Py_XDECREF(tmp_value);
15548 Py_XDECREF(tmp_tb);
15549 }
15550 #endif
15551
15552 /* PyErrExceptionMatches */
15553 #if CYTHON_FAST_THREAD_STATE
15554 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
15555 Py_ssize_t i, n;
15556 n = PyTuple_GET_SIZE(tuple);
15557 #if PY_MAJOR_VERSION >= 3
15558 for (i=0; i<n; i++) {
15559 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
15560 }
15561 #endif
15562 for (i=0; i<n; i++) {
15563 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
15564 }
15565 return 0;
15566 }
15567 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
15568 PyObject *exc_type = tstate->curexc_type;
15569 if (exc_type == err) return 1;
15570 if (unlikely(!exc_type)) return 0;
15571 if (unlikely(PyTuple_Check(err)))
15572 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
15573 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
15574 }
15575 #endif
15576
15577 /* GetException */
15578 #if CYTHON_FAST_THREAD_STATE
15579 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
15580 #else
15581 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
15582 #endif
15583 {
15584 PyObject *local_type, *local_value, *local_tb;
15585 #if CYTHON_FAST_THREAD_STATE
15586 PyObject *tmp_type, *tmp_value, *tmp_tb;
15587 local_type = tstate->curexc_type;
15588 local_value = tstate->curexc_value;
15589 local_tb = tstate->curexc_traceback;
15590 tstate->curexc_type = 0;
15591 tstate->curexc_value = 0;
15592 tstate->curexc_traceback = 0;
15593 #else
15594 PyErr_Fetch(&local_type, &local_value, &local_tb);
15595 #endif
15596 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
15597 #if CYTHON_FAST_THREAD_STATE
15598 if (unlikely(tstate->curexc_type))
15599 #else
15600 if (unlikely(PyErr_Occurred()))
15601 #endif
15602 goto bad;
15603 #if PY_MAJOR_VERSION >= 3
15604 if (local_tb) {
15605 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
15606 goto bad;
15607 }
15608 #endif
15609 Py_XINCREF(local_tb);
15610 Py_XINCREF(local_type);
15611 Py_XINCREF(local_value);
15612 *type = local_type;
15613 *value = local_value;
15614 *tb = local_tb;
15615 #if CYTHON_FAST_THREAD_STATE
15616 #if CYTHON_USE_EXC_INFO_STACK
15617 {
15618 _PyErr_StackItem *exc_info = tstate->exc_info;
15619 tmp_type = exc_info->exc_type;
15620 tmp_value = exc_info->exc_value;
15621 tmp_tb = exc_info->exc_traceback;
15622 exc_info->exc_type = local_type;
15623 exc_info->exc_value = local_value;
15624 exc_info->exc_traceback = local_tb;
15625 }
15626 #else
15627 tmp_type = tstate->exc_type;
15628 tmp_value = tstate->exc_value;
15629 tmp_tb = tstate->exc_traceback;
15630 tstate->exc_type = local_type;
15631 tstate->exc_value = local_value;
15632 tstate->exc_traceback = local_tb;
15633 #endif
15634 Py_XDECREF(tmp_type);
15635 Py_XDECREF(tmp_value);
15636 Py_XDECREF(tmp_tb);
15637 #else
15638 PyErr_SetExcInfo(local_type, local_value, local_tb);
15639 #endif
15640 return 0;
15641 bad:
15642 *type = 0;
15643 *value = 0;
15644 *tb = 0;
15645 Py_XDECREF(local_type);
15646 Py_XDECREF(local_value);
15647 Py_XDECREF(local_tb);
15648 return -1;
15649 }
15650
15651 /* RaiseTooManyValuesToUnpack */
15652 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
15653 PyErr_Format(PyExc_ValueError,
15654 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
15655 }
15656
15657 /* RaiseNeedMoreValuesToUnpack */
15658 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
15659 PyErr_Format(PyExc_ValueError,
15660 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
15661 index, (index == 1) ? "" : "s");
15662 }
15663
15664 /* IterFinish */
15665 static CYTHON_INLINE int __Pyx_IterFinish(void) {
15666 #if CYTHON_FAST_THREAD_STATE
15667 PyThreadState *tstate = __Pyx_PyThreadState_Current;
15668 PyObject* exc_type = tstate->curexc_type;
15669 if (unlikely(exc_type)) {
15670 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
15671 PyObject *exc_value, *exc_tb;
15672 exc_value = tstate->curexc_value;
15673 exc_tb = tstate->curexc_traceback;
15674 tstate->curexc_type = 0;
15675 tstate->curexc_value = 0;
15676 tstate->curexc_traceback = 0;
15677 Py_DECREF(exc_type);
15678 Py_XDECREF(exc_value);
15679 Py_XDECREF(exc_tb);
15680 return 0;
15681 } else {
15682 return -1;
15683 }
15684 }
15685 return 0;
15686 #else
15687 if (unlikely(PyErr_Occurred())) {
15688 if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
15689 PyErr_Clear();
15690 return 0;
15691 } else {
15692 return -1;
15693 }
15694 }
15695 return 0;
15696 #endif
15697 }
15698
15699 /* UnpackItemEndCheck */
15700 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
15701 if (unlikely(retval)) {
15702 Py_DECREF(retval);
15703 __Pyx_RaiseTooManyValuesError(expected);
15704 return -1;
15705 } else {
15706 return __Pyx_IterFinish();
15707 }
15708 return 0;
15709 }
15710
15711 /* SwapException */
15712 #if CYTHON_FAST_THREAD_STATE
15713 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
15714 PyObject *tmp_type, *tmp_value, *tmp_tb;
15715 #if CYTHON_USE_EXC_INFO_STACK
15716 _PyErr_StackItem *exc_info = tstate->exc_info;
15717 tmp_type = exc_info->exc_type;
15718 tmp_value = exc_info->exc_value;
15719 tmp_tb = exc_info->exc_traceback;
15720 exc_info->exc_type = *type;
15721 exc_info->exc_value = *value;
15722 exc_info->exc_traceback = *tb;
15723 #else
15724 tmp_type = tstate->exc_type;
15725 tmp_value = tstate->exc_value;
15726 tmp_tb = tstate->exc_traceback;
15727 tstate->exc_type = *type;
15728 tstate->exc_value = *value;
15729 tstate->exc_traceback = *tb;
15730 #endif
15731 *type = tmp_type;
15732 *value = tmp_value;
15733 *tb = tmp_tb;
15734 }
15735 #else
15736 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
15737 PyObject *tmp_type, *tmp_value, *tmp_tb;
15738 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
15739 PyErr_SetExcInfo(*type, *value, *tb);
15740 *type = tmp_type;
15741 *value = tmp_value;
15742 *tb = tmp_tb;
15743 }
15744 #endif
15745
15746 /* ArgTypeTest */
15747 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
15748 {
15749 if (unlikely(!type)) {
15750 PyErr_SetString(PyExc_SystemError, "Missing type object");
15751 return 0;
15752 }
15753 else if (exact) {
15754 #if PY_MAJOR_VERSION == 2
15755 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
15756 #endif
15757 }
15758 else {
15759 if (likely(__Pyx_TypeCheck(obj, type))) return 1;
15760 }
15761 PyErr_Format(PyExc_TypeError,
15762 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
15763 name, type->tp_name, Py_TYPE(obj)->tp_name);
15764 return 0;
15765 }
15766
1576715976 /* ExtTypeTest */
1576815977 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
1576915978 if (unlikely(!type)) {
1583816047 return PyObject_GenericGetAttr(obj, attr_name);
1583916048 }
1584016049 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
16050 }
16051 #endif
16052
16053 /* PyErrExceptionMatches */
16054 #if CYTHON_FAST_THREAD_STATE
16055 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
16056 Py_ssize_t i, n;
16057 n = PyTuple_GET_SIZE(tuple);
16058 #if PY_MAJOR_VERSION >= 3
16059 for (i=0; i<n; i++) {
16060 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
16061 }
16062 #endif
16063 for (i=0; i<n; i++) {
16064 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
16065 }
16066 return 0;
16067 }
16068 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
16069 PyObject *exc_type = tstate->curexc_type;
16070 if (exc_type == err) return 1;
16071 if (unlikely(!exc_type)) return 0;
16072 if (unlikely(PyTuple_Check(err)))
16073 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
16074 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
1584116075 }
1584216076 #endif
1584316077
1715117385 int one = 1; int little = (int)*(unsigned char *)&one;
1715217386 unsigned char *bytes = (unsigned char *)&value;
1715317387 return _PyLong_FromByteArray(bytes, sizeof(uint32_t),
17388 little, !is_unsigned);
17389 }
17390 }
17391
17392 /* CIntToPy */
17393 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_long(unsigned long value) {
17394 const unsigned long neg_one = (unsigned long) ((unsigned long) 0 - (unsigned long) 1), const_zero = (unsigned long) 0;
17395 const int is_unsigned = neg_one > const_zero;
17396 if (is_unsigned) {
17397 if (sizeof(unsigned long) < sizeof(long)) {
17398 return PyInt_FromLong((long) value);
17399 } else if (sizeof(unsigned long) <= sizeof(unsigned long)) {
17400 return PyLong_FromUnsignedLong((unsigned long) value);
17401 #ifdef HAVE_LONG_LONG
17402 } else if (sizeof(unsigned long) <= sizeof(unsigned PY_LONG_LONG)) {
17403 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
17404 #endif
17405 }
17406 } else {
17407 if (sizeof(unsigned long) <= sizeof(long)) {
17408 return PyInt_FromLong((long) value);
17409 #ifdef HAVE_LONG_LONG
17410 } else if (sizeof(unsigned long) <= sizeof(PY_LONG_LONG)) {
17411 return PyLong_FromLongLong((PY_LONG_LONG) value);
17412 #endif
17413 }
17414 }
17415 {
17416 int one = 1; int little = (int)*(unsigned char *)&one;
17417 unsigned char *bytes = (unsigned char *)&value;
17418 return _PyLong_FromByteArray(bytes, sizeof(unsigned long),
1715417419 little, !is_unsigned);
1715517420 }
1715617421 }
00 Metadata-Version: 1.2
11 Name: pygame-sdl2
2 Version: 2.1.0-for-renpy-7.4.2
2 Version: 2.1.0-for-renpy-7.4.8
33 Summary: UNKNOWN
44 Home-page: https://github.com/renpy/pygame_sdl2
55 Maintainer: Tom Rothamel
00 [egg_info]
1 tag_build = -for-renpy-7.4.2
1 tag_build = -for-renpy-7.4.8
22 tag_date = 0
33
119119 # The window that is used by the various module globals.
120120 main_window = None
121121
122 # Have we shown the first window?
123 _shown_first_window = False
124
125 def _before_first_window():
126 global _shown_first_window
127
128 if _shown_first_window:
129 return
130
131 _shown_first_window = True
132
133 # If we're on android, we have to close the splash window before opening
134 # our window.
135 try:
136 import androidembed
137 androidembed.close_window()
138 except ImportError:
139 pass
140
122 try:
123 import androidembed
124 except ImportError:
125 androidembed = None
141126
142127
143128 cdef class Window:
145130
146131 if not isinstance(title, bytes):
147132 title = title.encode("utf-8")
148
149 _before_first_window()
150133
151134 self.create_flags = flags
152135
157140 else:
158141 gl_flag = SDL_WINDOW_OPENGL
159142
160 self.window = SDL_CreateWindow(
161 title,
162 pos[0], pos[1],
163 resolution[0], resolution[1], flags | gl_flag)
143 self.window = NULL
144
145 if androidembed is not None:
146 self.window = SDL_GL_GetCurrentWindow()
147
148 if self.window:
149
150 # Android bug - a RGB_565 format is likely to mean the window
151 # wasn't created properly, so re-make it.
152 if SDL_GetWindowPixelFormat(self.window) == SDL_PIXELFORMAT_RGB565:
153 SDL_DestroyWindow(self.window)
154 self.window = NULL
155 else:
156 SDL_SetWindowTitle(self.window, title)
157
158 if not self.window:
159 self.window = SDL_CreateWindow(
160 title,
161 pos[0], pos[1],
162 resolution[0], resolution[1], flags | gl_flag)
164163
165164 if not self.window:
166165 raise error()
176175
177176 if self.gl_context == NULL:
178177 raise error()
178
179 SDL_GL_MakeCurrent(self.window, self.gl_context)
179180
180181 if not ios:
181182 # Try setting the swap interval - first positive, then negated
182183 # to deal with the case where the negative interval isn't
183184 # supported. Then give up and carry on.
184185 if SDL_GL_SetSwapInterval(default_swap_control):
185 SDL_GL_SetSwapInterval(-default_swap_control)
186
186 if default_swap_control < 0:
187 SDL_GL_SetSwapInterval(-default_swap_control)
187188
188189 self.create_surface()
189190
292293 Check to see if the GL context was lost, and re-create it if it was.
293294 """
294295
295 if <unsigned int> SDL_GL_GetCurrentContext():
296 if <unsigned long> SDL_GL_GetCurrentContext():
296297 return False
297298
298299 self.gl_context = SDL_GL_CreateContext(self.window)
463464 def minimize(self):
464465 SDL_MinimizeWindow(self.window)
465466
467 def get_sdl_window_pointer(self):
468 """
469 Returns the pointer to the SDL_Window corresponding to this window.
470 """
471
472 import ctypes
473 return ctypes.c_void_p(<unsigned long> self.window)
474
475
476
466477
467478 # The icon that's used for new windows.
468479 default_icon = None
493504 main_window.set_icon(default_icon)
494505
495506 return main_window.surface
507
508 def destroy():
509 global main_window
510
511 if main_window is not None:
512 main_window.destroy()
513 main_window = None
496514
497515 def get_surface():
498516 if main_window is None: