Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
Adds support for HiDPI (Retina Macs)
  • Loading branch information
OneSharpAce authored Feb 16, 2019
1 parent 43cdaad commit ea8f5e5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -779,10 +779,11 @@ def set_2d(self):
"""
width, height = self.get_size()
glDisable(GL_DEPTH_TEST)
glViewport(0, 0, width, height)
viewport = self.get_viewport_size()
glViewport(0, 0, max(1, viewport[0]), max(1, viewport[1]))
glMatrixMode(GL_PROJECTION)
glLoadIdentity()
glOrtho(0, width, 0, height, -1, 1)
glOrtho(0, max(1, width), 0, max(1, height), -1, 1)
glMatrixMode(GL_MODELVIEW)
glLoadIdentity()

Expand All @@ -792,7 +793,8 @@ def set_3d(self):
"""
width, height = self.get_size()
glEnable(GL_DEPTH_TEST)
glViewport(0, 0, width, height)
viewport = self.get_viewport_size()
glViewport(0, 0, max(1, viewport[0]), max(1, viewport[1]))
glMatrixMode(GL_PROJECTION)
glLoadIdentity()
gluPerspective(65.0, width / float(height), 0.1, 60.0)
Expand Down

2 comments on commit ea8f5e5

@WangYicheng666
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我看不懂😭😭😭

@WangYicheng666
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the "cd Minecraft"?

Please sign in to comment.