Added ugly set_mode to fix pygame shit

This commit is contained in:
Thomas FORGIONE 2016-12-01 11:47:18 +01:00
parent befe9c19fe
commit 5f58043207
No known key found for this signature in database
GPG Key ID: 2A210FFC062E00C3
1 changed files with 3 additions and 2 deletions

View File

@ -21,11 +21,12 @@ WINDOW_WIDTH = 1024
WINDOW_HEIGHT = 1024
def resize(width, height):
print((width, height))
length = min(width, height)
offset = int( math.fabs(width - height) / 2)
# Ugly AF
pg.display.set_mode((width, height), pg.DOUBLEBUF | pg.RESIZABLE | pg.OPENGL)
if width < height:
gl.glViewport(0, offset, length, length)
else: