File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -911,6 +911,11 @@ window_get_opengl(pgWindowObject *self, void *v)
911911 hasGL = self -> context != NULL ;
912912 }
913913 else {
914+ /* This is not a reliable way to test that OPENGL was requested by the
915+ * user. SDL can implicitly create and use an opengl context in some
916+ * platforms and in that case hasGL=1 even when the user didn't
917+ * request for it. As borrowed windows are deprecated functionality we
918+ * can ignore this issue. */
914919 hasGL = (SDL_GetWindowFlags (self -> _win ) & SDL_WINDOW_OPENGL ) > 0 ;
915920 }
916921 return PyBool_FromLong (hasGL );
Original file line number Diff line number Diff line change @@ -150,8 +150,9 @@ def test_size(self):
150150 self .win .size = (640 , 480 )
151151
152152 def test_position (self ):
153- self .win .position = (12 , 34 )
154- self .assertTupleEqual (self .win .position , (12 , 34 ))
153+ new_pos = (self .win .position [0 ] + 20 , self .win .position [1 ] + 10 )
154+ self .win .position = new_pos
155+ self .assertTupleEqual (self .win .position , new_pos )
155156
156157 self .win .position = pygame .WINDOWPOS_CENTERED
157158
@@ -323,13 +324,13 @@ def test_window_object_repr(self):
323324 pygame .init ()
324325
325326 def test_from_display_module (self ):
326- pygame .display .set_mode ((640 , 480 ))
327+ surf = pygame .display .set_mode ((640 , 480 ))
327328
328329 win1 = Window .from_display_module ()
329330 win2 = Window .from_display_module ()
330331
331332 self .assertIs (win1 , win2 )
332- self .assertFalse (win1 .opengl )
333+ self .assertIs (win1 .get_surface (), surf )
333334
334335 pygame .display .quit ()
335336 pygame .init ()
You can’t perform that action at this time.
0 commit comments