Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS Mojave / retina mac: Issue where windows are half size. #108

Closed
aaronrudkin opened this issue Aug 1, 2018 · 0 comments
Closed

macOS Mojave / retina mac: Issue where windows are half size. #108

aaronrudkin opened this issue Aug 1, 2018 · 0 comments

Comments

@aaronrudkin
Copy link

Minimum non-working example:

import pygame_sdl2

pygame_sdl2.init()
pygame_sdl2.display.init()

# Make a window
test_window = pygame_sdl2.display.set_mode((500, 500))
test_window.fill((0, 0, 0))

# Colors
white = (255, 255, 255)
red = (255, 0, 0)
blue = (0, 0, 255)

# How big do you think the window is?
print(test_window.get_size())

done = 0

while not done:
        for event in pygame_sdl2.event.get():
            if event.type == pygame_sdl2.QUIT:
                done = 1

	# Draw a white rectangle on the upper-left quarter
	pygame_sdl2.draw.rect(test_window, white, (0, 0, 250, 250))
	# Draw a red rectangle on the lower-left quarter
	pygame_sdl2.draw.rect(test_window, red, (0, 250, 250, 250))
	# Draw a blue rectangle on the top-right quarter
	pygame_sdl2.draw.rect(test_window, blue, (250, 0, 250, 250))
	# Update display: entire display is red.
	pygame_sdl2.display.update()

Although the window believes itself to be 500x500, what is actually being displayed is a 250x250 window, and the coordinates visible on the visible canvas are from (0, 250) to (250, 500). If I suppress the red rectangle, I see a line of white pixels at the very top and nothing else (so presumably 250 is the first pixel row I see).

Hardware / software info:

  • macOS Mojave Public Beta
  • python 2.7.15
  • pygame_sdl2 nightly installed today

It is unclear to me if this is an SDL2 issue, a retina mac issue, a mojave beta issue, or a pygame_sdl2 issue. I should say in full disclosure that regular pygame doesn't render at all for me on this computer, I just get a blank window, so it's possible it's an OS issue. I can't easily revert or test on another machine, so it's hard for me to say for sure. When I googled I found a number of people complaining about various retina mac issues with pygame years ago, but other than that nothing.

It'd be great to get confirmation from someone else using a Retina Mac on Mojave that it happens, or someone else using a Retina Mac on a non-Mojave OS to confirm it doesn't.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants