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 @@ -920,6 +920,11 @@ window_get_opengl(pgWindowObject *self, void *v)
920
920
hasGL = self -> context != NULL ;
921
921
}
922
922
else {
923
+ /* This is not a reliable way to test that OPENGL was requested by the
924
+ * user. SDL can implicitly create and use an opengl context in some
925
+ * platforms and in that case hasGL=1 even when the user didn't
926
+ * request for it. As borrowed windows are deprecated functionality we
927
+ * can ignore this issue. */
923
928
hasGL = (SDL_GetWindowFlags (self -> _win ) & SDL_WINDOW_OPENGL ) > 0 ;
924
929
}
925
930
return PyBool_FromLong (hasGL );
Original file line number Diff line number Diff line change @@ -150,8 +150,9 @@ def test_size(self):
150
150
self .win .size = (640 , 480 )
151
151
152
152
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 )
155
156
156
157
self .win .position = pygame .WINDOWPOS_CENTERED
157
158
@@ -323,13 +324,13 @@ def test_window_object_repr(self):
323
324
pygame .init ()
324
325
325
326
def test_from_display_module (self ):
326
- pygame .display .set_mode ((640 , 480 ))
327
+ surf = pygame .display .set_mode ((640 , 480 ))
327
328
328
329
win1 = Window .from_display_module ()
329
330
win2 = Window .from_display_module ()
330
331
331
332
self .assertIs (win1 , win2 )
332
- self .assertFalse (win1 .opengl )
333
+ self .assertIs (win1 .get_surface (), surf )
333
334
334
335
pygame .display .quit ()
335
336
pygame .init ()
You can’t perform that action at this time.
0 commit comments