@@ -815,10 +815,6 @@ pg_set_mode(PyObject *self, PyObject *arg, PyObject *kwds)
815815
816816 _DisplayState * state = DISPLAY_MOD_STATE (self );
817817 SDL_Window * win = pg_GetDefaultWindow ();
818- #if !SDL_VERSION_ATLEAST (2 , 0 , 22 )
819- SDL_Window * dummy = NULL ;
820- char dummy_id_str [64 ];
821- #endif
822818 pgSurfaceObject * surface = pg_GetDefaultWindowSurface ();
823819 SDL_Surface * surf = NULL ;
824820 SDL_Surface * newownedsurf = NULL ;
@@ -835,14 +831,13 @@ pg_set_mode(PyObject *self, PyObject *arg, PyObject *kwds)
835831 char * title = state -> title ;
836832 char * scale_env , * winid_env ;
837833
838- char * keywords [] = {"size" , "flags" , "depth" , "display" ,
839- "vsync" , "hwnd" , NULL };
834+ char * keywords [] = {"size" , "flags" , "depth" , "display" , "vsync" , NULL };
840835
841836 scale_env = SDL_getenv ("PYGAME_FORCE_SCALE" );
842837 winid_env = SDL_getenv ("SDL_WINDOWID" );
843838
844- if (!PyArg_ParseTupleAndKeywords (arg , kwds , "|OiiiiK " , keywords , & size ,
845- & flags , & depth , & display , & vsync , & hwnd ))
839+ if (!PyArg_ParseTupleAndKeywords (arg , kwds , "|Oiiii " , keywords , & size ,
840+ & flags , & depth , & display , & vsync ))
846841 return NULL ;
847842
848843 if (hwnd == 0 && winid_env != NULL ) {
@@ -1087,30 +1082,7 @@ pg_set_mode(PyObject *self, PyObject *arg, PyObject *kwds)
10871082 if (!win ) {
10881083 /*open window*/
10891084 if (hwnd != 0 ) {
1090- if (flags & PGS_OPENGL ) {
1091- #if SDL_VERSION_ATLEAST (2 , 0 , 22 )
1092- SDL_SetHint (SDL_HINT_VIDEO_FOREIGN_WINDOW_OPENGL , "1" );
1093- win = SDL_CreateWindowFrom ((void * )hwnd );
1094- SDL_SetHint (SDL_HINT_VIDEO_FOREIGN_WINDOW_OPENGL , "0" );
1095- #else
1096- // Create window with SDL_CreateWindowFrom() and OpenGL
1097- // See https://gamedev.stackexchange.com/a/119903
1098- dummy = SDL_CreateWindow (
1099- "OpenGL Dummy" , 0 , 0 , 1 , 1 ,
1100- SDL_WINDOW_OPENGL | SDL_WINDOW_HIDDEN );
1101- sprintf (dummy_id_str , "%p" , dummy );
1102- SDL_SetHint (SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT ,
1103- dummy_id_str );
1104-
1105- win = SDL_CreateWindowFrom ((void * )hwnd );
1106-
1107- SDL_SetHint (SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT ,
1108- "" );
1109- #endif
1110- }
1111- else {
1112- win = SDL_CreateWindowFrom ((void * )hwnd );
1113- }
1085+ win = SDL_CreateWindowFrom ((void * )hwnd );
11141086 }
11151087 else {
11161088 win = SDL_CreateWindow (title , x , y , w_1 , h_1 , sdl_flags );
0 commit comments