fullscreen flag windows 32-bit long test

This commit is contained in:
frank 2019-07-07 02:12:22 -04:00
parent 750b14c413
commit 2bba3da368
1 changed files with 7 additions and 2 deletions

View File

@ -1,5 +1,5 @@
from os import environ
from sys import maxsize
from sys import maxsize, platform
from pygame import display, image, mouse
from pygame.locals import *
@ -46,6 +46,8 @@ class Display(GameChild):
def set_screen(self, flags=0x0, dimensions=None, fs=False):
self.dimensions_changed = dimensions is not None
print("set_screen flags", hex(flags))
flags |= RESIZABLE
if dimensions is None:
if display.get_surface():
dimensions = display.get_surface().get_size()
@ -83,13 +85,16 @@ class Display(GameChild):
screen = self.screen
cpy = screen.convert()
flags = self.screen.get_flags()
print("toggle_fullscreen get_flags", hex(flags))
if flags & 0x80000000:
full = False
if maxsize >> 33:
print(hex(maxsize), hex(maxsize >> 33), hex(flags ^ 0x80000000), hex(flags ^ -0x80000000), hex(FULLSCREEN))
if not platform == "win32" and maxsize >> 33:
flags ^= 0x80000000
else:
flags ^= -0x80000000
else:
full = True
print("toggle_fullscreen set_screen", hex(flags))
self.set_screen(flags, fs=full)
screen.blit(cpy, (0, 0))